blob: 9167dfca6ab52f4540f8b354bac0a545f3656dce [file] [log] [blame]
Austin Schuh8d0a2852019-12-28 22:54:28 -08001.\" (C) Copyright Sridhar Samudrala IBM Corp. 2004, 2005.
2.\"
3.\" Permission is granted to distribute possibly modified copies
4.\" of this manual provided the header is included verbatim,
5.\" and in case of nontrivial modification author and date
6.\" of the modification is added to the header.
7.\"
8.TH SCTP_GETPADDRS 3 2005-10-25 "Linux 2.6" "Linux Programmer's Manual"
9.SH NAME
10sctp_getpaddrs \- Returns all peer addresses in an association.
11.SH SYNOPSIS
12.nf
13.B #include <sys/types.h>
14.B #include <sys/socket.h>
15.B #include <netinet/sctp.h>
16.sp
17.BI "int sctp_getpaddrs(int " sd ", sctp_assoc_t " assoc_id ,
18.BI " struct sockaddr **" addrs );
19.sp
20.BI "void sctp_freepaddrs(struct sockaddr *" addrs );
21.fi
22.SH DESCRIPTION
23.BR sctp_getpaddrs
24returns all peer addresses in an association. On return,
25.I addrs
26will point to a dynamically allocated packed array of
27.B sockaddr
28structures of the appropriate type for each address. The caller should use
29.BR sctp_freepaddrs
30to free the memory. Note that the in/out parameter
31.I addrs
32must not be NULL.
33.PP
34If
35.I sd
36is an IPv4 socket, the addresses returned will be all IPv4 addresses. If
37.I sd
38is an IPv6 socket, the addresses returned can be a mix of IPv4 or IPv6
39addresses.
40.PP
41For one-to-many style sockets,
42.I id
43specifies the association to query. For one-to-one style sockets,
44.I id
45is ignored.
46.PP
47.BR sctp_freepaddrs
48frees all the resources allocated by
49.BR sctp_getpaddrs.
50.SH "RETURN VALUE"
51On success,
52.BR sctp_getpaddrs
53returns the number of peer addresses in the association. If there is no
54association on this socket, 0 is returned and the value of
55.I *addrs
56is undefined. On error,
57.BR sctp_getpaddrs
58returns -1 and the value of
59.I *addrs
60is undefined.
61.SH "SEE ALSO"
62.BR sctp (7)
63.BR sctp_bindx (3),
64.BR sctp_connectx (3),
65.BR sctp_sendmsg (3),
66.BR sctp_sendv (3),
67.BR sctp_send (3),
68.BR sctp_recvmsg (3),
69.BR sctp_recvv (3),
70.BR sctp_peeloff (3),
71.BR sctp_getladdrs (3),
72.BR sctp_opt_info (3),