NetServices Stack source

Dependents:   HelloWorld ServoInterfaceBoardExample1 4180_Lab4

Embed: (wiki syntax)

« Back to documentation index

mib_structs.c File Reference

mib_structs.c File Reference

MIB tree access/construction functions. More...

Go to the source code of this file.

Functions

static void push_node (struct nse *node)
 Pushes nse struct onto stack.
static void pop_node (struct nse *node)
 Pops nse struct from stack.
void snmp_ifindextonetif (s32_t ifindex, struct netif **netif)
 Conversion from ifIndex to lwIP netif.
void snmp_netiftoifindex (struct netif *netif, s32_t *ifidx)
 Conversion from lwIP netif to ifIndex.
void snmp_oidtoip (s32_t *ident, ip_addr_t *ip)
 Conversion from oid to lwIP ip_addr.
void snmp_iptooid (ip_addr_t *ip, s32_t *ident)
 Conversion from lwIP ip_addr to oid.
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.
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.
struct mib_list_rootnodesnmp_mib_node_delete (struct mib_list_rootnode *rn, struct mib_list_node *n)
 Removes node from idx list if it has a single child left.
struct mib_nodesnmp_search_tree (struct mib_node *node, u8_t ident_len, s32_t *ident, struct snmp_name_ptr *np)
 Searches tree for the supplied (scalar?) object identifier.
static u8_t empty_table (struct mib_node *node)
 Test table for presence of at least one table entry.
struct mib_nodesnmp_expand_tree (struct mib_node *node, u8_t ident_len, s32_t *ident, struct snmp_obj_id *oidret)
 Tree expansion.
u8_t snmp_iso_prefix_tst (u8_t ident_len, s32_t *ident)
 Test object identifier for the iso.org.dod.internet prefix.
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.

Variables

const s32_t prefix [4] = {1, 3, 6, 1}
 .iso.org.dod.internet address prefix,

Detailed Description

MIB tree access/construction functions.

Definition in file mib_structs.c.


Function Documentation

static u8_t empty_table ( struct mib_node node ) [static]

Test table for presence of at least one table entry.

Definition at line 640 of file mib_structs.c.

static void pop_node ( struct nse *  node ) [static]

Pops nse struct from stack.

Definition at line 79 of file mib_structs.c.

static void push_node ( struct nse *  node ) [static]

Pushes nse struct onto stack.

Definition at line 64 of file mib_structs.c.

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.

Definition at line 683 of file mib_structs.c.

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

Conversion from ifIndex to lwIP netif.

Parameters:
ifindexis a s32_t object sub-identifier
netifpoints to returned netif struct pointer

Definition at line 95 of file mib_structs.c.

void snmp_iptooid ( ip_addr_t *  ip,
s32_t *  ident 
)

Conversion from lwIP ip_addr to oid.

Parameters:
ippoints to input struct
identpoints to s32_t ident[4] output

Definition at line 147 of file mib_structs.c.

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_lenthe length of the supplied object identifier
identpoints to the array of sub identifiers
oidretpoints 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!!

Definition at line 1140 of file mib_structs.c.

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_lenthe length of the supplied object identifier
identpoints to the array of sub identifiers
Returns:
1 if it matches, 0 otherwise

Definition at line 1114 of file mib_structs.c.

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:
rnpoints to the root node
npoints to the node to delete
Returns:
the nptr to be freed by caller

Definition at line 395 of file mib_structs.c.

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:
rnpoints to the root node
objidis the object sub identifier
fnreturns 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

Definition at line 338 of file mib_structs.c.

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:
rnpoints to the root node
objidis the object sub identifier
insnpoints to a pointer to the inserted node used for constructing the tree.
Returns:
-1 if failed, 1 if inserted, 2 if present.

Definition at line 216 of file mib_structs.c.

void snmp_netiftoifindex ( struct netif *  netif,
s32_t *  ifidx 
)

Conversion from lwIP netif to ifIndex.

Parameters:
netifpoints to a netif struct
ifidxpoints to s32_t object sub-identifier

Definition at line 116 of file mib_structs.c.

void snmp_oidtoip ( s32_t *  ident,
ip_addr_t *  ip 
)

Conversion from oid to lwIP ip_addr.

Parameters:
identpoints to s32_t ident[4] input
ippoints to output struct

Definition at line 136 of file mib_structs.c.

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:
nodepoints to the root of the tree ('.internet')
ident_lenthe length of the supplied object identifier
identpoints to the array of sub identifiers
nppoints to the found object instance (return)
Returns:
pointer to the requested parent (!) node if success, NULL otherwise

Definition at line 452 of file mib_structs.c.


Variable Documentation

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

.iso.org.dod.internet address prefix,

See also:
snmp_iso_*()

Definition at line 44 of file mib_structs.c.