[][src]Function libcoap_sys::coap_opt_parse

pub unsafe extern "C" fn coap_opt_parse(
    opt: *const coap_opt_t,
    length: usize,
    result: *mut coap_option_t
) -> usize

Parses the option pointed to by @p opt into @p result. This function returns the number of bytes that have been parsed, or @c 0 on error. An error is signaled when illegal delta or length values are encountered or when option parsing would result in reading past the option (i.e. beyond opt + length).

@param opt The beginning of the option to parse. @param length The maximum length of @p opt. @param result A pointer to the coap_option_t structure that is filled with actual values iff coap_opt_parse() > 0. @return The number of bytes parsed or @c 0 on error.