|
|
#include <snmp/snmp.h>struct type_SNMP_SMUX__PDUs decode_SMUX_PDU(char packet, long length);
short encode_SMUX_PDU(struct type_SMUX__PDUs pdu_ptr);
void free_SNMP_SMUX_pdu(struct type_SMUX__PDUs pdu_ptr);
void free_SMUX_SimpleOpen(SMUX_SimpleOpen open_ptr);
void free_SMUX_ClosePDU(SMUX_ClosePDU close_ptr);
void free_SMUX_RReqPDU(SMUX_RReqPDU rreq_ptr);
void free_SMUX_RRspPDU(SMUX_RrspPDU rrsp_ptr);
void free_SMUX_GetPDU(SMUX_Data_PDU get_ptr);
void free_SMUX_SOutPDU(SMUX_SOutPDU sout_ptr);
void free_SMUX_TrapPDU(SMUX_Trap_PDU trap_ptr);
encode_SMUX_PDU creates an ASN.1 encoded SMUX PDU from the SMUX PDU structure specified by pdu_ptr. ASN.1 encoding is required for the transfer of an SMUX PDU from an agent to a peer and vice versa. encode_SMUX_PDU traces down the structure of VarBinds that have been added to the SMUX PDU and builds the ASN.1 encoding of the SMUX PDU in the packlet pointer of the SMUX PDU data structure specified by pdu_ptr. When this ASN.1 encoding is complete, SMUX PDU processing is complete, and the structure is ready to be transferred. If successful, encode_SMUX_PDU returns 0; if unsuccessful, it returns -1.
free_SNMP_SMUX_pdu frees all memory associated with the PDU header data structure, including the actual packlet and all the VarBindList structures that were linked to the PDU. To accomplish this, free_SNMP_SMUX_pdu invokes one of the following functions, depending on the type of PDU that pdu_ptr points to: