8#define ASNERR_TOO_int32_t -5
10#define ASNERR_ASN_ENCODE -6
11#define ASNERR_ASN_DECODE -7
12#define ASNERR_PDU_TRANSLATION -8
13#define ASNERR_OS_ERR -9
14#define ASNERR_INVALID_TXTOID -10
16#define ASNERR_UNABLE_TO_FIX -11
17#define ASNERR_UNSUPPORTED_TYPE -12
18#define ASNERR_PDU_PARSE -13
19#define ASNERR_PACKET_ERR -14
20#define ASNERR_WRONG_TYPE -15
21#define ASNERR_ENDOFPACKET -16
30 uint8_t *protected_bufp;
31 uint16_t protected_len;
39 uint16_t put_header_offset;
44 void StoreByte(uint8_t b)
56 void StoreWord(uint16_t w) {StoreByte(w>>8); StoreByte(w&0xff);};
60 int RootParse(
int &length, uint8_t &rv_type );
76 uint8_t GetHeaderwLen(
int &objlen );
79 int GetOctets( uint8_t *pData,
int len );
80 int GetOid(
int *dest );
83 uint32_t GetGauge32();
84 uint32_t GetCounter32();
85 uint32_t GetTimeTick();
86 long long GetCounter64();
87 int GetOpaque( uint8_t *pData,
int &len );
88 void EatBytes(
int len );
90 int PeekType( uint8_t &type );
93 void PutHeader( uint8_t typ );
108 void PutUInt( uint32_t );
109 void PutOctets(
const uint8_t *pData,
int len );
110 void PutOctetString(
const char * );
111 void PutOid(
int *oid );
112 void PutOidFromString(
const char * );
113 void PutOidFromCoid(
const char * );
114 void PutNullObject();
116 void PutGauge32( uint32_t val );
117 void PutCounter32( uint32_t val );
118 void PutTimeTick( uint32_t val );
119 void PutCounter64(
long long val );
120 void PutOpaque( uint8_t *pData,
int len );
121 void Put_NOSUCHINSTANCE();
122 void Put_NOSUCHOBJECT();
123 void Put_ENDOFMIBVIEW();
124 void PutV1_NOSUCHOBJECT();
125 void PutRawUnsigned( uint8_t type, uint32_t val );
127 void PutCopyBlock(ASN & from);
133 return protected_bufp;
137 void ShowRemainder();
138 bool OverSize() {
return bOverSize; };
142void PrintOid(
const int *oid );
144void fPrintOid( FILE *fp,
const int *oidmlen );
148int CompOid(
const int *pOid,
const int *pOid2 );
150int CompOid(
const int *pOid,
const char *s );
153#define MAX_SUBID 0xFFFFFFFF
156#define MAX_OID_LEN 128
158#define ASN_BOOLEAN (0x01)
159#define ASN_INTEGER (0x02)
160#define ASN_BIT_STR (0x03)
161#define ASN_OCTET_STR (0x04)
162#define ASN_NULL (0x05)
163#define ASN_OBJECT_ID (0x06)
164#define ASN_SEQUENCE (0x10)
165#define ASN_SET (0x11)
167#define ASN_UNIVERSAL (0x00)
168#define ASN_APPLICATION (0x40)
169#define ASN_CONTEXT (0x80)
170#define ASN_PRIVATE (0xC0)
172#define ASN_PRIMITIVE (0x00)
173#define ASN_CONSTRUCTOR (0x20)
175#define ASN_int32_t_LEN (0x80)
176#define ASN_EXTENSION_ID (0x1F)
177#define ASN_BIT8 (0x80)
179#define IS_CONSTRUCTOR(byte) ((byte) & ASN_CONSTRUCTOR)
180#define IS_EXTENSION_ID(byte) (((byte) & ASN_EXTENSION_ID) == ASN_EXTENSION_ID)
185#define SMI_INTEGER ASN_INTEGER
186#define SMI_STRING ASN_OCTET_STR
187#define SMI_OBJID ASN_OBJECT_ID
188#define SMI_NULLOBJ ASN_NULL
189#define SMI_IPADDRESS (ASN_APPLICATION | 0)
190#define SMI_COUNTER32 (ASN_APPLICATION | 1)
191#define SMI_GAUGE32 (ASN_APPLICATION | 2)
192#define SMI_UNSIGNED32 SMI_GAUGE32
193#define SMI_TIMETICKS (ASN_APPLICATION | 3)
194#define SMI_OPAQUE (ASN_APPLICATION | 4)
195#define SMI_COUNTER64 (ASN_APPLICATION | 6)
197#define SMI_NOSUCHOBJECT (ASN_CONTEXT | ASN_PRIMITIVE | 0x0)
198#define SMI_NOSUCHINSTANCE (ASN_CONTEXT | ASN_PRIMITIVE | 0x1)
199#define SMI_ENDOFMIBVIEW (ASN_CONTEXT | ASN_PRIMITIVE | 0x2)
202#define SNMP_PDU_GET (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x0)
203#define SNMP_PDU_GETNEXT (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x1)
204#define SNMP_PDU_RESPONSE (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x2)
205#define SNMP_PDU_SET (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x3)
206#define SNMP_PDU_TRAP (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x4)
207#define TRP_REQ_MSG (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x4)
208#define SNMP_PDU_GETBULK (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x5)
209#define SNMP_PDU_INFORM (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x6)
210#define SNMP_PDU_V2TRAP (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x7)
211#define SNMP_PDU_REPORT (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x8)
212#define SNMP_VERSION_1 0
213#define SNMP_VERSION_2 1
216#define SNMP_ERR_NOERROR (0x0)
217#define SNMP_ERR_TOOBIG (0x1)
218#define SNMP_ERR_NOSUCHNAME (0x2)
219#define SNMP_ERR_BADVALUE (0x3)
220#define SNMP_ERR_READONLY (0x4)
221#define SNMP_ERR_GENERR (0x5)
223#define SNMP_COLDSTART_TRAP (0x0)
224#define SNMP_WARMSTART_TRAP (0x1)
225#define SNMP_LINKDOWN_TRAP (0x2)
226#define SNMP_LINKUP_TRAP (0x3)
227#define SNMP_AUTHENTICATIONFAIL_TRAP (0x4)
228#define SNMP_ENTERPRISE_TRAP (0x6)
Used to hold and manipulate IPv4 and IPv6 addresses in dual stack mode.
Definition ipv6_addr.h:41
UDP Packet Class - Complete UDP packet management.
Definition udp.h:602
#define MAX_UDPDATA
Definition constants.h:82