inet6_rth_space()--Return the Number of Bytes Required for the IPv6 Routing Header


  Syntax
  #include <netinet/in.h>

  socklen_t inet6_rth_space(int header_type,
                            int segments)

  Service Program Name: QSOSRV1IP6

  Default Public Authority: *USE

  Threadsafe: Yes

The inet6_rth_space() returns the number of bytes required to hold a routing extension header of type header_type that contains the number of segments (addresses) specified by the segments parameter.


Parameters

header_type
(Input) Type of routing extension header that is to be built.
segments
(Input) Total number of segments (addresses) to be included in the routing extension header.

Authorities

No authorization is required.


Return Value

inet6_rth_space() returns an integer. Possible values are:


Error Conditions

When inet6_rth_space() fails, errno can be set to one of the following:

[EINVAL] Parameter not valid.

This error code indicates one of the following:

  • The header_type field is not supported.
  • The segments field contains a value that is not valid for the specified header_type.


Usage Notes

  1. This function does not allocate buffer space required. This allows an application to allocate a larger buffer, if other ancillary data objects are desired, since all the ancillary data objects must be specified to sendmsg() as a single msg_control buffer.
  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.

Related Information




API introduced: V6R1

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