xref: /freebsd/lib/libc/net/sctp_bindx.3 (revision f4f33ea0c752ff0f9bfad34991d5bbb54e71133d)
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.\" $FreeBSD$
30.\"
31.Dd June 14, 2015
32.Dt SCTP_BINDX 3
33.Os
34.Sh NAME
35.Nm sctp_bindx
36.Nd bind or unbind an SCTP socket to a list of addresses
37.Sh LIBRARY
38.Lb libc
39.Sh SYNOPSIS
40.In sys/types.h
41.In sys/socket.h
42.In netinet/sctp.h
43.Ft int
44.Fn sctp_bindx "int s" "struct sockaddr *addrs" "int num" "int type"
45.Sh DESCRIPTION
46The
47.Fn sctp_bindx
48call binds or unbinds a address or a list of addresses to an
49SCTP endpoint.
50This allows a user to bind a subset of
51addresses.
52The
53.Fn sctp_bindx
54call operates similarly to
55.Fn bind
56but allows a list of addresses and also allows a bind or an
57unbind.
58The argument
59.Fa s
60must be a valid SCTP socket descriptor.
61The argument
62.Fa addrs
63is a list of addresses (where the list may be only 1 in
64length) that the user wishes to bind or unbind to the
65socket.
66The argument
67.Fa type
68must be one of the following values.
69.Pp
70.Dv SCTP_BINDX_ADD_ADDR
71This value indicates that the listed address(es) need to
72be added to the endpoint.
73.Pp
74.Dv SCTP_BINDX_REM_ADDR
75This value indicates that the listed address(es) need to
76be removed from the endpoint.
77.Pp
78Note that when a user adds or deletes an address to an
79association if the dynamic address flag
80.Va net.inet.sctp.auto_asconf
81is enabled any associations in the endpoint will attempt to
82have the address(es) added dynamically to the existing
83association.
84.Sh RETURN VALUES
85The call returns 0 on success and -1 upon failure.
86.Sh ERRORS
87The
88.Fn sctp_bindx
89function can return the following errors:
90.Bl -tag -width Er
91.It Bq Er EINVAL
92This value is returned if the
93.Fa type
94field is not one of the allowed values (see above).
95.It Bq Er ENOMEM
96This value is returned if the number of addresses
97being added causes a memory allocation failure in
98the call.
99.It Bq Er EBADF
100The argument
101.Fa s
102is not a valid descriptor.
103.It Bq Er ENOTSOCK
104The argument
105.Fa s
106is not a socket.
107.El
108.Sh SEE ALSO
109.Xr bind 2 ,
110.Xr sctp 4
111