Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of OmniWheels by
lwip_snmp_asn1.c File Reference
Abstract Syntax Notation One (ISO 8824, 8825) encoding. More...
Go to the source code of this file.
| Functions | |
| err_t | snmp_ans1_enc_tlv (struct snmp_pbuf_stream *pbuf_stream, struct snmp_asn1_tlv *tlv) | 
| Encodes a TLV into a pbuf stream. | |
| err_t | snmp_asn1_enc_raw (struct snmp_pbuf_stream *pbuf_stream, const u8_t *raw, u16_t raw_len) | 
| Encodes raw data (octet string, opaque) into a pbuf chained ASN1 msg. | |
| err_t | snmp_asn1_enc_u32t (struct snmp_pbuf_stream *pbuf_stream, u16_t octets_needed, u32_t value) | 
| Encodes u32_t (counter, gauge, timeticks) into a pbuf chained ASN1 msg. | |
| err_t | snmp_asn1_enc_u64t (struct snmp_pbuf_stream *pbuf_stream, u16_t octets_needed, const u32_t *value) | 
| Encodes u64_t (counter64) into a pbuf chained ASN1 msg. | |
| err_t | snmp_asn1_enc_s32t (struct snmp_pbuf_stream *pbuf_stream, u16_t octets_needed, s32_t value) | 
| Encodes s32_t integer into a pbuf chained ASN1 msg. | |
| err_t | snmp_asn1_enc_oid (struct snmp_pbuf_stream *pbuf_stream, const u32_t *oid, u16_t oid_len) | 
| Encodes object identifier into a pbuf chained ASN1 msg. | |
| void | snmp_asn1_enc_length_cnt (u16_t length, u8_t *octets_needed) | 
| Returns octet count for length. | |
| void | snmp_asn1_enc_u32t_cnt (u32_t value, u16_t *octets_needed) | 
| Returns octet count for an u32_t. | |
| void | snmp_asn1_enc_u64t_cnt (const u32_t *value, u16_t *octets_needed) | 
| Returns octet count for an u64_t. | |
| void | snmp_asn1_enc_s32t_cnt (s32_t value, u16_t *octets_needed) | 
| Returns octet count for an s32_t. | |
| void | snmp_asn1_enc_oid_cnt (const u32_t *oid, u16_t oid_len, u16_t *octets_needed) | 
| Returns octet count for an object identifier. | |
| err_t | snmp_asn1_dec_tlv (struct snmp_pbuf_stream *pbuf_stream, struct snmp_asn1_tlv *tlv) | 
| Decodes a TLV from a pbuf stream. | |
| err_t | snmp_asn1_dec_u32t (struct snmp_pbuf_stream *pbuf_stream, u16_t len, u32_t *value) | 
| Decodes positive integer (counter, gauge, timeticks) into u32_t. | |
| err_t | snmp_asn1_dec_u64t (struct snmp_pbuf_stream *pbuf_stream, u16_t len, u32_t *value) | 
| Decodes large positive integer (counter64) into 2x u32_t. | |
| err_t | snmp_asn1_dec_s32t (struct snmp_pbuf_stream *pbuf_stream, u16_t len, s32_t *value) | 
| Decodes integer into s32_t. | |
| err_t | snmp_asn1_dec_oid (struct snmp_pbuf_stream *pbuf_stream, u16_t len, u32_t *oid, u8_t *oid_len, u8_t oid_max_len) | 
| Decodes object identifier from incoming message into array of u32_t. | |
| err_t | snmp_asn1_dec_raw (struct snmp_pbuf_stream *pbuf_stream, u16_t len, u8_t *buf, u16_t *buf_len, u16_t buf_max_len) | 
| Decodes (copies) raw data (ip-addresses, octet strings, opaque encoding) from incoming message into array. | |
Detailed Description
Abstract Syntax Notation One (ISO 8824, 8825) encoding.
Definition in file lwip_snmp_asn1.c.
Function Documentation
| err_t snmp_ans1_enc_tlv | ( | struct snmp_pbuf_stream * | pbuf_stream, | 
| struct snmp_asn1_tlv * | tlv | ||
| ) | 
Encodes a TLV into a pbuf stream.
- Parameters:
- 
  pbuf_stream points to a pbuf stream tlv TLV to encode 
- Returns:
- ERR_OK if successful, ERR_ARG if we can't (or won't) encode
Definition at line 57 of file lwip_snmp_asn1.c.
| err_t snmp_asn1_dec_oid | ( | struct snmp_pbuf_stream * | pbuf_stream, | 
| u16_t | len, | ||
| u32_t * | oid, | ||
| u8_t * | oid_len, | ||
| u8_t | oid_max_len | ||
| ) | 
Decodes object identifier from incoming message into array of u32_t.
- Parameters:
- 
  pbuf_stream points to a pbuf stream len length of the coded object identifier oid return decoded object identifier oid_len return decoded object identifier length oid_max_len size of oid buffer 
- Returns:
- ERR_OK if successful, ERR_ARG if we can't (or won't) decode
Definition at line 641 of file lwip_snmp_asn1.c.
| err_t snmp_asn1_dec_raw | ( | struct snmp_pbuf_stream * | pbuf_stream, | 
| u16_t | len, | ||
| u8_t * | buf, | ||
| u16_t * | buf_len, | ||
| u16_t | buf_max_len | ||
| ) | 
Decodes (copies) raw data (ip-addresses, octet strings, opaque encoding) from incoming message into array.
- Parameters:
- 
  pbuf_stream points to a pbuf stream len length of the coded raw data (zero is valid, e.g. empty string!) buf return raw bytes buf_len returns length of the raw return value buf_max_len buffer size 
- Returns:
- ERR_OK if successful, ERR_ARG if we can't (or won't) decode
Definition at line 732 of file lwip_snmp_asn1.c.
| err_t snmp_asn1_dec_s32t | ( | struct snmp_pbuf_stream * | pbuf_stream, | 
| u16_t | len, | ||
| s32_t * | value | ||
| ) | 
Decodes integer into s32_t.
- Parameters:
- 
  pbuf_stream points to a pbuf stream len length of the coded integer field value return host order integer 
- Returns:
- ERR_OK if successful, ERR_ARG if we can't (or won't) decode
- Note:
- ASN coded integers are _always_ signed!
Definition at line 577 of file lwip_snmp_asn1.c.
| err_t snmp_asn1_dec_tlv | ( | struct snmp_pbuf_stream * | pbuf_stream, | 
| struct snmp_asn1_tlv * | tlv | ||
| ) | 
Decodes a TLV from a pbuf stream.
- Parameters:
- 
  pbuf_stream points to a pbuf stream tlv returns decoded TLV 
- Returns:
- ERR_OK if successful, ERR_VAL if we can't decode
Definition at line 423 of file lwip_snmp_asn1.c.
| err_t snmp_asn1_dec_u32t | ( | struct snmp_pbuf_stream * | pbuf_stream, | 
| u16_t | len, | ||
| u32_t * | value | ||
| ) | 
Decodes positive integer (counter, gauge, timeticks) into u32_t.
- Parameters:
- 
  pbuf_stream points to a pbuf stream len length of the coded integer field value return host order integer 
- Returns:
- ERR_OK if successful, ERR_ARG if we can't (or won't) decode
- Note:
- ASN coded integers are _always_ signed. E.g. +0xFFFF is coded as 0x00,0xFF,0xFF. Note the leading sign octet. A positive value of 0xFFFFFFFF is preceded with 0x00 and the length is 5 octets!!
Definition at line 485 of file lwip_snmp_asn1.c.
| err_t snmp_asn1_dec_u64t | ( | struct snmp_pbuf_stream * | pbuf_stream, | 
| u16_t | len, | ||
| u32_t * | value | ||
| ) | 
Decodes large positive integer (counter64) into 2x u32_t.
- Parameters:
- 
  pbuf_stream points to a pbuf stream len length of the coded integer field value return host order integer 
- Returns:
- ERR_OK if successful, ERR_ARG if we can't (or won't) decode
- Note:
- ASN coded integers are _always_ signed. E.g. +0xFFFF is coded as 0x00,0xFF,0xFF. Note the leading sign octet. A positive value of 0xFFFFFFFF is preceded with 0x00 and the length is 5 octets!!
Definition at line 525 of file lwip_snmp_asn1.c.
| void snmp_asn1_enc_length_cnt | ( | u16_t | length, | 
| u8_t * | octets_needed | ||
| ) | 
Returns octet count for length.
- Parameters:
- 
  length parameter length octets_needed points to the return value 
Definition at line 295 of file lwip_snmp_asn1.c.
| err_t snmp_asn1_enc_oid | ( | struct snmp_pbuf_stream * | pbuf_stream, | 
| const u32_t * | oid, | ||
| u16_t | oid_len | ||
| ) | 
Encodes object identifier into a pbuf chained ASN1 msg.
- Parameters:
- 
  pbuf_stream points to a pbuf stream oid points to object identifier array oid_len object identifier array length 
- Returns:
- ERR_OK if successful, ERR_ARG if we can't (or won't) encode
Definition at line 248 of file lwip_snmp_asn1.c.
| void snmp_asn1_enc_oid_cnt | ( | const u32_t * | oid, | 
| u16_t | oid_len, | ||
| u16_t * | octets_needed | ||
| ) | 
Returns octet count for an object identifier.
- Parameters:
- 
  oid points to object identifier array oid_len object identifier array length octets_needed points to the return value 
Definition at line 390 of file lwip_snmp_asn1.c.
| err_t snmp_asn1_enc_raw | ( | struct snmp_pbuf_stream * | pbuf_stream, | 
| const u8_t * | raw, | ||
| u16_t | raw_len | ||
| ) | 
Encodes raw data (octet string, opaque) into a pbuf chained ASN1 msg.
- Parameters:
- 
  pbuf_stream points to a pbuf stream raw_len raw data length raw points raw data 
- Returns:
- ERR_OK if successful, ERR_ARG if we can't (or won't) encode
Definition at line 133 of file lwip_snmp_asn1.c.
| err_t snmp_asn1_enc_s32t | ( | struct snmp_pbuf_stream * | pbuf_stream, | 
| u16_t | octets_needed, | ||
| s32_t | value | ||
| ) | 
Encodes s32_t integer into a pbuf chained ASN1 msg.
- Parameters:
- 
  pbuf_stream points to a pbuf stream octets_needed encoding length (from snmp_asn1_enc_s32t_cnt()) value is the host order s32_t value to be encoded 
- Returns:
- ERR_OK if successful, ERR_ARG if we can't (or won't) encode
- See also:
- snmp_asn1_enc_s32t_cnt()
Definition at line 225 of file lwip_snmp_asn1.c.
| void snmp_asn1_enc_s32t_cnt | ( | s32_t | value, | 
| u16_t * | octets_needed | ||
| ) | 
Returns octet count for an s32_t.
- Parameters:
- 
  value value to be encoded octets_needed points to the return value 
- Note:
- ASN coded integers are _always_ signed.
Definition at line 366 of file lwip_snmp_asn1.c.
| err_t snmp_asn1_enc_u32t | ( | struct snmp_pbuf_stream * | pbuf_stream, | 
| u16_t | octets_needed, | ||
| u32_t | value | ||
| ) | 
Encodes u32_t (counter, gauge, timeticks) into a pbuf chained ASN1 msg.
- Parameters:
- 
  pbuf_stream points to a pbuf stream octets_needed encoding length (from snmp_asn1_enc_u32t_cnt()) value is the host order u32_t value to be encoded 
- Returns:
- ERR_OK if successful, ERR_ARG if we can't (or won't) encode
- See also:
- snmp_asn1_enc_u32t_cnt()
Definition at line 151 of file lwip_snmp_asn1.c.
| void snmp_asn1_enc_u32t_cnt | ( | u32_t | value, | 
| u16_t * | octets_needed | ||
| ) | 
Returns octet count for an u32_t.
- Parameters:
- 
  value value to be encoded octets_needed points to the return value 
- Note:
- ASN coded integers are _always_ signed. E.g. +0xFFFF is coded as 0x00,0xFF,0xFF. Note the leading sign octet. A positive value of 0xFFFFFFFF is preceded with 0x00 and the length is 5 octets!!
Definition at line 317 of file lwip_snmp_asn1.c.
| err_t snmp_asn1_enc_u64t | ( | struct snmp_pbuf_stream * | pbuf_stream, | 
| u16_t | octets_needed, | ||
| const u32_t * | value | ||
| ) | 
Encodes u64_t (counter64) into a pbuf chained ASN1 msg.
- Parameters:
- 
  pbuf_stream points to a pbuf stream octets_needed encoding length (from snmp_asn1_enc_u32t_cnt()) value is the host order u32_t value to be encoded 
- Returns:
- ERR_OK if successful, ERR_ARG if we can't (or won't) encode
- See also:
- snmp_asn1_enc_u64t_cnt()
Definition at line 184 of file lwip_snmp_asn1.c.
| void snmp_asn1_enc_u64t_cnt | ( | const u32_t * | value, | 
| u16_t * | octets_needed | ||
| ) | 
Returns octet count for an u64_t.
- Parameters:
- 
  value value to be encoded octets_needed points to the return value 
- Note:
- ASN coded integers are _always_ signed. E.g. +0xFFFF is coded as 0x00,0xFF,0xFF. Note the leading sign octet. A positive value of 0xFFFFFFFF is preceded with 0x00 and the length is 5 octets!!
Definition at line 343 of file lwip_snmp_asn1.c.
Generated on Fri Jul 22 2022 04:54:07 by
 1.7.2
 1.7.2 
    