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