[−][src]Function libcoap_sys::coap_option_iterator_init
pub unsafe extern "C" fn coap_option_iterator_init(
pdu: *const coap_pdu_t,
oi: *mut coap_opt_iterator_t,
filter: *mut u16
) -> *mut coap_opt_iterator_t
Initializes the given option iterator @p oi to point to the beginning of the @p pdu's option list. This function returns @p oi on success, @c NULL otherwise (i.e. when no options exist). Note that a length check on the option list must be performed before coap_option_iterator_init() is called.
@param pdu The PDU the options of which should be walked through. @param oi An iterator object that will be initilized. @param filter An optional option type filter. With @p type != @c COAP_OPT_ALL, coap_option_next() will return only options matching this bitmask. Fence-post options @c 14, @c 28, @c 42, ... are always skipped.
@return The iterator object @p oi on success, @c NULL otherwise.