5.11.0.0R3
Software Development Kit
 
Loading...
Searching...
No Matches
MIBTAB Struct Reference

#include <ltrx_snmp.h>

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)}
};
#define MIBOPT_SCALAR
Definition ltrx_snmp.h:79
#define MIBOPT_CAR
Definition ltrx_snmp.h:83
#define MIBOPT_NWORDER
Definition ltrx_snmp.h:82
#define ARRAY_SIZE(a)
Size of array.
Definition ltrx_definitions.h:101
Definition ltrx_snmp.h:220
Definition ltrx_snmp.h:169

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.


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