yumapro  20.10-12
YumaPro SDK
agt_ypsnmp_util.h File Reference

Utility Functions for YP SNMP. More...

#include "status_enum.h"
#include "yangapi.h"
Include dependency graph for agt_ypsnmp_util.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  agent_nsap_t_
 NSAP for the agent. More...
 
struct  ypsnmp_agent_session_t_
 agent session More...
 

Enumerations

enum  ypsnmp_getnext_mode_t_ {
  YPSNMP_MODE_NONE,
  YPSNMP_MODE_TAB_NOINDEX,
  YPSNMP_MODE_TAB_INDEXED,
  YPSNMP_MODE_SCAL_NOINDEX,
  YPSNMP_MODE_SCAL_INDEXED,
  YPSNMP_MODE_COMPLEX
}
 There are several possible requests that can be sent to the netconfd SNMP server: More...
 

Functions

val_value_t * agt_ypsnmp_bestmatch_next_index (yangapi_cb_t *rcb)
 Find the next best matching list entry in the Queue. More...
 
val_value_t * agt_ypsnmp_get_first_getnextlist (yangapi_cb_t *rcb)
 Get the first list val_value structure in getnext_listQ. More...
 
val_value_t * agt_ypsnmp_get_next_getnextlist (val_value_t *list)
 Get the next list val_value structure in getnext_listQ. More...
 
boolean agt_ypsnmp_match_obj (obj_template_t *targetobj, obj_template_t *curobj)
 Checks if the current object in the walker is the target object for the request. More...
 
boolean agt_ypsnmp_match_index (yangapi_cb_t *rcb, val_value_t *keyval)
 Checks if the current index in the walker is the target index for the request. More...
 
obj_template_t * agt_ypsnmp_get_table_obj (obj_template_t *obj)
 Find the Table object of the current object. More...
 
obj_template_t * agt_ypsnmp_get_parent_obj (obj_template_t *obj)
 Find the complex parent of the current leaf object. More...
 
boolean agt_ypsnmp_is_scalar_obj (obj_template_t *curobj)
 Check if the object is a scalar object. More...
 
boolean agt_ypsnmp_is_augmented_obj (obj_template_t *curobj)
 Check if the object is an augmented object. More...
 
xmlChar * agt_ypsnmp_convert_physaddr (val_value_t *val)
 Converts the value of ifPhysAddress leaf element from yang syntax to SMI syntax expected by snmp client. More...
 
netsnmp_variable_list * agt_ypsnmp_create_snmp_varbind_object (const oid *name, size_t name_length, u_char type, const void *value, size_t len)
 Allocates and creates a new netsnmp variable binding object. More...
 
void agt_ypsnmp_append_varbind_to_list (netsnmp_variable_list **list, netsnmp_variable_list *var)
 Adds the given netsnmp variable binding object to the end of the list of given pdu. More...
 
obj_oid_t * agt_ypsnmp_convert_varbind_to_oid (netsnmp_variable_list *var_ptr)
 Converts an SNMP OID string into an internal object. More...
 
status_t agt_ypsnmp_set_varbind (ses_cb_t *scb, netsnmp_pdu *pdu, val_value_t *val, const obj_oid_t *oid_obj)
 Set the return Varbind based on the found value. More...
 
status_t agt_ypsnmp_setup_peeraddr (ses_cb_t *scb, netsnmp_pdu *pdu)
 Setup the scb->peeraddr for debugging and auditing. More...
 
yangapi_method_t agt_ypsnmp_get_yangapi_method (uint8 msg_code)
 Get the YANGAPI method from the SNMP method. More...
 
xmlChar * agt_ypsnmp_make_restconf_uri (obj_template_t *obj)
 Make a RESTCONF URI string from the specified OID string. More...
 
void agt_ypsnmp_log_pdu (netsnmp_pdu *pdu)
 logs the received SNMP PDU packet contents More...
 
const void * agt_ypsnmp_get_varbind_value (netsnmp_variable_list *var)
 Get the Varbind value. More...
 
const xmlChar * agt_ypsnmp_get_getnext_modename (ypsnmp_getnext_mode_t getnextmode)
 Get the getnext mode name from its enum. More...
 
obj_oid_t * agt_ypsnmp_get_index_oid (obj_oid_t *full_oid, uint32 index_length)
 parse requested OID and strip out index OID More...
 
status_t agt_ypsnmp_convert_oid2chars (xmlChar *str, uint32 len, const oid_t *useoid)
 Converts an OID to its character form. More...
 
status_t agt_ypsnmp_convert_str_oid2str (xmlChar *str, uint32 len, oid_t *useoid)
 Converts a string OID to its string form. More...
 
status_t agt_ypsnmp_convert_str2oid (const xmlChar *str, oid_t *useoid, uint32 len)
 Converts a string to its OID form. More...
 
status_t agt_ypsnmp_indexoid_to_value (yangapi_cb_t *rcb, obj_template_t *obj, uint32 index_length)
 Parse requested OID and strip out index OID. More...
 
status_t agt_ypsnmp_value_to_indexoid (yangapi_cb_t *rcb, val_value_t *list)
 Converts val_value list with keys into index OID. More...
 
ypsnmp_agent_session_t * agt_ypsnmp_init_agent_session (netsnmp_session *session, netsnmp_pdu *pdu)
 Allocate new ypsnmp session context. More...
 
void agt_ypsnmp_free_agent_session (ypsnmp_agent_session_t *asp)
 free the ypsnmp session and deallocate any associated memory More...
 
void free_varbind (netsnmp_variable_list *var)
 Frees the variable and any malloc'd data associated with it. More...
 
void free_varbind_yp (netsnmp_variable_list *var)
 Frees the variable and any malloc'd data associated with it. More...
 

Detailed Description

Utility Functions for YP SNMP.

Enumeration Type Documentation

◆ ypsnmp_getnext_mode_t_

There are several possible requests that can be sent to the netconfd SNMP server:

    1. GETNEXT on a tabular object (a leaf node)
      1.1   With key(s) specified
      1.2   With NO key(s) specified
    2. GETNEXT on a scalar object (a leaf node)
      2.1   With .0 (YPSNMP_MODE_SCAL_INDEXED)
      2.2   With no .0 specified (YPSNMP_MODE_SCAL_NOINDEX)
    3. GETNEXT on a complex object (a container or a list)
Enumerator
YPSNMP_MODE_NONE 

not set

YPSNMP_MODE_TAB_NOINDEX 

table no index

YPSNMP_MODE_TAB_INDEXED 

table indexed

YPSNMP_MODE_SCAL_NOINDEX 

scal no index

YPSNMP_MODE_SCAL_INDEXED 

scal indexed

YPSNMP_MODE_COMPLEX 

complex