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