NetBurner 3.5.7
PDF Version
SMI type aliases, ASN.1 tags, and SET return codes

The vocabulary used when registering a variable: pick a SMI type for the value, pass the matching ASN_type* tag, return SNMP_SET_OK / SNMP_SET_FAIL from setters. More...

Macros

#define MAX_COMMUNITY_SIZE   (80)
 Maximum length of an SNMP community string in bytes.
 

SMI type aliases

C-language typedefs that map to the SMI (Structure of Management Information) types used by SNMP. The return type of a read callback and the value parameter of a write callback must match the typedef that corresponds to the ASN_type* tag chosen when the variable is registered.

typedef int * snmp_typeObjID
 Object identifier (OID).
 
typedef const char * snmp_typeString
 Octet string (C string).
 
typedef int snmp_typeEnumVal
 Enumerated integer value.
 
typedef int snmp_typeINTEGER
 Generic INTEGER.
 
typedef MACADR snmp_typeNetAddr
 MAC / network-layer address.
 
typedef unsigned int snmp_typeCounter
 Counter32 — monotonically increasing count.
 
typedef int snmp_typeGauge
 Gauge32 — instantaneous value that may rise or fall.
 
typedef unsigned long snmp_typeTimeTic
 TimeTicks (legacy spelling, hundredths of a second).
 
typedef unsigned long long snmp_typeCounter64
 Counter64.
 
typedef unsigned int snmp_typeUnsigned
 Unsigned32.
 
typedef unsigned int snmp_typeUInteger
 Unsigned integer (alias of Unsigned32).
 
typedef int snmp_typeInteger32
 Signed 32-bit integer.
 
typedef IPADDR4 snmp_typeIpAddr4
 IPv4 address.
 
typedef IPADDR snmp_typeIpAddr
 IP address (IPv4/IPv6-aware).
 
typedef unsigned long snmp_typeTimeTicks
 TimeTicks in hundredths of a second.
 

SNMP set-callback return codes

Values returned by a scalar or table write callback.

#define SNMP_SET_WRONG_TYPE   (-2)
 Incoming value's type does not match the variable.
 
#define SNMP_SET_FAIL   (-1)
 Value is invalid or the set cannot be applied.
 
#define SNMP_SET_OK   (0)
 Value is acceptable / applied successfully.
 

ASN.1 type tags

Pass one of these as the typ / asn_type parameter when registering a variable. Each tag has a matching SMI typedef above — the return type of the read callback and the value parameter of the write callback must match that typedef.

#define ASN_typeObjID   ASN_OBJECT_ID
 Use with snmp_typeObjID.
 
#define ASN_typeString   ASN_OCTET_STR
 Use with snmp_typeString.
 
#define ASN_typeEnumVal   ASN_INTEGER
 Use with snmp_typeEnumVal.
 
#define ASN_typeINTEGER   ASN_INTEGER
 Use with snmp_typeINTEGER.
 
#define ASN_typeNetAddr   ASN_OCTET_STR
 Use with snmp_typeNetAddr.
 
#define ASN_typeCounter   SMI_COUNTER32
 Use with snmp_typeCounter.
 
#define ASN_typeGauge   SMI_GAUGE32
 Use with snmp_typeGauge.
 
#define ASN_typeTimeTic   SMI_UNSIGNED32
 Use with snmp_typeTimeTic.
 
#define ASN_typeCounter64   SMI_COUNTER64
 Use with snmp_typeCounter64.
 
#define ASN_typeUnsigned   SMI_UNSIGNED32
 Use with snmp_typeUnsigned.
 
#define ASN_typeUInteger   SMI_UNSIGNED32
 Use with snmp_typeUInteger.
 
#define ASN_typeInteger32   SMI_INTEGER
 Use with snmp_typeInteger32.
 
#define ASN_typeIpAddr   SMI_IPADDRESS
 Use with snmp_typeIpAddr.
 
#define ASN_typeTimeTicks   SMI_TIMETICKS
 Use with snmp_typeTimeTicks.
 

Detailed Description

The vocabulary used when registering a variable: pick a SMI type for the value, pass the matching ASN_type* tag, return SNMP_SET_OK / SNMP_SET_FAIL from setters.