michael@0: /*- michael@0: * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. michael@0: * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. michael@0: * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. michael@0: * michael@0: * Redistribution and use in source and binary forms, with or without michael@0: * modification, are permitted provided that the following conditions are met: michael@0: * michael@0: * a) Redistributions of source code must retain the above copyright notice, michael@0: * this list of conditions and the following disclaimer. michael@0: * michael@0: * b) Redistributions in binary form must reproduce the above copyright michael@0: * notice, this list of conditions and the following disclaimer in michael@0: * the documentation and/or other materials provided with the distribution. michael@0: * michael@0: * c) Neither the name of Cisco Systems, Inc. nor the names of its michael@0: * contributors may be used to endorse or promote products derived michael@0: * from this software without specific prior written permission. michael@0: * michael@0: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS michael@0: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, michael@0: * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE michael@0: * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE michael@0: * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR michael@0: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF michael@0: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS michael@0: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN michael@0: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) michael@0: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF michael@0: * THE POSSIBILITY OF SUCH DAMAGE. michael@0: */ michael@0: michael@0: #ifdef __FreeBSD__ michael@0: #include michael@0: __FBSDID("$FreeBSD: head/sys/netinet/sctp_header.h 240198 2012-09-07 13:36:42Z tuexen $"); michael@0: #endif michael@0: michael@0: #ifndef _NETINET_SCTP_HEADER_H_ michael@0: #define _NETINET_SCTP_HEADER_H_ michael@0: michael@0: #if defined(__Windows__) && !defined(__Userspace_os_Windows) michael@0: #include michael@0: #endif michael@0: #if !defined(__Userspace_os_Windows) michael@0: #include michael@0: #endif michael@0: #include michael@0: #include michael@0: michael@0: #if !defined(__Userspace_os_Windows) michael@0: #define SCTP_PACKED __attribute__((packed)) michael@0: #else michael@0: #pragma pack (push, 1) michael@0: #define SCTP_PACKED michael@0: #endif michael@0: michael@0: /* michael@0: * Parameter structures michael@0: */ michael@0: struct sctp_ipv4addr_param { michael@0: struct sctp_paramhdr ph;/* type=SCTP_IPV4_PARAM_TYPE, len=8 */ michael@0: uint32_t addr; /* IPV4 address */ michael@0: } SCTP_PACKED; michael@0: michael@0: #define SCTP_V6_ADDR_BYTES 16 michael@0: michael@0: michael@0: struct sctp_ipv6addr_param { michael@0: struct sctp_paramhdr ph;/* type=SCTP_IPV6_PARAM_TYPE, len=20 */ michael@0: uint8_t addr[SCTP_V6_ADDR_BYTES]; /* IPV6 address */ michael@0: } SCTP_PACKED; michael@0: michael@0: /* Cookie Preservative */ michael@0: struct sctp_cookie_perserve_param { michael@0: struct sctp_paramhdr ph;/* type=SCTP_COOKIE_PRESERVE, len=8 */ michael@0: uint32_t time; /* time in ms to extend cookie */ michael@0: } SCTP_PACKED; michael@0: michael@0: #define SCTP_ARRAY_MIN_LEN 1 michael@0: /* Host Name Address */ michael@0: struct sctp_host_name_param { michael@0: struct sctp_paramhdr ph;/* type=SCTP_HOSTNAME_ADDRESS */ michael@0: char name[SCTP_ARRAY_MIN_LEN]; /* host name */ michael@0: } SCTP_PACKED; michael@0: michael@0: /* michael@0: * This is the maximum padded size of a s-a-p michael@0: * so paramheadr + 3 address types (6 bytes) + 2 byte pad = 12 michael@0: */ michael@0: #define SCTP_MAX_ADDR_PARAMS_SIZE 12 michael@0: /* supported address type */ michael@0: struct sctp_supported_addr_param { michael@0: struct sctp_paramhdr ph;/* type=SCTP_SUPPORTED_ADDRTYPE */ michael@0: uint16_t addr_type[2]; /* array of supported address types */ michael@0: } SCTP_PACKED; michael@0: michael@0: /* ECN parameter */ michael@0: struct sctp_ecn_supported_param { michael@0: struct sctp_paramhdr ph;/* type=SCTP_ECN_CAPABLE */ michael@0: } SCTP_PACKED; michael@0: michael@0: michael@0: /* heartbeat info parameter */ michael@0: struct sctp_heartbeat_info_param { michael@0: struct sctp_paramhdr ph; michael@0: uint32_t time_value_1; michael@0: uint32_t time_value_2; michael@0: uint32_t random_value1; michael@0: uint32_t random_value2; michael@0: uint8_t addr_family; michael@0: uint8_t addr_len; michael@0: /* make sure that this structure is 4 byte aligned */ michael@0: uint8_t padding[2]; michael@0: char address[SCTP_ADDRMAX]; michael@0: } SCTP_PACKED; michael@0: michael@0: michael@0: /* draft-ietf-tsvwg-prsctp */ michael@0: /* PR-SCTP supported parameter */ michael@0: struct sctp_prsctp_supported_param { michael@0: struct sctp_paramhdr ph; michael@0: } SCTP_PACKED; michael@0: michael@0: michael@0: /* draft-ietf-tsvwg-addip-sctp */ michael@0: struct sctp_asconf_paramhdr { /* an ASCONF "parameter" */ michael@0: struct sctp_paramhdr ph;/* a SCTP parameter header */ michael@0: uint32_t correlation_id;/* correlation id for this param */ michael@0: } SCTP_PACKED; michael@0: michael@0: struct sctp_asconf_addr_param { /* an ASCONF address parameter */ michael@0: struct sctp_asconf_paramhdr aph; /* asconf "parameter" */ michael@0: struct sctp_ipv6addr_param addrp; /* max storage size */ michael@0: } SCTP_PACKED; michael@0: michael@0: michael@0: struct sctp_asconf_tag_param { /* an ASCONF NAT-Vtag parameter */ michael@0: struct sctp_asconf_paramhdr aph; /* asconf "parameter" */ michael@0: uint32_t local_vtag; michael@0: uint32_t remote_vtag; michael@0: } SCTP_PACKED; michael@0: michael@0: michael@0: struct sctp_asconf_addrv4_param { /* an ASCONF address (v4) parameter */ michael@0: struct sctp_asconf_paramhdr aph; /* asconf "parameter" */ michael@0: struct sctp_ipv4addr_param addrp; /* max storage size */ michael@0: } SCTP_PACKED; michael@0: michael@0: #define SCTP_MAX_SUPPORTED_EXT 256 michael@0: michael@0: struct sctp_supported_chunk_types_param { michael@0: struct sctp_paramhdr ph;/* type = 0x8008 len = x */ michael@0: uint8_t chunk_types[]; michael@0: } SCTP_PACKED; michael@0: michael@0: michael@0: /* michael@0: * Structures for DATA chunks michael@0: */ michael@0: struct sctp_data { michael@0: uint32_t tsn; michael@0: uint16_t stream_id; michael@0: uint16_t stream_sequence; michael@0: uint32_t protocol_id; michael@0: /* user data follows */ michael@0: } SCTP_PACKED; michael@0: michael@0: struct sctp_data_chunk { michael@0: struct sctp_chunkhdr ch; michael@0: struct sctp_data dp; michael@0: } SCTP_PACKED; michael@0: michael@0: /* michael@0: * Structures for the control chunks michael@0: */ michael@0: michael@0: /* Initiate (INIT)/Initiate Ack (INIT ACK) */ michael@0: struct sctp_init { michael@0: uint32_t initiate_tag; /* initiate tag */ michael@0: uint32_t a_rwnd; /* a_rwnd */ michael@0: uint16_t num_outbound_streams; /* OS */ michael@0: uint16_t num_inbound_streams; /* MIS */ michael@0: uint32_t initial_tsn; /* I-TSN */ michael@0: /* optional param's follow */ michael@0: } SCTP_PACKED; michael@0: #define SCTP_IDENTIFICATION_SIZE 16 michael@0: #define SCTP_ADDRESS_SIZE 4 michael@0: #if defined(__Userspace__) michael@0: #define SCTP_RESERVE_SPACE 5 michael@0: #else michael@0: #define SCTP_RESERVE_SPACE 6 michael@0: #endif michael@0: /* state cookie header */ michael@0: struct sctp_state_cookie { /* this is our definition... */ michael@0: uint8_t identification[SCTP_IDENTIFICATION_SIZE];/* id of who we are */ michael@0: struct timeval time_entered; /* the time I built cookie */ michael@0: uint32_t cookie_life; /* life I will award this cookie */ michael@0: uint32_t tie_tag_my_vtag; /* my tag in old association */ michael@0: michael@0: uint32_t tie_tag_peer_vtag; /* peers tag in old association */ michael@0: uint32_t peers_vtag; /* peers tag in INIT (for quick ref) */ michael@0: michael@0: uint32_t my_vtag; /* my tag in INIT-ACK (for quick ref) */ michael@0: uint32_t address[SCTP_ADDRESS_SIZE]; /* 4 ints/128 bits */ michael@0: uint32_t addr_type; /* address type */ michael@0: uint32_t laddress[SCTP_ADDRESS_SIZE]; /* my local from address */ michael@0: uint32_t laddr_type; /* my local from address type */ michael@0: uint32_t scope_id; /* v6 scope id for link-locals */ michael@0: michael@0: uint16_t peerport; /* port address of the peer in the INIT */ michael@0: uint16_t myport; /* my port address used in the INIT */ michael@0: uint8_t ipv4_addr_legal;/* Are V4 addr legal? */ michael@0: uint8_t ipv6_addr_legal;/* Are V6 addr legal? */ michael@0: #if defined(__Userspace__) michael@0: uint8_t conn_addr_legal; michael@0: #endif michael@0: uint8_t local_scope; /* IPv6 local scope flag */ michael@0: uint8_t site_scope; /* IPv6 site scope flag */ michael@0: michael@0: uint8_t ipv4_scope; /* IPv4 private addr scope */ michael@0: uint8_t loopback_scope; /* loopback scope information */ michael@0: uint8_t reserved[SCTP_RESERVE_SPACE]; /* Align to 64 bits */ michael@0: /* michael@0: * at the end is tacked on the INIT chunk and the INIT-ACK chunk michael@0: * (minus the cookie). michael@0: */ michael@0: } SCTP_PACKED; michael@0: michael@0: michael@0: /* Used for NAT state error cause */ michael@0: struct sctp_missing_nat_state { michael@0: uint16_t cause; michael@0: uint16_t length; michael@0: uint8_t data[]; michael@0: } SCTP_PACKED; michael@0: michael@0: michael@0: struct sctp_inv_mandatory_param { michael@0: uint16_t cause; michael@0: uint16_t length; michael@0: uint32_t num_param; michael@0: uint16_t param; michael@0: /* michael@0: * We include this to 0 it since only a missing cookie will cause michael@0: * this error. michael@0: */ michael@0: uint16_t resv; michael@0: } SCTP_PACKED; michael@0: michael@0: struct sctp_unresolv_addr { michael@0: uint16_t cause; michael@0: uint16_t length; michael@0: uint16_t addr_type; michael@0: uint16_t reserved; /* Only one invalid addr type */ michael@0: } SCTP_PACKED; michael@0: michael@0: /* state cookie parameter */ michael@0: struct sctp_state_cookie_param { michael@0: struct sctp_paramhdr ph; michael@0: struct sctp_state_cookie cookie; michael@0: } SCTP_PACKED; michael@0: michael@0: struct sctp_init_chunk { michael@0: struct sctp_chunkhdr ch; michael@0: struct sctp_init init; michael@0: } SCTP_PACKED; michael@0: michael@0: struct sctp_init_msg { michael@0: struct sctphdr sh; michael@0: struct sctp_init_chunk msg; michael@0: } SCTP_PACKED; michael@0: michael@0: /* ... used for both INIT and INIT ACK */ michael@0: #define sctp_init_ack sctp_init michael@0: #define sctp_init_ack_chunk sctp_init_chunk michael@0: #define sctp_init_ack_msg sctp_init_msg michael@0: michael@0: michael@0: /* Selective Ack (SACK) */ michael@0: struct sctp_gap_ack_block { michael@0: uint16_t start; /* Gap Ack block start */ michael@0: uint16_t end; /* Gap Ack block end */ michael@0: } SCTP_PACKED; michael@0: michael@0: struct sctp_sack { michael@0: uint32_t cum_tsn_ack; /* cumulative TSN Ack */ michael@0: uint32_t a_rwnd; /* updated a_rwnd of sender */ michael@0: uint16_t num_gap_ack_blks; /* number of Gap Ack blocks */ michael@0: uint16_t num_dup_tsns; /* number of duplicate TSNs */ michael@0: /* struct sctp_gap_ack_block's follow */ michael@0: /* uint32_t duplicate_tsn's follow */ michael@0: } SCTP_PACKED; michael@0: michael@0: struct sctp_sack_chunk { michael@0: struct sctp_chunkhdr ch; michael@0: struct sctp_sack sack; michael@0: } SCTP_PACKED; michael@0: michael@0: struct sctp_nr_sack { michael@0: uint32_t cum_tsn_ack; /* cumulative TSN Ack */ michael@0: uint32_t a_rwnd; /* updated a_rwnd of sender */ michael@0: uint16_t num_gap_ack_blks; /* number of Gap Ack blocks */ michael@0: uint16_t num_nr_gap_ack_blks; /* number of NR Gap Ack blocks */ michael@0: uint16_t num_dup_tsns; /* number of duplicate TSNs */ michael@0: uint16_t reserved; /* not currently used*/ michael@0: /* struct sctp_gap_ack_block's follow */ michael@0: /* uint32_t duplicate_tsn's follow */ michael@0: } SCTP_PACKED; michael@0: michael@0: struct sctp_nr_sack_chunk { michael@0: struct sctp_chunkhdr ch; michael@0: struct sctp_nr_sack nr_sack; michael@0: } SCTP_PACKED; michael@0: michael@0: michael@0: /* Heartbeat Request (HEARTBEAT) */ michael@0: struct sctp_heartbeat { michael@0: struct sctp_heartbeat_info_param hb_info; michael@0: } SCTP_PACKED; michael@0: michael@0: struct sctp_heartbeat_chunk { michael@0: struct sctp_chunkhdr ch; michael@0: struct sctp_heartbeat heartbeat; michael@0: } SCTP_PACKED; michael@0: michael@0: /* ... used for Heartbeat Ack (HEARTBEAT ACK) */ michael@0: #define sctp_heartbeat_ack sctp_heartbeat michael@0: #define sctp_heartbeat_ack_chunk sctp_heartbeat_chunk michael@0: michael@0: michael@0: /* Abort Asssociation (ABORT) */ michael@0: struct sctp_abort_chunk { michael@0: struct sctp_chunkhdr ch; michael@0: /* optional error cause may follow */ michael@0: } SCTP_PACKED; michael@0: michael@0: struct sctp_abort_msg { michael@0: struct sctphdr sh; michael@0: struct sctp_abort_chunk msg; michael@0: } SCTP_PACKED; michael@0: michael@0: michael@0: /* Shutdown Association (SHUTDOWN) */ michael@0: struct sctp_shutdown_chunk { michael@0: struct sctp_chunkhdr ch; michael@0: uint32_t cumulative_tsn_ack; michael@0: } SCTP_PACKED; michael@0: michael@0: michael@0: /* Shutdown Acknowledgment (SHUTDOWN ACK) */ michael@0: struct sctp_shutdown_ack_chunk { michael@0: struct sctp_chunkhdr ch; michael@0: } SCTP_PACKED; michael@0: michael@0: michael@0: /* Operation Error (ERROR) */ michael@0: struct sctp_error_chunk { michael@0: struct sctp_chunkhdr ch; michael@0: /* optional error causes follow */ michael@0: } SCTP_PACKED; michael@0: michael@0: michael@0: /* Cookie Echo (COOKIE ECHO) */ michael@0: struct sctp_cookie_echo_chunk { michael@0: struct sctp_chunkhdr ch; michael@0: struct sctp_state_cookie cookie; michael@0: } SCTP_PACKED; michael@0: michael@0: /* Cookie Acknowledgment (COOKIE ACK) */ michael@0: struct sctp_cookie_ack_chunk { michael@0: struct sctp_chunkhdr ch; michael@0: } SCTP_PACKED; michael@0: michael@0: /* Explicit Congestion Notification Echo (ECNE) */ michael@0: struct old_sctp_ecne_chunk { michael@0: struct sctp_chunkhdr ch; michael@0: uint32_t tsn; michael@0: } SCTP_PACKED; michael@0: michael@0: struct sctp_ecne_chunk { michael@0: struct sctp_chunkhdr ch; michael@0: uint32_t tsn; michael@0: uint32_t num_pkts_since_cwr; michael@0: } SCTP_PACKED; michael@0: michael@0: /* Congestion Window Reduced (CWR) */ michael@0: struct sctp_cwr_chunk { michael@0: struct sctp_chunkhdr ch; michael@0: uint32_t tsn; michael@0: } SCTP_PACKED; michael@0: michael@0: /* Shutdown Complete (SHUTDOWN COMPLETE) */ michael@0: struct sctp_shutdown_complete_chunk { michael@0: struct sctp_chunkhdr ch; michael@0: } SCTP_PACKED; michael@0: michael@0: /* Oper error holding a stale cookie */ michael@0: struct sctp_stale_cookie_msg { michael@0: struct sctp_paramhdr ph;/* really an error cause */ michael@0: uint32_t time_usec; michael@0: } SCTP_PACKED; michael@0: michael@0: struct sctp_adaptation_layer_indication { michael@0: struct sctp_paramhdr ph; michael@0: uint32_t indication; michael@0: } SCTP_PACKED; michael@0: michael@0: struct sctp_cookie_while_shutting_down { michael@0: struct sctphdr sh; michael@0: struct sctp_chunkhdr ch; michael@0: struct sctp_paramhdr ph;/* really an error cause */ michael@0: } SCTP_PACKED; michael@0: michael@0: struct sctp_shutdown_complete_msg { michael@0: struct sctphdr sh; michael@0: struct sctp_shutdown_complete_chunk shut_cmp; michael@0: } SCTP_PACKED; michael@0: michael@0: /* michael@0: * draft-ietf-tsvwg-addip-sctp michael@0: */ michael@0: /* Address/Stream Configuration Change (ASCONF) */ michael@0: struct sctp_asconf_chunk { michael@0: struct sctp_chunkhdr ch; michael@0: uint32_t serial_number; michael@0: /* lookup address parameter (mandatory) */ michael@0: /* asconf parameters follow */ michael@0: } SCTP_PACKED; michael@0: michael@0: /* Address/Stream Configuration Acknowledge (ASCONF ACK) */ michael@0: struct sctp_asconf_ack_chunk { michael@0: struct sctp_chunkhdr ch; michael@0: uint32_t serial_number; michael@0: /* asconf parameters follow */ michael@0: } SCTP_PACKED; michael@0: michael@0: /* draft-ietf-tsvwg-prsctp */ michael@0: /* Forward Cumulative TSN (FORWARD TSN) */ michael@0: struct sctp_forward_tsn_chunk { michael@0: struct sctp_chunkhdr ch; michael@0: uint32_t new_cumulative_tsn; michael@0: /* stream/sequence pairs (sctp_strseq) follow */ michael@0: } SCTP_PACKED; michael@0: michael@0: struct sctp_strseq { michael@0: uint16_t stream; michael@0: uint16_t sequence; michael@0: } SCTP_PACKED; michael@0: michael@0: struct sctp_forward_tsn_msg { michael@0: struct sctphdr sh; michael@0: struct sctp_forward_tsn_chunk msg; michael@0: } SCTP_PACKED; michael@0: michael@0: /* should be a multiple of 4 - 1 aka 3/7/11 etc. */ michael@0: michael@0: #define SCTP_NUM_DB_TO_VERIFY 31 michael@0: michael@0: struct sctp_chunk_desc { michael@0: uint8_t chunk_type; michael@0: uint8_t data_bytes[SCTP_NUM_DB_TO_VERIFY]; michael@0: uint32_t tsn_ifany; michael@0: } SCTP_PACKED; michael@0: michael@0: michael@0: struct sctp_pktdrop_chunk { michael@0: struct sctp_chunkhdr ch; michael@0: uint32_t bottle_bw; michael@0: uint32_t current_onq; michael@0: uint16_t trunc_len; michael@0: uint16_t reserved; michael@0: uint8_t data[]; michael@0: } SCTP_PACKED; michael@0: michael@0: /**********STREAM RESET STUFF ******************/ michael@0: michael@0: struct sctp_stream_reset_out_request { michael@0: struct sctp_paramhdr ph; michael@0: uint32_t request_seq; /* monotonically increasing seq no */ michael@0: uint32_t response_seq; /* if a response, the resp seq no */ michael@0: uint32_t send_reset_at_tsn; /* last TSN I assigned outbound */ michael@0: uint16_t list_of_streams[]; /* if not all list of streams */ michael@0: } SCTP_PACKED; michael@0: michael@0: struct sctp_stream_reset_in_request { michael@0: struct sctp_paramhdr ph; michael@0: uint32_t request_seq; michael@0: uint16_t list_of_streams[]; /* if not all list of streams */ michael@0: } SCTP_PACKED; michael@0: michael@0: michael@0: struct sctp_stream_reset_tsn_request { michael@0: struct sctp_paramhdr ph; michael@0: uint32_t request_seq; michael@0: } SCTP_PACKED; michael@0: michael@0: struct sctp_stream_reset_response { michael@0: struct sctp_paramhdr ph; michael@0: uint32_t response_seq; /* if a response, the resp seq no */ michael@0: uint32_t result; michael@0: } SCTP_PACKED; michael@0: michael@0: struct sctp_stream_reset_response_tsn { michael@0: struct sctp_paramhdr ph; michael@0: uint32_t response_seq; /* if a response, the resp seq no */ michael@0: uint32_t result; michael@0: uint32_t senders_next_tsn; michael@0: uint32_t receivers_next_tsn; michael@0: } SCTP_PACKED; michael@0: michael@0: struct sctp_stream_reset_add_strm { michael@0: struct sctp_paramhdr ph; michael@0: uint32_t request_seq; michael@0: uint16_t number_of_streams; michael@0: uint16_t reserved; michael@0: } SCTP_PACKED; michael@0: michael@0: #define SCTP_STREAM_RESET_RESULT_NOTHING_TO_DO 0x00000000 /* XXX: unused */ michael@0: #define SCTP_STREAM_RESET_RESULT_PERFORMED 0x00000001 michael@0: #define SCTP_STREAM_RESET_RESULT_DENIED 0x00000002 michael@0: #define SCTP_STREAM_RESET_RESULT_ERR__WRONG_SSN 0x00000003 /* XXX: unused */ michael@0: #define SCTP_STREAM_RESET_RESULT_ERR_IN_PROGRESS 0x00000004 michael@0: #define SCTP_STREAM_RESET_RESULT_ERR_BAD_SEQNO 0x00000005 michael@0: #define SCTP_STREAM_RESET_RESULT_IN_PROGRESS 0x00000006 /* XXX: unused */ michael@0: michael@0: /* michael@0: * convience structures, note that if you are making a request for specific michael@0: * streams then the request will need to be an overlay structure. michael@0: */ michael@0: michael@0: struct sctp_stream_reset_tsn_req { michael@0: struct sctp_chunkhdr ch; michael@0: struct sctp_stream_reset_tsn_request sr_req; michael@0: } SCTP_PACKED; michael@0: michael@0: struct sctp_stream_reset_resp { michael@0: struct sctp_chunkhdr ch; michael@0: struct sctp_stream_reset_response sr_resp; michael@0: } SCTP_PACKED; michael@0: michael@0: /* respone only valid with a TSN request */ michael@0: struct sctp_stream_reset_resp_tsn { michael@0: struct sctp_chunkhdr ch; michael@0: struct sctp_stream_reset_response_tsn sr_resp; michael@0: } SCTP_PACKED; michael@0: michael@0: /****************************************************/ michael@0: michael@0: /* michael@0: * Authenticated chunks support draft-ietf-tsvwg-sctp-auth michael@0: */ michael@0: michael@0: /* Should we make the max be 32? */ michael@0: #define SCTP_RANDOM_MAX_SIZE 256 michael@0: struct sctp_auth_random { michael@0: struct sctp_paramhdr ph;/* type = 0x8002 */ michael@0: uint8_t random_data[]; michael@0: } SCTP_PACKED; michael@0: michael@0: struct sctp_auth_chunk_list { michael@0: struct sctp_paramhdr ph;/* type = 0x8003 */ michael@0: uint8_t chunk_types[]; michael@0: } SCTP_PACKED; michael@0: michael@0: struct sctp_auth_hmac_algo { michael@0: struct sctp_paramhdr ph;/* type = 0x8004 */ michael@0: uint16_t hmac_ids[]; michael@0: } SCTP_PACKED; michael@0: michael@0: struct sctp_auth_chunk { michael@0: struct sctp_chunkhdr ch; michael@0: uint16_t shared_key_id; michael@0: uint16_t hmac_id; michael@0: uint8_t hmac[]; michael@0: } SCTP_PACKED; michael@0: michael@0: struct sctp_auth_invalid_hmac { michael@0: struct sctp_paramhdr ph; michael@0: uint16_t hmac_id; michael@0: uint16_t padding; michael@0: } SCTP_PACKED; michael@0: michael@0: /* michael@0: * we pre-reserve enough room for a ECNE or CWR AND a SACK with no missing michael@0: * pieces. If ENCE is missing we could have a couple of blocks. This way we michael@0: * optimize so we MOST likely can bundle a SACK/ECN with the smallest size michael@0: * data chunk I will split into. We could increase throughput slightly by michael@0: * taking out these two but the 24-sack/8-CWR i.e. 32 bytes I pre-reserve I michael@0: * feel is worth it for now. michael@0: */ michael@0: #ifndef SCTP_MAX_OVERHEAD michael@0: #ifdef INET6 michael@0: #define SCTP_MAX_OVERHEAD (sizeof(struct sctp_data_chunk) + \ michael@0: sizeof(struct sctphdr) + \ michael@0: sizeof(struct sctp_ecne_chunk) + \ michael@0: sizeof(struct sctp_sack_chunk) + \ michael@0: sizeof(struct ip6_hdr)) michael@0: michael@0: #define SCTP_MED_OVERHEAD (sizeof(struct sctp_data_chunk) + \ michael@0: sizeof(struct sctphdr) + \ michael@0: sizeof(struct ip6_hdr)) michael@0: michael@0: michael@0: #define SCTP_MIN_OVERHEAD (sizeof(struct ip6_hdr) + \ michael@0: sizeof(struct sctphdr)) michael@0: michael@0: #else michael@0: #define SCTP_MAX_OVERHEAD (sizeof(struct sctp_data_chunk) + \ michael@0: sizeof(struct sctphdr) + \ michael@0: sizeof(struct sctp_ecne_chunk) + \ michael@0: sizeof(struct sctp_sack_chunk) + \ michael@0: sizeof(struct ip)) michael@0: michael@0: #define SCTP_MED_OVERHEAD (sizeof(struct sctp_data_chunk) + \ michael@0: sizeof(struct sctphdr) + \ michael@0: sizeof(struct ip)) michael@0: michael@0: michael@0: #define SCTP_MIN_OVERHEAD (sizeof(struct ip) + \ michael@0: sizeof(struct sctphdr)) michael@0: michael@0: #endif /* INET6 */ michael@0: #endif /* !SCTP_MAX_OVERHEAD */ michael@0: michael@0: #define SCTP_MED_V4_OVERHEAD (sizeof(struct sctp_data_chunk) + \ michael@0: sizeof(struct sctphdr) + \ michael@0: sizeof(struct ip)) michael@0: michael@0: #define SCTP_MIN_V4_OVERHEAD (sizeof(struct ip) + \ michael@0: sizeof(struct sctphdr)) michael@0: michael@0: #if defined(__Windows__) michael@0: #include michael@0: #endif michael@0: #if defined(__Userspace_os_Windows) michael@0: #pragma pack () michael@0: #endif michael@0: #undef SCTP_PACKED michael@0: #endif /* !__sctp_header_h__ */