1sctp_getpaddrs(3SOCKET)    Sockets Library Functions   sctp_getpaddrs(3SOCKET)
2
3
4

NAME

6       sctp_getpaddrs, sctp_freepaddrs - returns all peer addresses on an SCTP
7       association
8

SYNOPSIS

10       cc [ flag... ] file... -lsocket  -lnsl   -lsctp  [ library... ]
11       #include <sys/types.h>
12       #include <sys/socket.h>
13       #include <netinet/sctp.h>
14
15       int sctp_getpaddrs(int sock, sctp_assoc_t id, void **addrs);
16
17
18       void sctp_freepaddrs(void *addrs);
19
20

DESCRIPTION

22       The sctp_getpaddrs() queries the peer addresses in an SCTP association.
23       The sctp_freepaddrs() function releases resources that are allocated to
24       hold the addresses.
25
26
27       The sctp_getpaddrs() function returns all the  peer  addresses  in  the
28       SCTP  association  identified  by sock. On completion addrs points to a
29       dynamically allocated array of sockaddr_in structures for  an  Internet
30       Protocol  (IPv4)  socket  or an array of sockaddr_in6 structures for an
31       Internet Protocol Version 6 (IPv6) socket. The addrs parameter must not
32       be  NULL.  For an IPv4 SCTP socket, the addresses returned in the sock‐
33       addr_in structures are IPv4 addresses. For an  IPv6  SCTP  socket,  the
34       addresses  in  the  sockaddr_in6  structures  can  be IPv6 addresses or
35       IPv4-mapped IPv6 addresses.
36
37
38       If sock is a one-to-many style SCTP socket, id specifies  the  associa‐
39       tion  of  interest.  If  sock  is a one-to-one style SCTP socket, id is
40       ignored.
41
42
43       The  sctp_freepaddrs()  function  frees  the  resources  allocated   by
44       sctp_getpaddrs().  The  addrs parameter is the array of addresses allo‐
45       cated by sctp_getpaddrs().
46

RETURN VALUES

48       Upon successful completion, the sctp_getpaddrs() function  returns  the
49       number of addresses in the addrs array. Otherwise, the function returns
50       -1 and sets errno to indicate the error.
51

ERRORS

53       The sctp_getpaddrs() succeeds unless one of  the  following  conditions
54       exist.
55
56       EBADF       The sock argument is an invalid file descriptor.
57
58
59       ENOTSOCK    The sock argument is not a socket.
60
61
62       EINVAL      The addrs argument is NULL.
63
64
65       EINVAL      The  id argument is an invalid association identifier for a
66                   one-to-many style STP socket.
67
68
69       ENOTCONN    The specified socket is not connected.
70
71

ATTRIBUTES

73       See attributes(5) for descriptions of the following attributes:
74
75
76
77
78       ┌─────────────────────────────┬─────────────────────────────┐
79       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
80       ├─────────────────────────────┼─────────────────────────────┤
81       │Interface Stability          │Committed                    │
82       ├─────────────────────────────┼─────────────────────────────┤
83       │MT-Level                     │Safe                         │
84       └─────────────────────────────┴─────────────────────────────┘
85

SEE ALSO

87       bind(3SOCKET),  in.h(3HEAD),  libsctp(3LIB),  sctp_freeladdrs(3SOCKET),
88       sctp_getladdrs(3SOCKET),   socket(3SOCKET),   attributes(5),  inet(7P),
89       inet6(7P), ip(7P), ip6(7P), sctp(7P)
90
91
92
93SunOS 5.11                        23 Jan 2008          sctp_getpaddrs(3SOCKET)
Impressum