GROUP_FILTER structure (ws2ipdef.h)

The GROUP_FILTER structure provides multicast filtering parameters for multicast IPv6 or IPv4 addresses.

Syntax

typedef struct group_filter {
  ULONG               gf_interface;
  SOCKADDR_STORAGE    gf_group;
  MULTICAST_MODE_TYPE gf_fmode;
  ULONG               gf_numsrc;
  SOCKADDR_STORAGE    gf_slist[1];
} GROUP_FILTER, *PGROUP_FILTER;

Members

gf_interface

The interface index of the local interface for the multicast group to filter.

gf_group

The multicast address group that should be filtered. This may be either an IPv6 or IPv4 multicast address.

gf_fmode

The multicast filter mode.

This member can be one of the values from the MULTICAST_MODE_TYPE enumeration type defined in the Ws2ipdef.h header file. This member determines if the list of IP addresses in the gf_numsrc member should be included or excluded.

Value Meaning
MCAST_INCLUDE
The filter contains a list of IP addresses to include.
MCAST_EXCLUDE
The filter contains a list of IP addresses to exclude.

gf_numsrc

The number of multicast filter source address entries in the gf_slist member.

gf_slist[1]

An array of SOCKADDR_STORAGE structures specifying the multicast source addresses to include or exclude. These IP addresses may be either IPv6 or IPv4 addresses, but they must be the same address family (IPv6 or IPv4) as the address specified in the gf_group member..

Remarks

The GROUP_FILTER structure is used with either IPv6 or IPv4 multicast addresses. The GROUP_FILTER structure is passed as an argument for the SIOCGMSFILTER and SIOCSMSFILTER IOCTLs.

The GROUP_FILTER structure and related structures used for multicast programming are based on IETF recommendations in sections 5 and 8.2 of RFC 3768. For more information, see http://www.ietf.org/rfc/rfc3678.txt.

On Windows Vista and later, a set of socket options are available for multicast programming that support IPv6 and IPv4 addresses. These socket options are IP agnostic and can be used on both IPv6 and IPv4. These IP agnostic options use the GROUP_REQ and the GROUP_SOURCE_REQ structures and are the preferred socket options for multicast programming on Windows Vista and later.

The GetAdaptersAddresses function can be used to obtain interface index information required for the gf_interface member.

The GROUP_FILTER structure and the Ioctls that use this structure are only valid on datagram and raw sockets (the socket type must be SOCK_DGRAM or SOCK_RAW).

The GROUP_FILTER structure is defined in the Ws2ipdef.h header file which is automatically included in the Ws2tcpip.h header file. The Ws2ipdef.h header files should never be used directly.

Requirements

Requirement Value
Minimum supported client None supported
Minimum supported server Windows Server 2008 [desktop apps only]
Header ws2ipdef.h (include Ws2tcpip.h)

See also

GROUP_REQ

GROUP_SOURCE_REQ

GetAdaptersAddresses

MULTICAST_MODE_TYPE

Multicast Programming

SOCKADDR_STORAGE

Socket Options

ip_mreq

ip_msfilter

ipv6_mreq