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