inet6_rth_segments() — Return number of segments contained in header
Standards
Standards / Extensions | C or C++ | Dependencies |
---|---|---|
RFC3542 |
both | z/OS® V1R7 |
Format
#define _OPEN_SYS_SOCK_IPV6
#include <netinet/in.h>
int inet6_rth_segments(const void *bp);
General description
inet6_rth_segments() returns the number of segments (addresses) contained in the routing header described by bp.
Returned value
If successful, inet6_rth_segments() returns the number of segments or 0, if there are none in the header.
Upon failure, returns -1 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.
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_init() — Initialize an IPv6 routing header buffer
- inet6_rth_reverse() — Reverse the order of the addresses
- inet6_rth_space() — Return number of bytes for a routing header