inet6_rth_getaddr()--Retrieve an Address from the IPv6 Routing Header
Syntax
#include <netinet/in.h> struct in6_addr *inet6_rth_getaddr(const void *routing_buffer, int address_index)
Service Program Name: QSOSRV1IP6
Default Public Authority: *USE
Threadsafe: Yes
The inet6_rth_getaddr() function returns a pointer to the IPv6 address at the specified index in the routing header.
Parameters
- routing_buffer
- (Input) Pointer to a buffer that contains the routing extension header.
- address_index
- (Input) Index value of the IPv6 address to be returned from the routing header.
Authorities
No authorization is required.
Return Value
inet6_rth_getaddr() returns a pointer. Possible values are:
- NULL (unsuccessful)
- n (successful), where n is a pointer to the IPv6 address
Error Conditions
When inet6_rth_getaddr() fails, errno can be set to one of the following:
[EFAULT] | Bad address.
The system detected an address that was not valid while attempting to access the buffer pointed to by the routing_buffer parameter. |
[EINVAL] | Parameter not valid.
The address_index field contains a value that is not positive or greater than the number of addresses contained in the routing extension header. |
Usage Notes
- Use the inet6_rth_segments() function to determine the number of segments in the routing header before calling this function.
- The address_index value must be between zero and one less than the value returned from inet6_rth_segments().
Related Information
- inet6_rth_add()--Add an IPv6 Address to the IPv6 Routing Header
- inet6_rth_init()--Initialize Buffer Data for the IPv6 Routing Header
- inet6_rth_reverse()--Reverse the Order of Addresses in the IPv6 Routing Header
- inet6_rth_segments()--Return the Number of Segments in the IPv6 Routing Header
- inet6_rth_space()--Return the Number of Bytes Required for the IPv6 Routing Header
API introduced: V6R1