Use the following options to control receiving of multicast packets:
- IPV6_JOIN_GROUP
- Enables an application to join a multicast group on a specific
local interface. The socket option data specifies an IPv6 multicast
address and an IPv6 interface index. IPv4-mapped IPv6 multicast addresses
are not supported. If an interface index of 0 is specified, the stack
selects a local interface. An application that wants to receive multicast
packets destined for a multicast group needs to join that group. It
is not necessary to join a multicast group to send multicast packets.
Restriction: Getsockopt() does not support this option.
Tip: This function is similar to the IPv4 socket option IP_ADD_MEMBERSHIP.
- IPV6_LEAVE_GROUP
- Enables an application to leave a multicast group it previously
joined. The socket option data specifies an IPv6 multicast address
and an IPv6 interface index. If an interface index of 0 is used to
join a multicast group, an interface index of 0 must be used to leave
the group.
Restriction: Getsockopt() does not support this
option.
Tip: This function is similar to the IPv4
socket option IP_DROP_MEMBERSHIP.
- MCAST_JOIN_GROUP
- Enables an application to join a multicast group on a specific
local interface. The socket option data specifies an IPv4 or IPv6
multicast address and an IPv4 or IPv6 interface index. IPv4-mapped
IPv6 multicast addresses are not supported. If the interface index
0 is specified, the stack selects a local interface. An application
that wants to receive multicast packets destined for a multicast group
needs to join that group. An application does not need to join a multicast
group to send multicast packets.
Restriction: Getsockopt()
does not support this option.
Tip: This function
is similar to the IPv4 socket option IP_ADD_MEMBERSHIP and the IPv6
socket option IPV6_JOIN_GROUP.
- MCAST_BLOCK_SOURCE
- Enables an application to exclude the reception of multicast packets
from specified source IP addresses. This socket option is issued after
an MCAST_JOIN_GROUP option has been issued.
Restriction: Getsockopt()
does not support this option.
Tip: This function
is similar to the IPv4 socket option IP_BLOCK_SOURCE.
- MCAST_UNBLOCK_SOURCE
- Enables an application to include the reception of multicast packets
from previously excluded source IP addresses. This socket option is
issued after the MCAST_JOIN_GROUP and the MCAST_BLOCK_SOURCE options
have been issued.
Restriction: Getsockopt()
does not support this option.
Tip: This
function is similar to the IPv4 socket option IP_UNBLOCK_SOURCE.
- MCAST_JOIN_SOURCE_GROUP
- Enables an application to join a multicast group on
a specific local interface and for a specific source address. The
socket option data specifies an IPv4 or IPv6 multicast address, an
IPv4 or IPv6 interface index, and a single IPv4 or IPv6 source address.
IPv4-mapped IPv6 multicast addresses and IPv4-mapped IPv6 source addresses
are not supported. If the interface index 0 is specified, the stack
selects a local interface. To receive multicast packets that are destined
for a multicast group and that are from a particular source IP address,
an application needs to join that group for the source address. An
application does not need to join a multicast group to send multicast
packets. MCAST_JOIN_SOURCE_GROUP cannot be used with MCAST_JOIN_GROUP.
Restriction: Getsockopt() does not support this option.
Tip: This function is similar to the IPv4 socket option IP_ADD_SOURCE_MEMBERSHIP.
- MCAST_LEAVE_GROUP
- Enables an application to leave a multicast group that it previously
joined or to leave all sources that joined for a multicast group.
The socket option data specifies an IPv4 or IPv6 multicast address
and an IPv4 or IPv6 interface index. If the interface index 0 was
specified on the MCAST_LEAVE_GROUP option to join a multicast group,
an interface index of 0 must be specified to leave the group.
Restriction: Getsockopt() does not support this option.
Tip: This function is similar to the IPv4 socket option IP_DROP_MEMBERSHIP.
- MCAST_LEAVE_SOURCE_GROUP
- Enables an application to leave a source multicast group
that it previously joined. The socket option data specifies an IPv4
or IPv6 multicast address, an IPv4 or IPv6 interface index, and a
single IPv4 or IPv6 source address. If the interface index 0 was specified
on the MCAST_JOIN_SOURCE_GROUP option to join a multicast group, an
interface index 0 must be specified to leave the group. MCAST_LEAVE_SOURCE_GROUP
is used to leave the group that was joined by MCAST_JOIN_SOURCE_GROUP.
Restriction: Getsockopt() does not support this option.
Tip: This function is similar to the IPv4 socket option IP_DROP_SOURCE_MEMBERSHIP.