|
coap_opt_t * | options_start (coap_pdu_t *pdu) |
| Calculates the beginning of the PDU's option section. More...
|
|
size_t | coap_opt_parse (const coap_opt_t *opt, size_t length, coap_option_t *result) |
| Parses the option pointed to by opt into result . More...
|
|
coap_opt_iterator_t * | coap_option_iterator_init (coap_pdu_t *pdu, coap_opt_iterator_t *oi, const coap_opt_filter_t filter) |
| Initializes the given option iterator oi to point to the beginning of the pdu's option list. More...
|
|
static int | opt_finished (coap_opt_iterator_t *oi) |
|
coap_opt_t * | coap_option_next (coap_opt_iterator_t *oi) |
| Updates the iterator oi to point to the next option. More...
|
|
coap_opt_t * | coap_check_option (coap_pdu_t *pdu, unsigned short type, coap_opt_iterator_t *oi) |
| Retrieves the first option of type type from pdu . More...
|
|
unsigned short | coap_opt_delta (const coap_opt_t *opt) |
| Decodes the delta value of the next option. More...
|
|
unsigned short | coap_opt_length (const coap_opt_t *opt) |
| Returns the length of the given option. More...
|
|
unsigned char * | coap_opt_value (coap_opt_t *opt) |
| Returns a pointer to the value of the given option. More...
|
|
size_t | coap_opt_size (const coap_opt_t *opt) |
| Returns the size of the given option, taking into account a possible option jump. More...
|
|
size_t | coap_opt_setheader (coap_opt_t *opt, size_t maxlen, unsigned short delta, size_t length) |
| Encodes the given delta and length values into opt . More...
|
|
size_t | coap_opt_encode (coap_opt_t *opt, size_t maxlen, unsigned short delta, const unsigned char *val, size_t length) |
| Encodes option with given delta into opt . More...
|
|
static int | is_long_option (unsigned short type) |
| Returns true iff type denotes an option type larger than 255. More...
|
|
static int | coap_option_filter_op (coap_opt_filter_t filter, unsigned short type, enum filter_op_t op) |
| Applies op on filter with respect to type . More...
|
|
int | coap_option_filter_set (coap_opt_filter_t filter, unsigned short type) |
| Sets the corresponding entry for type in filter . More...
|
|
int | coap_option_filter_unset (coap_opt_filter_t filter, unsigned short type) |
| Clears the corresponding entry for type in filter . More...
|
|
int | coap_option_filter_get (const coap_opt_filter_t filter, unsigned short type) |
| Checks if type is contained in filter . More...
|
|
Applies op
on filter
with respect to type
.
The following operations are defined:
FILTER_SET: Store type
into an empty slot in filter
. Returns 1
on success, or 0
if no spare slot was available.
FILTER_CLEAR: Remove type
from filter if it exists.
FILTER_GET: Search for type
in filter
. Returns 1
if found, or 0
if not found.
- Parameters
-
filter | The filter object. |
type | The option type to set, get or clear in filter . |
op | The operation to apply to filter and type . |
- Returns
- 1 on success, and 0 when FILTER_GET yields no hit or no free slot is available to store
type
with FILTER_SET.
Definition at line 449 of file option.c.