getipv4sourcefilter.3n (2010 09)
g
getipv4sourcefilter(3N) getipv4sourcefilter(3N)
NAME
getipv4sourcefilter() - get IPv4 multicast source filter state
SYNOPSIS
#include <netinet/in.h>
int getipv4sourcefilter(
int s,
struct in_addr interface,
struct in_addr group,
uint32_t *fmode,
uint32_t *numsrc,
struct in_addr *slist
);
DESCRIPTION
This function retrieves the multicast source filter state for an IPv4 multicast group which the application
has joined on a given socket.
Parameters
s Specifies the descriptor identifying the socket. The socket address family must be
AF_INET,
and the socket type must be SOCK_DGRAM.
interface Holds the IPv4 address of a local interface, or
INADDR_ANY. If set to
INADDR_ANY, the sys-
tem chooses a multicast group by matching the multicast address only.
group Holds the IPv4 multicast address of the group.
fmode Points to an integer that will contain the filter mode on a successful return. The value of this
field will be either
MCAST_INCLUDE
or MCAST_EXCLUDE, which are defined in
<netinet/in.h>.
numsrc On input, the numsrc argument holds the number of source addresses that will fit in the slist
array. On output, the numsrc argument will hold the total number of sources in the filter.
slist Points to buffer into which an array of IPv4 addresses of included or excluded (depending on
the filter mode) sources will be written. If numsrc was 0 on input, a NULL pointer may be
supplied.
If the application does not know the size of the source list beforehand, it can make a reasonable guess (for
example, by setting numsrc to 0), and if upon completion, numsrc holds a larger value, the operation can
be repeated with a large enough buffer.
That is, on return, numsrc is always updated to be the total number of sources in the filter, while slist
will hold as many source addresses as fit, up to the minimum of the array size passed in as the original
numsrc value and the total number of sources in the filter.
RETURN VALUES
getipv4sourcefilter() returns the following values:
0 Successful completion.
-1 Failure. errno is set to indicate the error.
ERRORS
If
getipv4sourcefilter() 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.
[EADDRNOTAVAIL] The specified IP address is not a local interface address; or the specified
multicast group has not been joined.
[EINVAL] slist is NULL when numsrc is greater than 0; or group is not an IPv4 multi-
cast address.
HP-UX 11i Version 3: September 2010 − 1 − Hewlett-Packard Company 1