1sctp_opt_info(3SOCKET) Sockets Library Functions sctp_opt_info(3SOCKET)
2
3
4
6 sctp_opt_info - examine SCTP level options for an SCTP endpoint
7
9 cc [ flag... ] file... -lsocket -lnsl -lsctp [ library... ]
10 #include <sys/types.h>
11 #include <sys/socket.h>
12 #include <netinet/sctp.h>
13
14 int sctp_opt_info(int sock, sctp_assoc_t id, int opt, void *arg,
15 socklen_t *len);
16
17
19 The sctp_opt_info() returns SCTP level options associated with the SCTP
20 socket sock. If sock is a one-to-many style socket, id refers to the
21 association of interest. If sock is a one-to-one socket or if sock is a
22 branched-off one-to-many style socket, id is ignored. The opt parameter
23 specifies the SCTP option to get. The arg structure is an option-spe‐
24 cific structure buffer allocated by the caller. The len parameter is
25 the length of the option specified.
26
27
28 Following are the currently supported values for the opt parameter.
29 When one of the options below specifies an association id, the id is
30 relevant for only one-to-many style SCTP sockets. The associatation id
31 can be ignored for one-to-one style or branched-off one-to-many style
32 SCTP sockets.
33
34 SCTP_RTOINFO Returns the protocol parameters used to ini‐
35 tialize and bind retransmission timeout
36 (RTO) tunable. The following structure is
37 used to access these parameters:
38
39 struct sctp_rtoinfo {
40 sctp_assoc_t srto_assoc_id;
41 uint32_t srto_initial;
42 uint32_t srto_max;
43 uint32_t srto_min;
44 };
45 where:
46 srto_assoc_id Association ID specified by the caller
47 srto_initial Initial RTO value
48 srto_max Maximum value for the RTO
49 srto_min Minimum value for the RTO
50
51
52
53 SSCTP_ASSOCINFO Returns association-specific parameters. The
54 following structure is used to access the
55 parameters:
56
57 struct sctp_assocparams {
58 sctp_assoc_t sasoc_assoc_id;
59 uint16_t sasoc_asocmaxrxt;
60 uint16_t sasoc_number_peer_destinations;
61 uint32_t sasoc_peer_rwnd;
62 uint32_t sasoc_local_rwnd;
63 uint32_t sasoc_cookie_life;
64 };
65 where:
66 srto_assoc_id Association ID specified by the caller
67 sasoc_asocmaxrxt Maximum retransmission count for
68 the association
69 sasoc_number_peer_destinations
70 Number of addresses the peer has
71 sasoc_peer_rwnd Current value of the peer's
72 receive window
73 sasoc_local_rwnd Last reported receive window sent
74 to the peer
75 sasoc_cookie_life Association cookie lifetime used
76 when issuing cookies
77
78 All parameters with time values are in mil‐
79 liseconds.
80
81
82 SCTP_DEFAULT_SEND_PARAM Returns the default set of parameters used
83 by the sendto() function on this associa‐
84 tion. The following structure is used to
85 access the parameters:
86
87 struct sctp_sndrcvinfo {
88 uint16_t sinfo_stream;
89 uint16_t sinfo_ssn;
90 uint16_t sinfo_flags;
91 uint32_t sinfo_ppid;
92 uint32_t sinfo_context;
93 uint32_t sinfo_timetolive;
94 uint32_t sinfo_tsn;
95 uint32_t sinfo_cumtsn;
96 sctp_assoc_t sinfo_assoc_id;
97 };
98 where:
99 sinfo_stream Default stream for sendmsg()
100 sinfo_ssn Always returned as 0
101 sinfo_flags Default flags for sendmsg()
102 that include the following:
103 MSG_UNORDERED
104 MSG_ADDR_OVER
105 MSG_ABORT
106 MSG_EOF
107 MSG_PR_SCTP
108 sinfo_ppid Default payload protocol identifier
109 for sendmsg()
110 sinfo_context Default context for sendmsg()
111 sinfo_timetolive Time to live in milliseconds for a
112 message on the sending side.
113 The message expires if the sending
114 side does not start the first
115 transmission for the message within
116 the specified time period. If the
117 sending side starts the first
118 transmission before the time period
119 expires, the message is sent as a
120 normal reliable message. A value of
121 0 indicates that the message does not
122 expire. When MSG_PR_SCTP is set in
123 sinfo_flags, the message expires if
124 it is not acknowledged within the
125 time period.
126 sinfo_tsn Always returned as 0
127 sinfo_cumtsn Always returned as 0
128 sinfo_assoc_id Association ID specified by the caller
129
130
131
132 SCTP_PEER_ADDR_PARAMS Returns the parameters for a specified peer
133 address of the association. The following
134 structure is used to access the parameters:
135
136 struct sctp_paddrparams {
137 sctp_assoc_t spp_assoc_id;
138 struct sockaddr_storage spp_address;
139 uint32_t spp_hbinterval;
140 uint16_t spp_pathmaxrxt;
141 };
142 where:
143 spp_assoc_id Association ID specified by the caller
144 spp_address Peer's address
145 spp_hbinterval Heartbeat interval in milliseconds
146 spp_pathmaxrxt Maximum number of retransmissions
147 to an address before it is
148 considered unreachable
149
150
151
152 SCTP_STATUS Returns the current status information about
153 the association. The following structure is
154 used to access the parameters:
155
156 struct sctp_status {
157 sctp_assoc_t sstat_assoc_id;
158 int32_t sstat_state;
159 uint32_t sstat_rwnd;
160 uint16_t sstat_unackdata;
161 uint16_t sstat_penddata;
162 uint16_t sstat_instrms;
163 uint16_t sstat_outstrms;
164 uint16_t sstat_fragmentation_point;
165 struct sctp_paddrinfo sstat_primary;
166 };
167 where:
168
169 sstat_assoc_id Association ID specifed by the caller
170 sstat_state Current state of the association
171 which might be one of the following:
172
173 SCTP_CLOSED
174 SCTP_BOUND
175 SCTP_LISTEN
176 SCTP_COOKIE_WAIT
177 SCTP_COOKIE_ECHOED
178 SCTP_ESTABLISHED
179 SCTP_SHUTDOWN_PENDING
180 SCTP_SHUTDOWN_SENT
181 SCTP_SHUTDOWN_RECEIVED
182 SCTP_SHUTDOWN_ACK_SENT
183 sstat_rwnd Current receive window of the
184 association peer
185 sstat_unackdata Number of unacked DATA chunks
186 sstat_penddata Number of DATA chunks pending
187 receipt
188 sstat_instrms Number of inbound streams
189 sstat_outstrms Number of outbound streams
190 sstat_fragmentation_point
191 Size at which SCTP fragmentation occurs
192 sstat_primary Information about the primary
193 peer address
194
195 sstat_primary has the following structure
196 struct sctp_paddrinfo {
197 sctp_assoc_t spinfo_assoc_id;
198 struct sockaddr_storage spinfo_address;
199 int32_t spinfo_state;
200 uint32_t spinfo cwnd;
201 uint32_t spinfo_srtt;
202 uint32_t spinfo_rto;
203 uint32_t spinfo_mtu;
204 };
205 where:
206 spinfo_assoc_id Association ID
207 specified by
208 the caller
209 spinfo_address Primary peer
210 address
211 spinfo_state State of the peer
212 address:
213 SCTP_ACTIVE or
214 SCTP_INACTIVE
215 spinfo_cwnd Congestion window
216 of the peer
217 address
218 spinfo_srtt Smoothed round-trip
219 time calculation of
220 the peer address
221 spinfo_rto Current retransmission
222 timeout value of the
223 peer address in
224 milliseconds
225 spinfo_mtu P-MTU of the address
226
227
228
230 Upon successful completion, the sctp_opt_info() function returns 0.
231 Otherwise, the function returns -1 and sets errno to indicate the
232 error.
233
235 The sctp_opt_info() call fails under the following conditions.
236
237 EBADF The sock argument is an invalid file descriptor.
238
239
240 ENOTSOCK The sock argument is not a socket.
241
242
243 EINVAL The association id is invalid for a one-to-many style
244 SCTP socket.
245
246
247 EINVAL The input buffer length is insufficient for the option
248 specified.
249
250
251 EINVAL The peer address is invalid or does not belong to the
252 association.
253
254
255 EAFNOSUPPORT The address family for the peer's address is other than
256 AF_INET or AF_INET6.
257
258
260 See attributes(5) for descriptions of the following attributes:
261
262
263
264
265 ┌─────────────────────────────┬─────────────────────────────┐
266 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
267 ├─────────────────────────────┼─────────────────────────────┤
268 │Interface Stability │Evolving │
269 ├─────────────────────────────┼─────────────────────────────┤
270 │MT-Level │Safe │
271 └─────────────────────────────┴─────────────────────────────┘
272
274 in.h(3HEAD), libsctp(3LIB), getsockopt(3SOCKET), setsockopt(3SOCKET),
275 socket(3SOCKET), inet(7P), inet6(7P), ip(7P), ip6(7P), sctp(7P)
276
277
278
279SunOS 5.11 25 Feb 2005 sctp_opt_info(3SOCKET)