Deprecated fork of old network stack source from github. Please use official library instead: https://mbed.org/users/mbed_official/code/EthernetInterface/

Embed: (wiki syntax)

« Back to documentation index

mib2.c File Reference

mib2.c File Reference

Management Information Base II (RFC1213) objects and functions. More...

Go to the source code of this file.

Functions

static void system_get_object_def (u8_t ident_len, s32_t *ident, struct obj_def *od)
 Returns systems object definitions.
static void system_get_value (struct obj_def *od, u16_t len, void *value)
 Returns system object value.
static void interfaces_get_object_def (u8_t ident_len, s32_t *ident, struct obj_def *od)
 Returns interfaces.ifnumber object definition.
static void interfaces_get_value (struct obj_def *od, u16_t len, void *value)
 Returns interfaces.ifnumber object value.
static void ifentry_get_object_def (u8_t ident_len, s32_t *ident, struct obj_def *od)
 Returns ifentry object definitions.
static void ifentry_get_value (struct obj_def *od, u16_t len, void *value)
 Returns ifentry object value.
static void atentry_get_object_def (u8_t ident_len, s32_t *ident, struct obj_def *od)
 Returns atentry object definitions.
static void ip_get_value (struct obj_def *od, u16_t len, void *value)
static u8_t ip_set_test (struct obj_def *od, u16_t len, void *value)
 Test ip object value before setting.
static void ip_addrentry_get_value (struct obj_def *od, u16_t len, void *value)
static void ip_rteentry_get_object_def (u8_t ident_len, s32_t *ident, struct obj_def *od)
static void ip_rteentry_get_value (struct obj_def *od, u16_t len, void *value)
static void ip_ntomentry_get_object_def (u8_t ident_len, s32_t *ident, struct obj_def *od)
static void tcp_get_object_def (u8_t ident_len, s32_t *ident, struct obj_def *od)
static void tcpconnentry_get_value (struct obj_def *od, u16_t len, void *value)
static u8_t snmp_set_test (struct obj_def *od, u16_t len, void *value)
 Test snmp object value before setting.
static void ocstrncpy (u8_t *dst, u8_t *src, u16_t n)
 Copy octet string.
void objectidncpy (s32_t *dst, s32_t *src, u8_t n)
 Copy object identifier (s32_t) array.
void snmp_set_sysdesr (u8_t *str, u8_t *len)
 Initializes sysDescr pointers.
void snmp_set_sysobjid (struct snmp_obj_id *oid)
 Initializes sysObjectID value.
void snmp_inc_sysuptime (void)
 Must be called at regular 10 msec interval from a timer interrupt or signal handler depending on your runtime environment.
void snmp_set_syscontact (u8_t *ocstr, u8_t *ocstrlen)
 Initializes sysContact pointers, e.g.
void snmp_set_sysname (u8_t *ocstr, u8_t *ocstrlen)
 Initializes sysName pointers, e.g.
void snmp_set_syslocation (u8_t *ocstr, u8_t *ocstrlen)
 Initializes sysLocation pointers, e.g.
void snmp_insert_arpidx_tree (struct netif *ni, ip_addr_t *ip)
 Inserts ARP table indexes (.xIfIndex.xNetAddress) into arp table index trees (both atTable and ipNetToMediaTable).
void snmp_delete_arpidx_tree (struct netif *ni, ip_addr_t *ip)
 Removes ARP table indexes (.xIfIndex.xNetAddress) from arp table index trees.
void snmp_insert_ipaddridx_tree (struct netif *ni)
 Inserts ipAddrTable indexes (.ipAdEntAddr) into index tree.
void snmp_delete_ipaddridx_tree (struct netif *ni)
 Removes ipAddrTable indexes (.ipAdEntAddr) from index tree.
void snmp_insert_iprteidx_tree (u8_t dflt, struct netif *ni)
 Inserts ipRouteTable indexes (.ipRouteDest) into index tree.
void snmp_delete_iprteidx_tree (u8_t dflt, struct netif *ni)
 Removes ipRouteTable indexes (.ipRouteDest) from index tree.
void snmp_insert_udpidx_tree (struct udp_pcb *pcb)
 Inserts udpTable indexes (.udpLocalAddress.udpLocalPort) into index tree.
void snmp_delete_udpidx_tree (struct udp_pcb *pcb)
 Removes udpTable indexes (.udpLocalAddress.udpLocalPort) from index tree.
void noleafs_get_object_def (u8_t ident_len, s32_t *ident, struct obj_def *od)
 dummy function pointers for non-leaf MIB nodes from mib2.c

Variables

struct mib_list_rootnode udp_root
 index root node for udpTable
struct mib_list_rootnode tcpconntree_root
 index root node for tcpConnTable
struct mib_list_rootnode ipntomtree_root
 index root node for ipNetToMediaTable
struct mib_list_rootnode iprtetree_root
 index root node for ipRouteTable
struct mib_list_rootnode ipaddrtree_root
 index root node for ipAddrTable
struct mib_list_rootnode arptree_root
 index root node for atTable
struct mib_list_rootnode iflist_root
 index root node for ifTable
struct mib_array_node internet
 export MIB tree from mib2.c
static struct snmp_obj_id sysobjid = {SNMP_SYSOBJID_LEN, SNMP_SYSOBJID}
 mib-2.system.sysObjectID
static struct snmp_obj_id snmpgrp_id = {7,{1,3,6,1,2,1,11}}
 enterprise ID for generic TRAPs, .iso.org.dod.internet.mgmt.mib-2.snmp
static const s32_t sysservices = SNMP_SYSSERVICES
 mib-2.system.sysServices
static const u8_t sysdescr_len_default = 4
 mib-2.system.sysDescr
static const u8_t syscontact_len_default = 0
 mib-2.system.sysContact
static const u8_t sysname_len_default = 8
 mib-2.system.sysName
static const u8_t syslocation_len_default = 0
 mib-2.system.sysLocation
static const u8_t snmpenableauthentraps_default = 2
 mib-2.snmp.snmpEnableAuthenTraps
static struct snmp_obj_id ifspecific = {2, {0, 0}}
 mib-2.interfaces.ifTable.ifEntry.ifSpecific (zeroDotZero)
static struct snmp_obj_id iprouteinfo = {2, {0, 0}}
 mib-2.ip.ipRouteTable.ipRouteEntry.ipRouteInfo (zeroDotZero)

Detailed Description

Management Information Base II (RFC1213) objects and functions.

Note:
the object identifiers for this MIB-2 and private MIB tree must be kept in sorted ascending order. This to ensure correct getnext operation.

Definition in file mib2.c.


Function Documentation

static void atentry_get_object_def ( u8_t  ident_len,
s32_t *  ident,
struct obj_def od 
) [static]

Returns atentry object definitions.

Parameters:
ident_lenthe address length (6)
identpoints to objectname.atifindex.atnetaddress
odpoints to object definition.

Definition at line 2676 of file mib2.c.

static void ifentry_get_object_def ( u8_t  ident_len,
s32_t *  ident,
struct obj_def od 
) [static]

Returns ifentry object definitions.

Parameters:
ident_lenthe address length (2)
identpoints to objectname.index
odpoints to object definition.

Note:
returning zeroDotZero (0.0) no media specific MIB support

Definition at line 2353 of file mib2.c.

static void ifentry_get_value ( struct obj_def od,
u16_t  len,
void *  value 
) [static]

Returns ifentry object value.

Parameters:
ident_lenthe address length (2)
identpoints to objectname.0 (object id trailer)
lenreturn value space (in bytes)
valuepoints to (varbind) space to copy value into.

Definition at line 2461 of file mib2.c.

static void interfaces_get_object_def ( u8_t  ident_len,
s32_t *  ident,
struct obj_def od 
) [static]

Returns interfaces.ifnumber object definition.

Parameters:
ident_lenthe address length (2)
identpoints to objectname.index
odpoints to object definition.

Definition at line 2304 of file mib2.c.

static void interfaces_get_value ( struct obj_def od,
u16_t  len,
void *  value 
) [static]

Returns interfaces.ifnumber object value.

Parameters:
ident_lenthe address length (2)
identpoints to objectname.0 (object id trailer)
lenreturn value space (in bytes)
valuepoints to (varbind) space to copy value into.

Definition at line 2335 of file mib2.c.

static void ip_addrentry_get_value ( struct obj_def od,
u16_t  len,
void *  value 
) [static]

Definition at line 3070 of file mib2.c.

static void ip_get_value ( struct obj_def od,
u16_t  len,
void *  value 
) [static]

Definition at line 2836 of file mib2.c.

static void ip_ntomentry_get_object_def ( u8_t  ident_len,
s32_t *  ident,
struct obj_def od 
) [static]

Definition at line 3362 of file mib2.c.

static void ip_rteentry_get_object_def ( u8_t  ident_len,
s32_t *  ident,
struct obj_def od 
) [static]
Note:
lwIP IP routing is currently using the network addresses in netif_list. if no suitable network IP is found in netif_list, the default_netif is used.

Note:
returning zeroDotZero (0.0) no routing protocol specific MIB

Definition at line 3146 of file mib2.c.

static void ip_rteentry_get_value ( struct obj_def od,
u16_t  len,
void *  value 
) [static]

See also:
snmp_insert_iprteidx_tree()

Definition at line 3211 of file mib2.c.

static u8_t ip_set_test ( struct obj_def od,
u16_t  len,
void *  value 
) [static]

Test ip object value before setting.

Parameters:
odis the object definition
lenreturn value space (in bytes)
valuepoints to (varbind) space to copy value from.
Note:
we allow set if the value matches the hardwired value, otherwise return badvalue.

Definition at line 2990 of file mib2.c.

void noleafs_get_object_def ( u8_t  ident_len,
s32_t *  ident,
struct obj_def od 
)

dummy function pointers for non-leaf MIB nodes from mib2.c

Definition at line 2075 of file mib2.c.

void objectidncpy ( s32_t *  dst,
s32_t *  src,
u8_t  n 
)

Copy object identifier (s32_t) array.

Parameters:
dstpoints to destination
srcpoints to source
nnumber of sub identifiers to copy.

Definition at line 921 of file mib2.c.

static void ocstrncpy ( u8_t *  dst,
u8_t *  src,
u16_t  n 
) [static]

Copy octet string.

Parameters:
dstpoints to destination
srcpoints to source
nnumber of octets to copy.

Definition at line 905 of file mib2.c.

void snmp_delete_arpidx_tree ( struct netif ni,
ip_addr_t *  ip 
)

Removes ARP table indexes (.xIfIndex.xNetAddress) from arp table index trees.

Definition at line 1161 of file mib2.c.

void snmp_delete_ipaddridx_tree ( struct netif ni )

Removes ipAddrTable indexes (.ipAdEntAddr) from index tree.

Definition at line 1372 of file mib2.c.

void snmp_delete_iprteidx_tree ( u8_t  dflt,
struct netif ni 
)

Removes ipRouteTable indexes (.ipRouteDest) from index tree.

Parameters:
dfltnon-zero for the default rte, zero for network rte
nipoints to network interface for this rte or NULL for default route to be removed.

Definition at line 1516 of file mib2.c.

void snmp_delete_udpidx_tree ( struct udp_pcb *  pcb )

Removes udpTable indexes (.udpLocalAddress.udpLocalPort) from index tree.

Definition at line 1844 of file mib2.c.

void snmp_inc_sysuptime ( void   )

Must be called at regular 10 msec interval from a timer interrupt or signal handler depending on your runtime environment.

Definition at line 964 of file mib2.c.

void snmp_insert_arpidx_tree ( struct netif ni,
ip_addr_t *  ip 
)

Inserts ARP table indexes (.xIfIndex.xNetAddress) into arp table index trees (both atTable and ipNetToMediaTable).

Definition at line 1089 of file mib2.c.

void snmp_insert_ipaddridx_tree ( struct netif ni )

Inserts ipAddrTable indexes (.ipAdEntAddr) into index tree.

Definition at line 1318 of file mib2.c.

void snmp_insert_iprteidx_tree ( u8_t  dflt,
struct netif ni 
)

Inserts ipRouteTable indexes (.ipRouteDest) into index tree.

Parameters:
dfltnon-zero for the default rte, zero for network rte
nipoints to network interface for this rte

Definition at line 1439 of file mib2.c.

void snmp_insert_udpidx_tree ( struct udp_pcb *  pcb )

Inserts udpTable indexes (.udpLocalAddress.udpLocalPort) into index tree.

Definition at line 1792 of file mib2.c.

void snmp_set_syscontact ( u8_t *  ocstr,
u8_t *  ocstrlen 
)

Initializes sysContact pointers, e.g.

ptrs to non-volatile memory external to lwIP.

Parameters:
ocstrif non-NULL then copy str pointer
ocstrlenpoints to string length, excluding zero terminator

Definition at line 987 of file mib2.c.

void snmp_set_sysdesr ( u8_t *  str,
u8_t *  len 
)

Initializes sysDescr pointers.

Parameters:
strif non-NULL then copy str pointer
lenpoints to string length, excluding zero terminator

Definition at line 936 of file mib2.c.

void snmp_set_syslocation ( u8_t *  ocstr,
u8_t *  ocstrlen 
)

Initializes sysLocation pointers, e.g.

ptrs to non-volatile memory external to lwIP.

Parameters:
ocstrif non-NULL then copy str pointer
ocstrlenpoints to string length, excluding zero terminator

Definition at line 1019 of file mib2.c.

void snmp_set_sysname ( u8_t *  ocstr,
u8_t *  ocstrlen 
)

Initializes sysName pointers, e.g.

ptrs to non-volatile memory external to lwIP.

Parameters:
ocstrif non-NULL then copy str pointer
ocstrlenpoints to string length, excluding zero terminator

Definition at line 1003 of file mib2.c.

void snmp_set_sysobjid ( struct snmp_obj_id oid )

Initializes sysObjectID value.

Parameters:
oidpoints to stuct snmp_obj_id to copy

Definition at line 955 of file mib2.c.

static u8_t snmp_set_test ( struct obj_def od,
u16_t  len,
void *  value 
) [static]

Test snmp object value before setting.

Parameters:
odis the object definition
lenreturn value space (in bytes)
valuepoints to (varbind) space to copy value from.

Definition at line 4096 of file mib2.c.

static void system_get_object_def ( u8_t  ident_len,
s32_t *  ident,
struct obj_def od 
) [static]

Returns systems object definitions.

Parameters:
ident_lenthe address length (2)
identpoints to objectname.0 (object id trailer)
odpoints to object definition.

Definition at line 2117 of file mib2.c.

static void system_get_value ( struct obj_def od,
u16_t  len,
void *  value 
) [static]

Returns system object value.

Parameters:
ident_lenthe address length (2)
identpoints to objectname.0 (object id trailer)
lenreturn value space (in bytes)
valuepoints to (varbind) space to copy value into.

Definition at line 2198 of file mib2.c.

static void tcp_get_object_def ( u8_t  ident_len,
s32_t *  ident,
struct obj_def od 
) [static]

Definition at line 3586 of file mib2.c.

static void tcpconnentry_get_value ( struct obj_def od,
u16_t  len,
void *  value 
) [static]

Definition at line 3773 of file mib2.c.


Variable Documentation

Initial value:
 {
  &noleafs_get_object_def,
  &noleafs_get_value,
  &noleafs_set_test,
  &noleafs_set_value,
  MIB_NODE_LR,
  0,
  NULL,
  NULL,
  0
}

index root node for atTable

Definition at line 513 of file mib2.c.

Initial value:
 {
  &ifentry_get_object_def,
  &ifentry_get_value,
#if SNMP_SAFE_REQUESTS
  &noleafs_set_test,
  &noleafs_set_value,
#else 
  &ifentry_set_test,
  &ifentry_set_value,
#endif 
  MIB_NODE_LR,
  0,
  NULL,
  NULL,
  0
}

index root node for ifTable

Definition at line 569 of file mib2.c.

struct snmp_obj_id ifspecific = {2, {0, 0}} [static]

mib-2.interfaces.ifTable.ifEntry.ifSpecific (zeroDotZero)

Definition at line 797 of file mib2.c.

Initial value:
 {
  &noleafs_get_object_def,
  &noleafs_get_value,
  &noleafs_set_test,
  &noleafs_set_value,
  MIB_NODE_AR,
  2,
  internet_ids,
  internet_nodes
}

export MIB tree from mib2.c

Definition at line 740 of file mib2.c.

Initial value:
 {
  &noleafs_get_object_def,
  &noleafs_get_value,
  &noleafs_set_test,
  &noleafs_set_value,
  MIB_NODE_LR,
  0,
  NULL,
  NULL,
  0
}

index root node for ipAddrTable

Definition at line 434 of file mib2.c.

Initial value:
 {
  &noleafs_get_object_def,
  &noleafs_get_value,
  &noleafs_set_test,
  &noleafs_set_value,
  MIB_NODE_LR,
  0,
  NULL,
  NULL,
  0
}

index root node for ipNetToMediaTable

Definition at line 347 of file mib2.c.

struct snmp_obj_id iprouteinfo = {2, {0, 0}} [static]

mib-2.ip.ipRouteTable.ipRouteEntry.ipRouteInfo (zeroDotZero)

Definition at line 799 of file mib2.c.

Initial value:
 {
  &noleafs_get_object_def,
  &noleafs_get_value,
  &noleafs_set_test,
  &noleafs_set_value,
  MIB_NODE_LR,
  0,
  NULL,
  NULL,
  0
}

index root node for ipRouteTable

Definition at line 388 of file mib2.c.

const u8_t snmpenableauthentraps_default = 2 [static]

mib-2.snmp.snmpEnableAuthenTraps

Definition at line 793 of file mib2.c.

struct snmp_obj_id snmpgrp_id = {7,{1,3,6,1,2,1,11}} [static]

enterprise ID for generic TRAPs, .iso.org.dod.internet.mgmt.mib-2.snmp

Definition at line 768 of file mib2.c.

const u8_t syscontact_len_default = 0 [static]

mib-2.system.sysContact

Definition at line 778 of file mib2.c.

const u8_t sysdescr_len_default = 4 [static]

mib-2.system.sysDescr

Definition at line 773 of file mib2.c.

const u8_t syslocation_len_default = 0 [static]

mib-2.system.sysLocation

Definition at line 788 of file mib2.c.

const u8_t sysname_len_default = 8 [static]

mib-2.system.sysName

Definition at line 783 of file mib2.c.

struct snmp_obj_id sysobjid = {SNMP_SYSOBJID_LEN, SNMP_SYSOBJID} [static]

mib-2.system.sysObjectID

Definition at line 766 of file mib2.c.

const s32_t sysservices = SNMP_SYSSERVICES [static]

mib-2.system.sysServices

Definition at line 770 of file mib2.c.

Initial value:
 {
  &noleafs_get_object_def,
  &noleafs_get_value,
  &noleafs_set_test,
  &noleafs_set_value,
  MIB_NODE_LR,
  0,
  NULL,
  NULL,
  0
}

index root node for tcpConnTable

Definition at line 236 of file mib2.c.

Initial value:
 {
  &noleafs_get_object_def,
  &noleafs_get_value,
  &noleafs_set_test,
  &noleafs_set_value,
  MIB_NODE_LR,
  0,
  NULL,
  NULL,
  0
}

index root node for udpTable

Definition at line 168 of file mib2.c.