inet6_rth_init() — Initialize an IPv6 routing header buffer
Standards
Standards / Extensions | C or C++ | Dependencies |
---|---|---|
RFC3542 |
both | z/OS® V1R7 |
Format
#define _OPEN_SYS_SOCK_IPV6
#include <netinet/in.h>
void *inet6_rth_init(void *bp, socklen_t bp_len,
int type, int segments);
General description
inet6_rth_init() initializes the buffer pointed to by bp to contain a routing header of the specified type and sets ip6r_len based on the segments parameter.
Returned value
When successful, inet6_rth_init() returns the pointer to the buffer, bp. This is then used as the first argument to the inet6_rth_add() function.
Upon failure, returns NULL and errno is set to one of the following:
EINVAL If one of the following is true::
- bp is NULL;
- type indicates an unsupported header type;
- segments is not valid for the type;
- the buffer is not large enough, bp_len is too small.
Usage notes
- The caller must allocate the buffer; its size can be determined by calling inet6_rth_space().
- Any cmsghdr fields must be initialized when the application uses ancillary data.
Related information
- netinet/in.h
- inet6_rth_add() — Add an IPv6 address to end of the routing header
- inet6_rth_getaddr() — Return pointer to the IPv6 address specified
- inet6_rth_reverse() — Reverse the order of the addresses
- inet6_rth_segments() — Return number of segments contained in header
- inet6_rth_space() — Return number of bytes for a routing header