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