| 1 |
.\" (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 |
| 10 |
sctp_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 |
| 22 |
adds or removes a set of bind addresses passed in the array |
| 23 |
.I addrs |
| 24 |
to/from the socket |
| 25 |
.I sd. |
| 26 |
.I addrcnt |
| 27 |
is the number of addresses in the array and the |
| 28 |
.I flags |
| 29 |
paramater indicates if the addresses need to be added or removed. |
| 30 |
.PP |
| 31 |
If |
| 32 |
.I sd |
| 33 |
is an IPv4 socket, the addresses passed must be IPv4 addresses. If |
| 34 |
.I sd |
| 35 |
is an IPv6 socket, the addresses passed can be either IPv4 or IPv6 |
| 36 |
addresses. |
| 37 |
.PP |
| 38 |
.I addrs |
| 39 |
is a pointer to an array of one or more socket addresses. Each address is |
| 40 |
contained in its appropriate structure(i.e. struct sockaddr_in or struct |
| 41 |
sockaddr_in6). The family of the address type must be used to distinguish |
| 42 |
the address length. The caller specifies the number of addresses in the |
| 43 |
array with |
| 44 |
.I addrcnt. |
| 45 |
.PP |
| 46 |
The |
| 47 |
.I flags |
| 48 |
parameter can be either |
| 49 |
.B SCTP_BINDX_ADD_ADDR |
| 50 |
or |
| 51 |
.B SCTP_BINDX_REM_ADDR. |
| 52 |
An application can use |
| 53 |
.B SCTP_BINDX_ADD_ADDR |
| 54 |
to associate additional addresses with an endpoint after calling |
| 55 |
.BR bind(2). |
| 56 |
.B SCTP_BINDX_REM_ADDR |
| 57 |
directs SCTP to remove the given addresses from the association. |
| 58 |
A caller may not remove all addresses from an association. It will |
| 59 |
fail with |
| 60 |
.B EINVAL. |
| 61 |
.SH "RETURN VALUE" |
| 62 |
On success, 0 is returned. On failure, \-1 is returned, and |
| 63 |
.I errno |
| 64 |
is set appropriately. |
| 65 |
.SH ERRORS |
| 66 |
.TP |
| 67 |
.B EBADF |
| 68 |
.I sd |
| 69 |
is not a valid descriptor. |
| 70 |
.TP |
| 71 |
.B ENOTSOCK |
| 72 |
.I sd |
| 73 |
is a descriptor for a file, not a socket. |
| 74 |
.TP |
| 75 |
.B EFAULT |
| 76 |
Error while copying in or out from the user address space. |
| 77 |
.TP |
| 78 |
.B EINVAL |
| 79 |
Invalid port or address or trying to remove all addresses from an association. |
| 80 |
.TP |
| 81 |
.B EACCES |
| 82 |
The 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) |