]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libc/net/sctp_bindx.3
MFV: zlib 1.3
[FreeBSD/FreeBSD.git] / lib / libc / net / sctp_bindx.3
1 .\" Copyright (c) 1983, 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\"     From: @(#)send.2        8.2 (Berkeley) 2/21/94
29 .\"
30 .Dd June 14, 2015
31 .Dt SCTP_BINDX 3
32 .Os
33 .Sh NAME
34 .Nm sctp_bindx
35 .Nd bind or unbind an SCTP socket to a list of addresses
36 .Sh LIBRARY
37 .Lb libc
38 .Sh SYNOPSIS
39 .In sys/types.h
40 .In sys/socket.h
41 .In netinet/sctp.h
42 .Ft int
43 .Fn sctp_bindx "int s" "struct sockaddr *addrs" "int num" "int type"
44 .Sh DESCRIPTION
45 The
46 .Fn sctp_bindx
47 call binds or unbinds a address or a list of addresses to an
48 SCTP endpoint.
49 This allows a user to bind a subset of
50 addresses.
51 The
52 .Fn sctp_bindx
53 call operates similarly to
54 .Fn bind
55 but allows a list of addresses and also allows a bind or an
56 unbind.
57 The argument
58 .Fa s
59 must be a valid SCTP socket descriptor.
60 The argument
61 .Fa addrs
62 is a list of addresses (where the list may be only 1 in
63 length) that the user wishes to bind or unbind to the
64 socket.
65 The argument
66 .Fa type
67 must be one of the following values.
68 .Pp
69 .Dv SCTP_BINDX_ADD_ADDR
70 This value indicates that the listed address(es) need to
71 be added to the endpoint.
72 .Pp
73 .Dv SCTP_BINDX_REM_ADDR
74 This value indicates that the listed address(es) need to
75 be removed from the endpoint.
76 .Pp
77 Note that when a user adds or deletes an address to an
78 association if the dynamic address flag
79 .Va net.inet.sctp.auto_asconf
80 is enabled any associations in the endpoint will attempt to
81 have the address(es) added dynamically to the existing
82 association.
83 .Sh RETURN VALUES
84 The call returns 0 on success and -1 upon failure.
85 .Sh ERRORS
86 The
87 .Fn sctp_bindx
88 function can return the following errors:
89 .Bl -tag -width Er
90 .It Bq Er EINVAL
91 This value is returned if the
92 .Fa type
93 field is not one of the allowed values (see above).
94 .It Bq Er ENOMEM
95 This value is returned if the number of addresses
96 being added causes a memory allocation failure in
97 the call.
98 .It Bq Er EBADF
99 The argument
100 .Fa s
101 is not a valid descriptor.
102 .It Bq Er ENOTSOCK
103 The argument
104 .Fa s
105 is not a socket.
106 .El
107 .Sh SEE ALSO
108 .Xr bind 2 ,
109 .Xr sctp 4