To get information about packets that have been received, use the
following options:
- IPV6_RECVPKTINFO (used with UDP and RAW applications)
- The IPV6_RECVPKTINFO socket option allows an application to receive
the following pieces of information:
- The destination IP address from the IPv6 header
- The interface index for the interface over which the packet was
received
When the IPV6_RECVPKTINFO socket option is enabled, the IP
address and interface index are returned as ancillary data on the
recvmsg() API. The ancillary data level is IPPROTO_IPV6. The option
name is IPV6_PKTINFO. For a detailed explanation of ancillary data,
see Using ancillary data on sendmsg() and recvmsg(). Restriction: This option can be enabled or disabled only with
a setsockopt(). IPV6_RECVPKTINFO is not valid as ancillary data on
sendmsg(). A nonzero option value enables the option; a value of
0 disables the option.
A getsockopt() with this option returns
the value set by a setsockopt(). If a setsockopt() has not been done,
the default value of 0 (disabled) is returned.
- IPV6_RECVHOPLIMIT (used with TCP, UDP and RAW applications)
- The IPV6_RECVHOPLIMIT socket option allows an application to receive
the value of the hop limit field from the IPv6 header. When the IPV6_RECVHOPLIMIT
socket option is enabled, the hop limit is returned as ancillary data
on the recvmsg() API. The ancillary data level is IPPROTO_IPV6.
The option name is IPV6_HOPLIMIT. For a UDP or RAW application,
if this option is enabled, the IPV6_HOPLIMIT ancillary data is returned
with each recvmsg(). For a TCP application, if this option is enabled,
IPV6_HOPLIMIT ancillary data is returned on recvmsg() only when the
hop limit value being used has changed. For a detailed explanation
of ancillary data, see Using ancillary data on sendmsg() and recvmsg().
This option can be enabled or disabled only with a setsockopt().
IPV6_RECVHOPLIMIT is not valid as ancillary data on sendmsg(). A
nonzero option value enables the option; a value of 0 disables the
option.
A getsockopt() with this option returns the value set
by a setsockopt(). If a setsockopt() has not been done, the default
value of 0 (disabled) is returned.
- IPV6_RECVRTHDR (used with UDP and RAW applications)
- The IPV6_RECVRTHDR socket option enables the application to receive
a routing header.
When the IPV6_RECVRTHDR socket option is enabled,
the routing header is returned as ancillary data on the recvmsg()
API. Each routing header is returned as one ancillary data object.
The ancillary data level is IPPROTO_IPV6. The option name is IPV6_RTHDR.
For a detailed explanation of ancillary data, see Using ancillary data on sendmsg() and recvmsg().
This option
can be enabled or disabled only with a setsockopt(). IPV6_RECVRTHDR
is not valid as ancillary data on sendmsg(). A nonzero value enables
the option; a value of 0 disables the option.
A getsockopt()
with this option returns the value set by a setsockopt(). If a setsockopt()
has not been performed, then getsockopt() returns a value of 0.
A
z/OS® UNIX C/C++ application can use the
following utilities to process routing headers:
- inet6_rth_reverse() - reverse a routing header
- inet6_rth_segments() - return number of segments in a routing
header
- inet6_rth_getaddr() - fetch one address from a routing header
See z/OS XL C/C++ Runtime Library Reference for a description of these utilities.
A z/OS UNIX Assembler Callable Services
application needs to build the options headers explicitly. See z/OS UNIX System Services Programming: Assembler
Callable Services Reference for information about z/OS UNIX Assembler Callable Services
and the data structures defined in the BPXYSOCK macro.
- IPV6_RECVHOPOPTS (used with UDP and RAW applications)
- The IPV6_RECVHOPOPTS socket option enables the application to
receive hop-by-hop options.
When the IPV6_RECVHOPOPTS socket option
is enabled, the hop-by-hop options are returned as ancillary data
on the recvmsg() API. The ancillary data level is IPPROTO_IPV6. The
option name is IPV6_HOPOPTS. For a detailed explanation of ancillary
data, see Using ancillary data on sendmsg() and recvmsg().
This
option can be enabled or disabled only with a setsockopt(). IPV6_RECVHOPOPTS
is not valid as ancillary data on sendmsg(). A nonzero value enables
the option; a value of 0 disables the option.
A getsockopt()
with this option returns the value set by a setsockopt(). If a setsockopt()
has not been performed, then getsockopt() returns a value of 0.
A
z/OS UNIX C/C++ application can use the
following utilities to process hop-by-hop options headers:
- inet6_opt_next() - extract the next option from the options header
- inet6_opt_find() - extract an option of a specified type from
the header
- inet6_opt_get_val() - retrieve one component of the option content
See z/OS XL C/C++ Runtime Library Reference for a description of these utilities.
A z/OS UNIX Assembler Callable Services
application needs to build the options headers explicitly. See z/OS UNIX System Services Programming: Assembler
Callable Services Reference for information about z/OS UNIX Assembler Callable Services
and the data structures defined in the BPXYSOCK macro.
- IPV6_RECVDSTOPTS (used with UDP and RAW applications)
- The IPV6_RECVDSTOPTS socket option enables the application to
receive destination options.
When the IPV6_RECVDSTOPTS
socket option is enabled, the destination options are returned as
ancillary data on the recvmsg() API. The application can receive two
destination options headers if a received packet contains a routing
header and one destination options header before the routing header
and one destination options header after the routing header. Each
destination options header is returned as one ancillary data object.
The ancillary data level is IPPROTO_IPV6. The option name is IPV6_DSTOPTS.
For more information about ancillary data, see Using ancillary data on sendmsg() and recvmsg().
This option
can be enabled or disabled only with a setsockopt(). IPV6_RECVDSTOPTS
is not valid as ancillary data on sendmsg(). A nonzero value enables
the option; a value of 0 disables the option.
A getsockopt()
with this option returns the value set by a setsockopt(). If a setsockopt()
has not been performed, then getsockopt() returns a value of 0.
A
z/OS UNIX C/C++ application can use the
following utilities to process destination options headers:
- inet6_opt_next() - extract the next option from the options header
- inet6_opt_find() - extract an option of a specified type from
the header
- inet6_opt_get_val() - retrieve one component of the option content
See z/OS XL C/C++ Runtime Library Reference for a description of these utilities.
A z/OS UNIX Assembler Callable Services
application needs to build the options headers explicitly. See z/OS UNIX System Services Programming: Assembler
Callable Services Reference for information about z/OS UNIX Assembler Callable Services
and the data structures defined in the BPXYSOCK macro.
- IPV6_RECVTCLASS (used with TCP, UDP and RAW applications)
- The IPV6_RECVTCLASS socket option enables the application to receive
the value of the traffic class field from the IPv6 header.
When
the IPV6_RECVTCLASS socket option is enabled, the traffic class is
returned as ancillary data on the recvmsg() API. The ancillary data
level is IPPROTO_IPV6. The option name is IPV6_TCLASS. For a UDP,
or RAW application, if this option is enabled, the IPv6_TCLASS ancillary
data is returned with each recvmsg(). For a TCP application, if this
option is enabled, IPV6_TCLASS ancillary data is returned on recvmsg()
only when the traffic class value being used has changed. For a detailed
explanation of ancillary data, see Using ancillary data on sendmsg() and recvmsg() .
This socket
option is also valid for an AF_INET6 socket that is using IPv4-mapped
IPv6 addresses.
This option can be enabled or disabled only
with a setsockopt(). IPV6_RECVTCLASS is not valid as ancillary data
on sendmsg(). A nonzero value enables the option; a value of 0 disables
the option.
A getsockopt() with this option returns the value
set by a setsockopt(). If a setsockopt() has not been performed, then
getsockopt() returns a value of 0.