29 #ifndef _SNMP_UXSNMP_H_ 30 #define _SNMP_UXSNMP_H_ 38 #ifdef SNMP_PP_NAMESPACE 42 #define SNMP_PP_WITH_UDPADDR // Snmp class has constructor with UdpAddress 45 #define MAXNAME 80 // maximum name length 46 #define MAX_ADDR_LEN 10 // maximum address len, ipx is 4+6 47 #ifndef INVALID_SOCKET 48 #define INVALID_SOCKET ((SnmpSocket)(~0)) // value for invalid socket 52 #define sNMP_PDU_GET_ASYNC 21 53 #define sNMP_PDU_GETNEXT_ASYNC 22 54 #define sNMP_PDU_SET_ASYNC 23 55 #define sNMP_PDU_GETBULK_ASYNC 24 56 #define sNMP_PDU_INFORM_ASYNC 25 127 Snmp(
int &status,
const unsigned short port = 0,
128 const bool bind_ipv6 =
false);
170 static const char *get_version();
180 static const char *error_msg(
const int c);
190 static int error_code(
const Oid& v3Oid);
201 {
return error_msg(error_code(v3Oid)); }
212 static void socket_startup();
218 static void socket_cleanup();
248 const void *callback_data = 0);
272 const void *callback_data = 0);
296 const void * callback_data = 0);
309 const int non_repeaters,
const int max_reps);
324 const int non_repeaters,
const int max_reps,
326 const void *callback_data = 0);
371 const void * callback_data = 0);
415 const int timeout_sec,
421 virtual int engine_id_discovery(
OctetStr &engine_id,
422 const int timeout_sec,
434 virtual int cancel(
const unsigned long rid);
447 virtual void notify_set_listen_port(
const int port);
452 virtual int notify_get_listen_port();
470 const void *callback_data=0);
478 virtual int notify_unregister();
520 virtual int send_raw_data(
unsigned char *send_buf,
540 bool start_poll_thread(
const int timeout);
550 void stop_poll_thread();
561 {
return m_isThreadRunning; };
572 static int process_thread(
Snmp *snmp);
574 static void* process_thread(
void *snmp);
590 const unsigned short port_v4,
const unsigned short port_v6);
595 void check_notify_timestamp(
Pdu &pdu);
606 int snmp_engine(
Pdu &pdu,
613 int reports_received = 0);
617 void map_action(
unsigned short action,
unsigned short &pdu_action);
634 friend void v3CallBack(
int reason,
Snmp *snmp,
Pdu &pdu,
664 #elif defined (CPU) && CPU == PPC603 672 #ifdef SNMP_PP_NAMESPACE 676 #endif // _SNMP_UXSNMP_H_ 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.
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...
SnmpSocket iv_snmp_session
void * notifycallback_data
The Object Identifier Class.
The SNMPv3 Message Processing Model (v3MP).
bool is_running() const
Check for the status of the worker thread.
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.
long int max_reps
For GET-BULK requests.
snmp_callback get_notify_callback()
Get a pointer to the callback function used for trap reception.
const IpAddress & get_listen_address() const
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.
bool setCloseOnExecFlag(SnmpSocket fd)
Set the FD_CLOEXEC flag on the given socket.
Abstract class used to provide a virtual interface into Targets.
EventListHolder * get_eventListHolder()