1sctp_bindx(3SOCKET) Sockets Library Functions sctp_bindx(3SOCKET)
2
3
4
6 sctp_bindx - add or remove IP addresses to or from an SCTP socket
7
9 cc [ flag... ] file... -lsocket -lnsl -lsctp [ library... ]
10 #include <sys/types.h>
11 #include <sys/socket.h>
12 #include <netinet/sctp.h>
13
14 int sctp_bindx(int sock, void *addrs, int addrcnt, int flags);
15
16
18 The sctp_bindx() function adds or removes addresses to or from an SCTP
19 socket. If sock is an Internet Protocol Version 4 (IPv4) socket, addrs
20 should be an array of sockaddr_in structures containing IPv4 addresses.
21 If sock is an Internet Protocol Version 6 (IPv6) socket, addrs should
22 be an array of sockaddr_in6 structures containing IPv6 or IPv4-mapped
23 IPv6 addresses. The addrcnt is the number of array elements in addrs.
24 The family of the address type is used with addrcnt to determine the
25 size of the array.
26
27
28 The flags parameter is a bitmask that indicates whether addresses are
29 to be added or removed from a socket. The flags parameter is formed by
30 bitwise OR of zero or more of the following flags:
31
32 SCTP_BINDX_ADD_ADDR Indicates that addresses from addrs should be
33 added to the SCTP socket.
34
35
36 SCTP_BINDX_REM_ADDR Indicates that addresses from addrs should be
37 removed from the SCTP socket.
38
39
40
41 These two flags are mutually exclusive. If flags is formed by a bitwise
42 OR of both SCTP_BINDX_ADD_ADDR and SCTP_BINDX_REM_ADDR, the
43 sctp_bindx() function will fail.
44
45
46 Prior to calling sctp_bindx() on an SCTP endpoint, the endpoint should
47 be bound using bind(3SOCKET). On a listening socket, a special
48 INADDR_ANY value for IP or an unspecified address of all zeros for IPv6
49 can be used in addrs to add all IPv4 or IPv6 addresses on the system to
50 the socket. The sctp_bindx() function can also be used to add or remove
51 addresses to or from an established association. In such a case, mes‐
52 sages are exchanged between the SCTP endpoints to update the address
53 lists for that association if both endpoints support dynamic address
54 reconfiguration.
55
57 Upon successful completion, the sctp_bindx() function returns 0. Other‐
58 wise, the function returns -1 and sets errno to indicate the error.
59
61 The sctp_bindx() call fails under the following conditions.
62
63 EBADF The sock argument is an invalid file descriptor.
64
65
66 ENOTSOCK The sock argument is not a socket.
67
68
69 EINVAL One or more of the IPv4 or IPv6 addresses is invalid.
70
71
72 EINVAL The endpoint is not bound.
73
74
75 EINVAL The last address is requested to be removed from an estab‐
76 lished association.
77
78
80 See attributes(5) for descriptions of the following attributes:
81
82
83
84
85 ┌─────────────────────────────┬─────────────────────────────┐
86 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
87 ├─────────────────────────────┼─────────────────────────────┤
88 │Interface Stability │Committed │
89 ├─────────────────────────────┼─────────────────────────────┤
90 │MT-Level │Safe │
91 └─────────────────────────────┴─────────────────────────────┘
92
94 bind(3SOCKET), in.h(3HEAD), libsctp(3LIB), listen(3SOCKET), sctp_free‐
95 laddrs(3SOCKET), sctp_freepaddrs(3SOCKET), sctp_getladdrs(3SOCKET),
96 sctp_getpaddrs(3SOCKET), socket(3SOCKET), inet(7P), inet6(7P), ip(7P),
97 ip6(7P), sctp(7P)
98
100 IPv4-mapped addresses are not recommended.
101
102
103
104SunOS 5.11 22 Aug 2007 sctp_bindx(3SOCKET)