blob: e1b151b7ae54e82c827af99fc966d70922acf32f [file] [log] [blame]
Austin Schuh8d0a2852019-12-28 22:54:28 -08001.\" (C) Copyright Sridhar Samudrala IBM Corp. 2004, 2005.
2.\"
3.\" Permission is granted to distribute possibly modified copies
4.\" of this manual provided the header is included verbatim,
5.\" and in case of nontrivial modification author and date
6.\" of the modification is added to the header.
7.\"
8.TH SCTP_BINDX 3 2005-10-25 "Linux 2.6" "Linux Programmer's Manual"
9.SH NAME
10sctp_bindx \- Add or remove bind addresses on a socket.
11.SH SYNOPSIS
12.nf
13.B #include <sys/types.h>
14.B #include <sys/socket.h>
15.B #include <netinet/sctp.h>
16.sp
17.BI "int sctp_bindx(int " sd ", struct sockaddr * " addrs ", int " addrcnt ,
18.BI " int " flags );
19.fi
20.SH DESCRIPTION
21.BR sctp_bindx
22adds or removes a set of bind addresses passed in the array
23.I addrs
24to/from the socket
25.I sd.
26.I addrcnt
27is the number of addresses in the array and the
28.I flags
29paramater indicates if the addresses need to be added or removed.
30.PP
31If
32.I sd
33is an IPv4 socket, the addresses passed must be IPv4 addresses. If
34.I sd
35is an IPv6 socket, the addresses passed can be either IPv4 or IPv6
36addresses.
37.PP
38.I addrs
39is a pointer to an array of one or more socket addresses. Each address is
40contained in its appropriate structure(i.e. struct sockaddr_in or struct
41sockaddr_in6). The family of the address type must be used to distinguish
42the address length. The caller specifies the number of addresses in the
43array with
44.I addrcnt.
45.PP
46The
47.I flags
48parameter can be either
49.B SCTP_BINDX_ADD_ADDR
50or
51.B SCTP_BINDX_REM_ADDR.
52An application can use
53.B SCTP_BINDX_ADD_ADDR
54to associate additional addresses with an endpoint after calling
55.BR bind(2).
56.B SCTP_BINDX_REM_ADDR
57directs SCTP to remove the given addresses from the association.
58A caller may not remove all addresses from an association. It will
59fail with
60.B EINVAL.
61.SH "RETURN VALUE"
62On success, 0 is returned. On failure, \-1 is returned, and
63.I errno
64is set appropriately.
65.SH ERRORS
66.TP
67.B EBADF
68.I sd
69is not a valid descriptor.
70.TP
71.B ENOTSOCK
72.I sd
73is a descriptor for a file, not a socket.
74.TP
75.B EFAULT
76Error while copying in or out from the user address space.
77.TP
78.B EINVAL
79Invalid port or address or trying to remove all addresses from an association.
80.TP
81.B EACCES
82The address is protected, and the user is not the super-user.
83.SH "SEE ALSO"
84.BR sctp (7)
85.BR sctp_sendmsg (3),
86.BR sctp_sendv (3),
87.BR sctp_send (3),
88.BR sctp_recvmsg (3),
89.BR sctp_recvv (3),
90.BR sctp_peeloff (3),
91.BR sctp_getpaddrs (3),
92.BR sctp_getladdrs (3),
93.BR sctp_opt_info (3),
94.BR sctp_connectx (3)