sctp_header.h revision 167598
1163953Srrs/*- 2167598Srrs * Copyright (c) 2001-2007, Cisco Systems, Inc. All rights reserved. 3163953Srrs * 4163953Srrs * Redistribution and use in source and binary forms, with or without 5163953Srrs * modification, are permitted provided that the following conditions are met: 6163953Srrs * 7163953Srrs * a) Redistributions of source code must retain the above copyright notice, 8163953Srrs * this list of conditions and the following disclaimer. 9163953Srrs * 10163953Srrs * b) Redistributions in binary form must reproduce the above copyright 11163953Srrs * notice, this list of conditions and the following disclaimer in 12163953Srrs * the documentation and/or other materials provided with the distribution. 13163953Srrs * 14163953Srrs * c) Neither the name of Cisco Systems, Inc. nor the names of its 15163953Srrs * contributors may be used to endorse or promote products derived 16163953Srrs * from this software without specific prior written permission. 17163953Srrs * 18163953Srrs * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19163953Srrs * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 20163953Srrs * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21163953Srrs * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22163953Srrs * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23163953Srrs * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24163953Srrs * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25163953Srrs * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26163953Srrs * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27163953Srrs * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28163953Srrs * THE POSSIBILITY OF SUCH DAMAGE. 29163953Srrs */ 30163953Srrs 31163953Srrs/* $KAME: sctp_header.h,v 1.14 2005/03/06 16:04:17 itojun Exp $ */ 32163953Srrs 33163953Srrs#include <sys/cdefs.h> 34163953Srrs__FBSDID("$FreeBSD: head/sys/netinet/sctp_header.h 167598 2007-03-15 11:27:14Z rrs $"); 35163953Srrs 36163953Srrs#ifndef __sctp_header_h__ 37163953Srrs#define __sctp_header_h__ 38163953Srrs 39163953Srrs 40163953Srrs#include <sys/time.h> 41163953Srrs#include <netinet/sctp.h> 42163953Srrs#include <netinet/sctp_constants.h> 43163953Srrs 44163953Srrs/* 45163953Srrs * Parameter structures 46163953Srrs */ 47163953Srrsstruct sctp_ipv4addr_param { 48163953Srrs struct sctp_paramhdr ph;/* type=SCTP_IPV4_PARAM_TYPE, len=8 */ 49163953Srrs uint32_t addr; /* IPV4 address */ 50163953Srrs}; 51163953Srrs 52167598Srrs#define SCTP_V6_ADDR_BYTES 16 53167598Srrs 54167598Srrs 55163953Srrsstruct sctp_ipv6addr_param { 56163953Srrs struct sctp_paramhdr ph;/* type=SCTP_IPV6_PARAM_TYPE, len=20 */ 57167598Srrs uint8_t addr[SCTP_V6_ADDR_BYTES]; /* IPV6 address */ 58163953Srrs}; 59163953Srrs 60163953Srrs/* Cookie Preservative */ 61163953Srrsstruct sctp_cookie_perserve_param { 62163953Srrs struct sctp_paramhdr ph;/* type=SCTP_COOKIE_PRESERVE, len=8 */ 63163953Srrs uint32_t time; /* time in ms to extend cookie */ 64163953Srrs}; 65163953Srrs 66167598Srrs#define SCTP_ARRAY_MIN_LEN 1 67167598Srrs 68163953Srrs/* Host Name Address */ 69163953Srrsstruct sctp_host_name_param { 70163953Srrs struct sctp_paramhdr ph;/* type=SCTP_HOSTNAME_ADDRESS */ 71167598Srrs char name[SCTP_ARRAY_MIN_LEN]; /* host name */ 72163953Srrs}; 73163953Srrs 74163953Srrs/* supported address type */ 75163953Srrsstruct sctp_supported_addr_param { 76163953Srrs struct sctp_paramhdr ph;/* type=SCTP_SUPPORTED_ADDRTYPE */ 77167598Srrs uint16_t addr_type[SCTP_ARRAY_MIN_LEN]; /* array of supported address 78167598Srrs * types */ 79163953Srrs}; 80163953Srrs 81163953Srrs/* ECN parameter */ 82163953Srrsstruct sctp_ecn_supported_param { 83163953Srrs struct sctp_paramhdr ph;/* type=SCTP_ECN_CAPABLE */ 84163953Srrs}; 85163953Srrs 86163953Srrs 87163953Srrs/* heartbeat info parameter */ 88163953Srrsstruct sctp_heartbeat_info_param { 89163953Srrs struct sctp_paramhdr ph; 90163953Srrs uint32_t time_value_1; 91163953Srrs uint32_t time_value_2; 92163953Srrs uint32_t random_value1; 93163953Srrs uint32_t random_value2; 94163953Srrs uint16_t user_req; 95163953Srrs uint8_t addr_family; 96163953Srrs uint8_t addr_len; 97163953Srrs char address[SCTP_ADDRMAX]; 98163953Srrs}; 99163953Srrs 100163953Srrs 101163953Srrs/* draft-ietf-tsvwg-prsctp */ 102163953Srrs/* PR-SCTP supported parameter */ 103163953Srrsstruct sctp_prsctp_supported_param { 104163953Srrs struct sctp_paramhdr ph; 105163953Srrs}; 106163953Srrs 107163953Srrs 108163953Srrs/* draft-ietf-tsvwg-addip-sctp */ 109163953Srrsstruct sctp_asconf_paramhdr { /* an ASCONF "parameter" */ 110163953Srrs struct sctp_paramhdr ph;/* a SCTP parameter header */ 111163953Srrs uint32_t correlation_id;/* correlation id for this param */ 112163953Srrs}; 113163953Srrs 114163953Srrsstruct sctp_asconf_addr_param { /* an ASCONF address parameter */ 115163953Srrs struct sctp_asconf_paramhdr aph; /* asconf "parameter" */ 116163953Srrs struct sctp_ipv6addr_param addrp; /* max storage size */ 117163953Srrs}; 118163953Srrs 119163953Srrsstruct sctp_asconf_addrv4_param { /* an ASCONF address (v4) parameter */ 120163953Srrs struct sctp_asconf_paramhdr aph; /* asconf "parameter" */ 121163953Srrs struct sctp_ipv4addr_param addrp; /* max storage size */ 122163953Srrs}; 123163953Srrs 124163953Srrsstruct sctp_supported_chunk_types_param { 125163953Srrs struct sctp_paramhdr ph;/* type = 0x8008 len = x */ 126163953Srrs uint8_t chunk_types[0]; 127163953Srrs}; 128163953Srrs 129163953Srrs 130163953Srrs/* ECN Nonce: draft-ladha-sctp-ecn-nonce */ 131163953Srrsstruct sctp_ecn_nonce_supported_param { 132163953Srrs struct sctp_paramhdr ph;/* type = 0x8001 len = 4 */ 133163953Srrs}; 134163953Srrs 135163953Srrs 136163953Srrs/* 137163953Srrs * Structures for DATA chunks 138163953Srrs */ 139163953Srrsstruct sctp_data { 140163953Srrs uint32_t tsn; 141163953Srrs uint16_t stream_id; 142163953Srrs uint16_t stream_sequence; 143163953Srrs uint32_t protocol_id; 144163953Srrs /* user data follows */ 145163953Srrs}; 146163953Srrs 147163953Srrsstruct sctp_data_chunk { 148163953Srrs struct sctp_chunkhdr ch; 149163953Srrs struct sctp_data dp; 150163953Srrs}; 151163953Srrs 152163953Srrs/* 153163953Srrs * Structures for the control chunks 154163953Srrs */ 155163953Srrs 156163953Srrs/* Initiate (INIT)/Initiate Ack (INIT ACK) */ 157163953Srrsstruct sctp_init { 158163953Srrs uint32_t initiate_tag; /* initiate tag */ 159163953Srrs uint32_t a_rwnd; /* a_rwnd */ 160163953Srrs uint16_t num_outbound_streams; /* OS */ 161163953Srrs uint16_t num_inbound_streams; /* MIS */ 162163953Srrs uint32_t initial_tsn; /* I-TSN */ 163163953Srrs /* optional param's follow */ 164163953Srrs}; 165163953Srrs 166167598Srrs#define SCTP_IDENTIFICATION_SIZE 16 167167598Srrs#define SCTP_ADDRESS_SIZE 4 168163953Srrs/* state cookie header */ 169163953Srrsstruct sctp_state_cookie { /* this is our definition... */ 170167598Srrs uint8_t identification[SCTP_IDENTIFICATION_SIZE]; /* id of who we are */ 171163953Srrs uint32_t cookie_life; /* life I will award this cookie */ 172163953Srrs uint32_t tie_tag_my_vtag; /* my tag in old association */ 173163953Srrs uint32_t tie_tag_peer_vtag; /* peers tag in old association */ 174163953Srrs uint32_t peers_vtag; /* peers tag in INIT (for quick ref) */ 175163953Srrs uint32_t my_vtag; /* my tag in INIT-ACK (for quick ref) */ 176163953Srrs struct timeval time_entered; /* the time I built cookie */ 177167598Srrs uint32_t address[SCTP_ADDRESS_SIZE]; /* 4 ints/128 bits */ 178163953Srrs uint32_t addr_type; /* address type */ 179167598Srrs uint32_t laddress[SCTP_ADDRESS_SIZE]; /* my local from address */ 180163953Srrs uint32_t laddr_type; /* my local from address type */ 181163953Srrs uint32_t scope_id; /* v6 scope id for link-locals */ 182163953Srrs uint16_t peerport; /* port address of the peer in the INIT */ 183163953Srrs uint16_t myport; /* my port address used in the INIT */ 184163953Srrs uint8_t ipv4_addr_legal;/* Are V4 addr legal? */ 185163953Srrs uint8_t ipv6_addr_legal;/* Are V6 addr legal? */ 186163953Srrs uint8_t local_scope; /* IPv6 local scope flag */ 187163953Srrs uint8_t site_scope; /* IPv6 site scope flag */ 188163953Srrs uint8_t ipv4_scope; /* IPv4 private addr scope */ 189163953Srrs uint8_t loopback_scope; /* loopback scope information */ 190163953Srrs uint16_t reserved; 191163953Srrs /* 192163953Srrs * at the end is tacked on the INIT chunk and the INIT-ACK chunk 193163953Srrs * (minus the cookie). 194163953Srrs */ 195163953Srrs}; 196163953Srrs 197163953Srrsstruct sctp_inv_mandatory_param { 198163953Srrs uint16_t cause; 199163953Srrs uint16_t length; 200163953Srrs uint32_t num_param; 201163953Srrs uint16_t param; 202163953Srrs /* 203163953Srrs * We include this to 0 it since only a missing cookie will cause 204163953Srrs * this error. 205163953Srrs */ 206163953Srrs uint16_t resv; 207163953Srrs}; 208163953Srrs 209163953Srrsstruct sctp_unresolv_addr { 210163953Srrs uint16_t cause; 211163953Srrs uint16_t length; 212163953Srrs uint16_t addr_type; 213163953Srrs uint16_t reserved; /* Only one invalid addr type */ 214163953Srrs}; 215163953Srrs 216163953Srrs/* state cookie parameter */ 217163953Srrsstruct sctp_state_cookie_param { 218163953Srrs struct sctp_paramhdr ph; 219163953Srrs struct sctp_state_cookie cookie; 220163953Srrs}; 221163953Srrs 222163953Srrsstruct sctp_init_chunk { 223163953Srrs struct sctp_chunkhdr ch; 224163953Srrs struct sctp_init init; 225163953Srrs}; 226163953Srrs 227163953Srrsstruct sctp_init_msg { 228163953Srrs struct sctphdr sh; 229163953Srrs struct sctp_init_chunk msg; 230163953Srrs}; 231163953Srrs 232163953Srrs/* ... used for both INIT and INIT ACK */ 233163953Srrs#define sctp_init_ack sctp_init 234163953Srrs#define sctp_init_ack_chunk sctp_init_chunk 235163953Srrs#define sctp_init_ack_msg sctp_init_msg 236163953Srrs 237163953Srrs 238163953Srrs/* Selective Ack (SACK) */ 239163953Srrsstruct sctp_gap_ack_block { 240163953Srrs uint16_t start; /* Gap Ack block start */ 241163953Srrs uint16_t end; /* Gap Ack block end */ 242163953Srrs}; 243163953Srrs 244163953Srrsstruct sctp_sack { 245163953Srrs uint32_t cum_tsn_ack; /* cumulative TSN Ack */ 246163953Srrs uint32_t a_rwnd; /* updated a_rwnd of sender */ 247163953Srrs uint16_t num_gap_ack_blks; /* number of Gap Ack blocks */ 248163953Srrs uint16_t num_dup_tsns; /* number of duplicate TSNs */ 249163953Srrs /* struct sctp_gap_ack_block's follow */ 250163953Srrs /* uint32_t duplicate_tsn's follow */ 251163953Srrs}; 252163953Srrs 253163953Srrsstruct sctp_sack_chunk { 254163953Srrs struct sctp_chunkhdr ch; 255163953Srrs struct sctp_sack sack; 256163953Srrs}; 257163953Srrs 258163953Srrs 259163953Srrs/* Heartbeat Request (HEARTBEAT) */ 260163953Srrsstruct sctp_heartbeat { 261163953Srrs struct sctp_heartbeat_info_param hb_info; 262163953Srrs}; 263163953Srrs 264163953Srrsstruct sctp_heartbeat_chunk { 265163953Srrs struct sctp_chunkhdr ch; 266163953Srrs struct sctp_heartbeat heartbeat; 267163953Srrs}; 268163953Srrs 269163953Srrs/* ... used for Heartbeat Ack (HEARTBEAT ACK) */ 270163953Srrs#define sctp_heartbeat_ack sctp_heartbeat 271163953Srrs#define sctp_heartbeat_ack_chunk sctp_heartbeat_chunk 272163953Srrs 273163953Srrs 274163953Srrs/* Abort Asssociation (ABORT) */ 275163953Srrsstruct sctp_abort_chunk { 276163953Srrs struct sctp_chunkhdr ch; 277163953Srrs /* optional error cause may follow */ 278163953Srrs}; 279163953Srrs 280163953Srrsstruct sctp_abort_msg { 281163953Srrs struct sctphdr sh; 282163953Srrs struct sctp_abort_chunk msg; 283163953Srrs}; 284163953Srrs 285163953Srrs 286163953Srrs/* Shutdown Association (SHUTDOWN) */ 287163953Srrsstruct sctp_shutdown_chunk { 288163953Srrs struct sctp_chunkhdr ch; 289163953Srrs uint32_t cumulative_tsn_ack; 290163953Srrs}; 291163953Srrs 292163953Srrs 293163953Srrs/* Shutdown Acknowledgment (SHUTDOWN ACK) */ 294163953Srrsstruct sctp_shutdown_ack_chunk { 295163953Srrs struct sctp_chunkhdr ch; 296163953Srrs}; 297163953Srrs 298163953Srrs 299163953Srrs/* Operation Error (ERROR) */ 300163953Srrsstruct sctp_error_chunk { 301163953Srrs struct sctp_chunkhdr ch; 302163953Srrs /* optional error causes follow */ 303163953Srrs}; 304163953Srrs 305163953Srrs 306163953Srrs/* Cookie Echo (COOKIE ECHO) */ 307163953Srrsstruct sctp_cookie_echo_chunk { 308163953Srrs struct sctp_chunkhdr ch; 309163953Srrs struct sctp_state_cookie cookie; 310163953Srrs}; 311163953Srrs 312163953Srrs/* Cookie Acknowledgment (COOKIE ACK) */ 313163953Srrsstruct sctp_cookie_ack_chunk { 314163953Srrs struct sctp_chunkhdr ch; 315163953Srrs}; 316163953Srrs 317163953Srrs/* Explicit Congestion Notification Echo (ECNE) */ 318163953Srrsstruct sctp_ecne_chunk { 319163953Srrs struct sctp_chunkhdr ch; 320163953Srrs uint32_t tsn; 321163953Srrs}; 322163953Srrs 323163953Srrs/* Congestion Window Reduced (CWR) */ 324163953Srrsstruct sctp_cwr_chunk { 325163953Srrs struct sctp_chunkhdr ch; 326163953Srrs uint32_t tsn; 327163953Srrs}; 328163953Srrs 329163953Srrs/* Shutdown Complete (SHUTDOWN COMPLETE) */ 330163953Srrsstruct sctp_shutdown_complete_chunk { 331163953Srrs struct sctp_chunkhdr ch; 332163953Srrs}; 333163953Srrs 334163953Srrs/* Oper error holding a stale cookie */ 335163953Srrsstruct sctp_stale_cookie_msg { 336163953Srrs struct sctp_paramhdr ph;/* really an error cause */ 337163953Srrs uint32_t time_usec; 338163953Srrs}; 339163953Srrs 340163953Srrsstruct sctp_adaptation_layer_indication { 341163953Srrs struct sctp_paramhdr ph; 342163953Srrs uint32_t indication; 343163953Srrs}; 344163953Srrs 345163953Srrsstruct sctp_cookie_while_shutting_down { 346163953Srrs struct sctphdr sh; 347163953Srrs struct sctp_chunkhdr ch; 348163953Srrs struct sctp_paramhdr ph;/* really an error cause */ 349163953Srrs}; 350163953Srrs 351163953Srrsstruct sctp_shutdown_complete_msg { 352163953Srrs struct sctphdr sh; 353163953Srrs struct sctp_shutdown_complete_chunk shut_cmp; 354163953Srrs}; 355163953Srrs 356163953Srrs/* 357163953Srrs * draft-ietf-tsvwg-addip-sctp 358163953Srrs */ 359163953Srrs/* Address/Stream Configuration Change (ASCONF) */ 360163953Srrsstruct sctp_asconf_chunk { 361163953Srrs struct sctp_chunkhdr ch; 362163953Srrs uint32_t serial_number; 363163953Srrs /* lookup address parameter (mandatory) */ 364163953Srrs /* asconf parameters follow */ 365163953Srrs}; 366163953Srrs 367163953Srrs/* Address/Stream Configuration Acknowledge (ASCONF ACK) */ 368163953Srrsstruct sctp_asconf_ack_chunk { 369163953Srrs struct sctp_chunkhdr ch; 370163953Srrs uint32_t serial_number; 371163953Srrs /* asconf parameters follow */ 372163953Srrs}; 373163953Srrs 374163953Srrs/* draft-ietf-tsvwg-prsctp */ 375163953Srrs/* Forward Cumulative TSN (FORWARD TSN) */ 376163953Srrsstruct sctp_forward_tsn_chunk { 377163953Srrs struct sctp_chunkhdr ch; 378163953Srrs uint32_t new_cumulative_tsn; 379163953Srrs /* stream/sequence pairs (sctp_strseq) follow */ 380163953Srrs}; 381163953Srrs 382163953Srrsstruct sctp_strseq { 383163953Srrs uint16_t stream; 384163953Srrs uint16_t sequence; 385163953Srrs}; 386163953Srrs 387163953Srrsstruct sctp_forward_tsn_msg { 388163953Srrs struct sctphdr sh; 389163953Srrs struct sctp_forward_tsn_chunk msg; 390163953Srrs}; 391163953Srrs 392163953Srrs/* should be a multiple of 4 - 1 aka 3/7/11 etc. */ 393163953Srrs 394163953Srrs#define SCTP_NUM_DB_TO_VERIFY 31 395163953Srrs 396163953Srrsstruct sctp_chunk_desc { 397163953Srrs uint8_t chunk_type; 398163953Srrs uint8_t data_bytes[SCTP_NUM_DB_TO_VERIFY]; 399163953Srrs uint32_t tsn_ifany; 400163953Srrs}; 401163953Srrs 402163953Srrs 403163953Srrsstruct sctp_pktdrop_chunk { 404163953Srrs struct sctp_chunkhdr ch; 405163953Srrs uint32_t bottle_bw; 406163953Srrs uint32_t current_onq; 407163953Srrs uint16_t trunc_len; 408163953Srrs uint16_t reserved; 409163953Srrs uint8_t data[0]; 410163953Srrs}; 411163953Srrs 412163953Srrs/**********STREAM RESET STUFF ******************/ 413163953Srrs 414163953Srrsstruct sctp_stream_reset_out_request { 415163953Srrs struct sctp_paramhdr ph; 416163953Srrs uint32_t request_seq; /* monotonically increasing seq no */ 417163953Srrs uint32_t response_seq; /* if a response, the resp seq no */ 418163953Srrs uint32_t send_reset_at_tsn; /* last TSN I assigned outbound */ 419163953Srrs uint16_t list_of_streams[0]; /* if not all list of streams */ 420163953Srrs}; 421163953Srrs 422163953Srrsstruct sctp_stream_reset_in_request { 423163953Srrs struct sctp_paramhdr ph; 424163953Srrs uint32_t request_seq; 425163953Srrs uint16_t list_of_streams[0]; /* if not all list of streams */ 426163953Srrs}; 427163953Srrs 428163953Srrs 429163953Srrsstruct sctp_stream_reset_tsn_request { 430163953Srrs struct sctp_paramhdr ph; 431163953Srrs uint32_t request_seq; 432163953Srrs}; 433163953Srrs 434163953Srrsstruct sctp_stream_reset_response { 435163953Srrs struct sctp_paramhdr ph; 436163953Srrs uint32_t response_seq; /* if a response, the resp seq no */ 437163953Srrs uint32_t result; 438163953Srrs}; 439163953Srrs 440163953Srrsstruct sctp_stream_reset_response_tsn { 441163953Srrs struct sctp_paramhdr ph; 442163953Srrs uint32_t response_seq; /* if a response, the resp seq no */ 443163953Srrs uint32_t result; 444163953Srrs uint32_t senders_next_tsn; 445163953Srrs uint32_t receivers_next_tsn; 446163953Srrs}; 447163953Srrs 448163953Srrs 449163953Srrs 450163953Srrs#define SCTP_STREAM_RESET_NOTHING 0x00000000 /* Nothing for me to do */ 451163953Srrs#define SCTP_STREAM_RESET_PERFORMED 0x00000001 /* Did it */ 452163953Srrs#define SCTP_STREAM_RESET_DENIED 0x00000002 /* refused to do it */ 453163953Srrs#define SCTP_STREAM_RESET_ERROR_STR 0x00000003 /* bad Stream no */ 454163953Srrs#define SCTP_STREAM_RESET_TRY_LATER 0x00000004 /* collision, try again */ 455163953Srrs#define SCTP_STREAM_RESET_BAD_SEQNO 0x00000005 /* bad str-reset seq no */ 456163953Srrs 457163953Srrs/* 458163953Srrs * convience structures, note that if you are making a request for specific 459163953Srrs * streams then the request will need to be an overlay structure. 460163953Srrs */ 461163953Srrs 462163953Srrsstruct sctp_stream_reset_out_req { 463163953Srrs struct sctp_chunkhdr ch; 464163953Srrs struct sctp_stream_reset_out_request sr_req; 465163953Srrs}; 466163953Srrs 467163953Srrsstruct sctp_stream_reset_in_req { 468163953Srrs struct sctp_chunkhdr ch; 469163953Srrs struct sctp_stream_reset_in_request sr_req; 470163953Srrs}; 471163953Srrs 472163953Srrsstruct sctp_stream_reset_tsn_req { 473163953Srrs struct sctp_chunkhdr ch; 474163953Srrs struct sctp_stream_reset_tsn_request sr_req; 475163953Srrs}; 476163953Srrs 477163953Srrsstruct sctp_stream_reset_resp { 478163953Srrs struct sctp_chunkhdr ch; 479163953Srrs struct sctp_stream_reset_response sr_resp; 480163953Srrs}; 481163953Srrs 482163953Srrs/* respone only valid with a TSN request */ 483163953Srrsstruct sctp_stream_reset_resp_tsn { 484163953Srrs struct sctp_chunkhdr ch; 485163953Srrs struct sctp_stream_reset_response_tsn sr_resp; 486163953Srrs}; 487163953Srrs 488163953Srrs/****************************************************/ 489163953Srrs 490163953Srrs/* 491163953Srrs * Authenticated chunks support draft-ietf-tsvwg-sctp-auth 492163953Srrs */ 493163953Srrsstruct sctp_auth_random { 494163953Srrs struct sctp_paramhdr ph;/* type = 0x8002 */ 495163953Srrs uint8_t random_data[0]; 496163953Srrs}; 497163953Srrs 498163953Srrsstruct sctp_auth_chunk_list { 499163953Srrs struct sctp_paramhdr ph;/* type = 0x8003 */ 500163953Srrs uint8_t chunk_types[0]; 501163953Srrs}; 502163953Srrs 503163953Srrsstruct sctp_auth_hmac_algo { 504163953Srrs struct sctp_paramhdr ph;/* type = 0x8004 */ 505163953Srrs uint16_t hmac_ids[0]; 506163953Srrs}; 507163953Srrs 508163953Srrsstruct sctp_auth_chunk { 509163953Srrs struct sctp_chunkhdr ch; 510163953Srrs uint16_t shared_key_id; 511163953Srrs uint16_t hmac_id; 512163953Srrs uint8_t hmac[0]; 513163953Srrs}; 514163953Srrs 515163953Srrsstruct sctp_auth_invalid_hmac { 516163953Srrs struct sctp_paramhdr ph; 517163953Srrs uint16_t hmac_id; 518163953Srrs uint16_t padding; 519163953Srrs}; 520163953Srrs 521163953Srrs/* 522163953Srrs * we pre-reserve enough room for a ECNE or CWR AND a SACK with no missing 523163953Srrs * pieces. If ENCE is missing we could have a couple of blocks. This way we 524163953Srrs * optimize so we MOST likely can bundle a SACK/ECN with the smallest size 525163953Srrs * data chunk I will split into. We could increase throughput slightly by 526163953Srrs * taking out these two but the 24-sack/8-CWR i.e. 32 bytes I pre-reserve I 527163953Srrs * feel is worth it for now. 528163953Srrs */ 529163953Srrs#ifndef SCTP_MAX_OVERHEAD 530167598Srrs#ifdef INET6 531163953Srrs#define SCTP_MAX_OVERHEAD (sizeof(struct sctp_data_chunk) + \ 532163953Srrs sizeof(struct sctphdr) + \ 533163953Srrs sizeof(struct sctp_ecne_chunk) + \ 534163953Srrs sizeof(struct sctp_sack_chunk) + \ 535163953Srrs sizeof(struct ip6_hdr)) 536163953Srrs 537163953Srrs#define SCTP_MED_OVERHEAD (sizeof(struct sctp_data_chunk) + \ 538163953Srrs sizeof(struct sctphdr) + \ 539163953Srrs sizeof(struct ip6_hdr)) 540163953Srrs 541163953Srrs 542163953Srrs#define SCTP_MIN_OVERHEAD (sizeof(struct ip6_hdr) + \ 543163953Srrs sizeof(struct sctphdr)) 544163953Srrs 545163953Srrs#else 546163953Srrs#define SCTP_MAX_OVERHEAD (sizeof(struct sctp_data_chunk) + \ 547163953Srrs sizeof(struct sctphdr) + \ 548163953Srrs sizeof(struct sctp_ecne_chunk) + \ 549163953Srrs sizeof(struct sctp_sack_chunk) + \ 550163953Srrs sizeof(struct ip)) 551163953Srrs 552163953Srrs#define SCTP_MED_OVERHEAD (sizeof(struct sctp_data_chunk) + \ 553163953Srrs sizeof(struct sctphdr) + \ 554163953Srrs sizeof(struct ip)) 555163953Srrs 556163953Srrs 557163953Srrs#define SCTP_MIN_OVERHEAD (sizeof(struct ip) + \ 558163953Srrs sizeof(struct sctphdr)) 559163953Srrs 560167598Srrs#endif /* INET6 */ 561163953Srrs#endif /* !SCTP_MAX_OVERHEAD */ 562163953Srrs 563163953Srrs#define SCTP_MED_V4_OVERHEAD (sizeof(struct sctp_data_chunk) + \ 564163953Srrs sizeof(struct sctphdr) + \ 565163953Srrs sizeof(struct ip)) 566163953Srrs 567163953Srrs#define SCTP_MIN_V4_OVERHEAD (sizeof(struct ip) + \ 568163953Srrs sizeof(struct sctphdr)) 569163953Srrs 570163953Srrs#endif /* !__sctp_header_h__ */ 571