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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
'\" te
.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH SCTP_BINDX 3SOCKET "Aug 22, 2007"
.SH NAME
sctp_bindx \- add or remove IP addresses to or from an SCTP socket
.SH SYNOPSIS
.LP
.nf
\fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-lsocket\fR \fB -lnsl \fR \fB -lsctp \fR [ \fIlibrary\fR... ]
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/sctp.h>
\fBint\fR \fBsctp_bindx\fR(\fBint\fR \fIsock\fR, \fBvoid *\fR\fIaddrs\fR, \fBint\fR \fIaddrcnt\fR, \fBint\fR \fIflags\fR);
.fi
.SH DESCRIPTION
.LP
The \fBsctp_bindx()\fR function adds or removes addresses to or from an SCTP
socket. If \fIsock\fR is an Internet Protocol Version 4 (IPv4) socket,
\fIaddrs\fR should be an array of \fBsockaddr_in\fR structures containing IPv4
addresses. If \fIsock\fR is an Internet Protocol Version 6 (IPv6) socket,
\fIaddrs\fR should be an array of \fBsockaddr_in6\fR structures containing IPv6
or IPv4-mapped IPv6 addresses. The \fIaddrcnt\fR is the number of array
elements in \fIaddrs\fR. The family of the address type is used with
\fIaddrcnt\fR to determine the size of the array.
.sp
.LP
The \fIflags\fR parameter is a bitmask that indicates whether addresses are to
be added or removed from a socket. The \fIflags\fR parameter is formed by
bitwise OR of zero or more of the following flags:
.sp
.ne 2
.na
\fB\fBSCTP_BINDX_ADD_ADDR\fR\fR
.ad
.RS 23n
Indicates that addresses from \fIaddrs\fR should be added to the SCTP socket.
.RE
.sp
.ne 2
.na
\fB\fBSCTP_BINDX_REM_ADDR\fR\fR
.ad
.RS 23n
Indicates that addresses from \fIaddrs\fR should be removed from the SCTP
socket.
.RE
.sp
.LP
These two flags are mutually exclusive. If \fIflags\fR is formed by a bitwise
OR of both \fBSCTP_BINDX_ADD_ADDR\fR and \fBSCTP_BINDX_REM_ADDR\fR, the
\fBsctp_bindx()\fR function will fail.
.sp
.LP
Prior to calling \fBsctp_bindx()\fR on an SCTP endpoint, the endpoint should be
bound using \fBbind\fR(3SOCKET). On a listening socket, a special
\fBINADDR_ANY\fR value for IP or an unspecified address of all zeros for IPv6
can be used in \fIaddrs\fR to add all IPv4 or IPv6 addresses on the system to
the socket. The \fBsctp_bindx()\fR function can also be used to add or remove
addresses to or from an established association. In such a case, messages are
exchanged between the SCTP endpoints to update the address lists for that
association if both endpoints support dynamic address reconfiguration.
.SH RETURN VALUES
.LP
Upon successful completion, the \fBsctp_bindx()\fR function returns \fB0\fR.
Otherwise, the function returns \fB-1\fR and sets \fBerrno\fR to indicate the
error.
.SH ERRORS
.LP
The \fBsctp_bindx()\fR call fails under the following conditions.
.sp
.ne 2
.na
\fB\fBEBADF\fR\fR
.ad
.RS 12n
The \fIsock\fR argument is an invalid file descriptor.
.RE
.sp
.ne 2
.na
\fB\fBENOTSOCK\fR\fR
.ad
.RS 12n
The \fIsock\fR argument is not a socket.
.RE
.sp
.ne 2
.na
\fB\fBEINVAL\fR\fR
.ad
.RS 12n
One or more of the IPv4 or IPv6 addresses is invalid.
.RE
.sp
.ne 2
.na
\fB\fBEINVAL\fR\fR
.ad
.RS 12n
The endpoint is not bound.
.RE
.sp
.ne 2
.na
\fB\fBEINVAL\fR\fR
.ad
.RS 12n
The last address is requested to be removed from an established association.
.RE
.SH ATTRIBUTES
.LP
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp
.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE ATTRIBUTE VALUE
_
Interface Stability Committed
_
MT-Level Safe
.TE
.SH SEE ALSO
.LP
.BR in.h (3HEAD),
.BR libsctp (3LIB),
.BR bind (3SOCKET),
.BR listen (3SOCKET),
.BR sctp_freeladdrs (3SOCKET),
.BR sctp_freepaddrs (3SOCKET),
.BR sctp_getladdrs (3SOCKET),
.BR sctp_getpaddrs (3SOCKET),
.BR sockaddr (3SOCKET),
.BR socket (3SOCKET),
.BR inet (4P),
.BR inet6 (4P),
.BR ip (4P),
.BR ip6 (4P),
.BR sctp (4P)
.SH NOTES
.LP
IPv4-mapped addresses are not recommended.
|