version 1.21, 2010/12/22 12:19:07
|
version 1.22, 2011/01/07 11:26:05
|
|
|
#include <Pegasus/General/Stopwatch.h> | #include <Pegasus/General/Stopwatch.h> |
#include <Pegasus/Client/CIMClient.h> | #include <Pegasus/Client/CIMClient.h> |
#include <Pegasus/Common/HostAddress.h> | #include <Pegasus/Common/HostAddress.h> |
|
#ifdef PEGASUS_USE_NET_SNMP |
#include <net-snmp/net-snmp-config.h> | #include <net-snmp/net-snmp-config.h> |
#include <net-snmp/net-snmp-includes.h> | #include <net-snmp/net-snmp-includes.h> |
|
#endif |
| |
PEGASUS_USING_PEGASUS; | PEGASUS_USING_PEGASUS; |
PEGASUS_USING_STD; | PEGASUS_USING_STD; |
|
|
CIMValue ((Uint16) snmpVersion))); | CIMValue ((Uint16) snmpVersion))); |
handlerInstance.addProperty (CIMProperty (CIMName ("PortNumber"), | handlerInstance.addProperty (CIMProperty (CIMName ("PortNumber"), |
CIMValue ((Uint32) PORT_NUMBER))); | CIMValue ((Uint32) PORT_NUMBER))); |
|
|
|
#ifdef PEGASUS_ENABLE_NET_SNMPV3 |
if(snmpVersion == _SNMPV3_TRAP) | if(snmpVersion == _SNMPV3_TRAP) |
{ | { |
| |
|
|
free(encryptedSecurityPrivKey); | free(encryptedSecurityPrivKey); |
} | } |
} | } |
|
#endif // ifdef PEGASUS_ENABLE_NET_SNMPV3 |
| |
return client.createInstance( | return client.createInstance( |
PEGASUS_NAMESPACENAME_INTEROP, handlerInstance); | PEGASUS_NAMESPACENAME_INTEROP, handlerInstance); |
|
|
} | } |
#endif | #endif |
| |
|
#ifdef PEGASUS_ENABLE_NET_SNMPV3 |
// create a snmp V3 trap handler. | // create a snmp V3 trap handler. |
try | try |
{ | { |
|
|
throw; | throw; |
} | } |
} | } |
# |
#endif // ifdef PEGASUS_ENABLE_NET_SNMPV3 |
} | } |
| |
void _cleanup (CIMClient & client) | void _cleanup (CIMClient & client) |
|
|
} | } |
#endif | #endif |
| |
|
#ifdef PEGASUS_ENABLE_NET_SNMPV3 |
try | try |
{ | { |
_deleteSubscriptionInstance (client, FILTER_NAME, | _deleteSubscriptionInstance (client, FILTER_NAME, |
|
|
throw; | throw; |
} | } |
} | } |
|
#endif |
| |
try | try |
{ | { |
|
|
} | } |
#endif | #endif |
| |
|
#ifdef PEGASUS_ENABLE_NET_SNMPV3 |
try | try |
{ | { |
_deleteHandlerInstance (client, SNMPV3_HANDLER_NAME); | _deleteHandlerInstance (client, SNMPV3_HANDLER_NAME); |
|
|
throw; | throw; |
} | } |
} | } |
|
#endif |
} | } |
| |
static void _testEnd(const String& uniqueID, const double elapsedTime) | static void _testEnd(const String& uniqueID, const double elapsedTime) |
|
|
{ | { |
receivedTrap2Count++; | receivedTrap2Count++; |
} | } |
|
#ifdef PEGASUS_ENABLE_NET_SNMPV3 |
if (String::compare(line, trap3) == 0) | if (String::compare(line, trap3) == 0) |
{ | { |
receivedTrap3Count++; | receivedTrap3Count++; |
} | } |
|
#endif |
} | } |
| |
ifs.close(); | ifs.close(); |
|
|
{ | { |
return (receivedTrap2Count); | return (receivedTrap2Count); |
} | } |
|
#ifdef PEGASUS_ENABLE_NET_SNMPV3 |
case _SNMPV3_TRAP: | case _SNMPV3_TRAP: |
{ | { |
return (receivedTrap3Count); | return (receivedTrap3Count); |
} | } |
|
#endif |
default: | default: |
{ | { |
return (0); | return (0); |
|
|
indicationTrapV2SendCount = indicationTrapV1SendCount; | indicationTrapV2SendCount = indicationTrapV1SendCount; |
#endif | #endif |
| |
|
#ifdef PEGASUS_ENABLE_NET_SNMPV3 |
indicationTrapV3SendCount = | indicationTrapV3SendCount = |
indicationSendCount * runClientThreadCount; | indicationSendCount * runClientThreadCount; |
|
#endif |
| |
// calculate the timeout based on the total send count allowing | // calculate the timeout based on the total send count allowing |
// using the MSG_PER_SEC rate | // using the MSG_PER_SEC rate |