Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

getsourcefilter(3n) [hpux man page]

getsourcefilter(3N)													       getsourcefilter(3N)

NAME
getsourcefilter() - get IP multicast source filter state SYNOPSIS
DESCRIPTION
This function retrieves the multicast source filter state for an IPv4 or IPv6 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 or and the socket type must be interface Holds the interface index of a local interface, or zero. If set to zero, the system chooses a multicast group by matching the multicast address only. 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 Points to an integer that will contain the filter mode on a successful return. The value of this field will be either or which are defined in numsrc On input, the numsrc argument holds the number of source addresses that will fit in the slist array. On output, the numsrc argu- ment will hold the total number of sources in the filter. slist Points to buffer into which an array of sockaddr_storage structures containing the IP addresses of included or excluded (depend- ing on the filter mode) sources will be written. 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 will match that of the group argument. 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
returns the following values: Successful completion. Failure. is set to indicate the error. ERRORS
If fails, is set to one of the following values: The argument s is not a valid descriptor. This function is not supported by the socket type. Insufficient memory is available for internal system data structures. The address family of the group argument is not supported. The specified multicast group has not been joined. slist is NULL when numsrc is greater than 0; or group does not contain a multicast address; or interface contains an invalid interface index; or grouplen is not valid. AUTHOR
was developed by HP and the IETF. SEE ALSO
socket(2), getipv4sourcefilter(3N), if_nameindex(3N), setipv4sourcefilter(3N), setsourcefilter(3N), ip(7P), ip6(7P). STANDARDS CONFORMANCE
RFC 3678 getsourcefilter(3N)

Check Out this Related Man Page

SOURCEFILTER(3) 					   BSD Library Functions Manual 					   SOURCEFILTER(3)

NAME
sourcefilter -- advanced multicast group membership API SYNOPSIS
#include <sys/socket.h> #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); int getsourcefilter(int s, uint32_t interface, struct sockaddr *group, socklen_t grouplen, uint32_t *fmode, uint32_t *numsrc, struct sockaddr_storage *slist); int setipv4sourcefilter(int s, struct in_addr interface, struct in_addr group, uint32_t fmode, uint32_t numsrc, struct in_addr *slist); int setsourcefilter(int s, uint32_t interface, struct sockaddr *group, socklen_t grouplen, uint32_t fmode, uint32_t numsrc, struct sockaddr_storage *slist); DESCRIPTION
The sourcefilter functions implement the advanced, full-state multicast API defined in RFC 3678. An application may use these functions to atomically set and retrieve the multicast source address filters associated with a socket s and a multicast group. The functions getipv4sourcefilter() and getsourcefilter() allow an application to discover the filter mode, and source filter entries, for an existing group membership. The kernel will always return the number of source filter entries on the socket for that group in *numsrc. If the *numsrc argument is non- zero, the kernel will attempt to return up to *numsrc filter entries in the array pointed to by slist. The *numsrc argument may be set to 0, in which case the slist argument will be ignored. For the setipv4sourcefilter() and setsourcefilter() functions, the fmode argument may be used to place the socket into inclusive or exclusive group membership modes, by using the MCAST_INCLUDE or MCAST_EXCLUDE constants respectively. The numsrc argument specifies the number of source entries in the slist array. If the numsrc argument has a value of 0, all source filters will be removed from the socket. Removing all source filters from a membership which is in the MCAST_INCLUDE filter mode will cause the group to be left on that socket. The protocol-independent function setsourcefilter() allows an application to join a multicast group on an interface which may not have an assigned protocol address, by passing its index for the interface argument. Any changes made by these functions will be communicated to IGMPv3 and/or MLDv2 routers on the local network as appropriate. If no IGMPv3 or MLDv2 routers are present, changes in the source filter lists made by these functions will not cause state changes to be transmitted, with the exception of any change which causes a group to be joined or left. The kernel will continue to maintain the source filter state regard- less of the IGMP or MLD version in use on the link. IMPLEMENTATION NOTES
The IPv4 specific versions of these functions are implemented in terms of the protocol-independent functions. Application writers are encouraged to use the protocol-independent functions for efficiency, and forwards compatibility with IPv6 networks. For the protocol-independent functions getsourcefilter() and setsourcefilter(), the grouplen argument specifies the size of the structure pointed to by group. This is required in order to differentiate between different address families. Currently FreeBSD does not support source address selection for the IPv4 protocol family, therefore the use of multicast APIs with an unnum- bered IPv4 interface is not recommended. In all cases, the first assigned IPv4 address on the interface will be used as the source address of IGMP control traffic. If this address is removed or changed, the results are undefined. RETURN VALUES
The getsourcefilter(), getipv4sourcefilter(), setsourcefilter(), and setipv4sourcefilter() functions return the value 0 if successful; other- wise the value -1 is returned and the global variable errno is set to indicate the error. ERRORS
The sourcefilter functions may fail because of: [EADDRNOTAVAIL] The network interface which the interface argument refers to was not configured in the system, or the system is not a mem- ber of the group. [EAFNOSUPPORT] The group and/or one or more of the slist arguments were of an address family unsupported by the system, or the address family of the group and slist arguments were not identical. [EINVAL] The group argument does not contain a multicast address. The fmode argument is invalid; it must be set to either MCAST_INCLUDE or MCAST_EXCLUDE. The numsrc or slist arguments do not specify a source list. [ENOMEM] Insufficient memory was available to carry out the requested operation. SEE ALSO
ip(4), ip6(4), multicast(4), ifmcstat(8) D. Thaler, B. Fenner, and B. Quinn, Socket Interface Extensions for Multicast Source Filters, RFC 3678, Jan 2004. HISTORY
The sourcefilter functions first appeared in FreeBSD 7.0. AUTHORS
Bruce M. Simpson <bms@FreeBSD.org> BSD
February 13, 2009 BSD
Man Page