inet6_rth_getaddr() — Return pointer to the IPv6 address specified

Standards

Standards / Extensions C or C++ Dependencies

RFC3542

both z/OS® V1R7

Format

#define _OPEN_SYS_SOCK_IPV6
#include <netinet/in.h>

struct in6_addr *inet6_rth_getaddr(const void *bp, int index);

General description

inet6_rth_getaddr() returns a pointer to the IPv6 address specified by index in the routing header described by bp.

Returned value

If successful, inet6_rth_getaddr() returns a pointer to the IPv6 address.

Upon failure, returns NULL and errno is set to one of the following:

EINVAL If one of the following is true:

  • bp is NULL;
  • the routing header indicates an unsupported header type;
  • the routing header contains a non-valid number of segments;
  • index is less than 0 or greater than or equal to the number of segments.

Usage notes

  1. To obtain the number of segments in the routing header, a call to inet6_rth_segments() should be made first.
  2. index must have a value between 0 and one less than the value returned by inet6_rth_segments().