These options allow an application to control certain features
in the transmission of IPv6 multicast packets. These socket options
do not have to be set to send multicast packets. Supplying a multicast
address as the destination address is the only thing required to send
an IPv6 multicast packet.
- IPV6_MULTICAST_IF
- This socket option allows an application to control the outgoing
interface used for a multicast packet. The socket option value is
the interface index of the interface to be used.
A getsockopt()
with this option returns the value set by setsockopt(). If a setsockopt()
has not been done, the value 0 is returned.
Tip: This
function is similar to the IPv4 socket option IP_MULTICAST_IF.
- IPV6_MULTICAST_HOPS
- The IPv6 header contains a hop limit field that controls the number
of hops over which a datagram can be sent before being discarded.
This is similar to the TTL field in the IPv4 header. The IPV6_MULTICAST_HOPS
socket option can be used to set the default hop limit value for an
outgoing multicast packet. The socket option value should be in the
range 0 – 255. A socket option value of -1 is used to clear the socket
option. This causes the default value 1 to be used.
A getsockopt()
with this option returns the value set by a setsockopt(). If a setsockopt()
has not been done, the default value 1 is returned.
The default
value is 1. An application must be APF-authorized or have superuser
authority to set this option to a value greater than the value of
HOPLIMIT on the IPCONFIG6 statement. See z/OS Communications Server: IP Configuration
Guide for more information about the IPCONFIG6
statement.
Tip: This function is similar to the IPv4
socket option IP_MULTICAST_TTL.
- IPV6_MULTICAST_LOOP
- When a multicast packet is sent, if the sender belongs to the
multicast group to which the packet was sent, then this option controls
whether the sender receives a copy of the packet. If this option is
enabled, then the sender receives a copy of the packet. The socket
option value should be 1 to enable the option, or 0 to disable 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 1 (enabled) is returned.
Tip: This function
is similar to the IPv4 socket option IP_MULTICAST_LOOP.