Add or remove one or more given addresses from an association
#include <netinet/sctp.h>
int sctp_bindx(int sd,
struct sockaddr *addrs,
int addrcnt,
int flags);
- sd
- Socket descriptor. Depending on the type of sd, the type of address
is determined. If sd is an IPv4 socket, the address passed is
an IPv4 address. If sd is an IPv6 socket,
the address passed is either an IPv4 or an IPv6 address.
A single address is specified as INADDR_ANY or IN6ADDR_ANY.
- addrs
- 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. This
representation is termed a "packed array" of addresses.
- addrcnt
- Number of addresses in the array.
- flags
- Either SCTP_BINDX_ADD_ADDR or SCTP_BINDX_REM_ADDR.
libsctp
Use the -l sctp option to
qcc
to link against this library.
The sctp_bindx() function adds or removes one or more addresses
to or from an association:
- Use SCTP_BINDX_ADD_ADDR to associate
additional addresses with an endpoint after calling
bind().
- Use SCTP_BINDX_REM_ADDR to remove some addresses that
a listening socket is associated with, so that no new association will be
associated with those addresses.
If the endpoint supports dynamic
addressing, adding or removing an address may cause an
endpoint to send the appropriate message to change the
peer's address lists.
- 0
- Success.
- -1
- Failure; errno is
set.
- EFAULT
- Passed-in flag was neither SCTP_BINDX_ADD_ADDR nor SCTP_BINDX_REM_ADDR.
- EINVAL
- Passed-in address has a wrong family.
SCTP
Safety: | |
Cancellation point |
Yes |
Interrupt handler |
No |
Signal handler |
No |
Thread |
Yes |
SCTP,
sctp_connectx(),
sctp_freeladdrs(),
sctp_freepaddrs(),
sctp_getladdrs(),
sctp_getpaddrs(),
sctp_peeloff(),
sctp_recvmsg(),
sctp_sendmsg()