NetBurner 3.5.7
PDF Version
Registering SNMP table rows and cells

Register per-row read callbacks and per-cell write callbacks for tabular MIB objects, and remove rows at runtime. More...

Typedefs

typedef void TableElementFunc(SNMP_Request &req, void *data_el, int subid)
 Signature of a table-element read callback.
 

Functions

void AddToIndex (int asn_type, snmp_typeInteger32 val, int &len, int *oidadd)
 Append a value to the OID index being constructed for a table row.
 
void AddSnmpEntry (int subid, const char *root, int add_len, int *suffix, TableElementFunc *pf, void *pData, uint32_t comm_mask)
 Register a read entry for one column of an SNMP table row.
 
void AddSnmpWriteEntry (int asn_type, const char *root, int add_len, int *suffix, PutIFuncTab *pf, void *pData, uint32_t comm_mask)
 Register a write callback for a single cell of an SNMP table.
 
void SnmpRemoveTableElement (const char *root, void *data_el)
 Remove a previously registered table element from the SNMP agent.
 

Detailed Description

Register per-row read callbacks and per-cell write callbacks for tabular MIB objects, and remove rows at runtime.

Typedef Documentation

◆ TableElementFunc

typedef void TableElementFunc(SNMP_Request &req, void *data_el, int subid)

#include <snmp_table.h>

Signature of a table-element read callback.

Called by the agent when an SNMP request targets an entry in a table registered with AddSnmpEntry. The callback is responsible for emitting the value for the requested sub-identifier.

Parameters
reqCurrent SNMP request context.
data_elUser pointer supplied at registration time (per-row context).
subidColumn sub-identifier within the table row.

Function Documentation

◆ AddSnmpEntry()

void AddSnmpEntry ( int subid,
const char * root,
int add_len,
int * suffix,
TableElementFunc * pf,
void * pData,
uint32_t comm_mask )

#include <snmp_table.h>

Register a read entry for one column of an SNMP table row.

Parameters
subidColumn sub-identifier within the row.
rootBase OID of the table (e.g. "1.3.6.1.4.1.8174.20.1").
add_lenLength of the per-row index suffix.
suffixPer-row index components appended after root.
pfCallback invoked on GET / GETNEXT for this column.
pDataPer-row context pointer passed to pf.
comm_maskCommunity mask, typically READ_COMMUNITY_MASK.

◆ AddSnmpWriteEntry()

void AddSnmpWriteEntry ( int asn_type,
const char * root,
int add_len,
int * suffix,
PutIFuncTab * pf,
void * pData,
uint32_t comm_mask )

#include <snmp_table.h>

Register a write callback for a single cell of an SNMP table.

Overloaded on every table write-callback signature in Read/write callback function signatures — the compiler picks the matching overload based on the signature of pf.

Parameters
asn_typeOne of the ASN_type* tags for the column's value.
rootBase OID of the table.
add_lenLength of the per-row index suffix.
suffixPer-row index components appended after root.
pfWrite callback for the column.
pDataPer-row context pointer passed to pf.
comm_maskCommunity mask, typically WRITE_COMMUNITY_MASK.

◆ AddToIndex()

void AddToIndex ( int asn_type,
snmp_typeInteger32 val,
int & len,
int * oidadd )

#include <snmp_table.h>

Append a value to the OID index being constructed for a table row.

Call from a TableElementFunc to build the row's full OID from its index components. Overloaded on every SMI type in SMI type aliases, ASN.1 tags, and SET return codes — the compiler picks the right one based on the type of val.

Parameters
asn_typeThe ASN_type* tag that matches the type of val.
valThe index component value to append.
lenRunning length of the OID; incremented by this call.
oidaddOID buffer to append into.

◆ SnmpRemoveTableElement()

void SnmpRemoveTableElement ( const char * root,
void * data_el )

#include <snmp_table.h>

Remove a previously registered table element from the SNMP agent.

Parameters
rootBase OID of the table.
data_elThe per-row context pointer used when registering with AddSnmpEntry.