Version of http://mbed.org/cookbook/NetServicesTribute with setting set the same for LPC2368

Dependents:   UDPSocketExample 24LCxx_I2CApp WeatherPlatform_pachube HvZServerLib ... more

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 2674 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 2351 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 2459 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 2302 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 2333 of file mib2.c.

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

Definition at line 3068 of file mib2.c.

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

Definition at line 2834 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 3360 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 3144 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 3209 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 2988 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 2073 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 919 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 903 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 1159 of file mib2.c.

void snmp_delete_ipaddridx_tree ( struct netif *  ni )

Removes ipAddrTable indexes (.ipAdEntAddr) from index tree.

Definition at line 1370 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 1514 of file mib2.c.

void snmp_delete_udpidx_tree ( struct udp_pcb *  pcb )

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

Definition at line 1842 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 962 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 1087 of file mib2.c.

void snmp_insert_ipaddridx_tree ( struct netif *  ni )

Inserts ipAddrTable indexes (.ipAdEntAddr) into index tree.

Definition at line 1316 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 1437 of file mib2.c.

void snmp_insert_udpidx_tree ( struct udp_pcb *  pcb )

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

Definition at line 1790 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 985 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 934 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 1017 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 1001 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 953 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 4094 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 2115 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 2196 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 3584 of file mib2.c.

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

Definition at line 3771 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 511 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 567 of file mib2.c.

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

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

Definition at line 795 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 738 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 432 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 345 of file mib2.c.

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

mib-2.ip.ipRouteTable.ipRouteEntry.ipRouteInfo (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_LR,
  0,
  NULL,
  NULL,
  0
}

index root node for ipRouteTable

Definition at line 386 of file mib2.c.

const u8_t snmpenableauthentraps_default = 2 [static]

mib-2.snmp.snmpEnableAuthenTraps

Definition at line 791 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 766 of file mib2.c.

const u8_t syscontact_len_default = 0 [static]

mib-2.system.sysContact

Definition at line 776 of file mib2.c.

const u8_t sysdescr_len_default = 4 [static]

mib-2.system.sysDescr

Definition at line 771 of file mib2.c.

const u8_t syslocation_len_default = 0 [static]

mib-2.system.sysLocation

Definition at line 786 of file mib2.c.

const u8_t sysname_len_default = 8 [static]

mib-2.system.sysName

Definition at line 781 of file mib2.c.

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

mib-2.system.sysObjectID

Definition at line 764 of file mib2.c.

const s32_t sysservices = SNMP_SYSSERVICES [static]

mib-2.system.sysServices

Definition at line 768 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 234 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 166 of file mib2.c.