#include "squid.h"
#include "asn1.h"
#include "snmp.h"
#include "snmp_api_error.h"
#include "snmp_error.h"
#include "snmp_msg.h"
#include "snmp_pdu.h"
#include "snmp_vars.h"
#include "util.h"
Go to the source code of this file.
Macros | |
#define | ASN_PARSE_ERROR(x) { return(x); } |
Functions | |
struct snmp_pdu * | snmp_pdu_create (int command) |
struct snmp_pdu * | snmp_pdu_clone (struct snmp_pdu *Src) |
struct snmp_pdu * | snmp_pdu_fix (struct snmp_pdu *pdu, int command) |
struct snmp_pdu * | snmp_fix_pdu (struct snmp_pdu *pdu, int command) |
void | snmp_pdu_free (struct snmp_pdu *pdu) |
void | snmp_free_pdu (struct snmp_pdu *pdu) |
u_char * | snmp_pdu_encode (u_char *DestBuf, int *DestBufLen, struct snmp_pdu *PDU) |
u_char * | snmp_pdu_decode (u_char *Packet, int *Length, struct snmp_pdu *PDU) |
void | snmp_add_null_var (struct snmp_pdu *pdu, oid *name, int name_length) |
Macro Definition Documentation
◆ ASN_PARSE_ERROR
#define ASN_PARSE_ERROR | ( | x | ) | { return(x); } |
Definition at line 105 of file snmp_pdu.c.
Function Documentation
◆ snmp_add_null_var()
Definition at line 637 of file snmp_pdu.c.
References variable_list::name, variable_list::name_length, variable_list::next_variable, NULL, snmp_var_new(), and snmp_pdu::variables.
◆ snmp_fix_pdu()
Definition at line 186 of file snmp_pdu.c.
References snmp_pdu::command, snmp_pdu::errindex, snmp_pdu::errstat, variable_list::next_variable, NULL, snmp_pdu::reqid, SNMP_DEFAULT_ERRINDEX, SNMP_DEFAULT_ERRSTAT, SNMP_DEFAULT_REQID, SNMP_ERR_NOERROR, snmp_free_pdu(), snmp_pdu_clone(), snmp_pdu_free(), SNMP_PDU_RESPONSE, snmp_set_api_error(), snmp_var_clone(), SNMPERR_UNABLE_TO_FIX, snmplib_debug(), and snmp_pdu::variables.
Referenced by snmp_pdu_fix().
◆ snmp_free_pdu()
void snmp_free_pdu | ( | struct snmp_pdu * | pdu | ) |
Definition at line 284 of file snmp_pdu.c.
References snmp_pdu::enterprise, variable_list::next_variable, snmp_var_free(), snmp_pdu::variables, and xfree.
Referenced by Snmp::SendResponse(), snmp_fix_pdu(), snmp_pdu_free(), snmpConstructReponse(), and snmpDecodePacket().
◆ snmp_pdu_clone()
Definition at line 147 of file snmp_pdu.c.
References NULL, snmp_set_api_error(), SNMPERR_OS_ERR, snmplib_debug(), and xmalloc.
Referenced by snmp_fix_pdu().
◆ snmp_pdu_create()
Definition at line 113 of file snmp_pdu.c.
References snmp_pdu::address, snmp_pdu::command, snmp_pdu::enterprise, snmp_pdu::enterprise_length, snmp_pdu::errindex, snmp_pdu::errstat, NULL, SNMP_DEFAULT_ADDRESS, SNMP_DEFAULT_ERRINDEX, SNMP_DEFAULT_ERRSTAT, snmp_set_api_error(), SNMPERR_OS_ERR, snmplib_debug(), snmp_pdu::variables, and xmalloc.
Referenced by snmpAgentResponse(), and snmpDecodePacket().
◆ snmp_pdu_decode()
Definition at line 486 of file snmp_pdu.c.
References snmp_pdu::agent_addr, ASN_PARSE_ERROR, asn_parse_header(), asn_parse_int(), asn_parse_objid(), asn_parse_string(), asn_parse_unsigned_int(), snmp_pdu::command, snmp_pdu::enterprise, snmp_pdu::enterprise_length, snmp_pdu::errindex, snmp_pdu::errstat, four, MAX_NAME_LEN, snmp_pdu::max_repetitions, snmp_pdu::non_repeaters, NULL, variable_list::objid, snmp_pdu::reqid, SNMP_PDU_GETBULK, snmp_set_api_error(), SNMPERR_OS_ERR, snmplib_debug(), snmp_pdu::specific_type, snmp_pdu::time, snmp_pdu::trap_type, and xmalloc.
Referenced by snmp_msg_Decode().
◆ snmp_pdu_encode()
Definition at line 350 of file snmp_pdu.c.
References snmp_pdu::agent_addr, asn_build_int(), asn_build_objid(), asn_build_string(), asn_build_unsigned_int(), ASN_INTEGER, ASN_OBJECT_ID, ASN_PRIMITIVE, ASN_UNIVERSAL, snmp_pdu::command, snmp_pdu::enterprise, snmp_pdu::enterprise_length, snmp_pdu::errindex, snmp_pdu::errstat, snmp_pdu::max_repetitions, snmp_pdu::non_repeaters, NULL, snmp_pdu::reqid, SMI_IPADDRESS, SMI_TIMETICKS, SNMP_PDU_GETBULK, snmplib_debug(), snmp_pdu::specific_type, snmp_pdu::time, and snmp_pdu::trap_type.
Referenced by snmp_msg_Encode().
◆ snmp_pdu_fix()
Definition at line 181 of file snmp_pdu.c.
References snmp_pdu::command, and snmp_fix_pdu().
◆ snmp_pdu_free()
void snmp_pdu_free | ( | struct snmp_pdu * | pdu | ) |
Definition at line 275 of file snmp_pdu.c.
References snmp_free_pdu().
Referenced by snmp_fix_pdu().