inet6_opt_init() — Return the number of bytes for empty extension 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_opt_init(void *extbuf, socklen_t extlen);
General description
inet6_opt_init() returns the number of bytes needed for the empty extension header. If extbuf is not NULL, the extension header is initialized to have the correct length field and the extlen value must be a positive, non-zero, multiple of 8, or the function will fail.
Returned value
If successful, inet6_opt_init() returns the number of bytes needed for the empty extension header.
Upon failure, returns -1 and errno is set to one of the following:
EINVAL If one of the following is true:
- extbuf is NULL and extlen is non-zero;
- extbuf is non-NULL and extlen is not a positive multiple of 8.
Related information
- netinet/in.h
- inet6_opt_append() — Add an option with length "len" and alignment "align"
- inet6_opt_find() — Search for an option specified by the caller
- inet6_opt_finish() — Return the updated total length of extension header
- inet6_opt_get_val() — Extract data items in the data portion of the option
- inet6_opt_next() — Parse received option headers returning the next option
- inet6_opt_set_val() — Insert data items into the data portion of the option