4.8.0.0R6
Software Development Kit
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules
MIBTAB Struct Reference

Data Fields

uint16_t ix [MAXKEY]
 
uint16_t len
 
uint8_t nix
 
OID oid
 

Detailed Description

This struct is used to define a MIB Table. For example the MIB-II UDP group and Listener table can be defined as:

static const MIBVAR mibvar_udp[] =
{
{{8,{0x2b,6,1,2,1,7,1,0}}, 0, SNMP_Counter,
sizeof(long), &g_UdpGroup.udpInDatagrams},
{{8,{0x2b,6,1,2,1,7,2,0}}, 0, SNMP_Counter,
sizeof(long), &g_UdpGroup.udpNoPorts},
{{8,{0x2b,6,1,2,1,7,3,0}}, 0, SNMP_Counter,
sizeof(long), &g_UdpGroup.udpInErrors},
{{8,{0x2b,6,1,2,1,7,4,0}}, 0, SNMP_Counter,
sizeof(long), &g_UdpGroup.udpOutDatagrams},
{{9,{0x2b,6,1,2,1,7,5,1,1}}, MIBOPT_CAR + MIBOPT_SCALAR,
SNMP_IpAddress, IID_SIZE, &dummy_uint32},
{{9,{0x2b,6,1,2,1,7,5,1,2}}, MIBOPT_CAR + MIBOPT_NWORDER, SNMP_Integer,
sizeof(g_Connections[0].myport), &g_Connections[0].myport},
};
static int mibvarsize_udp(void)
{
return ARRAY_SIZE(mibvar_udp);
}
#define XudpLocalAddress 4
#define XudpLocalPort 5
static const MIBTAB mibtab_udp[] =
{
{{7,{0x2b,6,1,2,1,7,5}}, 2,
{XudpLocalAddress,XudpLocalPort,0,0}, sizeof(struct connection)}
};

The UDP Listener table uses two indexes. One is the Local IP Address the the other is the Port number. The XudpLocalAddress and XudpLocalPort defines are used as index pointers intto the actual MIBVAR definition within the mibvar_udp table where the table indexes can be found.

Field Documentation

uint16_t MIBTAB::ix[MAXKEY]

Index values (offsets)

uint16_t MIBTAB::len

length of the table where the data lives

uint8_t MIBTAB::nix

number of indices for the table

OID MIBTAB::oid

base OID for the table


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