asn1.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MAX_SUBID   0xFFFFFFFF
 
#define MAX_OID_LEN   128 /* max subid's in an oid, per SNMP spec. */
 
#define ASN_BOOLEAN   (0x01)
 
#define ASN_INTEGER   (0x02)
 
#define ASN_BIT_STR   (0x03)
 
#define ASN_OCTET_STR   (0x04)
 
#define ASN_NULL   (0x05)
 
#define ASN_OBJECT_ID   (0x06)
 
#define ASN_SEQUENCE   (0x10)
 
#define ASN_SET   (0x11)
 
#define ASN_UNIVERSAL   (0x00)
 
#define ASN_APPLICATION   (0x40)
 
#define ASN_CONTEXT   (0x80)
 
#define ASN_PRIVATE   (0xC0)
 
#define ASN_PRIMITIVE   (0x00)
 
#define ASN_CONSTRUCTOR   (0x20)
 
#define ASN_LONG_LEN   (0x80)
 
#define ASN_EXTENSION_ID   (0x1F)
 
#define ASN_BIT8   (0x80)
 
#define IS_CONSTRUCTOR(byte)   ((byte) & ASN_CONSTRUCTOR)
 
#define IS_EXTENSION_ID(byte)   (((byte) & ASN_EXTENSION_ID) == ASN_EXTENSION_ID)
 

Typedefs

typedef u_int oid
 

Functions

u_char * asn_build_header (u_char *, int *, u_char, int)
 
u_char * asn_parse_int (u_char *, int *, u_char *, int *, int)
 
u_char * asn_parse_unsigned_int (u_char *, int *, u_char *, u_int *, int)
 
u_char * asn_build_int (u_char *, int *, u_char, int *, int)
 
u_char * asn_build_unsigned_int (u_char *, int *, u_char, u_int *, int)
 
u_char * asn_parse_string (u_char *, int *, u_char *, u_char *, int *)
 
u_char * asn_build_string (u_char *, int *, u_char, u_char *, int)
 
u_char * asn_parse_header (u_char *, int *, u_char *)
 
u_char * asn_build_header_with_truth (u_char *, int *, u_char, int, int)
 
u_char * asn_parse_length (u_char *, u_int *)
 
u_char * asn_build_length (u_char *, int *, int, int)
 
u_char * asn_parse_objid (u_char *, int *, u_char *, oid *, int *)
 
u_char * asn_build_objid (u_char *, int *, u_char, oid *, int)
 
u_char * asn_parse_null (u_char *, int *, u_char *)
 
u_char * asn_build_null (u_char *, int *, u_char)
 
u_char * asn_build_exception (u_char *, int *, u_char)
 

Macro Definition Documentation

#define ASN_APPLICATION   (0x40)

Definition at line 61 of file asn1.h.

#define ASN_BIT8   (0x80)

Definition at line 70 of file asn1.h.

Referenced by asn_build_objid(), and asn_parse_objid().

#define ASN_BIT_STR   (0x03)

Definition at line 53 of file asn1.h.

#define ASN_BOOLEAN   (0x01)

Definition at line 51 of file asn1.h.

#define ASN_CONSTRUCTOR   (0x20)
#define ASN_CONTEXT   (0x80)

Definition at line 62 of file asn1.h.

#define ASN_EXTENSION_ID   (0x1F)

Definition at line 69 of file asn1.h.

#define ASN_LONG_LEN   (0x80)

Definition at line 68 of file asn1.h.

Referenced by asn_build_length(), and asn_parse_length().

#define ASN_NULL   (0x05)

Definition at line 55 of file asn1.h.

Referenced by snmp_var_DecodeVarBind(), snmp_var_EncodeVarBind(), and snmp_var_new().

#define ASN_OBJECT_ID   (0x06)

Definition at line 56 of file asn1.h.

Referenced by snmp_pdu_encode(), snmp_var_DecodeVarBind(), and snmp_var_EncodeVarBind().

#define ASN_OCTET_STR   (0x04)
#define ASN_PRIMITIVE   (0x00)
#define ASN_PRIVATE   (0xC0)

Definition at line 63 of file asn1.h.

#define ASN_SEQUENCE   (0x10)
#define ASN_SET   (0x11)

Definition at line 58 of file asn1.h.

#define ASN_UNIVERSAL   (0x00)
#define IS_CONSTRUCTOR (   byte)    ((byte) & ASN_CONSTRUCTOR)

Definition at line 72 of file asn1.h.

#define IS_EXTENSION_ID (   byte)    (((byte) & ASN_EXTENSION_ID) == ASN_EXTENSION_ID)

Definition at line 73 of file asn1.h.

Referenced by asn_parse_header().

#define MAX_OID_LEN   128 /* max subid's in an oid, per SNMP spec. */

Definition at line 49 of file asn1.h.

Referenced by asn_build_objid().

#define MAX_SUBID   0xFFFFFFFF

Definition at line 43 of file asn1.h.

Referenced by asn_parse_objid(), and parse_subtree().

Typedef Documentation

typedef u_int oid

Definition at line 42 of file asn1.h.

Function Documentation

u_char* asn_build_exception ( u_char *  ,
int ,
u_char   
)

Definition at line 1008 of file asn1.c.

References asn_build_header_with_truth().

Referenced by snmp_var_EncodeVarBind().

u_char* asn_build_header ( u_char *  ,
int ,
u_char  ,
int   
)

Definition at line 93 of file asn1.c.

References asn_build_header_with_truth().

Referenced by snmp_msg_Encode(), and snmp_var_EncodeVarBind().

u_char* asn_build_header_with_truth ( u_char *  ,
int ,
u_char  ,
int  ,
int   
)
u_char* asn_build_int ( u_char *  ,
int ,
u_char  ,
int ,
int   
)
u_char* asn_build_length ( u_char *  ,
int ,
int  ,
int   
)

Definition at line 606 of file asn1.c.

References ASN_LONG_LEN, data, NULL, snmp_set_api_error(), and SNMPERR_ASN_ENCODE.

Referenced by asn_build_header_with_truth().

u_char* asn_build_null ( u_char *  ,
int ,
u_char   
)

Definition at line 876 of file asn1.c.

References asn_build_header_with_truth().

Referenced by snmp_var_EncodeVarBind().

u_char* asn_build_objid ( u_char *  ,
int ,
u_char  ,
oid ,
int   
)
u_char* asn_build_string ( u_char *  ,
int ,
u_char  ,
u_char *  ,
int   
)
u_char* asn_build_unsigned_int ( u_char *  ,
int ,
u_char  ,
u_int *  ,
int   
)
u_char* asn_parse_header ( u_char *  ,
int ,
u_char *   
)
u_char* asn_parse_int ( u_char *  ,
int ,
u_char *  ,
int ,
int   
)
u_char* asn_parse_length ( u_char *  ,
u_int *   
)
u_char* asn_parse_null ( u_char *  ,
int ,
u_char *   
)
u_char* asn_parse_objid ( u_char *  ,
int ,
u_char *  ,
oid ,
int  
)
u_char* asn_parse_string ( u_char *  ,
int ,
u_char *  ,
u_char *  ,
int  
)
u_char* asn_parse_unsigned_int ( u_char *  ,
int ,
u_char *  ,
u_int *  ,
int   
)

Definition at line 179 of file asn1.c.

References asn_parse_length(), data, int, NULL, snmp_set_api_error(), and SNMPERR_ASN_DECODE.

Referenced by snmp_pdu_decode(), and snmp_var_DecodeVarBind().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors