inet6_rth_space.3n (2010 09)

i
inet6_rth_space(3N) inet6_rth_space(3N)
the function is -1.
Note: If the Routing header is type 2, this function can only be called once.
inet6_rth_reverse()
This function takes a Routing header extension header pointed to by the first argument in and
writes a new Routing header. The new Routing header sends datagrams along the reverse of that
route. The function reverses the order of the addresses and sets the
segleft member in the new
routing header to the number of segments. Both arguments are allowed to point to the same buffer
(that is, the reversal can occur in place).
The return value of the function is 0 on success, or -1 upon an error.
Note: If Routing header is type 2, this function returns -1 (RFC 4584).
inet6_rth_segments()
This function returns the number of segments (addresses) contained in the Routing header
described by bp which can be 0 or greater.
The return value of the function is -1 upon an error.
inet6_rth_getaddr()
This function returns a pointer to the IPv6 address specified by index (which must be a value
between 0 and one less than the value returned by inet6_rth_segments()
) in the Routing
header described by bp.
An application should first call
inet6_rth_segments()
to obtain the number of segments in the
Routing header.
Upon an error, the return value of the function is NULL.
Note: If Routing header is type 2, this function returns a pointer to the IPv6 home address specified
by the ip6r2_homeaddr field in
ip6_rthdr2, which is pointed by bp. The index must be zero.
Notes
To use these functions, the application must be compiled with:
-D_HPUX_SOURCE -lipv6
To receive a Routing header, the application must enable the IPV6_RECVRTHDR
socket option:
int on = 1;
setsockopt(fd, IPPROTO_IPV6, IPV6_RECVRTHDR, &on, sizeof(on));
To send a Routing header, the application specifies it either as ancillary data in a call to
sendmsg() or
using
setsockopt() (see send (2) and getsockopt (2), respectively).
EXAMPLES
RFC 3542 gives a comprehensive example in Appendix B.
SEE ALSO
send(2), getsockopt(2), IPv6(7P), xopen_networking(7).
RFC 3542 Advanced Sockets API for IPv6
RFC 4584 Extension to Sockets API for Mobile IPv6
RFC 5095 Deprecation of Type 0 Routing Headers in IPv6
2 Hewlett-Packard Company 2 HP-UX 11i Version 3: September 2010