FreeBSD Manual Pages
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 atom- ically set and retrieve the multicast source address filters associated with a socket s and a multicast group. The protocol-independent functions getsourcefilter() and setsourcefilter() allow an application to join a multicast group on an interface by passing its index for the interface argument. The argument. grouplen argument specifies the size of the structure pointed to by group. 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 con- stants respectively. The numsrc argument specifies the number of source entries in the slist array. A value of 0 will remove all source filters from the socket. The changes will be communicated to IGMPv3 and/or MLDv2 routers on the local network as appropriate. 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 upwards compatibility with IPv6 networks. 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 in- dicate 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 member 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 ad- dress. 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 re- quested operation. SEE ALSO ip(4), ip6(4), multicast(4) 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 June 12, 2007 BSD
NAME | SYNOPSIS | DESCRIPTION | IMPLEMENTATION NOTES | RETURN VALUES | ERRORS | SEE ALSO | HISTORY | AUTHORS
Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=sourcefilter&sektion=3&manpath=FreeBSD+7.0-RELEASE>