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