Search for IPv6 hop-by-hop and destination options
#include <netinet/in.h> int inet6_option_find(const struct cmsghdr *cmsg, u_int8_t **tptrp, int type);
The inet6_option_find() function is similar to inet6_option_next(). It, however, lets the caller specify the option type to be searched for, instead of always returning the next option in the ancillary data object. The cmsg is a pointer to the cmsghdr structure of which cmsg_level equals IPPROTO_IPV6 and cmsg_type equals either IPV6_HOPOPTS or IPV6_DSTOPTS.
The tptrp is a pointer to a pointer to an 8-bit byte that the function uses to remember its place in the ancillary data object each time the function is called.
The first time you call this function for a given ancillary data object, you must set *tptrp to NULL. This function starts searching for an option of the specified type beginning after the value of *tptrp pointer.
Based on:
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |