version 1.4.18.1, 2007/07/03 21:50:07
|
version 1.5, 2007/02/21 10:02:34
|
|
|
#include <Pegasus/Common/FileSystem.h> | #include <Pegasus/Common/FileSystem.h> |
#include <Pegasus/Common/Stopwatch.h> | #include <Pegasus/Common/Stopwatch.h> |
#include <Pegasus/Client/CIMClient.h> | #include <Pegasus/Client/CIMClient.h> |
#include <Pegasus/Common/HostAddress.h> |
|
| |
PEGASUS_USING_PEGASUS; | PEGASUS_USING_PEGASUS; |
PEGASUS_USING_STD; | PEGASUS_USING_STD; |
|
|
const String FILTER_NAME = String ("IPFilter01"); | const String FILTER_NAME = String ("IPFilter01"); |
| |
enum SNMPVersion {_SNMPV1_TRAP = 2, _SNMPV2C_TRAP = 3}; | enum SNMPVersion {_SNMPV1_TRAP = 2, _SNMPV2C_TRAP = 3}; |
enum TargetHostFormat {_HOST_NAME = 2, _IPV4_ADDRESS = 3, _IPV6_ADDRESS = 4}; |
enum TargetHostFormat {_HOST_NAME = 2, _IPV4_ADDRESS = 3}; |
| |
#define PORT_NUMBER 2006 | #define PORT_NUMBER 2006 |
| |
|
|
| |
try | try |
{ | { |
String ipAddress; |
|
int af; |
|
System::getHostIP(System::getFullyQualifiedHostName (), &af, ipAddress); |
|
// Create SNMPv2 trap handler | // Create SNMPv2 trap handler |
snmpv2HandlerObjectPath = _createHandlerInstance (client, | snmpv2HandlerObjectPath = _createHandlerInstance (client, |
SNMPV2C_HANDLER_NAME, | SNMPV2C_HANDLER_NAME, |
ipAddress, |
System::getHostIP(System::getFullyQualifiedHostName ()), |
"public", | "public", |
af == AF_INET ? _IPV4_ADDRESS : _IPV6_ADDRESS, |
_IPV4_ADDRESS, |
_SNMPV2C_TRAP); | _SNMPV2C_TRAP); |
} | } |
catch (CIMException& e) | catch (CIMException& e) |
|
|
| |
#define MSG_PER_SEC 4 | #define MSG_PER_SEC 4 |
| |
Uint32 testTimeout = 20000+(indicationSendCountTotal/MSG_PER_SEC)*1000; |
Uint32 testTimeout = PEGASUS_DEFAULT_CLIENT_TIMEOUT_MILLISECONDS |
|
+ (indicationSendCountTotal/MSG_PER_SEC)*1000; |
| |
// connect the clients | // connect the clients |
for(Uint32 i = 0; i < runClientThreadCount; i++) | for(Uint32 i = 0; i < runClientThreadCount; i++) |