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

◆ ASN_APPLICATION

#define ASN_APPLICATION   (0x40)

Definition at line 61 of file asn1.h.

◆ ASN_BIT8

#define ASN_BIT8   (0x80)

Definition at line 70 of file asn1.h.

◆ ASN_BIT_STR

#define ASN_BIT_STR   (0x03)

Definition at line 53 of file asn1.h.

◆ ASN_BOOLEAN

#define ASN_BOOLEAN   (0x01)

Definition at line 51 of file asn1.h.

◆ ASN_CONSTRUCTOR

#define ASN_CONSTRUCTOR   (0x20)

Definition at line 66 of file asn1.h.

◆ ASN_CONTEXT

#define ASN_CONTEXT   (0x80)

Definition at line 62 of file asn1.h.

◆ ASN_EXTENSION_ID

#define ASN_EXTENSION_ID   (0x1F)

Definition at line 69 of file asn1.h.

◆ ASN_INTEGER

#define ASN_INTEGER   (0x02)

Definition at line 52 of file asn1.h.

◆ ASN_LONG_LEN

#define ASN_LONG_LEN   (0x80)

Definition at line 68 of file asn1.h.

◆ ASN_NULL

#define ASN_NULL   (0x05)

Definition at line 55 of file asn1.h.

◆ ASN_OBJECT_ID

#define ASN_OBJECT_ID   (0x06)

Definition at line 56 of file asn1.h.

◆ ASN_OCTET_STR

#define ASN_OCTET_STR   (0x04)

Definition at line 54 of file asn1.h.

◆ ASN_PRIMITIVE

#define ASN_PRIMITIVE   (0x00)

Definition at line 65 of file asn1.h.

◆ ASN_PRIVATE

#define ASN_PRIVATE   (0xC0)

Definition at line 63 of file asn1.h.

◆ ASN_SEQUENCE

#define ASN_SEQUENCE   (0x10)

Definition at line 57 of file asn1.h.

◆ ASN_SET

#define ASN_SET   (0x11)

Definition at line 58 of file asn1.h.

◆ ASN_UNIVERSAL

#define ASN_UNIVERSAL   (0x00)

Definition at line 60 of file asn1.h.

◆ IS_CONSTRUCTOR

#define IS_CONSTRUCTOR (   byte)    ((byte) & ASN_CONSTRUCTOR)

Definition at line 72 of file asn1.h.

◆ IS_EXTENSION_ID

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

Definition at line 73 of file asn1.h.

◆ MAX_OID_LEN

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

Definition at line 49 of file asn1.h.

◆ MAX_SUBID

#define MAX_SUBID   0xFFFFFFFF

Definition at line 43 of file asn1.h.

Typedef Documentation

◆ oid

typedef u_int oid

Definition at line 42 of file asn1.h.

Function Documentation

◆ asn_build_exception()

u_char * asn_build_exception ( u_char *  data,
int datalength,
u_char  type 
)

Definition at line 837 of file asn1.c.

References asn_build_header_with_truth().

Referenced by snmp_var_EncodeVarBind().

◆ asn_build_header()

u_char * asn_build_header ( u_char *  data,
int datalength,
u_char  type,
int  length 
)

Definition at line 93 of file asn1.c.

References asn_build_header_with_truth().

Referenced by snmp_msg_Encode(), and snmp_var_EncodeVarBind().

◆ asn_build_header_with_truth()

u_char * asn_build_header_with_truth ( u_char *  data,
int datalength,
u_char  type,
int  length,
int  truth 
)

◆ asn_build_int()

u_char * asn_build_int ( u_char *  data,
int datalength,
u_char  type,
int intp,
int  intsize 
)

◆ asn_build_length()

u_char * asn_build_length ( u_char *  data,
int datalength,
int  length,
int  truth 
)

Definition at line 570 of file asn1.c.

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

Referenced by asn_build_header_with_truth().

◆ asn_build_null()

u_char * asn_build_null ( u_char *  data,
int datalength,
u_char  type 
)

Definition at line 803 of file asn1.c.

References asn_build_header_with_truth().

Referenced by snmp_var_EncodeVarBind().

◆ asn_build_objid()

u_char * asn_build_objid ( u_char *  data,
int datalength,
u_char  type,
oid objid,
int  objidlength 
)

◆ asn_build_string()

u_char * asn_build_string ( u_char *  data,
int datalength,
u_char  type,
u_char *  string,
int  strlength 
)

◆ asn_build_unsigned_int()

u_char * asn_build_unsigned_int ( u_char *  data,
int datalength,
u_char  type,
u_int *  intp,
int  intsize 
)

◆ asn_parse_header()

u_char * asn_parse_header ( u_char *  data,
int datalength,
u_char *  type 
)

◆ asn_parse_int()

u_char * asn_parse_int ( u_char *  data,
int datalength,
u_char *  type,
int intp,
int  intsize 
)

◆ asn_parse_length()

u_char * asn_parse_length ( u_char *  data,
u_int *  length 
)

◆ asn_parse_null()

u_char * asn_parse_null ( u_char *  ,
int ,
u_char *   
)

◆ asn_parse_objid()

u_char * asn_parse_objid ( u_char *  data,
int datalength,
u_char *  type,
oid objid,
int objidlength 
)

◆ asn_parse_string()

u_char * asn_parse_string ( u_char *  data,
int datalength,
u_char *  type,
u_char *  string,
int strlength 
)

◆ asn_parse_unsigned_int()

u_char * asn_parse_unsigned_int ( u_char *  data,
int datalength,
u_char *  type,
u_int *  intp,
int  intsize 
)

Definition at line 179 of file asn1.c.

References asn_parse_length(), 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