diff options
| author | Sridhar Samudrala <sridhar@dyn9-47-18-140.beaverton.ibm.com> | 2002-11-04 03:00:03 -0800 |
|---|---|---|
| committer | Sridhar Samudrala <sridhar@dyn9-47-18-140.beaverton.ibm.com> | 2002-11-04 03:00:03 -0800 |
| commit | 5d068c48a4d4d4d30b424d83d3a1580d41f21237 (patch) | |
| tree | 658783b011ef94ed2d46b00fe698b7e77d9f589d /include | |
| parent | db01fdce0da7060ef86f496279acc676bee9e31c (diff) | |
| parent | 26e2d0a7afe1d4874acad61391736c6aa636c4e7 (diff) | |
Merge dyn9-47-18-140.beaverton.ibm.com:/home/sridhar/BK/linux-2.5.46
into dyn9-47-18-140.beaverton.ibm.com:/home/sridhar/BK/lksctp-2.5.46
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/sctp.h | 129 | ||||
| -rw-r--r-- | include/net/sctp/command.h | 2 | ||||
| -rw-r--r-- | include/net/sctp/sctp.h | 65 | ||||
| -rw-r--r-- | include/net/sctp/sm.h | 10 | ||||
| -rw-r--r-- | include/net/sctp/structs.h | 127 | ||||
| -rw-r--r-- | include/net/snmp.h | 29 |
6 files changed, 207 insertions, 155 deletions
diff --git a/include/linux/sctp.h b/include/linux/sctp.h index 1d54c9488601..d945f0b0b610 100644 --- a/include/linux/sctp.h +++ b/include/linux/sctp.h @@ -1,40 +1,40 @@ /* SCTP kernel reference Implementation * Copyright (c) 1999-2000 Cisco, 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 Nokia, Inc. * Copyright (c) 2001 La Monte H.P. Yarroll - * + * * This file is part of the SCTP kernel reference Implementation - * - * Various protocol defined structures. - * - * The SCTP reference implementation is free software; - * you can redistribute it and/or modify it under the terms of + * + * Various protocol defined structures. + * + * The SCTP reference implementation is free software; + * you can redistribute it and/or modify it under the terms of * the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * 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 * ************************ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with GNU CC; see the file COPYING. If not, write to * 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 * 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: * http://www.sf.net/projects/lksctp * - * Written or modified by: + * Written or modified by: * La Monte H.P. Yarroll <piggy@acm.org> * Karl Knutson <karl@athena.chicago.il.us> * Jon Grimm <jgrimm@us.ibm.com> @@ -42,7 +42,7 @@ * randall@sctp.chicago.il.us * kmorneau@cisco.com * qxie1@email.mot.com - * + * * Any bugs reported given to us we will try to fix... any fixes shared will * be incorporated into the next SCTP release. */ @@ -70,9 +70,9 @@ typedef struct sctp_chunkhdr { /* Section 3.2. Chunk Type Values. - * [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 - * reserved for future use as an extension field. + * [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 + * reserved for future use as an extension field. */ typedef enum { SCTP_CID_DATA = 0, @@ -97,7 +97,7 @@ typedef enum { } sctp_cid_t; /* enum */ -/* Section 3.2 +/* Section 3.2 * Chunk Types are encoded such that the highest-order two bits specify * the action that must be taken if the processing endpoint does not * recognize the Chunk Type. @@ -107,7 +107,7 @@ typedef enum { SCTP_CID_ACTION_DISCARD_ERR = 0x40, SCTP_CID_ACTION_SKIP = 0x80, SCTP_CID_ACTION_SKIP_ERR = 0xc0, -} sctp_cid_action_t; +} sctp_cid_action_t; enum { SCTP_CID_ACTION_MASK = 0xc0, }; @@ -127,23 +127,23 @@ enum { SCTP_CHUNK_FLAG_T = 0x01 }; * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Type = 14 |Reserved |T| Length = 4 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - * + * * Chunk Flags: 8 bits - * + * * Reserved: 7 bits * Set to 0 on transmit and ignored on receipt. - * + * * T bit: 1 bit * 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. - * - * 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. */ #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. */ @@ -167,11 +167,11 @@ typedef enum { SCTP_PARAM_ECN_CAPABLE = __constant_htons(0x8000), /* Add-IP Extension. Section 3.2 */ - SCTP_PARAM_ADD_IP = __constant_htons(0xc001), - SCTP_PARAM_DEL_IP = __constant_htons(0xc002), - SCTP_PARAM_ERR_CAUSE = __constant_htons(0xc003), - SCTP_PARAM_SET_PRIMARY = __constant_htons(0xc004), - SCTP_PARAM_SUCCESS_REPORT = __constant_htons(0xc005), + SCTP_PARAM_ADD_IP = __constant_htons(0xc001), + SCTP_PARAM_DEL_IP = __constant_htons(0xc002), + SCTP_PARAM_ERR_CAUSE = __constant_htons(0xc003), + SCTP_PARAM_SET_PRIMARY = __constant_htons(0xc004), + SCTP_PARAM_SUCCESS_REPORT = __constant_htons(0xc005), SCTP_PARAM_ADAPTION_LAYER_IND = __constant_htons(0xc006), } sctp_param_t; /* enum */ @@ -188,7 +188,7 @@ typedef enum { SCTP_PARAM_ACTION_DISCARD_ERR = __constant_htons(0x4000), SCTP_PARAM_ACTION_SKIP = __constant_htons(0x8000), SCTP_PARAM_ACTION_SKIP_ERR = __constant_htons(0xc000), -} sctp_param_action_t; +} sctp_param_action_t; enum { SCTP_PARAM_ACTION_MASK = __constant_htons(0xc000), }; @@ -215,14 +215,14 @@ enum { SCTP_DATA_NOT_FRAG = 0x03, 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) * * This chunk is used to initiate a SCTP association between two * endpoints. - */ + */ typedef struct sctp_inithdr { __u32 init_tag; __u32 a_rwnd; @@ -249,7 +249,7 @@ typedef struct sctp_ipv6addr_param { sctp_paramhdr_t param_hdr; struct in6_addr addr; } sctp_ipv6addr_param_t __attribute__((packed)); - + /* Section 3.3.2.1 Cookie Preservative (9) */ typedef struct sctp_cookie_preserve_param { sctp_paramhdr_t param_hdr; @@ -344,8 +344,8 @@ typedef struct sctp_heartbeat_chunk { sctp_chunkhdr_t chunk_hdr; sctp_heartbeathdr_t hb_hdr; } sctp_heartbeat_chunk_t __attribute__((packed)); - - + + /* 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 * chunk descriptor. @@ -366,7 +366,7 @@ struct sctp_shutdown_chunk_t { sctp_chunkhdr_t chunk_hdr; sctp_shutdownhdr_t shutdown_hdr; } __attribute__((packed)); - + /* RFC 2960. Section 3.3.10 Operation Error (ERROR) (9) */ @@ -403,9 +403,9 @@ typedef struct sctp_operr_chunk { */ typedef enum { - SCTP_ERROR_NO_ERROR = __constant_htons(0x00), - SCTP_ERROR_INV_STRM = __constant_htons(0x01), - SCTP_ERROR_MISS_PARAM = __constant_htons(0x02), + SCTP_ERROR_NO_ERROR = __constant_htons(0x00), + SCTP_ERROR_INV_STRM = __constant_htons(0x01), + SCTP_ERROR_MISS_PARAM = __constant_htons(0x02), SCTP_ERROR_STALE_COOKIE = __constant_htons(0x03), SCTP_ERROR_NO_RESOURCE = __constant_htons(0x04), SCTP_ERROR_DNS_FAILED = __constant_htons(0x05), @@ -416,13 +416,15 @@ typedef enum { SCTP_ERROR_COOKIE_IN_SHUTDOWN = __constant_htons(0x0a), - /* SCTP Implementation Guide: - * 11 Restart of an association with new addresses - * 12 User Initiated Abort + /* SCTP Implementation Guide: + * 11 Restart of an association with new addresses + * 12 User Initiated Abort + * 13 Protocol Violation */ SCTP_ERROR_RESTART = __constant_htons(0x0b), SCTP_ERROR_USER_ABORT = __constant_htons(0x0c), + SCTP_ERROR_PROTO_VIOLATION = __constant_htons(0x0d), /* ADDIP Section 3.3 New Error Causes * @@ -436,16 +438,16 @@ typedef enum { * 0x0102 Request to Delete Source IP Address. * 0x0103 Association Aborted due to illegal ASCONF-ACK */ - SCTP_ERROR_DEL_LAST_IP = __constant_htons(0x0100), - SCTP_ERROR_RSRC_LOW = __constant_htons(0x0101), - SCTP_ERROR_DEL_SRC_IP = __constant_htons(0x0102), + SCTP_ERROR_DEL_LAST_IP = __constant_htons(0x0100), + SCTP_ERROR_RSRC_LOW = __constant_htons(0x0101), + SCTP_ERROR_DEL_SRC_IP = __constant_htons(0x0102), SCTP_ERROR_ASCONF_ACK = __constant_htons(0x0103), } sctp_error_t; -/* RFC 2960. Appendix A. Explicit Congestion Notification. +/* RFC 2960. Appendix A. Explicit Congestion Notification. * Explicit Congestion Notification Echo (ECNE) (12) */ typedef struct sctp_ecnehdr { @@ -457,7 +459,7 @@ typedef struct sctp_ecne_chunk { sctp_ecnehdr_t ence_hdr; } 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) */ typedef struct sctp_cwrhdr { @@ -478,18 +480,18 @@ typedef struct sctp_cwr_chunk { /* ADDIP Section 3.1.1 - * + * * ASCONF-Request Correlation ID: 32 bits (unsigned integer) - * + * * This is an opaque integer assigned by the sender to identify each * 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 * 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 to find which request the response is for. - * + * * ASCONF Parameter: TLV format - * + * * Each Address configuration change is represented by a TLV parameter * as defined in Section 3.2. One or more requests may be present in * an ASCONF Chunk. @@ -502,7 +504,7 @@ typedef struct { /* ADDIP * 3.1.1 Address/Stream Configuration Change Chunk (ASCONF) - * + * * This chunk is used to communicate to the remote endpoint one of the * configuration change requests that MUST be acknowledged. The * information carried in the ASCONF Chunk uses the form of a @@ -517,18 +519,18 @@ typedef struct { __u32 addr[4]; sctpAsconfReq_t requests[0]; } sctpAsconf_t; - + /* ADDIP * 3.1.2 Address/Stream Configuration Acknowledgment Chunk (ASCONF-ACK) - * + * * ASCONF-Request Correlation ID: 32 bits (unsigned integer) - * + * * 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 * which ASCONF parameter this response is associated with. - * + * * ASCONF Parameter Response : TLV format - * + * * The ASCONF Parameter Response is used in the ASCONF-ACK to report * status of ASCONF processing. By default, if a responding endpoint * does not include any Error Cause, a success is indicated. Thus a @@ -555,7 +557,7 @@ typedef union { /* ADDIP * 3.1.2 Address/Stream Configuration Acknowledgment Chunk (ASCONF-ACK) - * + * * This chunk is used by the receiver of an ASCONF Chunk to * acknowledge the reception. It carries zero or more results for any * ASCONF Parameters that were processed by the receiver. @@ -579,11 +581,8 @@ typedef struct { struct list_head hook; 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; } sctpAsconfAckRspNode_t; - - - #endif /* __LINUX_SCTP_H__ */ diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h index d299eee377c1..67524f0b1a03 100644 --- a/include/net/sctp/command.h +++ b/include/net/sctp/command.h @@ -27,6 +27,7 @@ * * La Monte H.P. Yarroll <piggy@acm.org> * Karl Knutson <karl@athena.chicago.il.us> + * Ardelle Fan <ardelle.fan@intel.com> * * Any bugs reported given to us we will try to fix... any fixes shared will * be incorporated into the next SCTP release. @@ -72,6 +73,7 @@ typedef enum { SCTP_CMD_STRIKE, /* Mark a strike against a transport. */ SCTP_CMD_TRANSMIT, /* Transmit the outqueue. */ SCTP_CMD_HB_TIMERS_START, /* Start the heartbeat timers. */ + SCTP_CMD_HB_TIMERS_UPDATE, /* Update the heartbeat timers. */ SCTP_CMD_TRANSPORT_RESET, /* Reset the status of a transport. */ SCTP_CMD_TRANSPORT_ON, /* Mark the transport as active. */ SCTP_CMD_REPORT_ERROR, /* Pass this error back out of the sm. */ diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 9760c23a7af4..7b261af05ad4 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h @@ -3,41 +3,41 @@ * Copyright (c) 1999-2001 Motorola, Inc. * Copyright (c) 2001 International Business Machines, Corp. * Copyright (c) 2001 Intel Corp. - * + * * This file is part of the SCTP kernel reference Implementation - * - * The base lksctp header. - * - * The SCTP reference implementation is free software; - * you can redistribute it and/or modify it under the terms of + * + * The base lksctp header. + * + * The SCTP reference implementation is free software; + * you can redistribute it and/or modify it under the terms of * the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * 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 * ************************ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with GNU CC; see the file COPYING. If not, write to * 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 * email address(es): * lksctp developers <lksctp-developers@lists.sourceforge.net> - * + * * Or submit a bug report through the following website: * http://www.sf.net/projects/lksctp * - * Written or modified by: + * Written or modified by: * La Monte H.P. Yarroll <piggy@acm.org> * Xingang Guo <xingang.guo@intel.com> * Jon Grimm <jgrimm@us.ibm.com> * Daisy Chang <daisyc@us.ibm.com> - * + * * Any bugs reported given to us we will try to fix... any fixes shared will * be incorporated into the next SCTP release. */ @@ -52,10 +52,10 @@ * structs * prototypes * macros, externs, and inlines - * - * Move test_frame specific items out of the kernel headers + * + * Move test_frame specific items out of the kernel headers * and into the test frame headers. This is not perfect in any sense - * and will continue to evolve. + * and will continue to evolve. */ @@ -78,11 +78,12 @@ #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) #include <net/ipv6.h> #include <net/ip6_route.h> -#endif +#endif #include <asm/uaccess.h> #include <asm/page.h> #include <net/sock.h> +#include <net/snmp.h> #include <net/sctp/structs.h> #include <net/sctp/constants.h> #include <net/sctp/sm.h> @@ -104,19 +105,19 @@ #endif -/* Certain internal static functions need to be exported when +/* Certain internal static functions need to be exported when * compiled into the test frame. */ #ifndef SCTP_STATIC #define SCTP_STATIC static #endif -/* - * Function declarations. +/* + * Function declarations. */ /* - * sctp_protocol.c + * sctp_protocol.c */ extern sctp_protocol_t sctp_proto; extern struct sock *sctp_get_ctl_sock(void); @@ -141,7 +142,7 @@ extern int sctp_primitive_ASSOCIATE(sctp_association_t *, void *arg); extern int sctp_primitive_SHUTDOWN(sctp_association_t *, void *arg); extern int sctp_primitive_ABORT(sctp_association_t *, void *arg); extern int sctp_primitive_SEND(sctp_association_t *, void *arg); - +extern int sctp_primitive_REQUESTHEARTBEAT(sctp_association_t *, void *arg); /* * sctp_crc32c.c @@ -201,6 +202,11 @@ extern void sctp_hash_digest(const char *secret, const int secret_len, #define SCTP_SOCK_SLEEP_PRE(sk) SOCK_SLEEP_PRE(sk) #define SCTP_SOCK_SLEEP_POST(sk) SOCK_SLEEP_POST(sk) +/* SCTP SNMP MIB stats handlers */ +extern struct sctp_mib sctp_statistics[NR_CPUS * 2]; +#define SCTP_INC_STATS(field) SNMP_INC_STATS(sctp_statistics, field) +#define SCTP_INC_STATS_BH(field) SNMP_INC_STATS_BH(sctp_statistics, field) +#define SCTP_INC_STATS_USER(field) SNMP_INC_STATS_USER(sctp_statistics, field) /* Determine if this is a valid kernel address. */ static inline int sctp_is_valid_kaddr(unsigned long addr) @@ -412,6 +418,19 @@ static inline size_t get_user_iov_size(struct iovec *iov, int iovlen) return retval; } +/* Walk through a list of TLV parameters. Don't trust the + * individual parameter lengths and instead depend on + * the chunk length to indicate when to stop. Make sure + * there is room for a param header too. + */ +#define sctp_walk_params(pos, chunk, member)\ +_sctp_walk_params((pos), (chunk), ntohs((chunk)->chunk_hdr.length), member) + +#define _sctp_walk_params(pos, chunk, end, member)\ +for (pos.v = chunk->member;\ + pos.v <= (void *)chunk + end - sizeof(sctp_paramhdr_t) &&\ + pos.v <= (void *)chunk + end - WORD_ROUND(ntohs(pos.p->length)); \ + pos.v += WORD_ROUND(ntohs(pos.p->length))) /* Round an int up to the next multiple of 4. */ #define WORD_ROUND(s) (((s)+3)&~3) diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h index 36ed5af39824..9c5d678b2b14 100644 --- a/include/net/sctp/sm.h +++ b/include/net/sctp/sm.h @@ -44,6 +44,7 @@ * Dajiang Zhang <dajiang.zhang@nokia.com> * Sridhar Samudrala <sri@us.ibm.com> * Daisy Chang <daisyc@us.ibm.com> + * Ardelle Fan <ardelle.fan@intel.com> * * Any bugs reported given to us we will try to fix... any fixes shared will * be incorporated into the next SCTP release. @@ -156,6 +157,7 @@ sctp_state_fn_t sctp_sf_shutdown_ack_sent_prm_abort; sctp_state_fn_t sctp_sf_error_closed; sctp_state_fn_t sctp_sf_error_shutdown; sctp_state_fn_t sctp_sf_ignore_primitive; +sctp_state_fn_t sctp_sf_do_prm_requestheartbeat; /* Prototypes for other event state functions. */ sctp_state_fn_t sctp_sf_do_9_2_start_shutdown; @@ -205,9 +207,6 @@ sctp_association_t *sctp_make_temp_asoc(const sctp_endpoint_t *, sctp_chunk_t *, const int priority); __u32 sctp_generate_verification_tag(void); -sctpParam_t sctp_get_my_addrs_raw(const sctp_association_t *, - const int priority, int *addrs_len); - void sctp_populate_tie_tags(__u8 *cookie, __u32 curTag, __u32 hisTag); /* Prototypes for chunk-building functions. */ @@ -253,6 +252,9 @@ sctp_chunk_t *sctp_make_abort(const sctp_association_t *, sctp_chunk_t *sctp_make_abort_no_data(const sctp_association_t *, const sctp_chunk_t *, __u32 tsn); +sctp_chunk_t *sctp_make_abort_user(const sctp_association_t *, + const sctp_chunk_t *, + const struct msghdr *); sctp_chunk_t *sctp_make_heartbeat(const sctp_association_t *, const sctp_transport_t *, const void *payload, @@ -332,7 +334,7 @@ __u32 sctp_generate_tsn(const sctp_endpoint_t *); /* 4th level prototypes */ void sctp_param2sockaddr(sockaddr_storage_t *addr, sctp_addr_param_t *, __u16 port); -int sctp_addr2sockaddr(const sctpParam_t, sockaddr_storage_t *); +int sctp_addr2sockaddr(const union sctp_params, sockaddr_storage_t *); int sockaddr2sctp_addr(const sockaddr_storage_t *, sctp_addr_param_t *); /* Extern declarations for major data structures. */ diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 5a8b75d2da26..505e9a54bb39 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h @@ -3,34 +3,34 @@ * Copyright (c) 1999-2001 Motorola, Inc. * Copyright (c) 2001 Intel Corp. * Copyright (c) 2001 International Business Machines Corp. - * + * * This file is part of the SCTP kernel reference Implementation - * - * The SCTP reference implementation is free software; - * you can redistribute it and/or modify it under the terms of + * + * The SCTP reference implementation is free software; + * you can redistribute it and/or modify it under the terms of * the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * 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 * ************************ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with GNU CC; see the file COPYING. If not, write to * 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 * email addresses: * lksctp developers <lksctp-developers@lists.sourceforge.net> - * + * * Or submit a bug report through the following website: * http://www.sf.net/projects/lksctp * - * Written or modified by: + * Written or modified by: * Randall Stewart <randall@sctp.chicago.il.us> * Ken Morneau <kmorneau@cisco.com> * Qiaobing Xie <qxie1@email.mot.com> @@ -41,8 +41,8 @@ * Hui Huang <hui.huang@nokia.com> * Sridhar Samudrala <sri@us.ibm.com> * Daisy Chang <daisyc@us.ibm.com> - * Dajiang Zhang <dajiang.zhang@nokia.com> - * + * Dajiang Zhang <dajiang.zhang@nokia.com> + * * Any bugs reported given to us we will try to fix... any fixes shared will * be incorporated into the next SCTP release. */ @@ -246,8 +246,11 @@ typedef struct sctp_func { int optname, char *optval, int *optlen); - int (*get_dst_mtu) (const sockaddr_storage_t *address); - __u16 net_header_len; + struct dst_entry *(*get_dst) (sockaddr_storage_t *daddr, + sockaddr_storage_t *saddr); + int (*cmp_saddr) (struct dst_entry *dst, + sockaddr_storage_t *saddr); + __u16 net_header_len; int sockaddr_len; sa_family_t sa_family; struct list_head list; @@ -356,20 +359,6 @@ typedef struct sctp_signed_cookie { } sctp_signed_cookie_t; -/* This convenience type allows us to avoid casting when walking - * through a parameter list. - */ -typedef union { - __u8 *v; - sctp_paramhdr_t *p; - - sctp_cookie_preserve_param_t *bht; - sctp_hostname_param_t *dns; - sctp_cookie_param_t *cookie; - sctp_supported_addrs_param_t *sat; - sctp_ipv4addr_param_t *v4; - sctp_ipv6addr_param_t *v6; -} sctpParam_t; /* This is another convenience type to allocate memory for address * params for the maximum size and pass such structures around @@ -380,6 +369,21 @@ typedef union { sctp_ipv6addr_param_t v6; } sctp_addr_param_t; +/* A convenience type to allow walking through the various + * parameters and avoid casting all over the place. + */ +union sctp_params { + void *v; + sctp_paramhdr_t *p; + sctp_cookie_preserve_param_t *life; + sctp_hostname_param_t *dns; + sctp_cookie_param_t *cookie; + sctp_supported_addrs_param_t *sat; + sctp_ipv4addr_param_t *v4; + sctp_ipv6addr_param_t *v6; + sctp_addr_param_t *addr; +}; + /* RFC 2960. Section 3.3.5 Heartbeat. * Heartbeat Information: variable length * The Sender-specific Heartbeat Info field should normally include @@ -430,7 +434,7 @@ struct SCTP_chunk { */ /* We point this at the FIRST TLV parameter to chunk_hdr. */ - sctpParam_t param_hdr; + union sctp_params param_hdr; union { __u8 *v; sctp_datahdr_t *data_hdr; @@ -471,11 +475,13 @@ struct SCTP_chunk { __u8 ecn_ce_done; /* Have we processed the ECN CE bit? */ __u8 pdiscard; /* Discard the whole packet now? */ __u8 tsn_gap_acked; /* Is this chunk acked by a GAP ACK? */ - __u8 fast_retransmit; /* Is this chunk fast retransmitted? */ + __u8 fast_retransmit; /* Is this chunk fast retransmitted? */ __u8 tsn_missing_report; /* Data chunk missing counter. */ /* What is the origin IP address for this chunk? */ sockaddr_storage_t source; + /* Destination address for this chunk. */ + sockaddr_storage_t dest; /* For an inbound chunk, this tells us where it came from. * For an outbound chunk, it tells us where we'd like it to @@ -492,7 +498,7 @@ void *sctp_addto_chunk(sctp_chunk_t *chunk, int len, const void *data); int sctp_user_addto_chunk(sctp_chunk_t *chunk, int len, struct iovec *data); sctp_chunk_t *sctp_chunkify(struct sk_buff *, const sctp_association_t *, struct sock *); -void sctp_init_source(sctp_chunk_t *chunk); +void sctp_init_addrs(sctp_chunk_t *chunk); const sockaddr_storage_t *sctp_source(const sctp_chunk_t *chunk); /* This is a structure for holding either an IPv6 or an IPv4 address. */ @@ -655,6 +661,9 @@ struct SCTP_transport { /* PMTU : The current known path MTU. */ __u32 pmtu; + /* Destination */ + struct dst_entry *dst; + /* When was the last time(in jiffies) that a data packet was sent on * this transport? This is used to adjust the cwnd when the transport * becomes inactive. @@ -676,13 +685,15 @@ struct SCTP_transport { */ unsigned long last_time_ecne_reduced; - /* state : The current state of this destination, - * : i.e. DOWN, UP, ALLOW-HB, NO-HEARTBEAT, etc. + /* active : The current active state of this destination, + * : i.e. DOWN, UP, etc. */ - struct { - int active; - int hb_allowed; - } state; + int active; + + /* hb_allowed : The current heartbeat state of this destination, + * : i.e. ALLOW-HB, NO-HEARTBEAT, etc. + */ + int hb_allowed; /* These are the error stats for this destination. */ @@ -735,6 +746,7 @@ extern sctp_transport_t *sctp_transport_new(const sockaddr_storage_t *, int); extern sctp_transport_t *sctp_transport_init(sctp_transport_t *, const sockaddr_storage_t *, int); extern void sctp_transport_set_owner(sctp_transport_t *, sctp_association_t *); +extern void sctp_transport_route(sctp_transport_t *, sockaddr_storage_t *); extern void sctp_transport_free(sctp_transport_t *); extern void sctp_transport_destroy(sctp_transport_t *); extern void sctp_transport_reset_timers(sctp_transport_t *); @@ -885,9 +897,9 @@ int sctp_add_bind_addr(sctp_bind_addr_t *, sockaddr_storage_t *, int priority); int sctp_del_bind_addr(sctp_bind_addr_t *, sockaddr_storage_t *); int sctp_bind_addr_has_addr(sctp_bind_addr_t *, const sockaddr_storage_t *); -sctpParam_t sctp_bind_addrs_to_raw(const sctp_bind_addr_t *bp, - int *addrs_len, - int priority); +union sctp_params sctp_bind_addrs_to_raw(const sctp_bind_addr_t *bp, + int *addrs_len, + int priority); int sctp_raw_to_bind_addrs(sctp_bind_addr_t *bp, __u8 *raw_addr_list, int addrs_len, @@ -904,7 +916,7 @@ int sctp_addr_is_valid(const sockaddr_storage_t *addr); typedef enum { SCTP_EP_TYPE_SOCKET, SCTP_EP_TYPE_ASSOCIATION, -} sctp_endpoint_type_t; +} sctp_endpoint_type_t; /* * A common base class to bridge the implmentation view of a @@ -1052,22 +1064,11 @@ int sctp_verify_init(const sctp_association_t *asoc, sctp_init_chunk_t *peer_init, sctp_chunk_t *chunk, sctp_chunk_t **err_chunk); -int sctp_verify_param(const sctp_association_t *asoc, - sctpParam_t param, - sctp_cid_t cid, - sctp_chunk_t *chunk, - sctp_chunk_t **err_chunk); -int sctp_process_unk_param(const sctp_association_t *asoc, - sctpParam_t param, - sctp_chunk_t *chunk, - sctp_chunk_t **err_chunk); -void sctp_process_init(sctp_association_t *asoc, sctp_cid_t cid, - const sockaddr_storage_t *peer_addr, - sctp_init_chunk_t *peer_init, int priority); -int sctp_process_param(sctp_association_t *asoc, - sctpParam_t param, - const sockaddr_storage_t *peer_addr, - sctp_cid_t cid, int priority); +int sctp_process_init(sctp_association_t *asoc, sctp_cid_t cid, + const sockaddr_storage_t *peer_addr, + sctp_init_chunk_t *peer_init, int priority); +int sctp_process_param(sctp_association_t *asoc, union sctp_params param, + const sockaddr_storage_t *peer_addr, int priority); __u32 sctp_generate_tag(const sctp_endpoint_t *ep); __u32 sctp_generate_tsn(const sctp_endpoint_t *ep); @@ -1154,10 +1155,10 @@ struct SCTP_association { sctp_transport_t *primary_path; /* Cache the primary path address here, when we - * need a an address for msg_name. + * need a an address for msg_name. */ sockaddr_storage_t primary_addr; - + /* active_path * The path that we are currently using to * transmit new data and most control chunks. @@ -1258,7 +1259,7 @@ struct SCTP_association { /* Overall : The threshold for this association that if * Error : the Overall Error Count reaches will cause - * Threshold : this association to be torn down. + * Threshold : this association to be torn down. */ int overall_error_threshold; @@ -1304,13 +1305,13 @@ struct SCTP_association { */ __u32 next_tsn; - /* + /* * Last Rcvd : This is the last TSN received in sequence. This value * TSN : is set initially by taking the peer's Initial TSN, * : received in the INIT or INIT ACK chunk, and * : subtracting one from it. * - * Most of RFC 2960 refers to this as the Cumulative TSN Ack Point. + * Most of RFC 2960 refers to this as the Cumulative TSN Ack Point. */ __u32 ctsn_ack_point; diff --git a/include/net/snmp.h b/include/net/snmp.h index 0d80a7ef155e..553e8c0eedce 100644 --- a/include/net/snmp.h +++ b/include/net/snmp.h @@ -189,6 +189,35 @@ struct udp_mib unsigned long __pad[0]; } ____cacheline_aligned; +/* draft-ietf-sigtran-sctp-mib-07.txt */ +struct sctp_mib +{ + unsigned long SctpCurrEstab; + unsigned long SctpActiveEstabs; + unsigned long SctpPassiveEstabs; + unsigned long SctpAborteds; + unsigned long SctpShutdowns; + unsigned long SctpOutOfBlues; + unsigned long SctpChecksumErrors; + unsigned long SctpOutCtrlChunks; + unsigned long SctpOutOrderChunks; + unsigned long SctpOutUnorderChunks; + unsigned long SctpInCtrlChunks; + unsigned long SctpInOrderChunks; + unsigned long SctpInUnorderChunks; + unsigned long SctpFragUsrMsgs; + unsigned long SctpReasmUsrMsgs; + unsigned long SctpOutSCTPPacks; + unsigned long SctpInSCTPPacks; + unsigned long SctpRtoAlgorithm; + unsigned long SctpRtoMin; + unsigned long SctpRtoMax; + unsigned long SctpRtoInitial; + unsigned long SctpValCookieLife; + unsigned long SctpMaxInitRetr; + unsigned long __pad[0]; +} ____cacheline_aligned; + struct linux_mib { unsigned long SyncookiesSent; |
