inet6_rth_add()--Add an IPv6 Address to the IPv6 Routing Header


  Syntax
  #include <netinet/in.h>

  int inet6_rth_add(void *routing_buffer,
                    const struct in6_addr *routing_address)

  Service Program Name: QSOSRV1IP6

  Default Public Authority: *USE

  Threadsafe: Yes

The inet6_rth_add() function adds the IPv6 address that is pointed to by the routing_address parameter to the end of the routing extension header that is being constructed.


Parameters

routing_buffer
(I/O) Pointer to the buffer that contains the routing extension header.
routing_address
(Input) Pointer to the IPv6 address to add to the end of routing extension header.

Authorities

No authorization is required.


Return Value

inet6_rth_add() returns an integer. Possible values are:


Error Conditions

When inet6_rth_add() 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 or routing_address parameter.

[EINVAL] Parameter not valid.
  • The number of segments would have exceeded the maximum allowed for this type of routing extension header.
  • The routing_address is an IPv4 V6-mapped or IPv6 multicast address.


Usage Notes

  1. The address cannot be an IPv4-mapped IPv6 address or an IPv6 multicast address.
  2. IPV6_RTHDR_TYPE_0 is the only supported routing extension header type.
    The number of segments for IPV6_RTHDR_TYPE_0 must be in the range 0 to 127, inclusive.
  3. If successful, the segleft member of the routing extension header struct ip6_rthdr is updated to account for the new address.

Related Information




API introduced: V6R1

[ Back to top | UNIX-Type APIs | APIs by category ]