Parses received option extension headers. Format #include <in6.h> int inet6_opt_next ( void *extbuf, size_t extlen, int offset, uint8_t *typep, size_t *lenp, void **databufp );
1 – Arguments
extbuf Points to a buffer that contains an extension header. extlen Specifies the length, in bytes, of the extension header. offset Specifies the location in the extension header of an option. Valid values are either 0 for the first option or the length returned from a previous call to either inet6_opt_next() or inet6_opt_find(). typep Points to the type of the option found. lenp Points to the length of the option found. databufp Points to the option data.
2 – Description
This function parses a received option extension header and returns the next option. In addition, it returns an offset to the next option that you specify in the offset parameter to subsequent calls to inet6_opt_next(). This function does not return any PAD1 or PADN options.
3 – Return Values
x Upon successful completion, the inet6_opt_ next() function returns the offset for the next option in the data buffer. -1 Failure