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