Deprecated fork of old network stack source from github. Please use official library instead: https://mbed.org/users/mbed_official/code/EthernetInterface/
asn1_dec.c File Reference
Abstract Syntax Notation One (ISO 8824, 8825) decoding. More...
Go to the source code of this file.
Functions | |
err_t | snmp_asn1_dec_type (struct pbuf *p, u16_t ofs, u8_t *type) |
Retrieves type field from incoming pbuf chain. | |
err_t | snmp_asn1_dec_length (struct pbuf *p, u16_t ofs, u8_t *octets_used, u16_t *length) |
Decodes length field from incoming pbuf chain into host length. | |
err_t | snmp_asn1_dec_u32t (struct pbuf *p, u16_t ofs, u16_t len, u32_t *value) |
Decodes positive integer (counter, gauge, timeticks) into u32_t. | |
err_t | snmp_asn1_dec_s32t (struct pbuf *p, u16_t ofs, u16_t len, s32_t *value) |
Decodes integer into s32_t. | |
err_t | snmp_asn1_dec_oid (struct pbuf *p, u16_t ofs, u16_t len, struct snmp_obj_id *oid) |
Decodes object identifier from incoming message into array of s32_t. | |
err_t | snmp_asn1_dec_raw (struct pbuf *p, u16_t ofs, u16_t len, u16_t raw_len, u8_t *raw) |
Decodes (copies) raw data (ip-addresses, octet strings, opaque encoding) from incoming message into array. |
Detailed Description
Abstract Syntax Notation One (ISO 8824, 8825) decoding.
Definition in file asn1_dec.c.
Function Documentation
err_t snmp_asn1_dec_length | ( | struct pbuf * | p, |
u16_t | ofs, | ||
u8_t * | octets_used, | ||
u16_t * | length | ||
) |
Decodes length field from incoming pbuf chain into host length.
- Parameters:
-
p points to a pbuf holding an ASN1 coded length ofs points to the offset within the pbuf chain of the ASN1 coded length octets_used returns number of octets used by the length code length return host order length, upto 64k
- Returns:
- ERR_OK if successfull, ERR_ARG if we can't (or won't) decode
Definition at line 85 of file asn1_dec.c.
err_t snmp_asn1_dec_oid | ( | struct pbuf * | p, |
u16_t | ofs, | ||
u16_t | len, | ||
struct snmp_obj_id * | oid | ||
) |
Decodes object identifier from incoming message into array of s32_t.
- Parameters:
-
p points to a pbuf holding an ASN1 coded object identifier ofs points to the offset within the pbuf chain of the ASN1 coded object identifier len length of the coded object identifier oid return object identifier struct
- Returns:
- ERR_OK if successfull, ERR_ARG if we can't (or won't) decode
Definition at line 429 of file asn1_dec.c.
err_t snmp_asn1_dec_raw | ( | struct pbuf * | p, |
u16_t | ofs, | ||
u16_t | len, | ||
u16_t | raw_len, | ||
u8_t * | raw | ||
) |
Decodes (copies) raw data (ip-addresses, octet strings, opaque encoding) from incoming message into array.
- Parameters:
-
p points to a pbuf holding an ASN1 coded raw data ofs points to the offset within the pbuf chain of the ASN1 coded raw data len length of the coded raw data (zero is valid, e.g. empty string!) raw_len length of the raw return value raw return raw bytes
- Returns:
- ERR_OK if successfull, ERR_ARG if we can't (or won't) decode
Definition at line 596 of file asn1_dec.c.
err_t snmp_asn1_dec_s32t | ( | struct pbuf * | p, |
u16_t | ofs, | ||
u16_t | len, | ||
s32_t * | value | ||
) |
Decodes integer into s32_t.
- Parameters:
-
p points to a pbuf holding an ASN1 coded integer ofs points to the offset within the pbuf chain of the ASN1 coded integer len length of the coded integer field value return host order integer
- Returns:
- ERR_OK if successfull, ERR_ARG if we can't (or won't) decode
- Note:
- ASN coded integers are _always_ signed!
Definition at line 333 of file asn1_dec.c.
err_t snmp_asn1_dec_type | ( | struct pbuf * | p, |
u16_t | ofs, | ||
u8_t * | type | ||
) |
Retrieves type field from incoming pbuf chain.
- Parameters:
-
p points to a pbuf holding an ASN1 coded type field ofs points to the offset within the pbuf chain of the ASN1 coded type field type return ASN1 type
- Returns:
- ERR_OK if successfull, ERR_ARG if we can't (or won't) decode
Definition at line 52 of file asn1_dec.c.
err_t snmp_asn1_dec_u32t | ( | struct pbuf * | p, |
u16_t | ofs, | ||
u16_t | len, | ||
u32_t * | value | ||
) |
Decodes positive integer (counter, gauge, timeticks) into u32_t.
- Parameters:
-
p points to a pbuf holding an ASN1 coded integer ofs points to the offset within the pbuf chain of the ASN1 coded integer len length of the coded integer field value return host order integer
- Returns:
- ERR_OK if successfull, 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 240 of file asn1_dec.c.
Generated on Tue Jul 12 2022 23:10:20 by 1.7.2