Deleted Added
full compact
sctp_header.h (169382) sctp_header.h (170606)
1/*-
2 * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 *
7 * a) Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.

--- 17 unchanged lines hidden (view full) ---

26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28 * THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31/* $KAME: sctp_header.h,v 1.14 2005/03/06 16:04:17 itojun Exp $ */
32
33#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 *
7 * a) Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.

--- 17 unchanged lines hidden (view full) ---

26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28 * THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31/* $KAME: sctp_header.h,v 1.14 2005/03/06 16:04:17 itojun Exp $ */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/netinet/sctp_header.h 169382 2007-05-08 17:01:12Z rrs $");
34__FBSDID("$FreeBSD: head/sys/netinet/sctp_header.h 170606 2007-06-12 11:21:00Z rrs $");
35
36#ifndef __sctp_header_h__
37#define __sctp_header_h__
38
39
40#include <sys/time.h>
41#include <netinet/sctp.h>
42#include <netinet/sctp_constants.h>
43
35
36#ifndef __sctp_header_h__
37#define __sctp_header_h__
38
39
40#include <sys/time.h>
41#include <netinet/sctp.h>
42#include <netinet/sctp_constants.h>
43
44
44/*
45 * Parameter structures
46 */
47struct sctp_ipv4addr_param {
48 struct sctp_paramhdr ph;/* type=SCTP_IPV4_PARAM_TYPE, len=8 */
49 uint32_t addr; /* IPV4 address */
45/*
46 * Parameter structures
47 */
48struct sctp_ipv4addr_param {
49 struct sctp_paramhdr ph;/* type=SCTP_IPV4_PARAM_TYPE, len=8 */
50 uint32_t addr; /* IPV4 address */
50};
51} SCTP_PACKED;
51
52#define SCTP_V6_ADDR_BYTES 16
53
54
55struct sctp_ipv6addr_param {
56 struct sctp_paramhdr ph;/* type=SCTP_IPV6_PARAM_TYPE, len=20 */
57 uint8_t addr[SCTP_V6_ADDR_BYTES]; /* IPV6 address */
52
53#define SCTP_V6_ADDR_BYTES 16
54
55
56struct sctp_ipv6addr_param {
57 struct sctp_paramhdr ph;/* type=SCTP_IPV6_PARAM_TYPE, len=20 */
58 uint8_t addr[SCTP_V6_ADDR_BYTES]; /* IPV6 address */
58};
59} SCTP_PACKED;
59
60/* Cookie Preservative */
61struct sctp_cookie_perserve_param {
62 struct sctp_paramhdr ph;/* type=SCTP_COOKIE_PRESERVE, len=8 */
63 uint32_t time; /* time in ms to extend cookie */
64};
65
66#define SCTP_ARRAY_MIN_LEN 1
67/* Host Name Address */
68struct sctp_host_name_param {
69 struct sctp_paramhdr ph;/* type=SCTP_HOSTNAME_ADDRESS */
70 char name[SCTP_ARRAY_MIN_LEN]; /* host name */
60
61/* Cookie Preservative */
62struct sctp_cookie_perserve_param {
63 struct sctp_paramhdr ph;/* type=SCTP_COOKIE_PRESERVE, len=8 */
64 uint32_t time; /* time in ms to extend cookie */
65};
66
67#define SCTP_ARRAY_MIN_LEN 1
68/* Host Name Address */
69struct sctp_host_name_param {
70 struct sctp_paramhdr ph;/* type=SCTP_HOSTNAME_ADDRESS */
71 char name[SCTP_ARRAY_MIN_LEN]; /* host name */
71};
72} SCTP_PACKED;
72
73/*
74 * This is the maximum padded size of a s-a-p
75 * so paramheadr + 3 address types (6 bytes) + 2 byte pad = 12
76 */
77#define SCTP_MAX_ADDR_PARAMS_SIZE 12
78/* supported address type */
79struct sctp_supported_addr_param {
80 struct sctp_paramhdr ph;/* type=SCTP_SUPPORTED_ADDRTYPE */
81 uint16_t addr_type[SCTP_ARRAY_MIN_LEN]; /* array of supported address
82 * types */
73
74/*
75 * This is the maximum padded size of a s-a-p
76 * so paramheadr + 3 address types (6 bytes) + 2 byte pad = 12
77 */
78#define SCTP_MAX_ADDR_PARAMS_SIZE 12
79/* supported address type */
80struct sctp_supported_addr_param {
81 struct sctp_paramhdr ph;/* type=SCTP_SUPPORTED_ADDRTYPE */
82 uint16_t addr_type[SCTP_ARRAY_MIN_LEN]; /* array of supported address
83 * types */
83};
84} SCTP_PACKED;
84
85/* ECN parameter */
86struct sctp_ecn_supported_param {
87 struct sctp_paramhdr ph;/* type=SCTP_ECN_CAPABLE */
85
86/* ECN parameter */
87struct sctp_ecn_supported_param {
88 struct sctp_paramhdr ph;/* type=SCTP_ECN_CAPABLE */
88};
89} SCTP_PACKED;
89
90
91/* heartbeat info parameter */
92struct sctp_heartbeat_info_param {
93 struct sctp_paramhdr ph;
94 uint32_t time_value_1;
95 uint32_t time_value_2;
96 uint32_t random_value1;
97 uint32_t random_value2;
98 uint16_t user_req;
99 uint8_t addr_family;
100 uint8_t addr_len;
101 char address[SCTP_ADDRMAX];
90
91
92/* heartbeat info parameter */
93struct sctp_heartbeat_info_param {
94 struct sctp_paramhdr ph;
95 uint32_t time_value_1;
96 uint32_t time_value_2;
97 uint32_t random_value1;
98 uint32_t random_value2;
99 uint16_t user_req;
100 uint8_t addr_family;
101 uint8_t addr_len;
102 char address[SCTP_ADDRMAX];
102};
103} SCTP_PACKED;
103
104
105/* draft-ietf-tsvwg-prsctp */
106/* PR-SCTP supported parameter */
107struct sctp_prsctp_supported_param {
108 struct sctp_paramhdr ph;
104
105
106/* draft-ietf-tsvwg-prsctp */
107/* PR-SCTP supported parameter */
108struct sctp_prsctp_supported_param {
109 struct sctp_paramhdr ph;
109};
110} SCTP_PACKED;
110
111
112/* draft-ietf-tsvwg-addip-sctp */
113struct sctp_asconf_paramhdr { /* an ASCONF "parameter" */
114 struct sctp_paramhdr ph;/* a SCTP parameter header */
115 uint32_t correlation_id;/* correlation id for this param */
111
112
113/* draft-ietf-tsvwg-addip-sctp */
114struct sctp_asconf_paramhdr { /* an ASCONF "parameter" */
115 struct sctp_paramhdr ph;/* a SCTP parameter header */
116 uint32_t correlation_id;/* correlation id for this param */
116};
117} SCTP_PACKED;
117
118struct sctp_asconf_addr_param { /* an ASCONF address parameter */
119 struct sctp_asconf_paramhdr aph; /* asconf "parameter" */
120 struct sctp_ipv6addr_param addrp; /* max storage size */
118
119struct sctp_asconf_addr_param { /* an ASCONF address parameter */
120 struct sctp_asconf_paramhdr aph; /* asconf "parameter" */
121 struct sctp_ipv6addr_param addrp; /* max storage size */
121};
122} SCTP_PACKED;
122
123struct sctp_asconf_addrv4_param { /* an ASCONF address (v4) parameter */
124 struct sctp_asconf_paramhdr aph; /* asconf "parameter" */
125 struct sctp_ipv4addr_param addrp; /* max storage size */
123
124struct sctp_asconf_addrv4_param { /* an ASCONF address (v4) parameter */
125 struct sctp_asconf_paramhdr aph; /* asconf "parameter" */
126 struct sctp_ipv4addr_param addrp; /* max storage size */
126};
127} SCTP_PACKED;
127
128#define SCTP_MAX_SUPPORTED_EXT 256
129
130struct sctp_supported_chunk_types_param {
131 struct sctp_paramhdr ph;/* type = 0x8008 len = x */
132 uint8_t chunk_types[0];
128
129#define SCTP_MAX_SUPPORTED_EXT 256
130
131struct sctp_supported_chunk_types_param {
132 struct sctp_paramhdr ph;/* type = 0x8008 len = x */
133 uint8_t chunk_types[0];
133};
134} SCTP_PACKED;
134
135
136/* ECN Nonce: draft-ladha-sctp-ecn-nonce */
137struct sctp_ecn_nonce_supported_param {
138 struct sctp_paramhdr ph;/* type = 0x8001 len = 4 */
135
136
137/* ECN Nonce: draft-ladha-sctp-ecn-nonce */
138struct sctp_ecn_nonce_supported_param {
139 struct sctp_paramhdr ph;/* type = 0x8001 len = 4 */
139};
140} SCTP_PACKED;
140
141
142/*
143 * Structures for DATA chunks
144 */
145struct sctp_data {
146 uint32_t tsn;
147 uint16_t stream_id;
148 uint16_t stream_sequence;
149 uint32_t protocol_id;
150 /* user data follows */
141
142
143/*
144 * Structures for DATA chunks
145 */
146struct sctp_data {
147 uint32_t tsn;
148 uint16_t stream_id;
149 uint16_t stream_sequence;
150 uint32_t protocol_id;
151 /* user data follows */
151};
152} SCTP_PACKED;
152
153struct sctp_data_chunk {
154 struct sctp_chunkhdr ch;
155 struct sctp_data dp;
153
154struct sctp_data_chunk {
155 struct sctp_chunkhdr ch;
156 struct sctp_data dp;
156};
157} SCTP_PACKED;
157
158/*
159 * Structures for the control chunks
160 */
161
162/* Initiate (INIT)/Initiate Ack (INIT ACK) */
163struct sctp_init {
164 uint32_t initiate_tag; /* initiate tag */
165 uint32_t a_rwnd; /* a_rwnd */
166 uint16_t num_outbound_streams; /* OS */
167 uint16_t num_inbound_streams; /* MIS */
168 uint32_t initial_tsn; /* I-TSN */
169 /* optional param's follow */
158
159/*
160 * Structures for the control chunks
161 */
162
163/* Initiate (INIT)/Initiate Ack (INIT ACK) */
164struct sctp_init {
165 uint32_t initiate_tag; /* initiate tag */
166 uint32_t a_rwnd; /* a_rwnd */
167 uint16_t num_outbound_streams; /* OS */
168 uint16_t num_inbound_streams; /* MIS */
169 uint32_t initial_tsn; /* I-TSN */
170 /* optional param's follow */
170};
171} SCTP_PACKED;
171
172#define SCTP_IDENTIFICATION_SIZE 16
173#define SCTP_ADDRESS_SIZE 4
172
173#define SCTP_IDENTIFICATION_SIZE 16
174#define SCTP_ADDRESS_SIZE 4
175#define SCTP_RESERVE_SPACE 6
174/* state cookie header */
175struct sctp_state_cookie { /* this is our definition... */
176 uint8_t identification[SCTP_IDENTIFICATION_SIZE]; /* id of who we are */
176/* state cookie header */
177struct sctp_state_cookie { /* this is our definition... */
178 uint8_t identification[SCTP_IDENTIFICATION_SIZE]; /* id of who we are */
179 struct timeval time_entered; /* the time I built cookie */
177 uint32_t cookie_life; /* life I will award this cookie */
178 uint32_t tie_tag_my_vtag; /* my tag in old association */
180 uint32_t cookie_life; /* life I will award this cookie */
181 uint32_t tie_tag_my_vtag; /* my tag in old association */
182
179 uint32_t tie_tag_peer_vtag; /* peers tag in old association */
180 uint32_t peers_vtag; /* peers tag in INIT (for quick ref) */
183 uint32_t tie_tag_peer_vtag; /* peers tag in old association */
184 uint32_t peers_vtag; /* peers tag in INIT (for quick ref) */
185
181 uint32_t my_vtag; /* my tag in INIT-ACK (for quick ref) */
186 uint32_t my_vtag; /* my tag in INIT-ACK (for quick ref) */
182 struct timeval time_entered; /* the time I built cookie */
183 uint32_t address[SCTP_ADDRESS_SIZE]; /* 4 ints/128 bits */
184 uint32_t addr_type; /* address type */
185 uint32_t laddress[SCTP_ADDRESS_SIZE]; /* my local from address */
186 uint32_t laddr_type; /* my local from address type */
187 uint32_t scope_id; /* v6 scope id for link-locals */
187 uint32_t address[SCTP_ADDRESS_SIZE]; /* 4 ints/128 bits */
188 uint32_t addr_type; /* address type */
189 uint32_t laddress[SCTP_ADDRESS_SIZE]; /* my local from address */
190 uint32_t laddr_type; /* my local from address type */
191 uint32_t scope_id; /* v6 scope id for link-locals */
192
188 uint16_t peerport; /* port address of the peer in the INIT */
189 uint16_t myport; /* my port address used in the INIT */
190 uint8_t ipv4_addr_legal;/* Are V4 addr legal? */
191 uint8_t ipv6_addr_legal;/* Are V6 addr legal? */
192 uint8_t local_scope; /* IPv6 local scope flag */
193 uint8_t site_scope; /* IPv6 site scope flag */
193 uint16_t peerport; /* port address of the peer in the INIT */
194 uint16_t myport; /* my port address used in the INIT */
195 uint8_t ipv4_addr_legal;/* Are V4 addr legal? */
196 uint8_t ipv6_addr_legal;/* Are V6 addr legal? */
197 uint8_t local_scope; /* IPv6 local scope flag */
198 uint8_t site_scope; /* IPv6 site scope flag */
199
194 uint8_t ipv4_scope; /* IPv4 private addr scope */
195 uint8_t loopback_scope; /* loopback scope information */
200 uint8_t ipv4_scope; /* IPv4 private addr scope */
201 uint8_t loopback_scope; /* loopback scope information */
196 uint16_t reserved;
202 uint8_t reserved[SCTP_RESERVE_SPACE]; /* Align to 64 bits */
197 /*
198 * at the end is tacked on the INIT chunk and the INIT-ACK chunk
199 * (minus the cookie).
200 */
203 /*
204 * at the end is tacked on the INIT chunk and the INIT-ACK chunk
205 * (minus the cookie).
206 */
201};
207} SCTP_PACKED;
202
203struct sctp_inv_mandatory_param {
204 uint16_t cause;
205 uint16_t length;
206 uint32_t num_param;
207 uint16_t param;
208 /*
209 * We include this to 0 it since only a missing cookie will cause
210 * this error.
211 */
212 uint16_t resv;
208
209struct sctp_inv_mandatory_param {
210 uint16_t cause;
211 uint16_t length;
212 uint32_t num_param;
213 uint16_t param;
214 /*
215 * We include this to 0 it since only a missing cookie will cause
216 * this error.
217 */
218 uint16_t resv;
213};
219} SCTP_PACKED;
214
215struct sctp_unresolv_addr {
216 uint16_t cause;
217 uint16_t length;
218 uint16_t addr_type;
219 uint16_t reserved; /* Only one invalid addr type */
220
221struct sctp_unresolv_addr {
222 uint16_t cause;
223 uint16_t length;
224 uint16_t addr_type;
225 uint16_t reserved; /* Only one invalid addr type */
220};
226} SCTP_PACKED;
221
222/* state cookie parameter */
223struct sctp_state_cookie_param {
224 struct sctp_paramhdr ph;
225 struct sctp_state_cookie cookie;
227
228/* state cookie parameter */
229struct sctp_state_cookie_param {
230 struct sctp_paramhdr ph;
231 struct sctp_state_cookie cookie;
226};
232} SCTP_PACKED;
227
228struct sctp_init_chunk {
229 struct sctp_chunkhdr ch;
230 struct sctp_init init;
233
234struct sctp_init_chunk {
235 struct sctp_chunkhdr ch;
236 struct sctp_init init;
231};
237} SCTP_PACKED;
232
233struct sctp_init_msg {
234 struct sctphdr sh;
235 struct sctp_init_chunk msg;
238
239struct sctp_init_msg {
240 struct sctphdr sh;
241 struct sctp_init_chunk msg;
236};
242} SCTP_PACKED;
237
238/* ... used for both INIT and INIT ACK */
239#define sctp_init_ack sctp_init
240#define sctp_init_ack_chunk sctp_init_chunk
241#define sctp_init_ack_msg sctp_init_msg
242
243
244/* Selective Ack (SACK) */
245struct sctp_gap_ack_block {
246 uint16_t start; /* Gap Ack block start */
247 uint16_t end; /* Gap Ack block end */
243
244/* ... used for both INIT and INIT ACK */
245#define sctp_init_ack sctp_init
246#define sctp_init_ack_chunk sctp_init_chunk
247#define sctp_init_ack_msg sctp_init_msg
248
249
250/* Selective Ack (SACK) */
251struct sctp_gap_ack_block {
252 uint16_t start; /* Gap Ack block start */
253 uint16_t end; /* Gap Ack block end */
248};
254} SCTP_PACKED;
249
250struct sctp_sack {
251 uint32_t cum_tsn_ack; /* cumulative TSN Ack */
252 uint32_t a_rwnd; /* updated a_rwnd of sender */
253 uint16_t num_gap_ack_blks; /* number of Gap Ack blocks */
254 uint16_t num_dup_tsns; /* number of duplicate TSNs */
255 /* struct sctp_gap_ack_block's follow */
256 /* uint32_t duplicate_tsn's follow */
255
256struct sctp_sack {
257 uint32_t cum_tsn_ack; /* cumulative TSN Ack */
258 uint32_t a_rwnd; /* updated a_rwnd of sender */
259 uint16_t num_gap_ack_blks; /* number of Gap Ack blocks */
260 uint16_t num_dup_tsns; /* number of duplicate TSNs */
261 /* struct sctp_gap_ack_block's follow */
262 /* uint32_t duplicate_tsn's follow */
257};
263} SCTP_PACKED;
258
259struct sctp_sack_chunk {
260 struct sctp_chunkhdr ch;
261 struct sctp_sack sack;
264
265struct sctp_sack_chunk {
266 struct sctp_chunkhdr ch;
267 struct sctp_sack sack;
262};
268} SCTP_PACKED;
263
264
265/* Heartbeat Request (HEARTBEAT) */
266struct sctp_heartbeat {
267 struct sctp_heartbeat_info_param hb_info;
269
270
271/* Heartbeat Request (HEARTBEAT) */
272struct sctp_heartbeat {
273 struct sctp_heartbeat_info_param hb_info;
268};
274} SCTP_PACKED;
269
270struct sctp_heartbeat_chunk {
271 struct sctp_chunkhdr ch;
272 struct sctp_heartbeat heartbeat;
275
276struct sctp_heartbeat_chunk {
277 struct sctp_chunkhdr ch;
278 struct sctp_heartbeat heartbeat;
273};
279} SCTP_PACKED;
274
275/* ... used for Heartbeat Ack (HEARTBEAT ACK) */
276#define sctp_heartbeat_ack sctp_heartbeat
277#define sctp_heartbeat_ack_chunk sctp_heartbeat_chunk
278
279
280/* Abort Asssociation (ABORT) */
281struct sctp_abort_chunk {
282 struct sctp_chunkhdr ch;
283 /* optional error cause may follow */
280
281/* ... used for Heartbeat Ack (HEARTBEAT ACK) */
282#define sctp_heartbeat_ack sctp_heartbeat
283#define sctp_heartbeat_ack_chunk sctp_heartbeat_chunk
284
285
286/* Abort Asssociation (ABORT) */
287struct sctp_abort_chunk {
288 struct sctp_chunkhdr ch;
289 /* optional error cause may follow */
284};
290} SCTP_PACKED;
285
286struct sctp_abort_msg {
287 struct sctphdr sh;
288 struct sctp_abort_chunk msg;
291
292struct sctp_abort_msg {
293 struct sctphdr sh;
294 struct sctp_abort_chunk msg;
289};
295} SCTP_PACKED;
290
291
292/* Shutdown Association (SHUTDOWN) */
293struct sctp_shutdown_chunk {
294 struct sctp_chunkhdr ch;
295 uint32_t cumulative_tsn_ack;
296
297
298/* Shutdown Association (SHUTDOWN) */
299struct sctp_shutdown_chunk {
300 struct sctp_chunkhdr ch;
301 uint32_t cumulative_tsn_ack;
296};
302} SCTP_PACKED;
297
298
299/* Shutdown Acknowledgment (SHUTDOWN ACK) */
300struct sctp_shutdown_ack_chunk {
301 struct sctp_chunkhdr ch;
303
304
305/* Shutdown Acknowledgment (SHUTDOWN ACK) */
306struct sctp_shutdown_ack_chunk {
307 struct sctp_chunkhdr ch;
302};
308} SCTP_PACKED;
303
304
305/* Operation Error (ERROR) */
306struct sctp_error_chunk {
307 struct sctp_chunkhdr ch;
308 /* optional error causes follow */
309
310
311/* Operation Error (ERROR) */
312struct sctp_error_chunk {
313 struct sctp_chunkhdr ch;
314 /* optional error causes follow */
309};
315} SCTP_PACKED;
310
311
312/* Cookie Echo (COOKIE ECHO) */
313struct sctp_cookie_echo_chunk {
314 struct sctp_chunkhdr ch;
315 struct sctp_state_cookie cookie;
316
317
318/* Cookie Echo (COOKIE ECHO) */
319struct sctp_cookie_echo_chunk {
320 struct sctp_chunkhdr ch;
321 struct sctp_state_cookie cookie;
316};
322} SCTP_PACKED;
317
318/* Cookie Acknowledgment (COOKIE ACK) */
319struct sctp_cookie_ack_chunk {
320 struct sctp_chunkhdr ch;
323
324/* Cookie Acknowledgment (COOKIE ACK) */
325struct sctp_cookie_ack_chunk {
326 struct sctp_chunkhdr ch;
321};
327} SCTP_PACKED;
322
323/* Explicit Congestion Notification Echo (ECNE) */
324struct sctp_ecne_chunk {
325 struct sctp_chunkhdr ch;
326 uint32_t tsn;
328
329/* Explicit Congestion Notification Echo (ECNE) */
330struct sctp_ecne_chunk {
331 struct sctp_chunkhdr ch;
332 uint32_t tsn;
327};
333} SCTP_PACKED;
328
329/* Congestion Window Reduced (CWR) */
330struct sctp_cwr_chunk {
331 struct sctp_chunkhdr ch;
332 uint32_t tsn;
334
335/* Congestion Window Reduced (CWR) */
336struct sctp_cwr_chunk {
337 struct sctp_chunkhdr ch;
338 uint32_t tsn;
333};
339} SCTP_PACKED;
334
335/* Shutdown Complete (SHUTDOWN COMPLETE) */
336struct sctp_shutdown_complete_chunk {
337 struct sctp_chunkhdr ch;
340
341/* Shutdown Complete (SHUTDOWN COMPLETE) */
342struct sctp_shutdown_complete_chunk {
343 struct sctp_chunkhdr ch;
338};
344} SCTP_PACKED;
339
340/* Oper error holding a stale cookie */
341struct sctp_stale_cookie_msg {
342 struct sctp_paramhdr ph;/* really an error cause */
343 uint32_t time_usec;
345
346/* Oper error holding a stale cookie */
347struct sctp_stale_cookie_msg {
348 struct sctp_paramhdr ph;/* really an error cause */
349 uint32_t time_usec;
344};
350} SCTP_PACKED;
345
346struct sctp_adaptation_layer_indication {
347 struct sctp_paramhdr ph;
348 uint32_t indication;
351
352struct sctp_adaptation_layer_indication {
353 struct sctp_paramhdr ph;
354 uint32_t indication;
349};
355} SCTP_PACKED;
350
351struct sctp_cookie_while_shutting_down {
352 struct sctphdr sh;
353 struct sctp_chunkhdr ch;
354 struct sctp_paramhdr ph;/* really an error cause */
356
357struct sctp_cookie_while_shutting_down {
358 struct sctphdr sh;
359 struct sctp_chunkhdr ch;
360 struct sctp_paramhdr ph;/* really an error cause */
355};
361} SCTP_PACKED;
356
357struct sctp_shutdown_complete_msg {
358 struct sctphdr sh;
359 struct sctp_shutdown_complete_chunk shut_cmp;
362
363struct sctp_shutdown_complete_msg {
364 struct sctphdr sh;
365 struct sctp_shutdown_complete_chunk shut_cmp;
360};
366} SCTP_PACKED;
361
362/*
363 * draft-ietf-tsvwg-addip-sctp
364 */
365/* Address/Stream Configuration Change (ASCONF) */
366struct sctp_asconf_chunk {
367 struct sctp_chunkhdr ch;
368 uint32_t serial_number;
369 /* lookup address parameter (mandatory) */
370 /* asconf parameters follow */
367
368/*
369 * draft-ietf-tsvwg-addip-sctp
370 */
371/* Address/Stream Configuration Change (ASCONF) */
372struct sctp_asconf_chunk {
373 struct sctp_chunkhdr ch;
374 uint32_t serial_number;
375 /* lookup address parameter (mandatory) */
376 /* asconf parameters follow */
371};
377} SCTP_PACKED;
372
373/* Address/Stream Configuration Acknowledge (ASCONF ACK) */
374struct sctp_asconf_ack_chunk {
375 struct sctp_chunkhdr ch;
376 uint32_t serial_number;
377 /* asconf parameters follow */
378
379/* Address/Stream Configuration Acknowledge (ASCONF ACK) */
380struct sctp_asconf_ack_chunk {
381 struct sctp_chunkhdr ch;
382 uint32_t serial_number;
383 /* asconf parameters follow */
378};
384} SCTP_PACKED;
379
380/* draft-ietf-tsvwg-prsctp */
381/* Forward Cumulative TSN (FORWARD TSN) */
382struct sctp_forward_tsn_chunk {
383 struct sctp_chunkhdr ch;
384 uint32_t new_cumulative_tsn;
385 /* stream/sequence pairs (sctp_strseq) follow */
385
386/* draft-ietf-tsvwg-prsctp */
387/* Forward Cumulative TSN (FORWARD TSN) */
388struct sctp_forward_tsn_chunk {
389 struct sctp_chunkhdr ch;
390 uint32_t new_cumulative_tsn;
391 /* stream/sequence pairs (sctp_strseq) follow */
386};
392} SCTP_PACKED;
387
388struct sctp_strseq {
389 uint16_t stream;
390 uint16_t sequence;
393
394struct sctp_strseq {
395 uint16_t stream;
396 uint16_t sequence;
391};
397} SCTP_PACKED;
392
393struct sctp_forward_tsn_msg {
394 struct sctphdr sh;
395 struct sctp_forward_tsn_chunk msg;
398
399struct sctp_forward_tsn_msg {
400 struct sctphdr sh;
401 struct sctp_forward_tsn_chunk msg;
396};
402} SCTP_PACKED;
397
398/* should be a multiple of 4 - 1 aka 3/7/11 etc. */
399
400#define SCTP_NUM_DB_TO_VERIFY 31
401
402struct sctp_chunk_desc {
403 uint8_t chunk_type;
404 uint8_t data_bytes[SCTP_NUM_DB_TO_VERIFY];
405 uint32_t tsn_ifany;
403
404/* should be a multiple of 4 - 1 aka 3/7/11 etc. */
405
406#define SCTP_NUM_DB_TO_VERIFY 31
407
408struct sctp_chunk_desc {
409 uint8_t chunk_type;
410 uint8_t data_bytes[SCTP_NUM_DB_TO_VERIFY];
411 uint32_t tsn_ifany;
406};
412} SCTP_PACKED;
407
408
409struct sctp_pktdrop_chunk {
410 struct sctp_chunkhdr ch;
411 uint32_t bottle_bw;
412 uint32_t current_onq;
413 uint16_t trunc_len;
414 uint16_t reserved;
415 uint8_t data[0];
413
414
415struct sctp_pktdrop_chunk {
416 struct sctp_chunkhdr ch;
417 uint32_t bottle_bw;
418 uint32_t current_onq;
419 uint16_t trunc_len;
420 uint16_t reserved;
421 uint8_t data[0];
416};
422} SCTP_PACKED;
417
418/**********STREAM RESET STUFF ******************/
419
420struct sctp_stream_reset_out_request {
421 struct sctp_paramhdr ph;
422 uint32_t request_seq; /* monotonically increasing seq no */
423 uint32_t response_seq; /* if a response, the resp seq no */
424 uint32_t send_reset_at_tsn; /* last TSN I assigned outbound */
425 uint16_t list_of_streams[0]; /* if not all list of streams */
423
424/**********STREAM RESET STUFF ******************/
425
426struct sctp_stream_reset_out_request {
427 struct sctp_paramhdr ph;
428 uint32_t request_seq; /* monotonically increasing seq no */
429 uint32_t response_seq; /* if a response, the resp seq no */
430 uint32_t send_reset_at_tsn; /* last TSN I assigned outbound */
431 uint16_t list_of_streams[0]; /* if not all list of streams */
426};
432} SCTP_PACKED;
427
428struct sctp_stream_reset_in_request {
429 struct sctp_paramhdr ph;
430 uint32_t request_seq;
431 uint16_t list_of_streams[0]; /* if not all list of streams */
433
434struct sctp_stream_reset_in_request {
435 struct sctp_paramhdr ph;
436 uint32_t request_seq;
437 uint16_t list_of_streams[0]; /* if not all list of streams */
432};
438} SCTP_PACKED;
433
434
435struct sctp_stream_reset_tsn_request {
436 struct sctp_paramhdr ph;
437 uint32_t request_seq;
439
440
441struct sctp_stream_reset_tsn_request {
442 struct sctp_paramhdr ph;
443 uint32_t request_seq;
438};
444} SCTP_PACKED;
439
440struct sctp_stream_reset_response {
441 struct sctp_paramhdr ph;
442 uint32_t response_seq; /* if a response, the resp seq no */
443 uint32_t result;
445
446struct sctp_stream_reset_response {
447 struct sctp_paramhdr ph;
448 uint32_t response_seq; /* if a response, the resp seq no */
449 uint32_t result;
444};
450} SCTP_PACKED;
445
446struct sctp_stream_reset_response_tsn {
447 struct sctp_paramhdr ph;
448 uint32_t response_seq; /* if a response, the resp seq no */
449 uint32_t result;
450 uint32_t senders_next_tsn;
451 uint32_t receivers_next_tsn;
451
452struct sctp_stream_reset_response_tsn {
453 struct sctp_paramhdr ph;
454 uint32_t response_seq; /* if a response, the resp seq no */
455 uint32_t result;
456 uint32_t senders_next_tsn;
457 uint32_t receivers_next_tsn;
452};
458} SCTP_PACKED;
453
454
455
456#define SCTP_STREAM_RESET_NOTHING 0x00000000 /* Nothing for me to do */
457#define SCTP_STREAM_RESET_PERFORMED 0x00000001 /* Did it */
458#define SCTP_STREAM_RESET_DENIED 0x00000002 /* refused to do it */
459#define SCTP_STREAM_RESET_ERROR_STR 0x00000003 /* bad Stream no */
460#define SCTP_STREAM_RESET_TRY_LATER 0x00000004 /* collision, try again */
461#define SCTP_STREAM_RESET_BAD_SEQNO 0x00000005 /* bad str-reset seq no */
462
463/*
464 * convience structures, note that if you are making a request for specific
465 * streams then the request will need to be an overlay structure.
466 */
467
468struct sctp_stream_reset_out_req {
469 struct sctp_chunkhdr ch;
470 struct sctp_stream_reset_out_request sr_req;
459
460
461
462#define SCTP_STREAM_RESET_NOTHING 0x00000000 /* Nothing for me to do */
463#define SCTP_STREAM_RESET_PERFORMED 0x00000001 /* Did it */
464#define SCTP_STREAM_RESET_DENIED 0x00000002 /* refused to do it */
465#define SCTP_STREAM_RESET_ERROR_STR 0x00000003 /* bad Stream no */
466#define SCTP_STREAM_RESET_TRY_LATER 0x00000004 /* collision, try again */
467#define SCTP_STREAM_RESET_BAD_SEQNO 0x00000005 /* bad str-reset seq no */
468
469/*
470 * convience structures, note that if you are making a request for specific
471 * streams then the request will need to be an overlay structure.
472 */
473
474struct sctp_stream_reset_out_req {
475 struct sctp_chunkhdr ch;
476 struct sctp_stream_reset_out_request sr_req;
471};
477} SCTP_PACKED;
472
473struct sctp_stream_reset_in_req {
474 struct sctp_chunkhdr ch;
475 struct sctp_stream_reset_in_request sr_req;
478
479struct sctp_stream_reset_in_req {
480 struct sctp_chunkhdr ch;
481 struct sctp_stream_reset_in_request sr_req;
476};
482} SCTP_PACKED;
477
478struct sctp_stream_reset_tsn_req {
479 struct sctp_chunkhdr ch;
480 struct sctp_stream_reset_tsn_request sr_req;
483
484struct sctp_stream_reset_tsn_req {
485 struct sctp_chunkhdr ch;
486 struct sctp_stream_reset_tsn_request sr_req;
481};
487} SCTP_PACKED;
482
483struct sctp_stream_reset_resp {
484 struct sctp_chunkhdr ch;
485 struct sctp_stream_reset_response sr_resp;
488
489struct sctp_stream_reset_resp {
490 struct sctp_chunkhdr ch;
491 struct sctp_stream_reset_response sr_resp;
486};
492} SCTP_PACKED;
487
488/* respone only valid with a TSN request */
489struct sctp_stream_reset_resp_tsn {
490 struct sctp_chunkhdr ch;
491 struct sctp_stream_reset_response_tsn sr_resp;
493
494/* respone only valid with a TSN request */
495struct sctp_stream_reset_resp_tsn {
496 struct sctp_chunkhdr ch;
497 struct sctp_stream_reset_response_tsn sr_resp;
492};
498} SCTP_PACKED;
493
494/****************************************************/
495
496/*
497 * Authenticated chunks support draft-ietf-tsvwg-sctp-auth
498 */
499
500/* Should we make the max be 32? */
501#define SCTP_RANDOM_MAX_SIZE 256
502struct sctp_auth_random {
503 struct sctp_paramhdr ph;/* type = 0x8002 */
504 uint8_t random_data[0];
499
500/****************************************************/
501
502/*
503 * Authenticated chunks support draft-ietf-tsvwg-sctp-auth
504 */
505
506/* Should we make the max be 32? */
507#define SCTP_RANDOM_MAX_SIZE 256
508struct sctp_auth_random {
509 struct sctp_paramhdr ph;/* type = 0x8002 */
510 uint8_t random_data[0];
505};
511} SCTP_PACKED;
506
507struct sctp_auth_chunk_list {
508 struct sctp_paramhdr ph;/* type = 0x8003 */
509 uint8_t chunk_types[0];
512
513struct sctp_auth_chunk_list {
514 struct sctp_paramhdr ph;/* type = 0x8003 */
515 uint8_t chunk_types[0];
510};
516} SCTP_PACKED;
511
512struct sctp_auth_hmac_algo {
513 struct sctp_paramhdr ph;/* type = 0x8004 */
514 uint16_t hmac_ids[0];
517
518struct sctp_auth_hmac_algo {
519 struct sctp_paramhdr ph;/* type = 0x8004 */
520 uint16_t hmac_ids[0];
515};
521} SCTP_PACKED;
516
517struct sctp_auth_chunk {
518 struct sctp_chunkhdr ch;
519 uint16_t shared_key_id;
520 uint16_t hmac_id;
521 uint8_t hmac[0];
522
523struct sctp_auth_chunk {
524 struct sctp_chunkhdr ch;
525 uint16_t shared_key_id;
526 uint16_t hmac_id;
527 uint8_t hmac[0];
522};
528} SCTP_PACKED;
523
524struct sctp_auth_invalid_hmac {
525 struct sctp_paramhdr ph;
526 uint16_t hmac_id;
527 uint16_t padding;
529
530struct sctp_auth_invalid_hmac {
531 struct sctp_paramhdr ph;
532 uint16_t hmac_id;
533 uint16_t padding;
528};
534} SCTP_PACKED;
529
530/*
531 * we pre-reserve enough room for a ECNE or CWR AND a SACK with no missing
532 * pieces. If ENCE is missing we could have a couple of blocks. This way we
533 * optimize so we MOST likely can bundle a SACK/ECN with the smallest size
534 * data chunk I will split into. We could increase throughput slightly by
535 * taking out these two but the 24-sack/8-CWR i.e. 32 bytes I pre-reserve I
536 * feel is worth it for now.

--- 43 unchanged lines hidden ---
535
536/*
537 * we pre-reserve enough room for a ECNE or CWR AND a SACK with no missing
538 * pieces. If ENCE is missing we could have a couple of blocks. This way we
539 * optimize so we MOST likely can bundle a SACK/ECN with the smallest size
540 * data chunk I will split into. We could increase throughput slightly by
541 * taking out these two but the 24-sack/8-CWR i.e. 32 bytes I pre-reserve I
542 * feel is worth it for now.

--- 43 unchanged lines hidden ---