| Updated: October 28, 2024 |
Determine the space required by an IPv6 routing header
#include <netinet/in.h>
size_t inet6_rthdr_space(int type,
int segments);
This function returns the number of bytes required to hold a routing header of the specified type containing a specified number of segments (addresses). For an IPv6 Type 0 routing header, the number of segments must be between 1 and 23, inclusive. The return value includes the size of the cmsghdr structure that precedes the routing header, and any required padding.
Based on:
The number of bytes required, or 0 if the type of the routing header isn't supported by this implementation or the number of segments is invalid for this type of routing header.
| Safety: | |
|---|---|
| Cancellation point | No |
| Interrupt handler | No |
| Signal handler | Yes |
| Thread | Yes |