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:
- 0 (unsuccessful)
- n (successful), where n is the length, in bytes, needed for the routing header
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:
|
Usage Notes
- 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.
- 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
- inet6_rth_add()--Add an IPv6 Address to the IPv6 Routing Header
- inet6_rth_getaddr()--Retrieve an Address from 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
API introduced: V6R1