sctp_getpaddrs
![]() |
![]() |
![]() |
![]() |
sctp_getpaddrs()
Get all peer addresses in an association
Synopsis:
#include <netinet/sctp.h>
int sctp_getpaddrs(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 peer addresses, returned by the stack.
Library:
libsctp
Use the -l sctp option to qcc to link against this library.
Description:
The sctp_getpaddrs() function gets all peer addresses in an association.
On return, addrs points to a dynamically 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_getpaddrs() returns the number of peer addresses in the association. If there is no association, this function returns 0 and the value of *addrs is undefined.
If an error occurs, sctp_getpaddrs() returns -1, and the value of *addrs is undefined.
Errors:
- EINVAL
- The passed-in address is invalid.
- ENOMEM
- Can't allocate memory for the array of addresses.
Classification:
| Safety: | |
|---|---|
| Cancellation point | Yes |
| Interrupt handler | No |
| Signal handler | No |
| Thread | Yes |
See also:
SCTP, sctp_bindx(), sctp_connectx(), sctp_freeladdrs(), sctp_freepaddrs(), sctp_getladdrs(), sctp_peeloff(), sctp_recvmsg(), sctp_sendmsg()
![]() |
![]() |
![]() |
![]() |

![[Previous]](../prev.gif)
![[Contents]](../contents.gif)
![[Index]](../keyword_index.gif)
![[Next]](../next.gif)
