xref: /freebsd/sys/netinet/sctp_header.h (revision 57718be8fa0bd5edc11ab9a72e68cc71982939a6)
1 /*-
2  * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved.
3  * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved.
4  * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are met:
8  *
9  * a) Redistributions of source code must retain the above copyright notice,
10  *    this list of conditions and the following disclaimer.
11  *
12  * b) Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in
14  *    the documentation and/or other materials provided with the distribution.
15  *
16  * c) Neither the name of Cisco Systems, Inc. nor the names of its
17  *    contributors may be used to endorse or promote products derived
18  *    from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30  * THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #include <sys/cdefs.h>
34 __FBSDID("$FreeBSD$");
35 
36 #ifndef _NETINET_SCTP_HEADER_H_
37 #define _NETINET_SCTP_HEADER_H_
38 
39 #include <sys/time.h>
40 #include <netinet/sctp.h>
41 #include <netinet/sctp_constants.h>
42 
43 #define SCTP_PACKED __attribute__((packed))
44 
45 /*
46  * Parameter structures
47  */
48 struct sctp_ipv4addr_param {
49 	struct sctp_paramhdr ph;/* type=SCTP_IPV4_PARAM_TYPE, len=8 */
50 	uint32_t addr;		/* IPV4 address */
51 }                   SCTP_PACKED;
52 
53 #define SCTP_V6_ADDR_BYTES 16
54 
55 
56 struct 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 */
59 }                   SCTP_PACKED;
60 
61 /* Cookie Preservative */
62 struct 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 }                          SCTP_PACKED;
66 
67 #define SCTP_ARRAY_MIN_LEN 1
68 /* Host Name Address */
69 struct sctp_host_name_param {
70 	struct sctp_paramhdr ph;/* type=SCTP_HOSTNAME_ADDRESS */
71 	char name[SCTP_ARRAY_MIN_LEN];	/* host name */
72 }                    SCTP_PACKED;
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 */
80 struct sctp_supported_addr_param {
81 	struct sctp_paramhdr ph;/* type=SCTP_SUPPORTED_ADDRTYPE */
82 	uint16_t addr_type[2];	/* array of supported address types */
83 }                         SCTP_PACKED;
84 
85 /* heartbeat info parameter */
86 struct sctp_heartbeat_info_param {
87 	struct sctp_paramhdr ph;
88 	uint32_t time_value_1;
89 	uint32_t time_value_2;
90 	uint32_t random_value1;
91 	uint32_t random_value2;
92 	uint8_t addr_family;
93 	uint8_t addr_len;
94 	/* make sure that this structure is 4 byte aligned */
95 	uint8_t padding[2];
96 	char address[SCTP_ADDRMAX];
97 }                         SCTP_PACKED;
98 
99 
100 /* draft-ietf-tsvwg-prsctp */
101 /* PR-SCTP supported parameter */
102 struct sctp_prsctp_supported_param {
103 	struct sctp_paramhdr ph;
104 }                           SCTP_PACKED;
105 
106 
107 /* draft-ietf-tsvwg-addip-sctp */
108 struct sctp_asconf_paramhdr {	/* an ASCONF "parameter" */
109 	struct sctp_paramhdr ph;/* a SCTP parameter header */
110 	uint32_t correlation_id;/* correlation id for this param */
111 }                    SCTP_PACKED;
112 
113 struct sctp_asconf_addr_param {	/* an ASCONF address parameter */
114 	struct sctp_asconf_paramhdr aph;	/* asconf "parameter" */
115 	struct sctp_ipv6addr_param addrp;	/* max storage size */
116 }                      SCTP_PACKED;
117 
118 
119 struct sctp_asconf_tag_param {	/* an ASCONF NAT-Vtag parameter */
120 	struct sctp_asconf_paramhdr aph;	/* asconf "parameter" */
121 	uint32_t local_vtag;
122 	uint32_t remote_vtag;
123 }                     SCTP_PACKED;
124 
125 
126 struct sctp_asconf_addrv4_param {	/* an ASCONF address (v4) parameter */
127 	struct sctp_asconf_paramhdr aph;	/* asconf "parameter" */
128 	struct sctp_ipv4addr_param addrp;	/* max storage size */
129 }                        SCTP_PACKED;
130 
131 #define SCTP_MAX_SUPPORTED_EXT 256
132 
133 struct sctp_supported_chunk_types_param {
134 	struct sctp_paramhdr ph;/* type = 0x8008  len = x */
135 	uint8_t chunk_types[];
136 }                                SCTP_PACKED;
137 
138 
139 /*
140  * Structures for DATA chunks
141  */
142 struct sctp_data {
143 	uint32_t tsn;
144 	uint16_t stream_id;
145 	uint16_t stream_sequence;
146 	uint32_t protocol_id;
147 	/* user data follows */
148 }         SCTP_PACKED;
149 
150 struct sctp_data_chunk {
151 	struct sctp_chunkhdr ch;
152 	struct sctp_data dp;
153 }               SCTP_PACKED;
154 
155 /*
156  * Structures for the control chunks
157  */
158 
159 /* Initiate (INIT)/Initiate Ack (INIT ACK) */
160 struct sctp_init {
161 	uint32_t initiate_tag;	/* initiate tag */
162 	uint32_t a_rwnd;	/* a_rwnd */
163 	uint16_t num_outbound_streams;	/* OS */
164 	uint16_t num_inbound_streams;	/* MIS */
165 	uint32_t initial_tsn;	/* I-TSN */
166 	/* optional param's follow */
167 }         SCTP_PACKED;
168 
169 #define SCTP_IDENTIFICATION_SIZE 16
170 #define SCTP_ADDRESS_SIZE 4
171 #define SCTP_RESERVE_SPACE 6
172 /* state cookie header */
173 struct sctp_state_cookie {	/* this is our definition... */
174 	uint8_t identification[SCTP_IDENTIFICATION_SIZE];	/* id of who we are */
175 	struct timeval time_entered;	/* the time I built cookie */
176 	uint32_t cookie_life;	/* life I will award this cookie */
177 	uint32_t tie_tag_my_vtag;	/* my tag in old association */
178 
179 	uint32_t tie_tag_peer_vtag;	/* peers tag in old association */
180 	uint32_t peers_vtag;	/* peers tag in INIT (for quick ref) */
181 
182 	uint32_t my_vtag;	/* my tag in INIT-ACK (for quick ref) */
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 */
188 
189 	uint16_t peerport;	/* port address of the peer in the INIT */
190 	uint16_t myport;	/* my port address used in the INIT */
191 	uint8_t ipv4_addr_legal;/* Are V4 addr legal? */
192 	uint8_t ipv6_addr_legal;/* Are V6 addr legal? */
193 	uint8_t local_scope;	/* IPv6 local scope flag */
194 	uint8_t site_scope;	/* IPv6 site scope flag */
195 
196 	uint8_t ipv4_scope;	/* IPv4 private addr scope */
197 	uint8_t loopback_scope;	/* loopback scope information */
198 	uint8_t reserved[SCTP_RESERVE_SPACE];	/* Align to 64 bits */
199 	/*
200 	 * at the end is tacked on the INIT chunk and the INIT-ACK chunk
201 	 * (minus the cookie).
202 	 */
203 }                 SCTP_PACKED;
204 
205 
206 /* Used for NAT state error cause */
207 struct sctp_missing_nat_state {
208 	uint16_t cause;
209 	uint16_t length;
210 	uint8_t data[];
211 }                      SCTP_PACKED;
212 
213 
214 struct sctp_inv_mandatory_param {
215 	uint16_t cause;
216 	uint16_t length;
217 	uint32_t num_param;
218 	uint16_t param;
219 	/*
220 	 * We include this to 0 it since only a missing cookie will cause
221 	 * this error.
222 	 */
223 	uint16_t resv;
224 }                        SCTP_PACKED;
225 
226 struct sctp_unresolv_addr {
227 	uint16_t cause;
228 	uint16_t length;
229 	uint16_t addr_type;
230 	uint16_t reserved;	/* Only one invalid addr type */
231 }                  SCTP_PACKED;
232 
233 /* state cookie parameter */
234 struct sctp_state_cookie_param {
235 	struct sctp_paramhdr ph;
236 	struct sctp_state_cookie cookie;
237 }                       SCTP_PACKED;
238 
239 struct sctp_init_chunk {
240 	struct sctp_chunkhdr ch;
241 	struct sctp_init init;
242 }               SCTP_PACKED;
243 
244 struct sctp_init_msg {
245 	struct sctphdr sh;
246 	struct sctp_init_chunk msg;
247 }             SCTP_PACKED;
248 
249 /* ... used for both INIT and INIT ACK */
250 #define sctp_init_ack		sctp_init
251 #define sctp_init_ack_chunk	sctp_init_chunk
252 #define sctp_init_ack_msg	sctp_init_msg
253 
254 
255 /* Selective Ack (SACK) */
256 struct sctp_gap_ack_block {
257 	uint16_t start;		/* Gap Ack block start */
258 	uint16_t end;		/* Gap Ack block end */
259 }                  SCTP_PACKED;
260 
261 struct sctp_sack {
262 	uint32_t cum_tsn_ack;	/* cumulative TSN Ack */
263 	uint32_t a_rwnd;	/* updated a_rwnd of sender */
264 	uint16_t num_gap_ack_blks;	/* number of Gap Ack blocks */
265 	uint16_t num_dup_tsns;	/* number of duplicate TSNs */
266 	/* struct sctp_gap_ack_block's follow */
267 	/* uint32_t duplicate_tsn's follow */
268 }         SCTP_PACKED;
269 
270 struct sctp_sack_chunk {
271 	struct sctp_chunkhdr ch;
272 	struct sctp_sack sack;
273 }               SCTP_PACKED;
274 
275 struct sctp_nr_sack {
276 	uint32_t cum_tsn_ack;	/* cumulative TSN Ack */
277 	uint32_t a_rwnd;	/* updated a_rwnd of sender */
278 	uint16_t num_gap_ack_blks;	/* number of Gap Ack blocks */
279 	uint16_t num_nr_gap_ack_blks;	/* number of NR Gap Ack blocks */
280 	uint16_t num_dup_tsns;	/* number of duplicate TSNs */
281 	uint16_t reserved;	/* not currently used */
282 	/* struct sctp_gap_ack_block's follow */
283 	/* uint32_t duplicate_tsn's follow */
284 }            SCTP_PACKED;
285 
286 struct sctp_nr_sack_chunk {
287 	struct sctp_chunkhdr ch;
288 	struct sctp_nr_sack nr_sack;
289 }                  SCTP_PACKED;
290 
291 
292 /* Heartbeat Request (HEARTBEAT) */
293 struct sctp_heartbeat {
294 	struct sctp_heartbeat_info_param hb_info;
295 }              SCTP_PACKED;
296 
297 struct sctp_heartbeat_chunk {
298 	struct sctp_chunkhdr ch;
299 	struct sctp_heartbeat heartbeat;
300 }                    SCTP_PACKED;
301 
302 /* ... used for Heartbeat Ack (HEARTBEAT ACK) */
303 #define sctp_heartbeat_ack		sctp_heartbeat
304 #define sctp_heartbeat_ack_chunk	sctp_heartbeat_chunk
305 
306 
307 /* Abort Asssociation (ABORT) */
308 struct sctp_abort_chunk {
309 	struct sctp_chunkhdr ch;
310 	/* optional error cause may follow */
311 }                SCTP_PACKED;
312 
313 struct sctp_abort_msg {
314 	struct sctphdr sh;
315 	struct sctp_abort_chunk msg;
316 }              SCTP_PACKED;
317 
318 
319 /* Shutdown Association (SHUTDOWN) */
320 struct sctp_shutdown_chunk {
321 	struct sctp_chunkhdr ch;
322 	uint32_t cumulative_tsn_ack;
323 }                   SCTP_PACKED;
324 
325 
326 /* Shutdown Acknowledgment (SHUTDOWN ACK) */
327 struct sctp_shutdown_ack_chunk {
328 	struct sctp_chunkhdr ch;
329 }                       SCTP_PACKED;
330 
331 
332 /* Operation Error (ERROR) */
333 struct sctp_error_chunk {
334 	struct sctp_chunkhdr ch;
335 	/* optional error causes follow */
336 }                SCTP_PACKED;
337 
338 
339 /* Cookie Echo (COOKIE ECHO) */
340 struct sctp_cookie_echo_chunk {
341 	struct sctp_chunkhdr ch;
342 	struct sctp_state_cookie cookie;
343 }                      SCTP_PACKED;
344 
345 /* Cookie Acknowledgment (COOKIE ACK) */
346 struct sctp_cookie_ack_chunk {
347 	struct sctp_chunkhdr ch;
348 }                     SCTP_PACKED;
349 
350 /* Explicit Congestion Notification Echo (ECNE) */
351 struct old_sctp_ecne_chunk {
352 	struct sctp_chunkhdr ch;
353 	uint32_t tsn;
354 }                   SCTP_PACKED;
355 
356 struct sctp_ecne_chunk {
357 	struct sctp_chunkhdr ch;
358 	uint32_t tsn;
359 	uint32_t num_pkts_since_cwr;
360 }               SCTP_PACKED;
361 
362 /* Congestion Window Reduced (CWR) */
363 struct sctp_cwr_chunk {
364 	struct sctp_chunkhdr ch;
365 	uint32_t tsn;
366 }              SCTP_PACKED;
367 
368 /* Shutdown Complete (SHUTDOWN COMPLETE) */
369 struct sctp_shutdown_complete_chunk {
370 	struct sctp_chunkhdr ch;
371 }                            SCTP_PACKED;
372 
373 /* Oper error holding a stale cookie */
374 struct sctp_stale_cookie_msg {
375 	struct sctp_paramhdr ph;/* really an error cause */
376 	uint32_t time_usec;
377 }                     SCTP_PACKED;
378 
379 struct sctp_adaptation_layer_indication {
380 	struct sctp_paramhdr ph;
381 	uint32_t indication;
382 }                                SCTP_PACKED;
383 
384 struct sctp_cookie_while_shutting_down {
385 	struct sctphdr sh;
386 	struct sctp_chunkhdr ch;
387 	struct sctp_paramhdr ph;/* really an error cause */
388 }                               SCTP_PACKED;
389 
390 struct sctp_shutdown_complete_msg {
391 	struct sctphdr sh;
392 	struct sctp_shutdown_complete_chunk shut_cmp;
393 }                          SCTP_PACKED;
394 
395 /*
396  * draft-ietf-tsvwg-addip-sctp
397  */
398 /* Address/Stream Configuration Change (ASCONF) */
399 struct sctp_asconf_chunk {
400 	struct sctp_chunkhdr ch;
401 	uint32_t serial_number;
402 	/* lookup address parameter (mandatory) */
403 	/* asconf parameters follow */
404 }                 SCTP_PACKED;
405 
406 /* Address/Stream Configuration Acknowledge (ASCONF ACK) */
407 struct sctp_asconf_ack_chunk {
408 	struct sctp_chunkhdr ch;
409 	uint32_t serial_number;
410 	/* asconf parameters follow */
411 }                     SCTP_PACKED;
412 
413 /* draft-ietf-tsvwg-prsctp */
414 /* Forward Cumulative TSN (FORWARD TSN) */
415 struct sctp_forward_tsn_chunk {
416 	struct sctp_chunkhdr ch;
417 	uint32_t new_cumulative_tsn;
418 	/* stream/sequence pairs (sctp_strseq) follow */
419 }                      SCTP_PACKED;
420 
421 struct sctp_strseq {
422 	uint16_t stream;
423 	uint16_t sequence;
424 }           SCTP_PACKED;
425 
426 struct sctp_forward_tsn_msg {
427 	struct sctphdr sh;
428 	struct sctp_forward_tsn_chunk msg;
429 }                    SCTP_PACKED;
430 
431 /* should be a multiple of 4 - 1 aka 3/7/11 etc. */
432 
433 #define SCTP_NUM_DB_TO_VERIFY 31
434 
435 struct sctp_chunk_desc {
436 	uint8_t chunk_type;
437 	uint8_t data_bytes[SCTP_NUM_DB_TO_VERIFY];
438 	uint32_t tsn_ifany;
439 }               SCTP_PACKED;
440 
441 
442 struct sctp_pktdrop_chunk {
443 	struct sctp_chunkhdr ch;
444 	uint32_t bottle_bw;
445 	uint32_t current_onq;
446 	uint16_t trunc_len;
447 	uint16_t reserved;
448 	uint8_t data[];
449 }                  SCTP_PACKED;
450 
451 /**********STREAM RESET STUFF ******************/
452 
453 struct sctp_stream_reset_out_request {
454 	struct sctp_paramhdr ph;
455 	uint32_t request_seq;	/* monotonically increasing seq no */
456 	uint32_t response_seq;	/* if a response, the resp seq no */
457 	uint32_t send_reset_at_tsn;	/* last TSN I assigned outbound */
458 	uint16_t list_of_streams[];	/* if not all list of streams */
459 }                             SCTP_PACKED;
460 
461 struct sctp_stream_reset_in_request {
462 	struct sctp_paramhdr ph;
463 	uint32_t request_seq;
464 	uint16_t list_of_streams[];	/* if not all list of streams */
465 }                            SCTP_PACKED;
466 
467 
468 struct sctp_stream_reset_tsn_request {
469 	struct sctp_paramhdr ph;
470 	uint32_t request_seq;
471 }                             SCTP_PACKED;
472 
473 struct sctp_stream_reset_response {
474 	struct sctp_paramhdr ph;
475 	uint32_t response_seq;	/* if a response, the resp seq no */
476 	uint32_t result;
477 }                          SCTP_PACKED;
478 
479 struct sctp_stream_reset_response_tsn {
480 	struct sctp_paramhdr ph;
481 	uint32_t response_seq;	/* if a response, the resp seq no */
482 	uint32_t result;
483 	uint32_t senders_next_tsn;
484 	uint32_t receivers_next_tsn;
485 }                              SCTP_PACKED;
486 
487 struct sctp_stream_reset_add_strm {
488 	struct sctp_paramhdr ph;
489 	uint32_t request_seq;
490 	uint16_t number_of_streams;
491 	uint16_t reserved;
492 }                          SCTP_PACKED;
493 
494 #define SCTP_STREAM_RESET_RESULT_NOTHING_TO_DO   0x00000000	/* XXX: unused */
495 #define SCTP_STREAM_RESET_RESULT_PERFORMED       0x00000001
496 #define SCTP_STREAM_RESET_RESULT_DENIED          0x00000002
497 #define SCTP_STREAM_RESET_RESULT_ERR__WRONG_SSN  0x00000003	/* XXX: unused */
498 #define SCTP_STREAM_RESET_RESULT_ERR_IN_PROGRESS 0x00000004
499 #define SCTP_STREAM_RESET_RESULT_ERR_BAD_SEQNO   0x00000005
500 #define SCTP_STREAM_RESET_RESULT_IN_PROGRESS     0x00000006	/* XXX: unused */
501 
502 /*
503  * convience structures, note that if you are making a request for specific
504  * streams then the request will need to be an overlay structure.
505  */
506 
507 struct sctp_stream_reset_tsn_req {
508 	struct sctp_chunkhdr ch;
509 	struct sctp_stream_reset_tsn_request sr_req;
510 }                         SCTP_PACKED;
511 
512 struct sctp_stream_reset_resp {
513 	struct sctp_chunkhdr ch;
514 	struct sctp_stream_reset_response sr_resp;
515 }                      SCTP_PACKED;
516 
517 /* respone only valid with a TSN request */
518 struct sctp_stream_reset_resp_tsn {
519 	struct sctp_chunkhdr ch;
520 	struct sctp_stream_reset_response_tsn sr_resp;
521 }                          SCTP_PACKED;
522 
523 /****************************************************/
524 
525 /*
526  * Authenticated chunks support draft-ietf-tsvwg-sctp-auth
527  */
528 
529 /* Should we make the max be 32? */
530 #define SCTP_RANDOM_MAX_SIZE 256
531 struct sctp_auth_random {
532 	struct sctp_paramhdr ph;/* type = 0x8002 */
533 	uint8_t random_data[];
534 }                SCTP_PACKED;
535 
536 struct sctp_auth_chunk_list {
537 	struct sctp_paramhdr ph;/* type = 0x8003 */
538 	uint8_t chunk_types[];
539 }                    SCTP_PACKED;
540 
541 struct sctp_auth_hmac_algo {
542 	struct sctp_paramhdr ph;/* type = 0x8004 */
543 	uint16_t hmac_ids[];
544 }                   SCTP_PACKED;
545 
546 struct sctp_auth_chunk {
547 	struct sctp_chunkhdr ch;
548 	uint16_t shared_key_id;
549 	uint16_t hmac_id;
550 	uint8_t hmac[];
551 }               SCTP_PACKED;
552 
553 struct sctp_auth_invalid_hmac {
554 	struct sctp_paramhdr ph;
555 	uint16_t hmac_id;
556 	uint16_t padding;
557 }                      SCTP_PACKED;
558 
559 /*
560  * we pre-reserve enough room for a ECNE or CWR AND a SACK with no missing
561  * pieces. If ENCE is missing we could have a couple of blocks. This way we
562  * optimize so we MOST likely can bundle a SACK/ECN with the smallest size
563  * data chunk I will split into. We could increase throughput slightly by
564  * taking out these two but the  24-sack/8-CWR i.e. 32 bytes I pre-reserve I
565  * feel is worth it for now.
566  */
567 #ifndef SCTP_MAX_OVERHEAD
568 #ifdef INET6
569 #define SCTP_MAX_OVERHEAD (sizeof(struct sctp_data_chunk) + \
570 			   sizeof(struct sctphdr) + \
571 			   sizeof(struct sctp_ecne_chunk) + \
572 			   sizeof(struct sctp_sack_chunk) + \
573 			   sizeof(struct ip6_hdr))
574 
575 #define SCTP_MED_OVERHEAD (sizeof(struct sctp_data_chunk) + \
576 			   sizeof(struct sctphdr) + \
577 			   sizeof(struct ip6_hdr))
578 
579 
580 #define SCTP_MIN_OVERHEAD (sizeof(struct ip6_hdr) + \
581 			   sizeof(struct sctphdr))
582 
583 #else
584 #define SCTP_MAX_OVERHEAD (sizeof(struct sctp_data_chunk) + \
585 			   sizeof(struct sctphdr) + \
586 			   sizeof(struct sctp_ecne_chunk) + \
587 			   sizeof(struct sctp_sack_chunk) + \
588 			   sizeof(struct ip))
589 
590 #define SCTP_MED_OVERHEAD (sizeof(struct sctp_data_chunk) + \
591 			   sizeof(struct sctphdr) + \
592 			   sizeof(struct ip))
593 
594 
595 #define SCTP_MIN_OVERHEAD (sizeof(struct ip) + \
596 			   sizeof(struct sctphdr))
597 
598 #endif				/* INET6 */
599 #endif				/* !SCTP_MAX_OVERHEAD */
600 
601 #define SCTP_MED_V4_OVERHEAD (sizeof(struct sctp_data_chunk) + \
602 			      sizeof(struct sctphdr) + \
603 			      sizeof(struct ip))
604 
605 #define SCTP_MIN_V4_OVERHEAD (sizeof(struct ip) + \
606 			      sizeof(struct sctphdr))
607 
608 #undef SCTP_PACKED
609 #endif				/* !__sctp_header_h__ */
610