mib_structs.c File Reference


Data Structures

struct  nse

Functions

void snmp_ifindextonetif (s32_t ifindex, struct netif **netif)
void snmp_netiftoifindex (struct netif *netif, s32_t *ifidx)
void snmp_oidtoip (s32_t *ident, struct ip_addr *ip)
void snmp_iptooid (struct ip_addr *ip, s32_t *ident)
s8_t snmp_mib_node_insert (struct mib_list_rootnode *rn, s32_t objid, struct mib_list_node **insn)
s8_t snmp_mib_node_find (struct mib_list_rootnode *rn, s32_t objid, struct mib_list_node **fn)
struct mib_list_rootnodesnmp_mib_node_delete (struct mib_list_rootnode *rn, struct mib_list_node *n)
struct mib_nodesnmp_search_tree (struct mib_node *node, u8_t ident_len, s32_t *ident, struct snmp_name_ptr *np)
struct mib_nodesnmp_expand_tree (struct mib_node *node, u8_t ident_len, s32_t *ident, struct snmp_obj_id *oidret)
u8_t snmp_iso_prefix_tst (u8_t ident_len, s32_t *ident)
u8_t snmp_iso_prefix_expand (u8_t ident_len, s32_t *ident, struct snmp_obj_id *oidret)

Variables

const s32_t prefix [4] = {1, 3, 6, 1}

Detailed Description

MIB tree access/construction functions.

Function Documentation

struct mib_node* snmp_expand_tree ( struct mib_node node,
u8_t  ident_len,
s32_t *  ident,
struct snmp_obj_id oidret 
) [read]

Tree expansion.

void snmp_ifindextonetif ( s32_t  ifindex,
struct netif **  netif 
)

Conversion from ifIndex to lwIP netif

Parameters:
ifindex is a s32_t object sub-identifier
netif points to returned netif struct pointer

void snmp_iptooid ( struct ip_addr *  ip,
s32_t *  ident 
)

Conversion from lwIP ip_addr to oid

Parameters:
ip points to input struct
ident points to s32_t ident[4] output

u8_t snmp_iso_prefix_expand ( u8_t  ident_len,
s32_t *  ident,
struct snmp_obj_id oidret 
)

Expands object identifier to the iso.org.dod.internet prefix for use in getnext operation.

Parameters:
ident_len the length of the supplied object identifier
ident points to the array of sub identifiers
oidret points to returned expanded object identifier
Returns:
1 if it matches, 0 otherwise
Note:
ident_len 0 is allowed, expanding to the first known object id!!

u8_t snmp_iso_prefix_tst ( u8_t  ident_len,
s32_t *  ident 
)

Test object identifier for the iso.org.dod.internet prefix.

Parameters:
ident_len the length of the supplied object identifier
ident points to the array of sub identifiers
Returns:
1 if it matches, 0 otherwise

struct mib_list_rootnode* snmp_mib_node_delete ( struct mib_list_rootnode rn,
struct mib_list_node *  n 
) [read]

Removes node from idx list if it has a single child left.

Parameters:
rn points to the root node
n points to the node to delete
Returns:
the nptr to be freed by caller

s8_t snmp_mib_node_find ( struct mib_list_rootnode rn,
s32_t  objid,
struct mib_list_node **  fn 
)

Finds node in idx list and returns deletion mark.

Parameters:
rn points to the root node
objid is the object sub identifier
fn returns pointer to found node
Returns:
0 if not found, 1 if deletable, 2 can't delete (2 or more children), 3 not a list_node

s8_t snmp_mib_node_insert ( struct mib_list_rootnode rn,
s32_t  objid,
struct mib_list_node **  insn 
)

Inserts node in idx list in a sorted (ascending order) fashion and allocates the node if needed.

Parameters:
rn points to the root node
objid is the object sub identifier
insn points to a pointer to the inserted node used for constructing the tree.
Returns:
-1 if failed, 1 if inserted, 2 if present.

void snmp_netiftoifindex ( struct netif netif,
s32_t *  ifidx 
)

Conversion from lwIP netif to ifIndex

Parameters:
netif points to a netif struct
ifidx points to s32_t object sub-identifier

void snmp_oidtoip ( s32_t *  ident,
struct ip_addr *  ip 
)

Conversion from oid to lwIP ip_addr

Parameters:
ident points to s32_t ident[4] input
ip points to output struct

struct mib_node* snmp_search_tree ( struct mib_node node,
u8_t  ident_len,
s32_t *  ident,
struct snmp_name_ptr *  np 
) [read]

Searches tree for the supplied (scalar?) object identifier.

Parameters:
node points to the root of the tree ('.internet')
ident_len the length of the supplied object identifier
ident points to the array of sub identifiers
np points to the found object instance (rerurn)
Returns:
pointer to the requested parent (!) node if success, NULL otherwise


Variable Documentation

const s32_t prefix[4] = {1, 3, 6, 1}

.iso.org.dod.internet address prefix,

See also:
snmp_iso_*()


Generated on Sun Mar 23 19:22:46 2008 for lwIP 1.3.0 by  doxygen 1.5.4