#include "asn1.h"
Go to the source code of this file.
Classes | |
struct | variable_list |
Typedefs | |
typedef struct variable | variable |
typedef struct variable_list | variable_list |
Functions | |
struct variable_list * | snmp_var_new (oid *, int) |
struct variable_list * | snmp_var_new_integer (oid *, int, int, unsigned char) |
struct variable_list * | snmp_var_clone (struct variable_list *) |
void | snmp_var_free (struct variable_list *) |
u_char * | snmp_var_EncodeVarBind (u_char *, int *, struct variable_list *, int) |
u_char * | snmp_var_DecodeVarBind (u_char *, int *, struct variable_list **, int) |
Macro Definition Documentation
◆ INETADDRESSTYPE_DNS
#define INETADDRESSTYPE_DNS 16 |
Definition at line 97 of file snmp_vars.h.
◆ INETADDRESSTYPE_ENUMS
#define INETADDRESSTYPE_ENUMS |
Definition at line 90 of file snmp_vars.h.
◆ INETADDRESSTYPE_IPV4
#define INETADDRESSTYPE_IPV4 1 |
Definition at line 93 of file snmp_vars.h.
◆ INETADDRESSTYPE_IPV4Z
#define INETADDRESSTYPE_IPV4Z 3 |
Definition at line 95 of file snmp_vars.h.
◆ INETADDRESSTYPE_IPV6
#define INETADDRESSTYPE_IPV6 2 |
Definition at line 94 of file snmp_vars.h.
◆ INETADDRESSTYPE_IPV6Z
#define INETADDRESSTYPE_IPV6Z 4 |
Definition at line 96 of file snmp_vars.h.
◆ INETADDRESSTYPE_UNKNOWN
#define INETADDRESSTYPE_UNKNOWN 0 |
Definition at line 92 of file snmp_vars.h.
◆ MAX_NAME_LEN
Definition at line 65 of file snmp_vars.h.
◆ SMI_COUNTER32
#define SMI_COUNTER32 (ASN_APPLICATION | 1) /* INTEGER */ |
Definition at line 76 of file snmp_vars.h.
◆ SMI_COUNTER64
#define SMI_COUNTER64 (ASN_APPLICATION | 6) /* INTEGER */ |
Definition at line 81 of file snmp_vars.h.
◆ SMI_ENDOFMIBVIEW
#define SMI_ENDOFMIBVIEW (ASN_CONTEXT | ASN_PRIMITIVE | 0x2) /* endOfMibView[2] */ |
Definition at line 120 of file snmp_vars.h.
◆ SMI_GAUGE32
#define SMI_GAUGE32 (ASN_APPLICATION | 2) /* INTEGER */ |
Definition at line 77 of file snmp_vars.h.
◆ SMI_INTEGER
#define SMI_INTEGER ASN_INTEGER |
Definition at line 71 of file snmp_vars.h.
◆ SMI_IPADDRESS
#define SMI_IPADDRESS (ASN_APPLICATION | 0) /* OCTET STRING, net byte order */ |
Definition at line 75 of file snmp_vars.h.
◆ SMI_NOSUCHINSTANCE
#define SMI_NOSUCHINSTANCE (ASN_CONTEXT | ASN_PRIMITIVE | 0x1) /* noSuchInstance[1] */ |
Definition at line 119 of file snmp_vars.h.
◆ SMI_NOSUCHOBJECT
#define SMI_NOSUCHOBJECT (ASN_CONTEXT | ASN_PRIMITIVE | 0x0) /* noSuchObject[0] */ |
Definition at line 118 of file snmp_vars.h.
◆ SMI_NULLOBJ
#define SMI_NULLOBJ ASN_NULL |
Definition at line 74 of file snmp_vars.h.
◆ SMI_OBJID
#define SMI_OBJID ASN_OBJECT_ID |
Definition at line 73 of file snmp_vars.h.
◆ SMI_OPAQUE
#define SMI_OPAQUE (ASN_APPLICATION | 4) /* OCTET STRING */ |
Definition at line 80 of file snmp_vars.h.
◆ SMI_STRING
#define SMI_STRING ASN_OCTET_STR |
Definition at line 72 of file snmp_vars.h.
◆ SMI_TIMETICKS
#define SMI_TIMETICKS (ASN_APPLICATION | 3) /* INTEGER */ |
Definition at line 79 of file snmp_vars.h.
◆ SMI_UNSIGNED32
#define SMI_UNSIGNED32 SMI_GAUGE32 |
Definition at line 78 of file snmp_vars.h.
Typedef Documentation
◆ variable
Definition at line 121 of file snmp_vars.h.
◆ variable_list
typedef struct variable_list variable_list |
Definition at line 122 of file snmp_vars.h.
Function Documentation
◆ snmp_var_clone()
struct variable_list * snmp_var_clone | ( | struct variable_list * | Src | ) |
Definition at line 166 of file snmp_vars.c.
References variable_list::name, variable_list::name_length, NULL, snmp_set_api_error(), SNMPERR_OS_ERR, variable_list::string, variable_list::val, variable_list::val_len, xfree, and xmalloc.
Referenced by snmp_fix_pdu().
◆ snmp_var_DecodeVarBind()
u_char * snmp_var_DecodeVarBind | ( | u_char * | Buffer, |
int * | BufLen, | ||
struct variable_list ** | VarP, | ||
int | Version | ||
) |
Definition at line 368 of file snmp_vars.c.
References ASN_CONSTRUCTOR, ASN_INTEGER, ASN_NULL, ASN_OBJECT_ID, ASN_OCTET_STR, asn_parse_header(), asn_parse_int(), asn_parse_objid(), asn_parse_string(), asn_parse_unsigned_int(), ASN_PRIMITIVE, ASN_SEQUENCE, ASN_UNIVERSAL, int, variable_list::integer, MAX_NAME_LEN, variable_list::name, variable_list::name_length, variable_list::next_variable, NULL, variable_list::objid, PARSE_ERROR, SMI_COUNTER32, SMI_COUNTER64, SMI_ENDOFMIBVIEW, SMI_GAUGE32, SMI_IPADDRESS, SMI_NOSUCHINSTANCE, SMI_NOSUCHOBJECT, SMI_OPAQUE, SMI_TIMETICKS, snmp_set_api_error(), snmp_var_new(), SNMPERR_OS_ERR, SNMPERR_PDU_PARSE, SNMPERR_UNSUPPORTED_TYPE, snmplib_debug(), variable_list::string, variable_list::type, variable_list::val, variable_list::val_len, and xmalloc.
Referenced by snmp_msg_Decode().
◆ snmp_var_EncodeVarBind()
u_char * snmp_var_EncodeVarBind | ( | u_char * | Buffer, |
int * | BufLenP, | ||
struct variable_list * | VarList, | ||
int | Version | ||
) |
Definition at line 259 of file snmp_vars.c.
References asn_build_exception(), asn_build_header(), asn_build_int(), asn_build_null(), asn_build_objid(), asn_build_string(), asn_build_unsigned_int(), ASN_CONSTRUCTOR, ASN_INTEGER, ASN_NULL, ASN_OBJECT_ID, ASN_OCTET_STR, ASN_PRIMITIVE, ASN_SEQUENCE, ASN_UNIVERSAL, variable_list::integer, variable_list::name, variable_list::name_length, variable_list::next_variable, NULL, variable_list::objid, SMI_COUNTER32, SMI_COUNTER64, SMI_ENDOFMIBVIEW, SMI_GAUGE32, SMI_IPADDRESS, SMI_NOSUCHINSTANCE, SMI_NOSUCHOBJECT, SMI_OPAQUE, SMI_TIMETICKS, snmp_set_api_error(), SNMP_VERSION_1, SNMPERR_UNSUPPORTED_TYPE, snmplib_debug(), variable_list::string, variable_list::type, variable_list::val, and variable_list::val_len.
Referenced by snmp_msg_Encode().
◆ snmp_var_free()
void snmp_var_free | ( | struct variable_list * | Ptr | ) |
Definition at line 227 of file snmp_vars.c.
References variable_list::integer, variable_list::name, variable_list::string, variable_list::val, and xfree.
Referenced by Snmp::Pdu::clearVars(), snmp_free_pdu(), and snmpAgentResponse().
◆ snmp_var_new()
struct variable_list * snmp_var_new | ( | oid * | Name, |
int | Len | ||
) |
Definition at line 109 of file snmp_vars.c.
References ASN_NULL, variable_list::name, variable_list::name_length, NULL, snmp_set_api_error(), SNMPERR_OS_ERR, variable_list::type, xfree, and xmalloc.
Referenced by snmp_add_null_var(), snmp_confFn(), snmp_meshCtblFn(), snmp_meshPtblFn(), snmp_var_DecodeVarBind(), snmp_var_new_integer(), and snmpAgentResponse().
◆ snmp_var_new_integer()
struct variable_list * snmp_var_new_integer | ( | oid * | Name, |
int | Len, | ||
int | ival, | ||
unsigned char | type | ||
) |
Definition at line 151 of file snmp_vars.c.
References int, variable_list::integer, snmp_var_new(), variable_list::type, variable_list::val, variable_list::val_len, and xmalloc.
Referenced by snmp_confFn(), snmp_meshCtblFn(), snmp_meshPtblFn(), snmp_netDnsFn(), snmp_netFqdnFn(), snmp_netIpFn(), snmp_prfProtoFn(), snmp_prfSysFn(), and snmp_sysFn().