sctp.h
上传用户:szlgq88
上传日期:2009-04-28
资源大小:48287k
文件大小:19k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  1. /* SCTP kernel reference Implementation
  2.  * (C) Copyright IBM Corp. 2001, 2004
  3.  * Copyright (c) 1999-2000 Cisco, Inc.
  4.  * Copyright (c) 1999-2001 Motorola, Inc.
  5.  * Copyright (c) 2001 Intel Corp.
  6.  * Copyright (c) 2001 Nokia, Inc.
  7.  * Copyright (c) 2001 La Monte H.P. Yarroll
  8.  *
  9.  * This file is part of the SCTP kernel reference Implementation
  10.  *
  11.  * Various protocol defined structures.
  12.  *
  13.  * The SCTP reference implementation is free software;
  14.  * you can redistribute it and/or modify it under the terms of
  15.  * the GNU General Public License as published by
  16.  * the Free Software Foundation; either version 2, or (at your option)
  17.  * any later version.
  18.  *
  19.  * The SCTP reference implementation is distributed in the hope that it
  20.  * will be useful, but WITHOUT ANY WARRANTY; without even the implied
  21.  *                 ************************
  22.  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  23.  * See the GNU General Public License for more details.
  24.  *
  25.  * You should have received a copy of the GNU General Public License
  26.  * along with GNU CC; see the file COPYING.  If not, write to
  27.  * the Free Software Foundation, 59 Temple Place - Suite 330,
  28.  * Boston, MA 02111-1307, USA.
  29.  *
  30.  * Please send any bug reports or fixes you make to the
  31.  * email address(es):
  32.  *    lksctp developers <lksctp-developerst@lists.sourceforge.net>
  33.  *
  34.  * Or submit a bug report through the following website:
  35.  *    http://www.sf.net/projects/lksctp
  36.  *
  37.  * Written or modified by:
  38.  *    La Monte H.P. Yarroll <piggy@acm.org>
  39.  *    Karl Knutson <karl@athena.chicago.il.us>
  40.  *    Jon Grimm <jgrimm@us.ibm.com>
  41.  *    Xingang Guo <xingang.guo@intel.com>
  42.  *    randall@sctp.chicago.il.us
  43.  *    kmorneau@cisco.com
  44.  *    qxie1@email.mot.com
  45.  *    Sridhar Samudrala <sri@us.ibm.com>
  46.  *    Kevin Gao <kevin.gao@intel.com>
  47.  *
  48.  * Any bugs reported given to us we will try to fix... any fixes shared will
  49.  * be incorporated into the next SCTP release.
  50.  */
  51. #ifndef __LINUX_SCTP_H__
  52. #define __LINUX_SCTP_H__
  53. #include <linux/in.h> /* We need in_addr.  */
  54. #include <linux/in6.h> /* We need in6_addr.  */
  55. /* Section 3.1.  SCTP Common Header Format */
  56. typedef struct sctphdr {
  57. __u16 source;
  58. __u16 dest;
  59. __u32 vtag;
  60. __u32 checksum;
  61. } __attribute__((packed)) sctp_sctphdr_t;
  62. /* Section 3.2.  Chunk Field Descriptions. */
  63. typedef struct sctp_chunkhdr {
  64. __u8 type;
  65. __u8 flags;
  66. __u16 length;
  67. } __attribute__((packed)) sctp_chunkhdr_t;
  68. /* Section 3.2.  Chunk Type Values.
  69.  * [Chunk Type] identifies the type of information contained in the Chunk
  70.  * Value field. It takes a value from 0 to 254. The value of 255 is
  71.  * reserved for future use as an extension field.
  72.  */
  73. typedef enum {
  74. SCTP_CID_DATA = 0,
  75.         SCTP_CID_INIT = 1,
  76.         SCTP_CID_INIT_ACK = 2,
  77.         SCTP_CID_SACK = 3,
  78.         SCTP_CID_HEARTBEAT = 4,
  79.         SCTP_CID_HEARTBEAT_ACK = 5,
  80.         SCTP_CID_ABORT = 6,
  81.         SCTP_CID_SHUTDOWN = 7,
  82.         SCTP_CID_SHUTDOWN_ACK = 8,
  83.         SCTP_CID_ERROR = 9,
  84.         SCTP_CID_COOKIE_ECHO = 10,
  85.         SCTP_CID_COOKIE_ACK         = 11,
  86.         SCTP_CID_ECN_ECNE = 12,
  87.         SCTP_CID_ECN_CWR = 13,
  88.         SCTP_CID_SHUTDOWN_COMPLETE = 14,
  89. /* PR-SCTP Sec 3.2 */
  90. SCTP_CID_FWD_TSN = 0xC0,
  91. /* Use hex, as defined in ADDIP sec. 3.1 */
  92. SCTP_CID_ASCONF = 0xC1,
  93. SCTP_CID_ASCONF_ACK = 0x80,
  94. } sctp_cid_t; /* enum */
  95. /* Section 3.2
  96.  *  Chunk Types are encoded such that the highest-order two bits specify
  97.  *  the action that must be taken if the processing endpoint does not
  98.  *  recognize the Chunk Type.
  99.  */
  100. typedef enum {
  101. SCTP_CID_ACTION_DISCARD     = 0x00,
  102. SCTP_CID_ACTION_DISCARD_ERR = 0x40,
  103. SCTP_CID_ACTION_SKIP        = 0x80,
  104. SCTP_CID_ACTION_SKIP_ERR    = 0xc0,
  105. } sctp_cid_action_t;
  106. enum { SCTP_CID_ACTION_MASK = 0xc0, };
  107. /* This flag is used in Chunk Flags for ABORT and SHUTDOWN COMPLETE.
  108.  *
  109.  * 3.3.7 Abort Association (ABORT) (6):
  110.  *    The T bit is set to 0 if the sender had a TCB that it destroyed.
  111.  *    If the sender did not have a TCB it should set this bit to 1.
  112.  */
  113. enum { SCTP_CHUNK_FLAG_T = 0x01 };
  114. /*
  115.  *  Set the T bit
  116.  *
  117.  *      0                   1                   2                   3
  118.  *      0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  119.  *     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  120.  *     |   Type = 14   |Reserved     |T|      Length = 4               |
  121.  *     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  122.  *
  123.  * Chunk Flags: 8 bits
  124.  *
  125.  *   Reserved:  7 bits
  126.  *     Set to 0 on transmit and ignored on receipt.
  127.  *
  128.  *   T bit:  1 bit
  129.  *     The T bit is set to 0 if the sender had a TCB that it destroyed. If
  130.  *     the sender did NOT have a TCB it should set this bit to 1.
  131.  *
  132.  * Note: Special rules apply to this chunk for verification, please
  133.  * see Section 8.5.1 for details.
  134.  */
  135. #define sctp_test_T_bit(c)    ((c)->chunk_hdr->flags & SCTP_CHUNK_FLAG_T)
  136. /* RFC 2960
  137.  * Section 3.2.1 Optional/Variable-length Parmaeter Format.
  138.  */
  139. typedef struct sctp_paramhdr {
  140. __u16 type;
  141. __u16 length;
  142. } __attribute__((packed)) sctp_paramhdr_t;
  143. typedef enum {
  144. /* RFC 2960 Section 3.3.5 */
  145. SCTP_PARAM_HEARTBEAT_INFO = __constant_htons(1),
  146. /* RFC 2960 Section 3.3.2.1 */
  147. SCTP_PARAM_IPV4_ADDRESS = __constant_htons(5),
  148. SCTP_PARAM_IPV6_ADDRESS = __constant_htons(6),
  149. SCTP_PARAM_STATE_COOKIE = __constant_htons(7),
  150. SCTP_PARAM_UNRECOGNIZED_PARAMETERS = __constant_htons(8),
  151. SCTP_PARAM_COOKIE_PRESERVATIVE = __constant_htons(9),
  152. SCTP_PARAM_HOST_NAME_ADDRESS = __constant_htons(11),
  153. SCTP_PARAM_SUPPORTED_ADDRESS_TYPES = __constant_htons(12),
  154. SCTP_PARAM_ECN_CAPABLE = __constant_htons(0x8000),
  155. /* PR-SCTP Sec 3.1 */
  156. SCTP_PARAM_FWD_TSN_SUPPORT = __constant_htons(0xc000),
  157. /* Add-IP Extension. Section 3.2 */
  158. SCTP_PARAM_ADD_IP = __constant_htons(0xc001),
  159. SCTP_PARAM_DEL_IP = __constant_htons(0xc002),
  160. SCTP_PARAM_ERR_CAUSE = __constant_htons(0xc003),
  161. SCTP_PARAM_SET_PRIMARY = __constant_htons(0xc004),
  162. SCTP_PARAM_SUCCESS_REPORT = __constant_htons(0xc005),
  163. SCTP_PARAM_ADAPTION_LAYER_IND   = __constant_htons(0xc006),
  164. } sctp_param_t; /* enum */
  165. /* RFC 2960 Section 3.2.1
  166.  *  The Parameter Types are encoded such that the highest-order two bits
  167.  *  specify the action that must be taken if the processing endpoint does
  168.  *  not recognize the Parameter Type.
  169.  *
  170.  */
  171. typedef enum {
  172. SCTP_PARAM_ACTION_DISCARD     = __constant_htons(0x0000),
  173. SCTP_PARAM_ACTION_DISCARD_ERR = __constant_htons(0x4000),
  174. SCTP_PARAM_ACTION_SKIP        = __constant_htons(0x8000),
  175. SCTP_PARAM_ACTION_SKIP_ERR    = __constant_htons(0xc000),
  176. } sctp_param_action_t;
  177. enum { SCTP_PARAM_ACTION_MASK = __constant_htons(0xc000), };
  178. /* RFC 2960 Section 3.3.1 Payload Data (DATA) (0) */
  179. typedef struct sctp_datahdr {
  180. __u32 tsn;
  181. __u16 stream;
  182. __u16 ssn;
  183. __u32 ppid;
  184. __u8  payload[0];
  185. } __attribute__((packed)) sctp_datahdr_t;
  186. typedef struct sctp_data_chunk {
  187.         sctp_chunkhdr_t chunk_hdr;
  188.         sctp_datahdr_t  data_hdr;
  189. } __attribute__((packed)) sctp_data_chunk_t;
  190. /* DATA Chuck Specific Flags */
  191. enum {
  192. SCTP_DATA_MIDDLE_FRAG = 0x00,
  193. SCTP_DATA_LAST_FRAG = 0x01,
  194. SCTP_DATA_FIRST_FRAG = 0x02,
  195. SCTP_DATA_NOT_FRAG = 0x03,
  196. SCTP_DATA_UNORDERED = 0x04,
  197. };
  198. enum { SCTP_DATA_FRAG_MASK = 0x03, };
  199. /* RFC 2960 Section 3.3.2 Initiation (INIT) (1)
  200.  *
  201.  *  This chunk is used to initiate a SCTP association between two
  202.  *  endpoints.
  203.  */
  204. typedef struct sctp_inithdr {
  205. __u32 init_tag;
  206. __u32 a_rwnd;
  207. __u16 num_outbound_streams;
  208. __u16 num_inbound_streams;
  209. __u32 initial_tsn;
  210. __u8  params[0];
  211. } __attribute__((packed)) sctp_inithdr_t;
  212. typedef struct sctp_init_chunk {
  213. sctp_chunkhdr_t chunk_hdr;
  214. sctp_inithdr_t init_hdr;
  215. } __attribute__((packed)) sctp_init_chunk_t;
  216. /* Section 3.3.2.1. IPv4 Address Parameter (5) */
  217. typedef struct sctp_ipv4addr_param {
  218. sctp_paramhdr_t param_hdr;
  219. struct in_addr  addr;
  220. } __attribute__((packed)) sctp_ipv4addr_param_t;
  221. /* Section 3.3.2.1. IPv6 Address Parameter (6) */
  222. typedef struct sctp_ipv6addr_param {
  223. sctp_paramhdr_t param_hdr;
  224. struct in6_addr addr;
  225. } __attribute__((packed)) sctp_ipv6addr_param_t;
  226. /* Section 3.3.2.1 Cookie Preservative (9) */
  227. typedef struct sctp_cookie_preserve_param {
  228. sctp_paramhdr_t param_hdr;
  229. uint32_t        lifespan_increment;
  230. } __attribute__((packed)) sctp_cookie_preserve_param_t;
  231. /* Section 3.3.2.1 Host Name Address (11) */
  232. typedef struct sctp_hostname_param {
  233. sctp_paramhdr_t param_hdr;
  234. uint8_t hostname[0];
  235. } __attribute__((packed)) sctp_hostname_param_t;
  236. /* Section 3.3.2.1 Supported Address Types (12) */
  237. typedef struct sctp_supported_addrs_param {
  238. sctp_paramhdr_t param_hdr;
  239. uint16_t types[0];
  240. } __attribute__((packed)) sctp_supported_addrs_param_t;
  241. /* Appendix A. ECN Capable (32768) */
  242. typedef struct sctp_ecn_capable_param {
  243. sctp_paramhdr_t param_hdr;
  244. } __attribute__((packed)) sctp_ecn_capable_param_t;
  245. /* ADDIP Section 3.2.6 Adaption Layer Indication */
  246. typedef struct sctp_adaption_ind_param {
  247. struct sctp_paramhdr param_hdr;
  248. __u32 adaption_ind;
  249. } __attribute__((packed)) sctp_adaption_ind_param_t;
  250. /* RFC 2960.  Section 3.3.3 Initiation Acknowledgement (INIT ACK) (2):
  251.  *   The INIT ACK chunk is used to acknowledge the initiation of an SCTP
  252.  *   association.
  253.  */
  254. typedef sctp_init_chunk_t sctp_initack_chunk_t;
  255. /* Section 3.3.3.1 State Cookie (7) */
  256. typedef struct sctp_cookie_param {
  257. sctp_paramhdr_t p;
  258. __u8 body[0];
  259. } __attribute__((packed)) sctp_cookie_param_t;
  260. /* Section 3.3.3.1 Unrecognized Parameters (8) */
  261. typedef struct sctp_unrecognized_param {
  262. sctp_paramhdr_t param_hdr;
  263. sctp_paramhdr_t unrecognized;
  264. } __attribute__((packed)) sctp_unrecognized_param_t;
  265. /*
  266.  * 3.3.4 Selective Acknowledgement (SACK) (3):
  267.  *
  268.  *  This chunk is sent to the peer endpoint to acknowledge received DATA
  269.  *  chunks and to inform the peer endpoint of gaps in the received
  270.  *  subsequences of DATA chunks as represented by their TSNs.
  271.  */
  272. typedef struct sctp_gap_ack_block {
  273. __u16 start;
  274. __u16 end;
  275. } __attribute__((packed)) sctp_gap_ack_block_t;
  276. typedef uint32_t sctp_dup_tsn_t;
  277. typedef union {
  278. sctp_gap_ack_block_t gab;
  279.         sctp_dup_tsn_t dup;
  280. } sctp_sack_variable_t;
  281. typedef struct sctp_sackhdr {
  282. __u32 cum_tsn_ack;
  283. __u32 a_rwnd;
  284. __u16 num_gap_ack_blocks;
  285. __u16 num_dup_tsns;
  286. sctp_sack_variable_t variable[0];
  287. } __attribute__((packed)) sctp_sackhdr_t;
  288. typedef struct sctp_sack_chunk {
  289. sctp_chunkhdr_t chunk_hdr;
  290. sctp_sackhdr_t sack_hdr;
  291. } __attribute__((packed)) sctp_sack_chunk_t;
  292. /* RFC 2960.  Section 3.3.5 Heartbeat Request (HEARTBEAT) (4):
  293.  *
  294.  *  An endpoint should send this chunk to its peer endpoint to probe the
  295.  *  reachability of a particular destination transport address defined in
  296.  *  the present association.
  297.  */
  298. typedef struct sctp_heartbeathdr {
  299. sctp_paramhdr_t info;
  300. } __attribute__((packed)) sctp_heartbeathdr_t;
  301. typedef struct sctp_heartbeat_chunk {
  302. sctp_chunkhdr_t chunk_hdr;
  303. sctp_heartbeathdr_t hb_hdr;
  304. } __attribute__((packed)) sctp_heartbeat_chunk_t;
  305. /* For the abort and shutdown ACK we must carry the init tag in the
  306.  * common header. Just the common header is all that is needed with a
  307.  * chunk descriptor.
  308.  */
  309. typedef struct sctp_abort_chunk {
  310.         sctp_chunkhdr_t uh;
  311. } __attribute__((packed)) sctp_abort_chunk_t;
  312. /* For the graceful shutdown we must carry the tag (in common header)
  313.  * and the highest consecutive acking value.
  314.  */
  315. typedef struct sctp_shutdownhdr {
  316. __u32 cum_tsn_ack;
  317. } __attribute__((packed)) sctp_shutdownhdr_t;
  318. struct sctp_shutdown_chunk_t {
  319.         sctp_chunkhdr_t    chunk_hdr;
  320.         sctp_shutdownhdr_t shutdown_hdr;
  321. } __attribute__ ((packed));
  322. /* RFC 2960.  Section 3.3.10 Operation Error (ERROR) (9) */
  323. typedef struct sctp_errhdr {
  324. __u16 cause;
  325. __u16 length;
  326. __u8  variable[0];
  327. } __attribute__((packed)) sctp_errhdr_t;
  328. typedef struct sctp_operr_chunk {
  329.         sctp_chunkhdr_t chunk_hdr;
  330. sctp_errhdr_t   err_hdr;
  331. } __attribute__((packed)) sctp_operr_chunk_t;
  332. /* RFC 2960 3.3.10 - Operation Error
  333.  *
  334.  * Cause Code: 16 bits (unsigned integer)
  335.  *
  336.  *     Defines the type of error conditions being reported.
  337.  *    Cause Code
  338.  *     Value           Cause Code
  339.  *     ---------      ----------------
  340.  *      1              Invalid Stream Identifier
  341.  *      2              Missing Mandatory Parameter
  342.  *      3              Stale Cookie Error
  343.  *      4              Out of Resource
  344.  *      5              Unresolvable Address
  345.  *      6              Unrecognized Chunk Type
  346.  *      7              Invalid Mandatory Parameter
  347.  *      8              Unrecognized Parameters
  348.  *      9              No User Data
  349.  *     10              Cookie Received While Shutting Down
  350.  */
  351. typedef enum {
  352. SCTP_ERROR_NO_ERROR    = __constant_htons(0x00),
  353. SCTP_ERROR_INV_STRM    = __constant_htons(0x01),
  354. SCTP_ERROR_MISS_PARAM     = __constant_htons(0x02),
  355. SCTP_ERROR_STALE_COOKIE    = __constant_htons(0x03),
  356. SCTP_ERROR_NO_RESOURCE     = __constant_htons(0x04),
  357. SCTP_ERROR_DNS_FAILED      = __constant_htons(0x05),
  358. SCTP_ERROR_UNKNOWN_CHUNK   = __constant_htons(0x06),
  359. SCTP_ERROR_INV_PARAM       = __constant_htons(0x07),
  360. SCTP_ERROR_UNKNOWN_PARAM   = __constant_htons(0x08),
  361. SCTP_ERROR_NO_DATA         = __constant_htons(0x09),
  362. SCTP_ERROR_COOKIE_IN_SHUTDOWN = __constant_htons(0x0a),
  363. /* SCTP Implementation Guide:
  364.  *  11  Restart of an association with new addresses
  365.  *  12  User Initiated Abort
  366.  *  13  Protocol Violation
  367.  */
  368. SCTP_ERROR_RESTART         = __constant_htons(0x0b),
  369. SCTP_ERROR_USER_ABORT      = __constant_htons(0x0c),
  370. SCTP_ERROR_PROTO_VIOLATION = __constant_htons(0x0d),
  371. /* ADDIP Section 3.3  New Error Causes
  372.  *
  373.  * Four new Error Causes are added to the SCTP Operational Errors,
  374.  * primarily for use in the ASCONF-ACK chunk.
  375.  *
  376.  * Value          Cause Code
  377.  * ---------      ----------------
  378.  * 0x0100          Request to Delete Last Remaining IP Address.
  379.  * 0x0101          Operation Refused Due to Resource Shortage.
  380.  * 0x0102          Request to Delete Source IP Address.
  381.  * 0x0103          Association Aborted due to illegal ASCONF-ACK
  382.  * 0x0104          Request refused - no authorization.
  383.  */
  384. SCTP_ERROR_DEL_LAST_IP = __constant_htons(0x0100),
  385. SCTP_ERROR_RSRC_LOW = __constant_htons(0x0101),
  386. SCTP_ERROR_DEL_SRC_IP = __constant_htons(0x0102),
  387. SCTP_ERROR_ASCONF_ACK   = __constant_htons(0x0103),
  388. SCTP_ERROR_REQ_REFUSED = __constant_htons(0x0104)
  389. } sctp_error_t;
  390. /* RFC 2960.  Appendix A.  Explicit Congestion Notification.
  391.  *   Explicit Congestion Notification Echo (ECNE) (12)
  392.  */
  393. typedef struct sctp_ecnehdr {
  394. __u32 lowest_tsn;
  395. } sctp_ecnehdr_t;
  396. typedef struct sctp_ecne_chunk {
  397. sctp_chunkhdr_t chunk_hdr;
  398. sctp_ecnehdr_t ence_hdr;
  399. } __attribute__((packed)) sctp_ecne_chunk_t;
  400. /* RFC 2960.  Appendix A.  Explicit Congestion Notification.
  401.  *   Congestion Window Reduced (CWR) (13)
  402.  */
  403. typedef struct sctp_cwrhdr {
  404. __u32 lowest_tsn;
  405. } sctp_cwrhdr_t;
  406. typedef struct sctp_cwr_chunk {
  407. sctp_chunkhdr_t chunk_hdr;
  408. sctp_cwrhdr_t cwr_hdr;
  409. } __attribute__((packed)) sctp_cwr_chunk_t;
  410. /* PR-SCTP
  411.  * 3.2 Forward Cumulative TSN Chunk Definition (FORWARD TSN)
  412.  *
  413.  * Forward Cumulative TSN chunk has the following format:
  414.  *
  415.  *        0                   1                   2                   3
  416.  *        0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  417.  *      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  418.  *      |   Type = 192  |  Flags = 0x00 |        Length = Variable      |
  419.  *      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  420.  *      |                      New Cumulative TSN                       |
  421.  *      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  422.  *      |         Stream-1              |       Stream Sequence-1       |
  423.  *      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  424.  *                                                                     /
  425.  *      /                                                               
  426.  *      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  427.  *      |         Stream-N              |       Stream Sequence-N       |
  428.  *      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  429.  *
  430.  *      Chunk Flags:
  431.  *
  432.  *        Set to all zeros on transmit and ignored on receipt.
  433.  *
  434.  *      New Cumulative TSN: 32 bit u_int
  435.  *
  436.  *       This indicates the new cumulative TSN to the data receiver. Upon
  437.  *       the reception of this value, the data receiver MUST consider
  438.  *       any missing TSNs earlier than or equal to this value as received
  439.  *       and stop reporting them as gaps in any subsequent SACKs.
  440.  *
  441.  *      Stream-N: 16 bit u_int
  442.  *
  443.  *       This field holds a stream number that was skipped by this
  444.  *       FWD-TSN.
  445.  *
  446.  *      Stream Sequence-N: 16 bit u_int
  447.  *       This field holds the sequence number associated with the stream
  448.  *       that was skipped. The stream sequence field holds the largest stream
  449.  *       sequence number in this stream being skipped.  The receiver of
  450.  *       the FWD-TSN's can use the Stream-N and Stream Sequence-N fields
  451.  *       to enable delivery of any stranded TSN's that remain on the stream
  452.  *       re-ordering queues. This field MUST NOT report TSN's corresponding
  453.  *       to DATA chunk that are marked as unordered. For ordered DATA
  454.  *       chunks this field MUST be filled in.
  455.  */
  456. struct sctp_fwdtsn_skip {
  457. __u16 stream;
  458. __u16 ssn;
  459. } __attribute__((packed));
  460. struct sctp_fwdtsn_hdr {
  461. __u32 new_cum_tsn;
  462. struct sctp_fwdtsn_skip skip[0];
  463. } __attribute((packed));
  464. struct sctp_fwdtsn_chunk {
  465. struct sctp_chunkhdr chunk_hdr;
  466. struct sctp_fwdtsn_hdr fwdtsn_hdr;
  467. } __attribute((packed));
  468. /* ADDIP
  469.  * Section 3.1.1 Address Configuration Change Chunk (ASCONF)
  470.  *
  471.  *  Serial Number: 32 bits (unsigned integer)
  472.  * This value represents a Serial Number for the ASCONF Chunk. The
  473.  * valid range of Serial Number is from 0 to 2^32-1.
  474.  * Serial Numbers wrap back to 0 after reaching 2^32 -1.
  475.  *
  476.  * Address Parameter: 8 or 20 bytes (depending on type)
  477.  * The address is an address of the sender of the ASCONF chunk,
  478.  * the address MUST be considered part of the association by the
  479.  * peer endpoint. This field may be used by the receiver of the 
  480.  * ASCONF to help in finding the association. This parameter MUST
  481.  * be present in every ASCONF message i.e. it is a mandatory TLV
  482.  * parameter.
  483.  *
  484.  * ASCONF Parameter: TLV format
  485.  * Each Address configuration change is represented by a TLV
  486.  * parameter as defined in Section 3.2. One or more requests may
  487.  * be present in an ASCONF Chunk.
  488.  *
  489.  * Section 3.1.2 Address Configuration Acknowledgement Chunk (ASCONF-ACK)
  490.  * 
  491.  * Serial Number: 32 bits (unsigned integer)
  492.  * This value represents the Serial Number for the received ASCONF
  493.  * Chunk that is acknowledged by this chunk. This value is copied
  494.  * from the received ASCONF Chunk. 
  495.  *
  496.  * ASCONF Parameter Response: TLV format
  497.  * The ASCONF Parameter Response is used in the ASCONF-ACK to
  498.  * report status of ASCONF processing.
  499.  */
  500. typedef struct sctp_addip_param {
  501. sctp_paramhdr_t param_hdr;
  502. __u32 crr_id;
  503. } __attribute__((packed)) sctp_addip_param_t;
  504. typedef struct sctp_addiphdr {
  505. __u32 serial;
  506. __u8 params[0];
  507. } __attribute__((packed)) sctp_addiphdr_t;
  508. typedef struct sctp_addip_chunk {
  509. sctp_chunkhdr_t chunk_hdr;
  510. sctp_addiphdr_t addip_hdr;
  511. } __attribute__((packed)) sctp_addip_chunk_t;
  512. #endif /* __LINUX_SCTP_H__ */