Commit d8f3637a authored by Jon Grimm's avatar Jon Grimm

Merge touki.austin.ibm.com:/home/jgrimm/bk/lksctp-2.5

into touki.austin.ibm.com:/home/jgrimm/bk/lksctp-2.5.work
parents f64d4b67 150d6421
/* SCTP kernel reference Implementation /* SCTP kernel reference Implementation
* Copyright (c) 1999-2000 Cisco, Inc. * Copyright (c) 1999-2000 Cisco, Inc.
* Copyright (c) 1999-2001 Motorola, Inc. * Copyright (c) 1999-2001 Motorola, Inc.
* Copyright (c) 2001 International Business Machines, Corp. * Copyright (c) 2001-2002 International Business Machines, Corp.
* Copyright (c) 2001 Intel Corp. * Copyright (c) 2001 Intel Corp.
* Copyright (c) 2001 Nokia, Inc. * Copyright (c) 2001 Nokia, Inc.
* Copyright (c) 2001 La Monte H.P. Yarroll * Copyright (c) 2001 La Monte H.P. Yarroll
* *
* This file is part of the SCTP kernel reference Implementation * This file is part of the SCTP kernel reference Implementation
* *
* Various protocol defined structures. * Various protocol defined structures.
* *
* The SCTP reference implementation is free software; * The SCTP reference implementation is free software;
* you can redistribute it and/or modify it under the terms of * you can redistribute it and/or modify it under the terms of
* the GNU General Public License as published by * the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option) * the Free Software Foundation; either version 2, or (at your option)
* any later version. * any later version.
* *
* The SCTP reference implementation is distributed in the hope that it * The SCTP reference implementation is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied * will be useful, but WITHOUT ANY WARRANTY; without even the implied
* ************************ * ************************
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. * See the GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with GNU CC; see the file COPYING. If not, write to * along with GNU CC; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330, * the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
* *
* Please send any bug reports or fixes you make to the * Please send any bug reports or fixes you make to the
* email address(es): * email address(es):
* lksctp developers <sctp-developers-list@cig.mot.com> * lksctp developers <lksctp-developerst@lists.sourceforge.net>
* *
* Or submit a bug report through the following website: * Or submit a bug report through the following website:
* http://www.sf.net/projects/lksctp * http://www.sf.net/projects/lksctp
* *
* Written or modified by: * Written or modified by:
* La Monte H.P. Yarroll <piggy@acm.org> * La Monte H.P. Yarroll <piggy@acm.org>
* Karl Knutson <karl@athena.chicago.il.us> * Karl Knutson <karl@athena.chicago.il.us>
* Jon Grimm <jgrimm@us.ibm.com> * Jon Grimm <jgrimm@us.ibm.com>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
* randall@sctp.chicago.il.us * randall@sctp.chicago.il.us
* kmorneau@cisco.com * kmorneau@cisco.com
* qxie1@email.mot.com * qxie1@email.mot.com
* *
* Any bugs reported given to us we will try to fix... any fixes shared will * Any bugs reported given to us we will try to fix... any fixes shared will
* be incorporated into the next SCTP release. * be incorporated into the next SCTP release.
*/ */
...@@ -70,9 +70,9 @@ typedef struct sctp_chunkhdr { ...@@ -70,9 +70,9 @@ typedef struct sctp_chunkhdr {
/* Section 3.2. Chunk Type Values. /* Section 3.2. Chunk Type Values.
* [Chunk Type] identifies the type of information contained in the Chunk * [Chunk Type] identifies the type of information contained in the Chunk
* Value field. It takes a value from 0 to 254. The value of 255 is * Value field. It takes a value from 0 to 254. The value of 255 is
* reserved for future use as an extension field. * reserved for future use as an extension field.
*/ */
typedef enum { typedef enum {
SCTP_CID_DATA = 0, SCTP_CID_DATA = 0,
...@@ -97,7 +97,7 @@ typedef enum { ...@@ -97,7 +97,7 @@ typedef enum {
} sctp_cid_t; /* enum */ } sctp_cid_t; /* enum */
/* Section 3.2 /* Section 3.2
* Chunk Types are encoded such that the highest-order two bits specify * Chunk Types are encoded such that the highest-order two bits specify
* the action that must be taken if the processing endpoint does not * the action that must be taken if the processing endpoint does not
* recognize the Chunk Type. * recognize the Chunk Type.
...@@ -107,7 +107,7 @@ typedef enum { ...@@ -107,7 +107,7 @@ typedef enum {
SCTP_CID_ACTION_DISCARD_ERR = 0x40, SCTP_CID_ACTION_DISCARD_ERR = 0x40,
SCTP_CID_ACTION_SKIP = 0x80, SCTP_CID_ACTION_SKIP = 0x80,
SCTP_CID_ACTION_SKIP_ERR = 0xc0, SCTP_CID_ACTION_SKIP_ERR = 0xc0,
} sctp_cid_action_t; } sctp_cid_action_t;
enum { SCTP_CID_ACTION_MASK = 0xc0, }; enum { SCTP_CID_ACTION_MASK = 0xc0, };
...@@ -127,23 +127,23 @@ enum { SCTP_CHUNK_FLAG_T = 0x01 }; ...@@ -127,23 +127,23 @@ enum { SCTP_CHUNK_FLAG_T = 0x01 };
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Type = 14 |Reserved |T| Length = 4 | * | Type = 14 |Reserved |T| Length = 4 |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* *
* Chunk Flags: 8 bits * Chunk Flags: 8 bits
* *
* Reserved: 7 bits * Reserved: 7 bits
* Set to 0 on transmit and ignored on receipt. * Set to 0 on transmit and ignored on receipt.
* *
* T bit: 1 bit * T bit: 1 bit
* The T bit is set to 0 if the sender had a TCB that it destroyed. If * The T bit is set to 0 if the sender had a TCB that it destroyed. If
* the sender did NOT have a TCB it should set this bit to 1. * the sender did NOT have a TCB it should set this bit to 1.
* *
* Note: Special rules apply to this chunk for verification, please * Note: Special rules apply to this chunk for verification, please
* see Section 8.5.1 for details. * see Section 8.5.1 for details.
*/ */
#define sctp_test_T_bit(c) ((c)->chunk_hdr->flags & SCTP_CHUNK_FLAG_T) #define sctp_test_T_bit(c) ((c)->chunk_hdr->flags & SCTP_CHUNK_FLAG_T)
/* RFC 2960 /* RFC 2960
* Section 3.2.1 Optional/Variable-length Parmaeter Format. * Section 3.2.1 Optional/Variable-length Parmaeter Format.
*/ */
...@@ -167,11 +167,11 @@ typedef enum { ...@@ -167,11 +167,11 @@ typedef enum {
SCTP_PARAM_ECN_CAPABLE = __constant_htons(0x8000), SCTP_PARAM_ECN_CAPABLE = __constant_htons(0x8000),
/* Add-IP Extension. Section 3.2 */ /* Add-IP Extension. Section 3.2 */
SCTP_PARAM_ADD_IP = __constant_htons(0xc001), SCTP_PARAM_ADD_IP = __constant_htons(0xc001),
SCTP_PARAM_DEL_IP = __constant_htons(0xc002), SCTP_PARAM_DEL_IP = __constant_htons(0xc002),
SCTP_PARAM_ERR_CAUSE = __constant_htons(0xc003), SCTP_PARAM_ERR_CAUSE = __constant_htons(0xc003),
SCTP_PARAM_SET_PRIMARY = __constant_htons(0xc004), SCTP_PARAM_SET_PRIMARY = __constant_htons(0xc004),
SCTP_PARAM_SUCCESS_REPORT = __constant_htons(0xc005), SCTP_PARAM_SUCCESS_REPORT = __constant_htons(0xc005),
SCTP_PARAM_ADAPTION_LAYER_IND = __constant_htons(0xc006), SCTP_PARAM_ADAPTION_LAYER_IND = __constant_htons(0xc006),
} sctp_param_t; /* enum */ } sctp_param_t; /* enum */
...@@ -188,7 +188,7 @@ typedef enum { ...@@ -188,7 +188,7 @@ typedef enum {
SCTP_PARAM_ACTION_DISCARD_ERR = __constant_htons(0x4000), SCTP_PARAM_ACTION_DISCARD_ERR = __constant_htons(0x4000),
SCTP_PARAM_ACTION_SKIP = __constant_htons(0x8000), SCTP_PARAM_ACTION_SKIP = __constant_htons(0x8000),
SCTP_PARAM_ACTION_SKIP_ERR = __constant_htons(0xc000), SCTP_PARAM_ACTION_SKIP_ERR = __constant_htons(0xc000),
} sctp_param_action_t; } sctp_param_action_t;
enum { SCTP_PARAM_ACTION_MASK = __constant_htons(0xc000), }; enum { SCTP_PARAM_ACTION_MASK = __constant_htons(0xc000), };
...@@ -215,14 +215,14 @@ enum { ...@@ -215,14 +215,14 @@ enum {
SCTP_DATA_NOT_FRAG = 0x03, SCTP_DATA_NOT_FRAG = 0x03,
SCTP_DATA_UNORDERED = 0x04, SCTP_DATA_UNORDERED = 0x04,
}; };
enum { SCTP_DATA_FRAG_MASK = 0x03, }; enum { SCTP_DATA_FRAG_MASK = 0x03, };
/* RFC 2960 Section 3.3.2 Initiation (INIT) (1) /* RFC 2960 Section 3.3.2 Initiation (INIT) (1)
* *
* This chunk is used to initiate a SCTP association between two * This chunk is used to initiate a SCTP association between two
* endpoints. * endpoints.
*/ */
typedef struct sctp_inithdr { typedef struct sctp_inithdr {
__u32 init_tag; __u32 init_tag;
__u32 a_rwnd; __u32 a_rwnd;
...@@ -249,7 +249,7 @@ typedef struct sctp_ipv6addr_param { ...@@ -249,7 +249,7 @@ typedef struct sctp_ipv6addr_param {
sctp_paramhdr_t param_hdr; sctp_paramhdr_t param_hdr;
struct in6_addr addr; struct in6_addr addr;
} sctp_ipv6addr_param_t __attribute__((packed)); } sctp_ipv6addr_param_t __attribute__((packed));
/* Section 3.3.2.1 Cookie Preservative (9) */ /* Section 3.3.2.1 Cookie Preservative (9) */
typedef struct sctp_cookie_preserve_param { typedef struct sctp_cookie_preserve_param {
sctp_paramhdr_t param_hdr; sctp_paramhdr_t param_hdr;
...@@ -344,8 +344,8 @@ typedef struct sctp_heartbeat_chunk { ...@@ -344,8 +344,8 @@ typedef struct sctp_heartbeat_chunk {
sctp_chunkhdr_t chunk_hdr; sctp_chunkhdr_t chunk_hdr;
sctp_heartbeathdr_t hb_hdr; sctp_heartbeathdr_t hb_hdr;
} sctp_heartbeat_chunk_t __attribute__((packed)); } sctp_heartbeat_chunk_t __attribute__((packed));
/* For the abort and shutdown ACK we must carry the init tag in the /* For the abort and shutdown ACK we must carry the init tag in the
* common header. Just the common header is all that is needed with a * common header. Just the common header is all that is needed with a
* chunk descriptor. * chunk descriptor.
...@@ -366,7 +366,7 @@ struct sctp_shutdown_chunk_t { ...@@ -366,7 +366,7 @@ struct sctp_shutdown_chunk_t {
sctp_chunkhdr_t chunk_hdr; sctp_chunkhdr_t chunk_hdr;
sctp_shutdownhdr_t shutdown_hdr; sctp_shutdownhdr_t shutdown_hdr;
} __attribute__((packed)); } __attribute__((packed));
/* RFC 2960. Section 3.3.10 Operation Error (ERROR) (9) */ /* RFC 2960. Section 3.3.10 Operation Error (ERROR) (9) */
...@@ -403,9 +403,9 @@ typedef struct sctp_operr_chunk { ...@@ -403,9 +403,9 @@ typedef struct sctp_operr_chunk {
*/ */
typedef enum { typedef enum {
SCTP_ERROR_NO_ERROR = __constant_htons(0x00), SCTP_ERROR_NO_ERROR = __constant_htons(0x00),
SCTP_ERROR_INV_STRM = __constant_htons(0x01), SCTP_ERROR_INV_STRM = __constant_htons(0x01),
SCTP_ERROR_MISS_PARAM = __constant_htons(0x02), SCTP_ERROR_MISS_PARAM = __constant_htons(0x02),
SCTP_ERROR_STALE_COOKIE = __constant_htons(0x03), SCTP_ERROR_STALE_COOKIE = __constant_htons(0x03),
SCTP_ERROR_NO_RESOURCE = __constant_htons(0x04), SCTP_ERROR_NO_RESOURCE = __constant_htons(0x04),
SCTP_ERROR_DNS_FAILED = __constant_htons(0x05), SCTP_ERROR_DNS_FAILED = __constant_htons(0x05),
...@@ -416,13 +416,15 @@ typedef enum { ...@@ -416,13 +416,15 @@ typedef enum {
SCTP_ERROR_COOKIE_IN_SHUTDOWN = __constant_htons(0x0a), SCTP_ERROR_COOKIE_IN_SHUTDOWN = __constant_htons(0x0a),
/* SCTP Implementation Guide: /* SCTP Implementation Guide:
* 11 Restart of an association with new addresses * 11 Restart of an association with new addresses
* 12 User Initiated Abort * 12 User Initiated Abort
* 13 Protocol Violation
*/ */
SCTP_ERROR_RESTART = __constant_htons(0x0b), SCTP_ERROR_RESTART = __constant_htons(0x0b),
SCTP_ERROR_USER_ABORT = __constant_htons(0x0c), SCTP_ERROR_USER_ABORT = __constant_htons(0x0c),
SCTP_ERROR_PROTO_VIOLATION = __constant_htons(0x0d),
/* ADDIP Section 3.3 New Error Causes /* ADDIP Section 3.3 New Error Causes
* *
...@@ -436,16 +438,16 @@ typedef enum { ...@@ -436,16 +438,16 @@ typedef enum {
* 0x0102 Request to Delete Source IP Address. * 0x0102 Request to Delete Source IP Address.
* 0x0103 Association Aborted due to illegal ASCONF-ACK * 0x0103 Association Aborted due to illegal ASCONF-ACK
*/ */
SCTP_ERROR_DEL_LAST_IP = __constant_htons(0x0100), SCTP_ERROR_DEL_LAST_IP = __constant_htons(0x0100),
SCTP_ERROR_RSRC_LOW = __constant_htons(0x0101), SCTP_ERROR_RSRC_LOW = __constant_htons(0x0101),
SCTP_ERROR_DEL_SRC_IP = __constant_htons(0x0102), SCTP_ERROR_DEL_SRC_IP = __constant_htons(0x0102),
SCTP_ERROR_ASCONF_ACK = __constant_htons(0x0103), SCTP_ERROR_ASCONF_ACK = __constant_htons(0x0103),
} sctp_error_t; } sctp_error_t;
/* RFC 2960. Appendix A. Explicit Congestion Notification. /* RFC 2960. Appendix A. Explicit Congestion Notification.
* Explicit Congestion Notification Echo (ECNE) (12) * Explicit Congestion Notification Echo (ECNE) (12)
*/ */
typedef struct sctp_ecnehdr { typedef struct sctp_ecnehdr {
...@@ -457,7 +459,7 @@ typedef struct sctp_ecne_chunk { ...@@ -457,7 +459,7 @@ typedef struct sctp_ecne_chunk {
sctp_ecnehdr_t ence_hdr; sctp_ecnehdr_t ence_hdr;
} sctp_ecne_chunk_t __attribute__((packed)); } sctp_ecne_chunk_t __attribute__((packed));
/* RFC 2960. Appendix A. Explicit Congestion Notification. /* RFC 2960. Appendix A. Explicit Congestion Notification.
* Congestion Window Reduced (CWR) (13) * Congestion Window Reduced (CWR) (13)
*/ */
typedef struct sctp_cwrhdr { typedef struct sctp_cwrhdr {
...@@ -478,18 +480,18 @@ typedef struct sctp_cwr_chunk { ...@@ -478,18 +480,18 @@ typedef struct sctp_cwr_chunk {
/* ADDIP Section 3.1.1 /* ADDIP Section 3.1.1
* *
* ASCONF-Request Correlation ID: 32 bits (unsigned integer) * ASCONF-Request Correlation ID: 32 bits (unsigned integer)
* *
* This is an opaque integer assigned by the sender to identify each * This is an opaque integer assigned by the sender to identify each
* request parameter. It is in host byte order and is only meaningful * request parameter. It is in host byte order and is only meaningful
* to the sender. The receiver of the ASCONF Chunk will copy this 32 * to the sender. The receiver of the ASCONF Chunk will copy this 32
* bit value into the ASCONF Correlation ID field of the * bit value into the ASCONF Correlation ID field of the
* ASCONF-ACK. The sender of the ASCONF can use this same value in the * ASCONF-ACK. The sender of the ASCONF can use this same value in the
* ASCONF-ACK to find which request the response is for. * ASCONF-ACK to find which request the response is for.
* *
* ASCONF Parameter: TLV format * ASCONF Parameter: TLV format
* *
* Each Address configuration change is represented by a TLV parameter * Each Address configuration change is represented by a TLV parameter
* as defined in Section 3.2. One or more requests may be present in * as defined in Section 3.2. One or more requests may be present in
* an ASCONF Chunk. * an ASCONF Chunk.
...@@ -502,7 +504,7 @@ typedef struct { ...@@ -502,7 +504,7 @@ typedef struct {
/* ADDIP /* ADDIP
* 3.1.1 Address/Stream Configuration Change Chunk (ASCONF) * 3.1.1 Address/Stream Configuration Change Chunk (ASCONF)
* *
* This chunk is used to communicate to the remote endpoint one of the * This chunk is used to communicate to the remote endpoint one of the
* configuration change requests that MUST be acknowledged. The * configuration change requests that MUST be acknowledged. The
* information carried in the ASCONF Chunk uses the form of a * information carried in the ASCONF Chunk uses the form of a
...@@ -517,18 +519,18 @@ typedef struct { ...@@ -517,18 +519,18 @@ typedef struct {
__u32 addr[4]; __u32 addr[4];
sctpAsconfReq_t requests[0]; sctpAsconfReq_t requests[0];
} sctpAsconf_t; } sctpAsconf_t;
/* ADDIP /* ADDIP
* 3.1.2 Address/Stream Configuration Acknowledgment Chunk (ASCONF-ACK) * 3.1.2 Address/Stream Configuration Acknowledgment Chunk (ASCONF-ACK)
* *
* ASCONF-Request Correlation ID: 32 bits (unsigned integer) * ASCONF-Request Correlation ID: 32 bits (unsigned integer)
* *
* This value is copied from the ASCONF Correlation ID received in the * This value is copied from the ASCONF Correlation ID received in the
* ASCONF Chunk. It is used by the receiver of the ASCONF-ACK to identify * ASCONF Chunk. It is used by the receiver of the ASCONF-ACK to identify
* which ASCONF parameter this response is associated with. * which ASCONF parameter this response is associated with.
* *
* ASCONF Parameter Response : TLV format * ASCONF Parameter Response : TLV format
* *
* The ASCONF Parameter Response is used in the ASCONF-ACK to report * The ASCONF Parameter Response is used in the ASCONF-ACK to report
* status of ASCONF processing. By default, if a responding endpoint * status of ASCONF processing. By default, if a responding endpoint
* does not include any Error Cause, a success is indicated. Thus a * does not include any Error Cause, a success is indicated. Thus a
...@@ -555,7 +557,7 @@ typedef union { ...@@ -555,7 +557,7 @@ typedef union {
/* ADDIP /* ADDIP
* 3.1.2 Address/Stream Configuration Acknowledgment Chunk (ASCONF-ACK) * 3.1.2 Address/Stream Configuration Acknowledgment Chunk (ASCONF-ACK)
* *
* This chunk is used by the receiver of an ASCONF Chunk to * This chunk is used by the receiver of an ASCONF Chunk to
* acknowledge the reception. It carries zero or more results for any * acknowledge the reception. It carries zero or more results for any
* ASCONF Parameters that were processed by the receiver. * ASCONF Parameters that were processed by the receiver.
...@@ -579,11 +581,8 @@ typedef struct { ...@@ -579,11 +581,8 @@ typedef struct {
struct list_head hook; struct list_head hook;
int length; /* length of the TLV */ int length; /* length of the TLV */
/* the actually TLV to be copied into ASCONF_ACK */ /* the actually TLV to be copied into ASCONF_ACK */
sctpAsconfAckRsp_t TLV; sctpAsconfAckRsp_t TLV;
} sctpAsconfAckRspNode_t; } sctpAsconfAckRspNode_t;
#endif /* __LINUX_SCTP_H__ */ #endif /* __LINUX_SCTP_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment