inet6_opt_init.3n (2010 09)

i
inet6_opt_init(3N) inet6_opt_init(3N)
int on = 1;
setsockopt(fd, IPPROTO_IPV6, IPV6_RECVDSTOPTS, &on, sizeof(on));
To receive Destination options appearing before a Routing header, the application must enable the
IPV6_RECVRTHDRDSTOPTS
socket option:
int on = 1;
setsockopt(fd, IPPROTO_IPV6, IPV6_RECVRTHDRDSTOPTS, &on, sizeof(on));
To send a Destination options header, the application specifies it either as ancillary data in a call to
sendmsg() or using setsockopt().
The application can remove any sticky Destination extension header by calling
setsockopt() for
IPV6_RTHDRDSTOPTS
/IPV6_DSTOPTS with a zero option length.
RETURN VALUE
inet6_opt_init()
, inet6_opt_append()
, inet6_opt_finish()
, inet6_opt_next()
, and
inet6_opt_find()
return -1 on an error.
EXAMPLES
RFC 3542 gives a comprehensive example in Appendix C.
SEE ALSO
ip6(7P), xopen_networking(7).
RFC 3542 Advanced Sockets API for IPv6
HP-UX 11i Version 3: September 2010 3 Hewlett-Packard Company 3