/*- * SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. * Copyright (c) 2008-2012, by Randall Stewart. All rights reserved. * Copyright (c) 2008-2012, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * a) Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * b) Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the distribution. * * c) Neither the name of Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE.
*/
struct sctp_idata {
uint32_t tsn;
uint16_t sid;
uint16_t reserved; /* Where does the SSN go? */
uint32_t mid; union {
uint32_t ppid;
uint32_t fsn; /* Fragment Sequence Number */
} ppid_fsn; /* user data follows */
} SCTP_PACKED;
/* Initiate (INIT)/Initiate Ack (INIT ACK) */ struct sctp_init {
uint32_t initiate_tag; /* initiate tag */
uint32_t a_rwnd; /* a_rwnd */
uint16_t num_outbound_streams; /* OS */
uint16_t num_inbound_streams; /* MIS */
uint32_t initial_tsn; /* I-TSN */ /* optional param's follow */
} SCTP_PACKED; #define SCTP_IDENTIFICATION_SIZE 16 #define SCTP_ADDRESS_SIZE 4 #ifdefined(__Userspace__) #define SCTP_RESERVE_SPACE 4 #else #define SCTP_RESERVE_SPACE 5 #endif /* state cookie header */ struct sctp_state_cookie { /* this is our definition... */
uint8_t identification[SCTP_IDENTIFICATION_SIZE];/* id of who we are */ struct timeval time_entered; /* the time I built cookie */
uint32_t cookie_life; /* life I will award this cookie */
uint32_t tie_tag_my_vtag; /* my tag in old association */
uint32_t tie_tag_peer_vtag; /* peers tag in old association */
uint32_t peers_vtag; /* peers tag in INIT (for quick ref) */
uint32_t my_vtag; /* my tag in INIT-ACK (for quick ref) */
uint32_t address[SCTP_ADDRESS_SIZE]; /* 4 ints/128 bits */
uint32_t addr_type; /* address type */
uint32_t laddress[SCTP_ADDRESS_SIZE]; /* my local from address */
uint32_t laddr_type; /* my local from address type */
uint32_t scope_id; /* v6 scope id for link-locals */
uint16_t peerport; /* port address of the peer in the INIT */
uint16_t myport; /* my port address used in the INIT */
uint8_t ipv4_addr_legal;/* Are V4 addr legal? */
uint8_t ipv6_addr_legal;/* Are V6 addr legal? */ #ifdefined(__Userspace__)
uint8_t conn_addr_legal; #endif
uint8_t local_scope; /* IPv6 local scope flag */
uint8_t site_scope; /* IPv6 site scope flag */
uint8_t ipv4_scope; /* IPv4 private addr scope */
uint8_t loopback_scope; /* loopback scope information */
uint8_t rcv_edmid; /* copy of the inp value */
uint8_t reserved[SCTP_RESERVE_SPACE]; /* Align to 64 bits */ /* * at the end is tacked on the INIT chunk and the INIT-ACK chunk * (minus the cookie).
*/
} SCTP_PACKED;
/* ... used for both INIT and INIT ACK */ #define sctp_init_ack sctp_init #define sctp_init_ack_chunk sctp_init_chunk #define sctp_init_ack_msg sctp_init_msg
/* Selective Ack (SACK) */ struct sctp_gap_ack_block {
uint16_t start; /* Gap Ack block start */
uint16_t end; /* Gap Ack block end */
} SCTP_PACKED;
struct sctp_sack {
uint32_t cum_tsn_ack; /* cumulative TSN Ack */
uint32_t a_rwnd; /* updated a_rwnd of sender */
uint16_t num_gap_ack_blks; /* number of Gap Ack blocks */
uint16_t num_dup_tsns; /* number of duplicate TSNs */ /* struct sctp_gap_ack_block's follow */ /* uint32_t duplicate_tsn's follow */
} SCTP_PACKED;
struct sctp_stream_reset_out_request { struct sctp_paramhdr ph;
uint32_t request_seq; /* monotonically increasing seq no */
uint32_t response_seq; /* if a response, the resp seq no */
uint32_t send_reset_at_tsn; /* last TSN I assigned outbound */
uint16_t list_of_streams[]; /* if not all list of streams */
} SCTP_PACKED;
struct sctp_stream_reset_in_request { struct sctp_paramhdr ph;
uint32_t request_seq;
uint16_t list_of_streams[]; /* if not all list of streams */
} SCTP_PACKED;
/* * Authenticated chunks support draft-ietf-tsvwg-sctp-auth
*/
/* Should we make the max be 32? */ #define SCTP_RANDOM_MAX_SIZE 256 struct sctp_auth_random { struct sctp_paramhdr ph;/* type = 0x8002 */
uint8_t random_data[];
} SCTP_PACKED;
/* * we pre-reserve enough room for a ECNE or CWR AND a SACK with no missing * pieces. If ENCE is missing we could have a couple of blocks. This way we * optimize so we MOST likely can bundle a SACK/ECN with the smallest size * data chunk I will split into. We could increase throughput slightly by * taking out these two but the 24-sack/8-CWR i.e. 32 bytes I pre-reserve I * feel is worth it for now.
*/ #ifndef SCTP_MAX_OVERHEAD #ifdef INET6 #define SCTP_MAX_OVERHEAD (sizeof(struct sctp_data_chunk) + \ sizeof(struct sctphdr) + \ sizeof(struct sctp_ecne_chunk) + \ sizeof(struct sctp_sack_chunk) + \ sizeof(struct ip6_hdr))
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.