yumapro  20.10-10
YumaPro SDK
Core Functions

Control interface for Server interface to net-snmp agent for SNMP support. More...

Collaboration diagram for Core Functions:

Functions

int ypsnmp_snmp_packet (int op_type, netsnmp_session *session, int reqid, netsnmp_pdu *pdu, void *magic)
 Register handle an incoming SNMP packet. More...
 
int ypsnmp_check_packet (netsnmp_session *session, netsnmp_transport *transport, void *transport_data, int transport_data_length)
 Handler for all incoming messages (a.k.a. More...
 
int ypsnmp_check_parse (netsnmp_session *session, netsnmp_pdu *pdu, int result)
 Check the PDU parse. More...
 
status_t agt_ypsnmp_init (void)
 Initialize the agt_ypsnmp module. More...
 
void agt_ypsnmp_cleanup (void)
 Cleanup the agt_ypsnmp module. More...
 
void agt_ypsnmp_check_io (void)
 Check if any SNMP messages to process. More...
 
status_t agt_ypsnmp_reply_handler (ses_cb_t *scb, yangapi_cb_t *rcb, rpc_msg_t *msg, status_t result)
 Handler called for sending a response. More...
 
status_t agt_ypsnmp_notification_handler (agt_not_msg_t *notif)
 Handler called for sending a notification. More...
 
status_t agt_ypsnmp_handle_request (ypsnmp_agent_session_t *asp)
 Incoming Packet handling function. More...
 

Detailed Description

Control interface for Server interface to net-snmp agent for SNMP support.

Requires WITH_SNMP=1 in build and –with-snmp=true CLI parameter at runtime.

Function Documentation

void agt_ypsnmp_check_io ( void  )

Check if any SNMP messages to process.

Adapted from net-snmp agent

Only present if WITH_SNMP=1.

Here is the call graph for this function:

Here is the caller graph for this function:

void agt_ypsnmp_cleanup ( void  )

Cleanup the agt_ypsnmp module.

Only present if WITH_SNMP=1.

Here is the call graph for this function:

Here is the caller graph for this function:

status_t agt_ypsnmp_handle_request ( ypsnmp_agent_session_t asp)

Incoming Packet handling function.

Handles master packets as well as AgentX packets Only present if WITH_SNMP=1.

Parameters
aspagent session to use
Returns
status

Here is the call graph for this function:

Here is the caller graph for this function:

status_t agt_ypsnmp_init ( void  )

Initialize the agt_ypsnmp module.

Only present if WITH_SNMP=1.

Returns
status

Here is the call graph for this function:

Here is the caller graph for this function:

status_t agt_ypsnmp_notification_handler ( agt_not_msg_t notif)

Handler called for sending a notification.

Only present if WITH_SNMP=1.

Parameters
notifnotification message
Returns
status

Here is the call graph for this function:

status_t agt_ypsnmp_reply_handler ( ses_cb_t scb,
yangapi_cb_t rcb,
rpc_msg_t msg,
status_t  result 
)

Handler called for sending a response.

Only present if WITH_SNMP=1.

Parameters
scbsession control block
rcbyangapi control block to use
msgrpc_msg_t in progress
resultgeneral request status
Returns
status

Here is the call graph for this function:

Here is the caller graph for this function:

int ypsnmp_check_packet ( netsnmp_session *  session,
netsnmp_transport *  transport,
void *  transport_data,
int  transport_data_length 
)

Handler for all incoming messages (a.k.a.

packets) for the agent.

Print output when appropriate, and increment the incoming counter.

Only present if WITH_SNMP=1.

Parameters
sessionThe net-snmp session
transporttransport enum
transport_datacontrol block for transport
transport_data_lengthlength of transport_data
Returns
1 on success, 0 on error

Here is the call graph for this function:

int ypsnmp_check_parse ( netsnmp_session *  session,
netsnmp_pdu *  pdu,
int  result 
)

Check the PDU parse.

Only present if WITH_SNMP=1.

Parameters
sessionThe net-snmp session
pdumessage to process
resultof parse
Returns
1 on success, 0 on error
int ypsnmp_snmp_packet ( int  op_type,
netsnmp_session *  session,
int  reqid,
netsnmp_pdu *  pdu,
void *  magic 
)

Register handle an incoming SNMP packet.

This is the callback registered for incoming packets.

This function processes a complete (according to asn_check_packet or the AgentX equivalent) packet, parsing it into a PDU and calling the relevant callbacks. On entry, packetptr points at the packet in the session's buffer and length is the length of the packet.

Only present if WITH_SNMP=1.

Parameters
op_typeOperation type
sessionThe net-snmp session
reqidThe request id of this pdu ( 0 for TRAP)
pduThe snmp pdu information
magicopaque handler
Returns
Returns 1 if request was successful, 0 if it should be kept pending. Any data in the pdu must be copied because it will be freed elsewhere.

Here is the call graph for this function: