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