38#ifndef LWIP_HDR_APPS_SNMP_ASN1_H
39#define LWIP_HDR_APPS_SNMP_ASN1_H
53#define SNMP_ASN1_TLV_INDEFINITE_LENGTH 0x80
55#define SNMP_ASN1_CLASS_MASK 0xC0
56#define SNMP_ASN1_CONTENTTYPE_MASK 0x20
57#define SNMP_ASN1_DATATYPE_MASK 0x1F
58#define SNMP_ASN1_DATATYPE_EXTENDED 0x1F
61#define SNMP_ASN1_CONTEXT_PDU_GET_REQ 0
62#define SNMP_ASN1_CONTEXT_PDU_GET_NEXT_REQ 1
63#define SNMP_ASN1_CONTEXT_PDU_GET_RESP 2
64#define SNMP_ASN1_CONTEXT_PDU_SET_REQ 3
65#define SNMP_ASN1_CONTEXT_PDU_TRAP 4
66#define SNMP_ASN1_CONTEXT_PDU_GET_BULK_REQ 5
67#define SNMP_ASN1_CONTEXT_PDU_INFORM_REQ 6
68#define SNMP_ASN1_CONTEXT_PDU_V2_TRAP 7
69#define SNMP_ASN1_CONTEXT_PDU_REPORT 8
71#define SNMP_ASN1_CONTEXT_VARBIND_NO_SUCH_OBJECT 0
72#define SNMP_ASN1_CONTEXT_VARBIND_END_OF_MIB_VIEW 2
80#define SNMP_ASN1_TLV_HDR_LENGTH(tlv) ((tlv).type_len + (tlv).length_len)
81#define SNMP_ASN1_TLV_LENGTH(tlv) ((tlv).type_len + (tlv).length_len + (tlv).value_len)
82#define SNMP_ASN1_SET_TLV_PARAMS(tlv, type_, length_len_, value_len_) do { (tlv).type = (type_); (tlv).type_len = 0; (tlv).length_len = (length_len_); (tlv).value_len = (value_len_); } while (0);
84err_t snmp_asn1_dec_tlv(
struct snmp_pbuf_stream *pbuf_stream,
struct snmp_asn1_tlv *tlv);
90err_t snmp_ans1_enc_tlv(
struct snmp_pbuf_stream *pbuf_stream,
struct snmp_asn1_tlv *tlv);
95void snmp_asn1_enc_oid_cnt(
const u32_t *oid,
u16_t oid_len,
u16_t *octets_needed);
96err_t snmp_asn1_enc_oid(
struct snmp_pbuf_stream *pbuf_stream,
const u32_t *oid,
u16_t oid_len);
99err_t snmp_asn1_enc_raw(
struct snmp_pbuf_stream *pbuf_stream,
const u8_t *raw,
u16_t raw_len);
102err_t snmp_asn1_dec_u64t(
struct snmp_pbuf_stream *pbuf_stream,
u16_t len, u64_t *
value);
103void snmp_asn1_enc_u64t_cnt(u64_t
value,
u16_t *octets_needed);
104err_t snmp_asn1_enc_u64t(
struct snmp_pbuf_stream *pbuf_stream,
u16_t octets_needed, u64_t
value);
GLuint GLuint GLsizei GLenum type
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLsizei GLsizei * length