libcoap 4.3.5-develop-19cef11
coap_opt_iterator_t Struct Reference

Iterator to run through PDU options. More...

#include <coap_option.h>

+ Collaboration diagram for coap_opt_iterator_t:

Data Fields

size_t length
 remaining length of PDU More...
 
coap_option_num_t number
 decoded option number More...
 
unsigned int bad:1
 iterator object is ok if not set More...
 
unsigned int filtered:1
 denotes whether or not filter is used More...
 
coap_opt_tnext_option
 pointer to the unparsed next option More...
 
coap_opt_filter_t filter
 option filter More...
 

Detailed Description

Iterator to run through PDU options.

This object must be initialized with coap_option_iterator_init(). Call coap_option_next() to walk through the list of options until coap_option_next() returns NULL.

coap_opt_t *option;
while ((option = coap_option_next(&opt_iter))) {
... do something with option ...
}
uint8_t coap_opt_t
Use byte-oriented access methods here because sliding a complex struct coap_opt_t over the data buffe...
Definition: coap_option.h:26
coap_opt_t * coap_option_next(coap_opt_iterator_t *oi)
Updates the iterator oi to point to the next option.
Definition: coap_option.c:153
coap_opt_iterator_t * coap_option_iterator_init(const 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.
Definition: coap_option.c:117
#define COAP_OPT_ALL
Pre-defined filter that includes all options.
Definition: coap_option.h:108
Iterator to run through PDU options.
Definition: coap_option.h:168

Definition at line 168 of file coap_option.h.

Field Documentation

◆ bad

unsigned int coap_opt_iterator_t::bad

iterator object is ok if not set

Definition at line 171 of file coap_option.h.

◆ filter

coap_opt_filter_t coap_opt_iterator_t::filter

option filter

Definition at line 174 of file coap_option.h.

◆ filtered

unsigned int coap_opt_iterator_t::filtered

denotes whether or not filter is used

Definition at line 172 of file coap_option.h.

◆ length

size_t coap_opt_iterator_t::length

remaining length of PDU

Definition at line 169 of file coap_option.h.

◆ next_option

coap_opt_t* coap_opt_iterator_t::next_option

pointer to the unparsed next option

Definition at line 173 of file coap_option.h.

◆ number

coap_option_num_t coap_opt_iterator_t::number

decoded option number

Definition at line 170 of file coap_option.h.


The documentation for this struct was generated from the following file: