Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

setipv4sourcefilter function

The setipv4sourcefilter inline function sets the multicast filter state for an IPv4 socket.

Syntax


int  setipv4sourcefilter(
  _In_       SOCKET              Socket,
  _In_       IN_ADDR             Interface,
  _In_       IN_ADDR             Group,
  _In_       MULTICAST_MODE_TYPE FilterMode,
  _In_       ULONG               SourceCount,
  _In_ const IN_ADDR             *SourceList
);

Parameters

Socket [in]

A descriptor that identifies a multicast socket.

Interface [in]

The local IPv4 address of the interface or the interface index on which the multicast group should be joined or dropped.

This value is in network byte order. If this member specifies an IPv4 address of 0.0.0.0, the default IPv4 multicast interface is used.

Any IP address in the 0.x.x.x block (first octet of 0) except IPv4 address 0.0.0.0 is treated as an interface index. An interface index is a 24-bit number, and the 0.0.0.0/8 IPv4 address block is not used (this range is reserved).

To use an interface index of 1 would be the same as an IP address of 0.0.0.1.

Group [in]

The IPv4 address of the multicast group.

FilterMode [in]

The multicast filter mode for multicast group address.

SourceCount [in]

The number of source addresses in the buffer pointed to by the SourceList parameter.

SourceList [in]

A pointer to a buffer with the IP addresses to associate with the multicast filter.

Return value

On success, setipv4sourcefilter returns NO_ERROR (0). Any nonzero return value indicates failure and a specific error code can be retrieved by calling WSAGetLastError.

Error codeMeaning
WSAENOBUFS

Insufficient buffer space is available.

WSAENOTSOCK

The descriptor is not a socket.

 

Remarks

The setipv4sourcefilter inline function is used to set the multicast filter state for an IPv4 socket.

This function is part of socket interface extensions for multicast source filters defined in RFC 3678. An app can use these functions to retrieve and set the multicast source address filters associated with a socket.

Windows Phone 8: This function is supported for Windows Phone Store apps on Windows Phone 8 and later.

Windows 8.1 and Windows Server 2012 R2: This function is supported for Windows Store apps on Windows 8.1, Windows Server 2012 R2, and later.

Requirements

Minimum supported client

Windows 8.1, Windows Vista [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2003 [desktop apps | Windows Store apps]

Minimum supported phone

Windows Phone 8

Header

Ws2tcpip.h

Library

Ws2_32.lib

DLL

Ws2_32.dll

See also

getipv4sourcefilter
getsourcefilter
in_addr
MULTICAST_MODE_TYPE
setsourcefilter

 

 

Show:
© 2017 Microsoft