37 #ifdef SNMP_PP_NAMESPACE
41 #define SNMP_PP_WITH_UDPADDR // Snmp class has constructor with UdpAddress
44 #define MAXNAME 80 // maximum name length
45 #define MAX_ADDR_LEN 10 // maximum address len, ipx is 4+6
46 #ifndef INVALID_SOCKET
47 #define INVALID_SOCKET ((SnmpSocket)(~0)) // value for invalid socket
51 #define sNMP_PDU_GET_ASYNC 21
52 #define sNMP_PDU_GETNEXT_ASYNC 22
53 #define sNMP_PDU_SET_ASYNC 23
54 #define sNMP_PDU_GETBULK_ASYNC 24
55 #define sNMP_PDU_INFORM_ASYNC 25
119 Snmp(
int &status,
const unsigned short port = 0,
120 const bool bind_ipv6 =
false);
162 static const char *get_version();
172 static const char *error_msg(
const int c);
182 static int error_code(
const Oid& v3Oid);
193 {
return error_msg(error_code(v3Oid)); }
204 static void socket_startup();
210 static void socket_cleanup();
240 const void *callback_data = 0);
264 const void *callback_data = 0);
288 const void * callback_data = 0);
301 const int non_repeaters,
const int max_reps);
316 const int non_repeaters,
const int max_reps,
318 const void *callback_data = 0);
363 const void * callback_data = 0);
407 const int timeout_sec,
413 virtual int engine_id_discovery(
OctetStr &engine_id,
414 const int timeout_sec,
426 virtual int cancel(
const unsigned long rid);
439 virtual void notify_set_listen_port(
const int port);
444 virtual int notify_get_listen_port();
462 const void *callback_data=0);
470 virtual int notify_unregister();
512 virtual int send_raw_data(
unsigned char *send_buf,
532 bool start_poll_thread(
const int timeout);
542 void stop_poll_thread();
553 {
return m_bThreadRunning; };
565 static int process_thread(
Snmp *pSnmp);
567 static void* process_thread(
void *arg);
583 const unsigned short port_v4,
const unsigned short port_v6);
588 void check_notify_timestamp(
Pdu &pdu);
599 int snmp_engine(
Pdu &pdu,
606 int reports_received = 0);
610 void map_action(
unsigned short action,
unsigned short &pdu_action);
627 friend void v3CallBack(
int reason,
Snmp *snmp,
Pdu &pdu,
657 HANDLE m_hThreadEndEvent;
658 #elif defined (CPU) && CPU == PPC603
666 #ifdef SNMP_PP_NAMESPACE
Pdu * pdu
The Pdu that was sent.
const void * cbd
User callback data.
EventListHolder * eventListHolder
SnmpTarget * target
Pointer to the Target object to use.
void * get_notify_callback_data()
Get a pointer to the data that is passed to the callback function.
bool is_running(void) const
Check for the status of the worker thread.
SnmpSocket iv_snmp_session
void * notifycallback_data
The Object Identifier Class.
The SNMPv3 Message Processing Model (v3MP).
long int non_reps
For GET-BULK requests.
snmp_version
The SNMP version to use is passed with this enum.
snmp_callback notifycallback
Internal used callback data structure for async v3 requests.
const IpAddress & get_listen_address() const
long int max_reps
For GET-BULK requests.
snmp_callback get_notify_callback()
Get a pointer to the callback function used for trap reception.
snmp_callback oldCallback
User callback function.
int reports_received
How many reports are already received.
static const char * error_msg(const Oid &v3Oid)
Returns a human readable error string.
void(* snmp_callback)(int reason, Snmp *session, Pdu &pdu, SnmpTarget &target, void *data)
Async methods of the class Snmp require the caller to provide a callback address of a function with t...
Abstract class used to provide a virtual interface into Targets.
EventListHolder * get_eventListHolder()