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

NAME

6       sctp_getladdrs,  sctp_freeladdrs  - returns all locally bound addresses
7       on an SCTP socket
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_getladdrs(int sock, sctp_assoc_t id, void **addrs);
16
17
18       void sctp_freeladdrs(void *addrs);
19
20

DESCRIPTION

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

RETURN VALUES

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

ERRORS

54       The sctp_getladdrs() call fails under the following conditions.
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 socket.
66
67

ATTRIBUTES

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

SEE ALSO

83       bind(3SOCKET),  in.h(3HEAD),  libsctp(3LIB),  sctp_freepaddrs(3SOCKET),
84       sctp_getpaddrs(3SOCKET),  socket(3SOCKET),   attributes(5),   inet(7P),
85       inet6(7P), ip(7P), ip6(7P), sctp(7P)
86
87
88
89SunOS 5.11                        23 Jan 2008          sctp_getladdrs(3SOCKET)
Impressum