version 1.2, 2006/01/30 16:17:54
|
version 1.3, 2006/04/18 18:36:33
|
|
|
| |
#include <iostream> | #include <iostream> |
| |
|
#include <Pegasus/Common/IPC.h> |
#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> |
#include "snmpDeliverTrap.h" | #include "snmpDeliverTrap.h" |
|
|
{ | { |
public: | public: |
| |
|
void initialize(); |
|
|
|
void terminate(); |
|
|
void deliverTrap( | void deliverTrap( |
const String& trapOid, | const String& trapOid, |
const String& securityName, | const String& securityName, |
|
|
| |
private: | private: |
| |
|
// Mutex is needed before a session is created. Sessions created |
|
// using the Single API do not interact with other SNMP sessions. |
|
Mutex _sessionInitMutex; |
|
|
/** | /** |
Creates a SNMP session. | Creates a SNMP session. |
| |
|
|
to receive a trap | to receive a trap |
@param portNumber the port number to receive a trap | @param portNumber the port number to receive a trap |
@param securityName the human readable community name | @param securityName the human readable community name |
@param snmpSession the SNMP session |
|
@param sessionHandle an opaque pointer of the SNMP session | @param sessionHandle an opaque pointer of the SNMP session |
@param sessionPtr the SNMP session pointer to its associated | @param sessionPtr the SNMP session pointer to its associated |
struct snmp_session | struct snmp_session |
|
|
void _createSession(const String & targetHost, | void _createSession(const String & targetHost, |
Uint32 portNumber, | Uint32 portNumber, |
const String & securityName, | const String & securityName, |
struct snmp_session & snmpSession, |
|
void *&sessionHandle, | void *&sessionHandle, |
struct snmp_session *&sessionPtr); | struct snmp_session *&sessionPtr); |
| |