1 .\" Copyright (c) 2007 Bruce M. Simpson. All rights reserved.
3 .\" Redistribution and use in source and binary forms, with or without
4 .\" modification, are permitted provided that the following conditions
6 .\" 1. Redistributions of source code must retain the above copyright
7 .\" notice, this list of conditions and the following disclaimer.
9 .\" THIS SOFTWARE IS PROVIDED BY Bruce M. Simpson ``AS IS'' AND
10 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
11 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
12 .\" ARE DISCLAIMED. IN NO EVENT SHALL Bruce M. Simpson BE LIABLE
13 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
14 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
15 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
16 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
17 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
18 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .Nd advanced multicast group membership API
33 .Fo getipv4sourcefilter
35 .Fa "struct in_addr interface"
36 .Fa "struct in_addr group"
38 .Fa "uint32_t *numsrc"
39 .Fa "struct in_addr *slist"
44 .Fa "uint32_t interface"
45 .Fa "struct sockaddr *group"
46 .Fa "socklen_t grouplen"
48 .Fa "uint32_t *numsrc"
49 .Fa "struct sockaddr_storage *slist"
52 .Fo setipv4sourcefilter
54 .Fa "struct in_addr interface"
55 .Fa "struct in_addr group"
58 .Fa "struct in_addr *slist"
63 .Fa "uint32_t interface"
64 .Fa "struct sockaddr *group"
65 .Fa "socklen_t grouplen"
68 .Fa "struct sockaddr_storage *slist"
73 functions implement the advanced, full-state multicast API
75 An application may use these functions to atomically set and
76 retrieve the multicast source address filters associated with a socket
81 The protocol-independent functions
85 allow an application to join a multicast group on an interface by
86 passing its index for the
92 argument specifies the size of the structure pointed to by
96 .Fn setipv4sourcefilter
102 argument may be used to place the socket into inclusive or exclusive
103 group membership modes, by using the
107 constants respectively.
110 argument specifies the number of source entries in the
113 A value of 0 will remove all source filters from the socket.
114 The changes will be communicated to IGMPv3 and/or MLDv2 routers
115 on the local network as appropriate.
116 .Sh IMPLEMENTATION NOTES
117 The IPv4 specific versions of these functions are implemented in terms
118 of the protocol-independent functions.
119 Application writers are encouraged to use the protocol-independent functions
120 for efficiency, and upwards compatibility with IPv6 networks.
122 .Rv -std getsourcefilter getipv4sourcefilter setsourcefilter setipv4sourcefilter
126 functions may fail because of:
128 .It Bq Er EADDRNOTAVAIL
129 The network interface which the
131 argument refers to was not configured in the system,
132 or the system is not a member of the
134 .It Bq Er EAFNOSUPPORT
137 and/or one or more of the
139 arguments were of an address family unsupported by the system,
140 or the address family of the
144 arguments were not identical.
148 argument does not contain a multicast address.
151 argument is invalid; it must be set to either
159 arguments do not specify a source list.
161 Insufficient memory was available to carry out the requested
172 .%T "Socket Interface Extensions for Multicast Source Filters"
179 functions first appeared in