yumapro  24.10-1
YumaPro SDK
Loading...
Searching...
No Matches

Manages AVL tree of SMIv2 OID to YANG object mappings. More...

Collaboration diagram for SNMP:

Data Structures

struct  smioid_node_t
 represents a pair of OID and associated object instance More...
 

Functions

boolean smioid_extract_integers (const xmlChar *oid, obj_oid_t *oid_obj)
 Split SMI oid string into integers using '. More...
 
obj_oid_tsmioid_new_object_oid (void)
 Malloc and init a new obj_oid_t control block. More...
 
void smioid_free_object_oid (obj_oid_t *oid)
 Clean and free a malloced get2 control block. More...
 
obj_oid_tsmioid_new_object_oid_ex (oid_t *name, uint32 oid_len, uint32 start_pos)
 Malloc and init a new obj_oid_t control block. More...
 
status_t smioid_tree_init (void)
 initialize the tree used for managing the SMI OID and the associated obj_template_t reference More...
 
void smioid_tree_cleanup (void)
 Clean and free the oid tree. More...
 
void smioid_tree_insert (obj_template_t *obj, obj_oid_t *oid_obj)
 Add a list entry to the oid tree. More...
 
boolean smioid_tree_remove (obj_template_t *obj)
 Remove a entity from the specified tree. More...
 
obj_template_tsmioid_tree_find (obj_oid_t *oid_obj)
 Find a object template node from the specified SMI OID string. More...
 
status_t smioid_tree_dump (void)
 Traverses the SMI OID tree and prints the OID string and info on the obj_template_t instance. More...
 
obj_oid_tsmioid_tree_getnext_oid (obj_oid_t *oid_obj, boolean *found)
 Returns the next or closest OID for the specified oid as per the lexicographical order. More...
 
obj_template_tsmioid_tree_getnext_oid_obj (obj_oid_t *oid_obj, boolean *ignored_index)
 Returns the next or closest oid's object template for the specified oid as per the lexicographical order. More...
 
obj_oid_tsmioid_tree_find_oid (obj_template_t *obj)
 Find the OID value of the corresponding OBJ template. More...
 
void smioid_dump_oid_string (const obj_oid_t *oid_obj)
 Logs the given oid object as a string. More...
 
void smioid_dump_oid_string_obj (obj_template_t *obj)
 Logs the given obj_template->oid object as a string. More...
 
obj_oid_tsmioid_concat_object_oid (oid_t *name1, uint32 oid_len1, oid_t *name2, uint32 oid_len2)
 Concatenate 2 OIDs into one OID. More...
 
obj_oid_tsmioid_dup_object_oid (obj_oid_t *copyfrom)
 Duplicate OID. More...
 
obj_oid_tsmioid_new_scalar_object_oid (void)
 Malloc a scalar index OID: '.0'. More...
 
hb_tree * smioid_tree_get (void)
 Get the SMI OID tree. More...
 

Detailed Description

Manages AVL tree of SMIv2 OID to YANG object mappings.

The smi:oid YANG extension is used to derive the mapping.

Function Documentation

◆ smioid_concat_object_oid()

obj_oid_t * smioid_concat_object_oid ( oid_t name1,
uint32  oid_len1,
oid_t name2,
uint32  oid_len2 
)

Concatenate 2 OIDs into one OID.

Parameters
name1the first OID to write
oid_len1length of the first OID
name2the second OID to write
oid_len2length of the second OID
Returns
malloced and initialized struct
Here is the call graph for this function:

◆ smioid_dump_oid_string()

void smioid_dump_oid_string ( const obj_oid_t oid_obj)

Logs the given oid object as a string.

Parameters
oid_objobj_oid_t structure which needs to be logged
Here is the caller graph for this function:

◆ smioid_dump_oid_string_obj()

void smioid_dump_oid_string_obj ( obj_template_t obj)

Logs the given obj_template->oid object as a string.

Parameters
objobj_template to use
Here is the call graph for this function:

◆ smioid_dup_object_oid()

obj_oid_t * smioid_dup_object_oid ( obj_oid_t copyfrom)

Duplicate OID.

Parameters
copyfromOID to copy from
Returns
malloced and initialized struct
Here is the call graph for this function:
Here is the caller graph for this function:

◆ smioid_extract_integers()

boolean smioid_extract_integers ( const xmlChar *  oid,
obj_oid_t oid_obj 
)

Split SMI oid string into integers using '.

'(dot) delimiter and store in the provided obj_oid_t object

Parameters
oidSMI string
oid_objobj_oid_t structure which needs to be filled (in/out)
Returns
TRUE if extracted and stored the oid string; false otherwise
Here is the caller graph for this function:

◆ smioid_free_object_oid()

void smioid_free_object_oid ( obj_oid_t oid)

Clean and free a malloced get2 control block.

Parameters
oidobj_oid_t control block to free
Here is the caller graph for this function:

◆ smioid_new_object_oid()

obj_oid_t * smioid_new_object_oid ( void  )

Malloc and init a new obj_oid_t control block.

Returns
malloced and initialized struct
Here is the caller graph for this function:

◆ smioid_new_object_oid_ex()

obj_oid_t * smioid_new_object_oid_ex ( oid_t name,
uint32  oid_len,
uint32  start_pos 
)

Malloc and init a new obj_oid_t control block.

Initialize with given OID array and from a specified start position

Parameters
nameOID to use
oid_lenlength of a new OID
start_posstart position to start a write
Returns
malloced and initialized struct
Here is the call graph for this function:
Here is the caller graph for this function:

◆ smioid_new_scalar_object_oid()

obj_oid_t * smioid_new_scalar_object_oid ( void  )

Malloc a scalar index OID: '.0'.

Returns
malloced and initialized struct
Here is the call graph for this function:

◆ smioid_tree_cleanup()

void smioid_tree_cleanup ( void  )

Clean and free the oid tree.

Here is the caller graph for this function:

◆ smioid_tree_dump()

status_t smioid_tree_dump ( void  )

Traverses the SMI OID tree and prints the OID string and info on the obj_template_t instance.

This is a debug function to dump the SMI OID tree.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ smioid_tree_find()

obj_template_t * smioid_tree_find ( obj_oid_t oid_obj)

Find a object template node from the specified SMI OID string.

Parameters
oid_objSMI OID string which is used to search the tree
Returns
object template structure if found, NULL otherwise

◆ smioid_tree_find_oid()

obj_oid_t * smioid_tree_find_oid ( obj_template_t obj)

Find the OID value of the corresponding OBJ template.

Parameters
objobject template to use
Returns
obj_oid_t the OID or NULL if there is no matching OBJ
Here is the call graph for this function:

◆ smioid_tree_get()

hb_tree * smioid_tree_get ( void  )

Get the SMI OID tree.

Returns
AVL tree

◆ smioid_tree_getnext_oid()

obj_oid_t * smioid_tree_getnext_oid ( obj_oid_t oid_obj,
boolean *  found 
)

Returns the next or closest OID for the specified oid as per the lexicographical order.

Parameters
oid_objSMI OID string which is used to search the tree
*foundTRUE if the next OID found
Returns
obj_oid_t the next OID as per lexicographical order
Here is the call graph for this function:

◆ smioid_tree_getnext_oid_obj()

obj_template_t * smioid_tree_getnext_oid_obj ( obj_oid_t oid_obj,
boolean *  ignored_index 
)

Returns the next or closest oid's object template for the specified oid as per the lexicographical order.

Parameters
oid_objSMI OID string which is used to search the tree
[out]ignored_indexaddress of return flag
  • *ignored_index TRUE if the index was ignored
Returns
obj the next obj template as per lexicographical order
Here is the call graph for this function:

◆ smioid_tree_init()

status_t smioid_tree_init ( void  )

initialize the tree used for managing the SMI OID and the associated obj_template_t reference

Returns
status
Here is the caller graph for this function:

◆ smioid_tree_insert()

void smioid_tree_insert ( obj_template_t obj,
obj_oid_t oid_obj 
)

Add a list entry to the oid tree.

Parameters
objobject to be inserted into the tree
oid_objobj_oid_t structure which needs to be filled (in/out)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ smioid_tree_remove()

boolean smioid_tree_remove ( obj_template_t obj)

Remove a entity from the specified tree.

Parameters
objobject to be removed from the tree
Returns
TRUE if removed; FALSE if not
Here is the call graph for this function:
Here is the caller graph for this function: