inet6_rthdr_init()
Initialize an IPv6 routing header
Synopsis:
#include <netinet/in.h>
struct cmsghdr * inet6_rthdr_init(void *bp,
int type);
Arguments:
- bp
- A pointer to the buffer where the function can build a cmsghdr structure followed by a routing header of the specified type.
- type
- The type of IPv6 Routing header (e.g., Type 0 as defined in <netinet/in.h>).
Library:
libsocket
Use the -l socket option to qcc to link against this library.
Description:
This function initializes the buffer pointed to by bp to contain a cmsghdr structure followed by a Routing header of the specified type. The cmsg_len member of the cmsghdr structure is initialized to the size of the structure plus the amount of space required by the Routing header.
The cmsg_level and cmsg_type members are also initialized as required.
You must allocate the buffer before calling this function. To determine the size of the buffer, call inet6_rthdr_space().
Based on:
- W. Stevens and M. Thomas, Advanced Sockets API for IPv6, RFC 2292, February 1998. Contains good examples.
- S. Deering and R. Hinden, Internet Protocol, Version 6 (IPv6) Specification, RFC 2460, December 1998.
Returns:
A pointer to the cmsghdr structure, which you'll pass to other functions (and used as the first argument to list functions), or NULL if an error occurred.
Classification:
| Safety: | |
|---|---|
| Cancellation point | No |
| Interrupt handler | No |
| Signal handler | Yes |
| Thread | Yes |
