HP-UX Reference (11i v1 05/09) - 3 Library Functions A-M (vol 6)
i
inet6_rth_space(3N) inet6_rth_space(3N)
Upon success, the return value is the pointer to the buffer (bp), and the pointer is then used as the first
argument to the
inet6_rth_add()
function. Upon an error, the return value is NULL.
inet6_rth_add()
This function adds the IPv6 address pointed to by addr to the end of the Routing header being con-
structed.
If successful, the segleft member of the Routing header is updated to account for the new address in the
Routing header and the return value of the function is 0. Upon an error the return value of the function is
-1.
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.
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 Rout-
ing header.
Upon an error, the return value of the function is NULL.
NOTE
To use these functions, the application must be compiled with
-D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED -lxnet -lipv6
The APIs are implemented based on internet-draft Advanced Sockets API for IPv6 <draft-ietf-ipngwg-
2292bis-02.txt>. The APIs may be updated, replaced, or obsoleted based on future changes to the docu-
ment.
EXAMPLES
Advanced Sockets API for IPv6 <draft-ietf-ipngwg-2292bis-02.txt> gives a comprehensive example in Appen-
dix B.
AUTHOR
The APIs were developed by HP.
SEE ALSO
send(2), getsockopt(2), ip6(7P).
Advanced Sockets API for IPv6 <draft-ietf-ipngwg-2292bis-02.txt>
Section 3−−486 Hewlett-Packard Company − 2 − HP-UX 11i Version 1: September 2005