Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

sctp_getladdrs()

Get all locally bound addresses on a socket

Synopsis:

#include <netinet/sctp.h>

int sctp_getladdrs(int sd, 
                   sctp_assoc_t  id, 
                   struct sockaddr **addrs);

Arguments:

sd
Socket descriptor.
id
Specifies the association for one-to-many style sockets. It is ignored for one-to-one style sockets.
addrs
A pointer to an array of local addresses, returned by the stack.

Library:

libsctp

Use the -l sctp option to qcc to link against this library.

Description:

The sctp_getladdrs() function gets all locally bound addresses on a socket.

On return, addrs points to a dynamically allocated packed array of sockaddr structures of the appropriate type for each address. Use sctp_freepaddrs() to free the memory. Note that the in-and-out parameter addrs must not be NULL.

Returns:

On success, sctp_getladdrs() returns the number of local addresses bound to the socket. If the socket is unbound, sctp_getladdrs() returns 0, and the value of *addrs is undefined.

If an error occurs, sctp_getladdrs() returns -1, and the value of *addrs is undefined.

Errors:

EINVAL
The address is invalid.
ENOTCONN
The socket isn't bound.
ENOMEM
Can't allocate memory for the array of addresses.

Classification:

SCTP

Safety:
Cancellation point Yes
Interrupt handler No
Signal handler No
Thread Yes

See also:

SCTP, sctp_bindx(), sctp_connectx(), sctp_freeladdrs(), sctp_freepaddrs(), sctp_getpaddrs(), sctp_peeloff(), sctp_recvmsg(), sctp_sendmsg()