aboutsummaryrefslogtreecommitdiffstats
path: root/man/man2const/IP_ADD_MEMBERSHIP.2const
blob: aac81abf1a5617b76e9205f448e9d9e86c9fca53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
.\" Copyright, the authors of the Linux man-pages project
.\"
.\" SPDX-License-Identifier: Linux-man-pages-copyleft
.\"
.TH IP_ADD_MEMBERSHIP 2const (date) "Linux man-pages (unreleased)"
.SH NAME
IP_ADD_MEMBERSHIP
\-
join a multicast group
.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_MEMBERSHIP,
.BI "               const\~struct\~ip_mreqn\~*" val ,\~sizeof(struct\~ip_mreqn));
.fi
.SH DESCRIPTION
Join a multicast group.
.P
.B IP_ADD_MEMBERSHIP
is valid only for
.BR setsockopt (2).
.SH ERRORS
See
.BR IPPROTO_IP (2const).
See
.BR setsockopt (2).
See
.BR ip (7).
.TP
.B EINVAL
.I val->imr_multiaddr
is not a valid multicast address.
.SH HISTORY
Linux 1.2.
.P
For compatibility, the old
.I ip_mreq
structure is still supported.
The kernel determines which structure is being passed based
on the size passed in the last argument.
.SH SEE ALSO
.BR IPPROTO_IP (2const),
.BR ip_mreqn (2type),
.BR setsockopt (2),
.BR ip (7)