NetBurner 3.5.7
PDF Version
SNMPReadObject Class Reference

Registers a scalar read callback with the SNMP agent. More...

#include <snmp_table.h>

Public Member Functions

 SNMPReadObject (const char *oid, int typ, GetpIFunc *pf, uint32_t commmask)
 Register a read callback for one SNMP scalar.
 

Detailed Description

Registers a scalar read callback with the SNMP agent.

Application code does not instantiate this class directly — use the SNMPREADFUNC macro, which constructs a file-static instance so the callback is registered before main() runs. The constructor is overloaded on every read-callback signature in Read/write callback function signatures; the compiler picks the overload that matches your getter, which in turn selects the matching ASN.1 dispatcher.

Example
snmp_typeInteger32 ReadVoltage() { return g_voltage_mv; }
SNMPREADFUNC(VOLTAGE, "1.3.6.1.4.1.8174.10.1.0", ASN_typeInteger32,
ReadVoltage, READ_COMMUNITY_MASK);
#define READ_COMMUNITY_MASK
Bitmask indicating read community access.
Definition snmp.h:312
#define SNMPREADFUNC(w, x, y, z, q)
Register a read callback for one SNMP scalar at file scope.
Definition snmp_table.h:444
#define ASN_typeInteger32
Use with snmp_typeInteger32.
Definition snmp_table.h:139
int snmp_typeInteger32
Signed 32-bit integer.
Definition snmp_table.h:70

Constructor & Destructor Documentation

◆ SNMPReadObject()

SNMPReadObject::SNMPReadObject ( const char * oid,
int typ,
GetpIFunc * pf,
uint32_t commmask )
inline

Register a read callback for one SNMP scalar.

Parameters
oidDotted-decimal OID string. Scalars end in .0.
typOne of the ASN_type* tags (e.g. ASN_typeInteger32).
pfPointer to the getter; the overload chosen follows from its signature.
commmaskCommunity mask (typically READ_COMMUNITY_MASK).

The documentation for this class was generated from the following file: