]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
man/man2const/{IPPROTO_IP,IP_ADD_SOURCE_MEMBERSHIP}.2const: Split IP_ADD_SOURCE_MEMBE...
authorAlejandro Colomar <alx@kernel.org>
Fri, 21 Nov 2025 12:35:03 +0000 (13:35 +0100)
committerAlejandro Colomar <alx@kernel.org>
Tue, 25 Nov 2025 00:09:36 +0000 (01:09 +0100)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
man/man2const/IPPROTO_IP.2const
man/man2const/IP_ADD_SOURCE_MEMBERSHIP.2const [new file with mode: 0644]

index bf854bf0b5c6d5c13a3022cb89330b12f12c5f83..df0647edb85bba0342bd44e0ccbd7b6ce921727b 100644 (file)
@@ -69,46 +69,8 @@ fail with the error
 .BR ENOPROTOOPT .
 .TP
 .BR IP_ADD_MEMBERSHIP (2const)
-.TP
-.BR IP_ADD_SOURCE_MEMBERSHIP " (since Linux 2.4.22 / Linux 2.5.68)"
-Join a multicast group and allow receiving data only
-from a specified source.
-Argument is an
-.I ip_mreq_source
-structure.
-.IP
-.in +4n
-.EX
-struct ip_mreq_source {
-    struct in_addr imr_multiaddr;  /* IP multicast group
-                                      address */
-    struct in_addr imr_interface;  /* IP address of local
-                                      interface */
-    struct in_addr imr_sourceaddr; /* IP address of
-                                      multicast source */
-};
-.EE
-.in
-.IP
-The
-.I ip_mreq_source
-structure is similar to
-.BR ip_mreqn (2type).
-The
-.I imr_multiaddr
-field contains the address of the multicast group the application
-wants to join or leave.
-The
-.I imr_interface
-field is the address of the local interface with which
-the system should join the multicast group.
-Finally, the
-.I imr_sourceaddr
-field contains the address of the source the
-application wants to receive data from.
-.IP
-This option can be used multiple times to allow
-receiving data from more than one source.
+.TQ
+.BR IP_ADD_SOURCE_MEMBERSHIP (2const)
 .TP
 .BR IP_BIND_ADDRESS_NO_PORT " (since Linux 4.2)"
 .\" commit 90c337da1524863838658078ec34241f45d8394d
@@ -126,12 +88,12 @@ This is valid only after the application has subscribed
 to the multicast group using either
 .BR IP_ADD_MEMBERSHIP (2const)
 or
-.BR IP_ADD_SOURCE_MEMBERSHIP .
+.BR IP_ADD_SOURCE_MEMBERSHIP (2const).
 .IP
 Argument is an
 .I ip_mreq_source
-structure as described under
-.BR IP_ADD_SOURCE_MEMBERSHIP .
+structure as described in
+.BR IP_ADD_SOURCE_MEMBERSHIP (2const).
 .TP
 .BR IP_DROP_MEMBERSHIP " (since Linux 1.2)"
 Leave a multicast group.
@@ -151,8 +113,8 @@ To stop receiving data from all sources at once, use
 .IP
 Argument is an
 .I ip_mreq_source
-structure as described under
-.BR IP_ADD_SOURCE_MEMBERSHIP .
+structure as described in
+.BR IP_ADD_SOURCE_MEMBERSHIP (2const).
 .TP
 .BR IP_FREEBIND " (since Linux 2.4)"
 .\" Precisely: since Linux 2.4.0-test10
@@ -809,8 +771,8 @@ when given source is not being blocked.
 .IP
 Argument is an
 .I ip_mreq_source
-structure as described under
-.BR IP_ADD_SOURCE_MEMBERSHIP .
+structure as described in
+.BR IP_ADD_SOURCE_MEMBERSHIP (2const).
 .TP
 .BR SO_PEERSEC " (since Linux 2.6.17)"
 If labeled IPSEC or NetLabel is configured on both the sending and
diff --git a/man/man2const/IP_ADD_SOURCE_MEMBERSHIP.2const b/man/man2const/IP_ADD_SOURCE_MEMBERSHIP.2const
new file mode 100644 (file)
index 0000000..e0d468a
--- /dev/null
@@ -0,0 +1,77 @@
+.\" Copyright, the authors of the Linux man-pages project
+.\"
+.\" SPDX-License-Identifier: Linux-man-pages-copyleft
+.\"
+.TH IP_ADD_SOURCE_MEMBERSHIP 2const (date) "Linux man-pages (unreleased)"
+.SH NAME
+IP_ADD_SOURCE_MEMBERSHIP
+\-
+join a multicast group
+and allow receiving data
+only from a specified source
+.SH LIBRARY
+Standard C library
+.RI ( libc ,\~ \-lc )
+.SH SYNOPSIS
+.nf
+.BR "#include <netinet/in.h>" "  /* Definition of " IP* " constants */"
+.B #include <sys/socket.h>
+.P
+.BI int\~setsockopt(int\~ sockfd ,\~IPPROTO_IP,\~IP_ADD_SOURCE_MEMBERSHIP,
+.BI "               const\~struct\~ip_mreq_source\~*" val ,
+.B "               sizeof(struct\~ip_mreq_source));"
+.fi
+.SH DESCRIPTION
+.TP
+.BR IP_ADD_SOURCE_MEMBERSHIP " (since Linux 2.4.22 / Linux 2.5.68)"
+Join a multicast group and allow receiving data only
+from a specified source.
+Argument is an
+.I ip_mreq_source
+structure.
+.IP
+.in +4n
+.EX
+struct ip_mreq_source {
+    struct in_addr imr_multiaddr;  /* IP multicast group
+                                      address */
+    struct in_addr imr_interface;  /* IP address of local
+                                      interface */
+    struct in_addr imr_sourceaddr; /* IP address of
+                                      multicast source */
+};
+.EE
+.in
+.IP
+The
+.I ip_mreq_source
+structure is similar to
+.I ip_mreqn
+described in
+.BR IP_ADD_MEMBERSHIP (2const).
+The
+.I imr_multiaddr
+field contains the address of the multicast group the application
+wants to join or leave.
+The
+.I imr_interface
+field is the address of the local interface with which
+the system should join the multicast group.
+Finally, the
+.I imr_sourceaddr
+field contains the address of the source the
+application wants to receive data from.
+.IP
+This option can be used multiple times to allow
+receiving data from more than one source.
+.SH ERRORS
+See
+.BR IPPROTO_IP (2const).
+See
+.BR setsockopt (2).
+See
+.BR ip (7).
+.SH SEE ALSO
+.BR IPPROTO_IP (2const),
+.BR setsockopt (2),
+.BR ip (7)