diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/sctp.h | 70 | ||||
| -rw-r--r-- | include/linux/sysctl.h | 3 | ||||
| -rw-r--r-- | include/net/sctp/command.h | 5 | ||||
| -rw-r--r-- | include/net/sctp/constants.h | 4 | ||||
| -rw-r--r-- | include/net/sctp/sctp.h | 8 | ||||
| -rw-r--r-- | include/net/sctp/sm.h | 27 | ||||
| -rw-r--r-- | include/net/sctp/structs.h | 65 | ||||
| -rw-r--r-- | include/net/sctp/tsnmap.h | 6 | ||||
| -rw-r--r-- | include/net/sctp/ulpqueue.h | 6 |
9 files changed, 142 insertions, 52 deletions
diff --git a/include/linux/sctp.h b/include/linux/sctp.h index a851af99af70..cff28345eacf 100644 --- a/include/linux/sctp.h +++ b/include/linux/sctp.h @@ -1,5 +1,5 @@ /* SCTP kernel reference Implementation - * (C) Copyright IBM Corp. 2001, 2003 + * (C) Copyright IBM Corp. 2001, 2004 * Copyright (c) 1999-2000 Cisco, Inc. * Copyright (c) 1999-2001 Motorola, Inc. * Copyright (c) 2001 Intel Corp. @@ -93,6 +93,9 @@ typedef enum { SCTP_CID_ECN_CWR = 13, SCTP_CID_SHUTDOWN_COMPLETE = 14, + /* PR-SCTP Sec 3.2 */ + SCTP_CID_FWD_TSN = 0xC0, + /* Use hex, as defined in ADDIP sec. 3.1 */ SCTP_CID_ASCONF = 0xC1, SCTP_CID_ASCONF_ACK = 0x80, @@ -168,6 +171,9 @@ typedef enum { SCTP_PARAM_SUPPORTED_ADDRESS_TYPES = __constant_htons(12), SCTP_PARAM_ECN_CAPABLE = __constant_htons(0x8000), + /* PR-SCTP Sec 3.1 */ + SCTP_PARAM_FWD_TSN_SUPPORT = __constant_htons(0xc000), + /* Add-IP Extension. Section 3.2 */ SCTP_PARAM_ADD_IP = __constant_htons(0xc001), SCTP_PARAM_DEL_IP = __constant_htons(0xc002), @@ -472,9 +478,67 @@ typedef struct sctp_cwr_chunk { sctp_cwrhdr_t cwr_hdr; } __attribute__((packed)) sctp_cwr_chunk_t; -/* - * ADDIP Section 3.1 New Chunk Types +/* PR-SCTP + * 3.2 Forward Cumulative TSN Chunk Definition (FORWARD TSN) + * + * Forward Cumulative TSN chunk has the following format: + * + * 0 1 2 3 + * 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 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | Type = 192 | Flags = 0x00 | Length = Variable | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | New Cumulative TSN | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | Stream-1 | Stream Sequence-1 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * \ / + * / \ + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | Stream-N | Stream Sequence-N | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * + * Chunk Flags: + * + * Set to all zeros on transmit and ignored on receipt. + * + * New Cumulative TSN: 32 bit u_int + * + * This indicates the new cumulative TSN to the data receiver. Upon + * the reception of this value, the data receiver MUST consider + * any missing TSNs earlier than or equal to this value as received + * and stop reporting them as gaps in any subsequent SACKs. + * + * Stream-N: 16 bit u_int + * + * This field holds a stream number that was skipped by this + * FWD-TSN. + * + * Stream Sequence-N: 16 bit u_int + * This field holds the sequence number associated with the stream + * that was skipped. The stream sequence field holds the largest stream + * sequence number in this stream being skipped. The receiver of + * the FWD-TSN's can use the Stream-N and Stream Sequence-N fields + * to enable delivery of any stranded TSN's that remain on the stream + * re-ordering queues. This field MUST NOT report TSN's corresponding + * to DATA chunk that are marked as unordered. For ordered DATA + * chunks this field MUST be filled in. */ +struct sctp_fwdtsn_skip { + __u16 stream; + __u16 ssn; +} __attribute__((packed)); + +struct sctp_fwdtsn_hdr { + __u32 new_cum_tsn; + struct sctp_fwdtsn_skip skip[0]; +} __attribute((packed)); + +struct sctp_fwdtsn_chunk { + struct sctp_chunkhdr chunk_hdr; + struct sctp_fwdtsn_hdr fwdtsn_hdr; +} __attribute((packed)); + /* ADDIP * Section 3.1.1 Address Configuration Change Chunk (ASCONF) diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 3767428df94d..c7b45667088b 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -599,8 +599,7 @@ enum { NET_SCTP_PRESERVE_ENABLE = 11, NET_SCTP_MAX_BURST = 12, NET_SCTP_ADDIP_ENABLE = 13, - NET_SCTP_RMEM = 14, - NET_SCTP_WMEM = 15, + NET_SCTP_PRSCTP_ENABLE = 14, }; /* /proc/sys/net/bridge */ diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h index 941f935b012b..2f5e32ebd0ab 100644 --- a/include/net/sctp/command.h +++ b/include/net/sctp/command.h @@ -1,5 +1,5 @@ /* SCTP kernel reference Implementation - * (C) Copyright IBM Corp. 2001, 2003 + * (C) Copyright IBM Corp. 2001, 2004 * Copyright (C) 1999-2001 Cisco, Motorola * * This file is part of the SCTP kernel reference Implementation @@ -29,6 +29,7 @@ * La Monte H.P. Yarroll <piggy@acm.org> * Karl Knutson <karl@athena.chicago.il.us> * Ardelle Fan <ardelle.fan@intel.com> + * Sridhar Samudrala <sri@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. @@ -90,6 +91,8 @@ typedef enum { SCTP_CMD_RENEGE, /* Renege data on an association. */ SCTP_CMD_SETUP_T4, /* ADDIP, setup T4 RTO timer parms. */ SCTP_CMD_PROCESS_OPERR, /* Process an ERROR chunk. */ + SCTP_CMD_REPORT_FWDTSN, /* Report new cumulative TSN Ack. */ + SCTP_CMD_PROCESS_FWDTSN, /* Skips were reported, so process further. */ SCTP_CMD_LAST } sctp_verb_t; diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index fe40983df1b0..2abcf517b897 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h @@ -1,5 +1,5 @@ /* SCTP kernel reference Implementation - * (C) Copyright IBM Corp. 2001, 2003 + * (C) Copyright IBM Corp. 2001, 2004 * Copyright (c) 1999-2000 Cisco, Inc. * Copyright (c) 1999-2001 Motorola, Inc. * Copyright (c) 2001 Intel Corp. @@ -68,6 +68,8 @@ enum { SCTP_DEFAULT_INSTREAMS = SCTP_MAX_STREAM }; #define SCTP_NUM_ADDIP_CHUNK_TYPES 2 +#define SCTP_NUM_PRSCTP_CHUNK_TYPES 1 + /* These are the different flavours of event. */ typedef enum { diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index ee5e38a37d00..efceb30d69bb 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h @@ -475,6 +475,14 @@ for (err = (sctp_errhdr_t *)((void *)chunk_hdr + \ err = (sctp_errhdr_t *)((void *)err + \ WORD_ROUND(ntohs(err->length)))) +#define sctp_walk_fwdtsn(pos, chunk)\ +_sctp_walk_fwdtsn((pos), (chunk), ntohs((chunk)->chunk_hdr->length) - sizeof(struct sctp_fwdtsn_chunk)) + +#define _sctp_walk_fwdtsn(pos, chunk, end)\ +for (pos = chunk->subh.fwdtsn_hdr->skip;\ + (void *)pos <= (void *)chunk->subh.fwdtsn_hdr->skip + end - sizeof(struct sctp_fwdtsn_skip);\ + pos++) + /* 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 60dea46dec21..70384234f979 100644 --- a/include/net/sctp/sm.h +++ b/include/net/sctp/sm.h @@ -1,5 +1,5 @@ /* SCTP kernel reference Implementation - * (C) Copyright IBM Corp. 2001, 2003 + * (C) Copyright IBM Corp. 2001, 2004 * Copyright (c) 1999-2000 Cisco, Inc. * Copyright (c) 1999-2001 Motorola, Inc. * Copyright (c) 2001 Intel Corp. @@ -141,6 +141,9 @@ sctp_state_fn_t sctp_sf_cookie_echoed_err; sctp_state_fn_t sctp_sf_do_5_2_6_stale; sctp_state_fn_t sctp_sf_do_asconf; sctp_state_fn_t sctp_sf_do_asconf_ack; +sctp_state_fn_t sctp_sf_do_9_2_reshutack; +sctp_state_fn_t sctp_sf_eat_fwd_tsn; +sctp_state_fn_t sctp_sf_eat_fwd_tsn_fast; /* Prototypes for primitive event state functions. */ sctp_state_fn_t sctp_sf_do_prm_asoc; @@ -170,25 +173,6 @@ sctp_state_fn_t sctp_sf_do_6_3_3_rtx; sctp_state_fn_t sctp_sf_do_6_2_sack; sctp_state_fn_t sctp_sf_autoclose_timer_expire; - -/* These are state functions which are either obsolete or not in use yet. - * If any of these functions needs to be revived, it should be renamed with - * the "sctp_sf_xxx" prefix, and be moved to the above prototype groups. - */ - -/* Prototypes for chunk state functions. Not in use. */ -sctp_state_fn_t sctp_sf_do_9_2_reshutack; -sctp_state_fn_t sctp_sf_do_9_2_reshut; -sctp_state_fn_t sctp_sf_do_9_2_shutack; - -/* Prototypes for timeout event state functions. Not in use. */ -sctp_state_fn_t sctp_do_4_2_reinit; -sctp_state_fn_t sctp_do_4_3_reecho; -sctp_state_fn_t sctp_do_9_2_reshut; -sctp_state_fn_t sctp_do_9_2_reshutack; -sctp_state_fn_t sctp_do_8_3_hb_err; -sctp_state_fn_t sctp_heartoff; - /* Prototypes for utility support functions. */ __u8 sctp_get_chunk_type(struct sctp_chunk *chunk); const sctp_sm_table_entry_t *sctp_sm_lookup_event(sctp_event_t, @@ -277,6 +261,9 @@ struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc, struct sctp_chunk *asconf); int sctp_process_asconf_ack(struct sctp_association *asoc, struct sctp_chunk *asconf_ack); +struct sctp_chunk *sctp_make_fwdtsn(const struct sctp_association *asoc, + __u32 new_cum_tsn, size_t nstreams, + struct sctp_fwdtsn_skip *skiplist); void sctp_chunk_assign_tsn(struct sctp_chunk *); void sctp_chunk_assign_ssn(struct sctp_chunk *); diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 0b7717a84ea6..691f146f29dd 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h @@ -193,6 +193,9 @@ extern struct sctp_globals { /* Flag to indicate if addip is enabled. */ int addip_enable; + + /* Flag to indicate if PR-SCTP is enabled. */ + int prsctp_enable; } sctp_globals; #define sctp_rto_initial (sctp_globals.rto_initial) @@ -221,6 +224,7 @@ extern struct sctp_globals { #define sctp_local_addr_list (sctp_globals.local_addr_list) #define sctp_local_addr_lock (sctp_globals.local_addr_lock) #define sctp_addip_enable (sctp_globals.addip_enable) +#define sctp_prsctp_enable (sctp_globals.prsctp_enable) /* SCTP Socket type: UDP or TCP style. */ typedef enum { @@ -317,6 +321,8 @@ struct sctp_cookie { /* This holds the originating address of the INIT packet. */ union sctp_addr peer_addr; + __u8 prsctp_capable; + /* This is a shim for my peer's INIT packet, followed by * a copy of the raw address list of the association. * The length of the raw address list is saved in the @@ -413,6 +419,13 @@ static inline __u16 sctp_ssn_next(struct sctp_stream *stream, __u16 id) return stream->ssn[id]++; } +/* Skip over this ssn and all below. */ +static inline void sctp_ssn_skip(struct sctp_stream *stream, __u16 id, + __u16 ssn) +{ + stream->ssn[id] = ssn+1; +} + /* * Pointers to address related SCTP functions. * (i.e. things that depend on the address family.) @@ -514,8 +527,8 @@ struct sctp_datamsg { /* Did the messenge fail to send? */ int send_error; char send_failed; - /* Control whether fragments from this message can expire. */ - char can_expire; + /* Control whether chunks from this message can be abandoned. */ + char can_abandon; }; struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *, @@ -527,8 +540,8 @@ void sctp_datamsg_hold(struct sctp_datamsg *); void sctp_datamsg_free(struct sctp_datamsg *); void sctp_datamsg_track(struct sctp_chunk *); void sctp_datamsg_assign(struct sctp_datamsg *, struct sctp_chunk *); -void sctp_datamsg_fail(struct sctp_chunk *, int error); -int sctp_datamsg_expires(struct sctp_chunk *); +void sctp_chunk_fail(struct sctp_chunk *, int error); +int sctp_chunk_abandoned(struct sctp_chunk *); /* RFC2960 1.4 Key Terms @@ -583,6 +596,7 @@ struct sctp_chunk { struct sctp_cwrhdr *ecn_cwr_hdr; struct sctp_errhdr *err_hdr; struct sctp_addiphdr *addip_hdr; + struct sctp_fwdtsn_hdr *fwdtsn_hdr; } subh; __u8 *chunk_end; @@ -890,7 +904,7 @@ struct sctp_transport { /* A flag which indicates the occurrence of a changeover */ char changeover_active; - /* A glag which indicates whether the change of primary is + /* A flag which indicates whether the change of primary is * the first switch to this destination address during an * active switch. */ @@ -993,6 +1007,11 @@ struct sctp_outq { */ struct list_head retransmit; + /* Put chunks on this list to save them for FWD TSN processing as + * they were abandoned. + */ + struct list_head abandoned; + /* How many unackd bytes do we have in-flight? */ __u32 outstanding_bytes; @@ -1356,16 +1375,25 @@ struct sctp_association { struct sctp_tsnmap tsn_map; __u8 _map[sctp_tsnmap_storage_size(SCTP_TSN_MAP_SIZE)]; - /* Do we need to sack the peer? */ - __u8 sack_needed; + /* Ack State : This flag indicates if the next received + * : packet is to be responded to with a + * : SACK. This is initializedto 0. When a packet + * : is received it is incremented. If this value + * : reaches 2 or more, a SACK is sent and the + * : value is reset to 0. Note: This is used only + * : when no DATA chunks are received out of + * : order. When DATA chunks are out of order, + * : SACK's are not delayed (see Section 6). + */ + __u8 sack_needed; /* Do we need to sack the peer? */ + /* These are capabilities which our peer advertised. */ __u8 ecn_capable; /* Can peer do ECN? */ __u8 ipv4_address; /* Peer understands IPv4 addresses? */ __u8 ipv6_address; /* Peer understands IPv6 addresses? */ __u8 hostname_address;/* Peer understands DNS addresses? */ - - /* Does peer support ADDIP? */ - __u8 asconf_capable; + __u8 asconf_capable; /* Does peer support ADDIP? */ + __u8 prsctp_capable; /* Can peer do PR-SCTP? */ /* This mask is used to disable sending the ASCONF chunk * with specified parameter to peer. @@ -1458,6 +1486,9 @@ struct sctp_association { __u32 ctsn_ack_point; + /* PR-SCTP Advanced.Peer.Ack.Point */ + __u32 adv_peer_ack_point; + /* Highest TSN that is acknowledged by incoming SACKs. */ __u32 highest_sacked; @@ -1498,19 +1529,7 @@ struct sctp_association { /* The message size at which SCTP fragmentation will occur. */ __u32 frag_point; - /* Ack State : This flag indicates if the next received - * : packet is to be responded to with a - * : SACK. This is initializedto 0. When a packet - * : is received it is incremented. If this value - * : reaches 2 or more, a SACK is sent and the - * : value is reset to 0. Note: This is used only - * : when no DATA chunks are received out of - * : order. When DATA chunks are out of order, - * : SACK's are not delayed (see Section 6). - */ - /* Do we need to send an ack? - * When counters[SctpCounterAckState] is above 1 we do! - */ + /* Currently only one counter is used to count INIT errors. */ int counters[SCTP_NUMBER_COUNTERS]; /* Default send parameters. */ diff --git a/include/net/sctp/tsnmap.h b/include/net/sctp/tsnmap.h index 49ab1c3f7e94..8d77b89ca979 100644 --- a/include/net/sctp/tsnmap.h +++ b/include/net/sctp/tsnmap.h @@ -1,7 +1,7 @@ /* SCTP kernel reference Implementation + * (C) Copyright IBM Corp. 2001, 2004 * Copyright (c) 1999-2000 Cisco, Inc. * Copyright (c) 1999-2001 Motorola, Inc. - * Copyright (c) 2001-2003 International Business Machines, Corp. * Copyright (c) 2001 Intel Corp. * * This file is part of the SCTP kernel reference Implementation @@ -37,6 +37,7 @@ * Jon Grimm <jgrimm@us.ibm.com> * La Monte H.P. Yarroll <piggy@acm.org> * Karl Knutson <karl@athena.chicago.il.us> + * Sridhar Samudrala <sri@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. @@ -145,6 +146,9 @@ int sctp_tsnmap_check(const struct sctp_tsnmap *, __u32 tsn); /* Mark this TSN as seen. */ void sctp_tsnmap_mark(struct sctp_tsnmap *, __u32 tsn); +/* Mark this TSN and all lower as seen. */ +void sctp_tsnmap_skip(struct sctp_tsnmap *map, __u32 tsn); + /* Retrieve the Cumulative TSN ACK Point. */ static inline __u32 sctp_tsnmap_get_ctsn(const struct sctp_tsnmap *map) { diff --git a/include/net/sctp/ulpqueue.h b/include/net/sctp/ulpqueue.h index 69541c80301e..5a2ce0cf4d00 100644 --- a/include/net/sctp/ulpqueue.h +++ b/include/net/sctp/ulpqueue.h @@ -1,7 +1,7 @@ /* SCTP kernel reference Implementation + * (C) Copyright IBM Corp. 2001, 2004 * Copyright (c) 1999-2000 Cisco, Inc. * Copyright (c) 1999-2001 Motorola, Inc. - * Copyright (c) 2001-2003 International Business Machines, Corp. * Copyright (c) 2001 Intel Corp. * Copyright (c) 2001 Nokia, Inc. * Copyright (c) 2001 La Monte H.P. Yarroll @@ -38,6 +38,7 @@ * Written or modified by: * Jon Grimm <jgrimm@us.ibm.com> * La Monte H.P. Yarroll <piggy@acm.org> + * Sridhar Samudrala <sri@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. @@ -79,6 +80,9 @@ void sctp_ulpq_abort_pd(struct sctp_ulpq *, int); /* Clear the partial data delivery condition on this socket. */ int sctp_clear_pd(struct sock *sk); +/* Skip over an SSN. */ +void sctp_ulpq_skip(struct sctp_ulpq *ulpq, __u16 sid, __u16 ssn); + #endif /* __sctp_ulpqueue_h__ */ |
