setsourcefilter.3n (2010 09)

s
setsourcefilter(3N) setsourcefilter(3N)
NAME
setsourcefilter() - set IP multicast source filter state
SYNOPSIS
#include <sys/socket.h>
#include <netinet/in.h>
int setsourcefilter(
int s,
uint32_t interface,
struct sockaddr *group,
socklen_t grouplen,
uint32_t fmode,
uint_t numsrc,
struct sockaddr_storage *slist
);
DESCRIPTION
This function sets the multicast source filter state for an IPv4 or IPv6 multicast group on a given socket.
This function can be used to join a multicast group by specifying a filter mode of
MCAST_EXCLUDE
(with
or without a source list), or by specifying a filter mode of
MCAST_INCLUDE
with a non-empty source list.
If the multicast group is already joined, this function replaces the existing filter mode and source list with
the ones provided. This function can be used to leave a multicast group by specifying a filter mode of
MCAST_INCLUDE and an empty source list.
Parameters
s Specifies the descriptor identifying the socket. The socket address family must be
AF_INET
or
AF_INET6, and the socket type must be SOCK_DGRAM.
interface Holds the interface index of a local interface, or zero. If set to zero, the system chooses a mul-
ticast group by matching the multicast address only; or when joining a group, the system
chooses the interface that datagrams for the group would be sent from, based on the routing
configuration.
group Points to either a sockaddr_in structure (for IPv4) or a sockaddr_in6 structure (for IPv6) that
holds the IP multicast address of the group.
grouplen Holds the size of the structure pointed to by the group argument.
fmode Identifies the filter mode. The value of this field must be either
MCAST_INCLUDE or
MCAST_EXCLUDE, which are defined in <netinet/in.h>
.
numsrc Holds the number of source addresses in the slist array.
slist Points to an array of sockaddr_storage structures containing the IP addresses to include or
exclude depending on the filter mode. The sockaddr_storage structures will contain either a
sockaddr_in structure (for IPv4 addresses) or a sockaddr_in6 structure (for IPv6 addresses,
including IPv4-mapped IPv6 addresses); the address family must match that of the group
argument.
RETURN VALUES
setsourcefilter() returns the following values:
0 Successful completion.
-1 Failure. errno is set to indicate the error.
ERRORS
If
setsourcefilter() fails, errno is set to one of the following values:
[EBADF] The argument s is not a valid descriptor.
[EOPNOTSUPP] This function is not supported by the socket type.
[ENOMEM] Insufficient memory is available for internal system data structures.
[ENOBUFS] numsrc exceeds the maximum number of sources allowed, as determined by
the ndd tunable parameters
ip_ipc_mcast_maxsrc and
ip_igmp_maxsrc (for IPv4), or ip6_ipc_mcast_maxsrc and
ip6_mld_maxsrc (for IPv6).
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (2 pages)