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