inet6_rth_reverse() — Reverse the order of the addresses

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_reverse(const void *in, void *out); 

General description

inet6_rth_reverse() takes a routing header, pointed to by in, and writes a new routing header that sends datagrams along the reverse of that route. It reverses the order of the addresses and sets the segleft member in the new routing header to the number of segments required to send the datagram back to where it originated. Both arguments are allowed to point to the same buffer (the reversal can occur in place).

Returned value

If successful, inet6_rth_reverse() returns 0.

Upon failure, returns -1 and errno is set to one of the following:

EINVAL If one of the following is true:

  • in is NULL or out is NULL;
  • the input routing header indicates an unsupported header type;
  • the input routing header contains a non-valid number of segments;
  • in and out overlap, but in and out are not the same buffer.

Related information