SNMP++  3.3.11
uxsnmp.h File Reference
#include <libsnmp.h>
#include "snmp_pp/reentrant.h"
#include "snmp_pp/target.h"
#include "snmp_pp/oid.h"
#include "snmp_pp/address.h"

Go to the source code of this file.

Classes

class  Snmp
 SNMP class definition. More...
 
struct  Snmp::V3CallBackData
 Internal used callback data structure for async v3 requests. More...
 

Macros

#define SNMP_PP_WITH_UDPADDR
 
#define MAXNAME   80
 
#define MAX_ADDR_LEN   10
 
#define INVALID_SOCKET   ((SnmpSocket)(~0))
 
#define sNMP_PDU_GET_ASYNC   21
 
#define sNMP_PDU_GETNEXT_ASYNC   22
 
#define sNMP_PDU_SET_ASYNC   23
 
#define sNMP_PDU_GETBULK_ASYNC   24
 
#define sNMP_PDU_INFORM_ASYNC   25
 

Typedefs

typedef 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 this typedef. More...
 

Functions

bool setCloseOnExecFlag (SnmpSocket fd)
 Set the FD_CLOEXEC flag on the given socket. More...
 

Macro Definition Documentation

◆ INVALID_SOCKET

#define INVALID_SOCKET   ((SnmpSocket)(~0))

Definition at line 48 of file uxsnmp.h.

◆ MAX_ADDR_LEN

#define MAX_ADDR_LEN   10

Definition at line 46 of file uxsnmp.h.

◆ MAXNAME

#define MAXNAME   80

Definition at line 45 of file uxsnmp.h.

◆ sNMP_PDU_GET_ASYNC

#define sNMP_PDU_GET_ASYNC   21

Definition at line 52 of file uxsnmp.h.

◆ sNMP_PDU_GETBULK_ASYNC

#define sNMP_PDU_GETBULK_ASYNC   24

Definition at line 55 of file uxsnmp.h.

◆ sNMP_PDU_GETNEXT_ASYNC

#define sNMP_PDU_GETNEXT_ASYNC   22

Definition at line 53 of file uxsnmp.h.

◆ sNMP_PDU_INFORM_ASYNC

#define sNMP_PDU_INFORM_ASYNC   25

Definition at line 56 of file uxsnmp.h.

◆ sNMP_PDU_SET_ASYNC

#define sNMP_PDU_SET_ASYNC   23

Definition at line 54 of file uxsnmp.h.

◆ SNMP_PP_WITH_UDPADDR

#define SNMP_PP_WITH_UDPADDR

Definition at line 42 of file uxsnmp.h.

Typedef Documentation

◆ snmp_callback

typedef 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 this typedef.

Note
It is not allowed to call any synchronous Snmp methods within the callback. Async methods are allowed.
Parameters
reason- Reason for callback (see snmperrs.h)
session- Pointer to Snmp object that was used to send the request
pdu- The received Pdu if reason indicates a received message
target- source target
data- Pointer passed to the async method

Definition at line 78 of file uxsnmp.h.

Function Documentation

◆ setCloseOnExecFlag()

bool setCloseOnExecFlag ( SnmpSocket  fd)

Set the FD_CLOEXEC flag on the given socket.

Parameters
fd- The socket
Returns
true on success