aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sctp
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/sctp')
-rw-r--r--include/net/sctp/command.h1
-rw-r--r--include/net/sctp/constants.h4
-rw-r--r--include/net/sctp/sctp.h4
-rw-r--r--include/net/sctp/sm.h4
-rw-r--r--include/net/sctp/structs.h22
-rw-r--r--include/net/sctp/user.h134
6 files changed, 69 insertions, 100 deletions
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h
index 8be5135ff7aa..2c55a7ea20af 100644
--- a/include/net/sctp/command.h
+++ b/include/net/sctp/command.h
@@ -107,6 +107,7 @@ typedef enum {
107 SCTP_CMD_T1_RETRAN, /* Mark for retransmission after T1 timeout */ 107 SCTP_CMD_T1_RETRAN, /* Mark for retransmission after T1 timeout */
108 SCTP_CMD_UPDATE_INITTAG, /* Update peer inittag */ 108 SCTP_CMD_UPDATE_INITTAG, /* Update peer inittag */
109 SCTP_CMD_SEND_MSG, /* Send the whole use message */ 109 SCTP_CMD_SEND_MSG, /* Send the whole use message */
110 SCTP_CMD_SEND_NEXT_ASCONF, /* Send the next ASCONF after ACK */
110 SCTP_CMD_LAST 111 SCTP_CMD_LAST
111} sctp_verb_t; 112} sctp_verb_t;
112 113
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index 58f714a3b670..63908840eef0 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -308,6 +308,10 @@ enum { SCTP_MAX_GABS = 16 };
308 308
309#define SCTP_DEFAULT_MINWINDOW 1500 /* default minimum rwnd size */ 309#define SCTP_DEFAULT_MINWINDOW 1500 /* default minimum rwnd size */
310#define SCTP_DEFAULT_MAXWINDOW 65535 /* default rwnd size */ 310#define SCTP_DEFAULT_MAXWINDOW 65535 /* default rwnd size */
311#define SCTP_DEFAULT_RWND_SHIFT 4 /* by default, update on 1/16 of
312 * rcvbuf, which is 1/8 of initial
313 * window
314 */
311#define SCTP_DEFAULT_MAXSEGMENT 1500 /* MTU size, this is the limit 315#define SCTP_DEFAULT_MAXSEGMENT 1500 /* MTU size, this is the limit
312 * to which we will raise the P-MTU. 316 * to which we will raise the P-MTU.
313 */ 317 */
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 8a6d5297de16..fa6cde578a1d 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -128,6 +128,7 @@ extern int sctp_register_pf(struct sctp_pf *, sa_family_t);
128int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb); 128int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb);
129int sctp_inet_listen(struct socket *sock, int backlog); 129int sctp_inet_listen(struct socket *sock, int backlog);
130void sctp_write_space(struct sock *sk); 130void sctp_write_space(struct sock *sk);
131void sctp_data_ready(struct sock *sk, int len);
131unsigned int sctp_poll(struct file *file, struct socket *sock, 132unsigned int sctp_poll(struct file *file, struct socket *sock,
132 poll_table *wait); 133 poll_table *wait);
133void sctp_sock_rfree(struct sk_buff *skb); 134void sctp_sock_rfree(struct sk_buff *skb);
@@ -227,8 +228,7 @@ DECLARE_SNMP_STAT(struct sctp_mib, sctp_statistics);
227#endif /* !TEST_FRAME */ 228#endif /* !TEST_FRAME */
228 229
229/* sctp mib definitions */ 230/* sctp mib definitions */
230enum 231enum {
231{
232 SCTP_MIB_NUM = 0, 232 SCTP_MIB_NUM = 0,
233 SCTP_MIB_CURRESTAB, /* CurrEstab */ 233 SCTP_MIB_CURRESTAB, /* CurrEstab */
234 SCTP_MIB_ACTIVEESTABS, /* ActiveEstabs */ 234 SCTP_MIB_ACTIVEESTABS, /* ActiveEstabs */
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index c1dd89365833..61d73e37d543 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -243,7 +243,8 @@ struct sctp_chunk *sctp_make_op_error(const struct sctp_association *,
243 const struct sctp_chunk *chunk, 243 const struct sctp_chunk *chunk,
244 __be16 cause_code, 244 __be16 cause_code,
245 const void *payload, 245 const void *payload,
246 size_t paylen); 246 size_t paylen,
247 size_t reserve_tail);
247 248
248struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *, 249struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *,
249 union sctp_addr *, 250 union sctp_addr *,
@@ -278,6 +279,7 @@ int sctp_do_sm(sctp_event_t event_type, sctp_subtype_t subtype,
278/* 2nd level prototypes */ 279/* 2nd level prototypes */
279void sctp_generate_t3_rtx_event(unsigned long peer); 280void sctp_generate_t3_rtx_event(unsigned long peer);
280void sctp_generate_heartbeat_event(unsigned long peer); 281void sctp_generate_heartbeat_event(unsigned long peer);
282void sctp_generate_proto_unreach_event(unsigned long peer);
281 283
282void sctp_ootb_pkt_free(struct sctp_packet *); 284void sctp_ootb_pkt_free(struct sctp_packet *);
283 285
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 0a474568b003..219043a67bf7 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -231,6 +231,11 @@ extern struct sctp_globals {
231 /* Flag to indicate whether computing and verifying checksum 231 /* Flag to indicate whether computing and verifying checksum
232 * is disabled. */ 232 * is disabled. */
233 int checksum_disable; 233 int checksum_disable;
234
235 /* Threshold for rwnd update SACKS. Receive buffer shifted this many
236 * bits is an indicator of when to send and window update SACK.
237 */
238 int rwnd_update_shift;
234} sctp_globals; 239} sctp_globals;
235 240
236#define sctp_rto_initial (sctp_globals.rto_initial) 241#define sctp_rto_initial (sctp_globals.rto_initial)
@@ -267,6 +272,7 @@ extern struct sctp_globals {
267#define sctp_prsctp_enable (sctp_globals.prsctp_enable) 272#define sctp_prsctp_enable (sctp_globals.prsctp_enable)
268#define sctp_auth_enable (sctp_globals.auth_enable) 273#define sctp_auth_enable (sctp_globals.auth_enable)
269#define sctp_checksum_disable (sctp_globals.checksum_disable) 274#define sctp_checksum_disable (sctp_globals.checksum_disable)
275#define sctp_rwnd_upd_shift (sctp_globals.rwnd_update_shift)
270 276
271/* SCTP Socket type: UDP or TCP style. */ 277/* SCTP Socket type: UDP or TCP style. */
272typedef enum { 278typedef enum {
@@ -772,6 +778,7 @@ int sctp_user_addto_chunk(struct sctp_chunk *chunk, int off, int len,
772 struct iovec *data); 778 struct iovec *data);
773void sctp_chunk_free(struct sctp_chunk *); 779void sctp_chunk_free(struct sctp_chunk *);
774void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data); 780void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data);
781void *sctp_addto_chunk_fixed(struct sctp_chunk *, int len, const void *data);
775struct sctp_chunk *sctp_chunkify(struct sk_buff *, 782struct sctp_chunk *sctp_chunkify(struct sk_buff *,
776 const struct sctp_association *, 783 const struct sctp_association *,
777 struct sock *); 784 struct sock *);
@@ -935,6 +942,8 @@ struct sctp_transport {
935 /* Data that has been sent, but not acknowledged. */ 942 /* Data that has been sent, but not acknowledged. */
936 __u32 flight_size; 943 __u32 flight_size;
937 944
945 __u32 burst_limited; /* Holds old cwnd when max.burst is applied */
946
938 /* TSN marking the fast recovery exit point */ 947 /* TSN marking the fast recovery exit point */
939 __u32 fast_recovery_exit; 948 __u32 fast_recovery_exit;
940 949
@@ -943,12 +952,6 @@ struct sctp_transport {
943 /* Source address. */ 952 /* Source address. */
944 union sctp_addr saddr; 953 union sctp_addr saddr;
945 954
946 /* When was the last time(in jiffies) that a data packet was sent on
947 * this transport? This is used to adjust the cwnd when the transport
948 * becomes inactive.
949 */
950 unsigned long last_time_used;
951
952 /* Heartbeat interval: The endpoint sends out a Heartbeat chunk to 955 /* Heartbeat interval: The endpoint sends out a Heartbeat chunk to
953 * the destination address every heartbeat interval. 956 * the destination address every heartbeat interval.
954 */ 957 */
@@ -987,7 +990,7 @@ struct sctp_transport {
987 int init_sent_count; 990 int init_sent_count;
988 991
989 /* state : The current state of this destination, 992 /* state : The current state of this destination,
990 * : i.e. SCTP_ACTIVE, SCTP_INACTIVE, SCTP_UNKOWN. 993 * : i.e. SCTP_ACTIVE, SCTP_INACTIVE, SCTP_UNKNOWN.
991 */ 994 */
992 int state; 995 int state;
993 996
@@ -1007,6 +1010,9 @@ struct sctp_transport {
1007 /* Heartbeat timer is per destination. */ 1010 /* Heartbeat timer is per destination. */
1008 struct timer_list hb_timer; 1011 struct timer_list hb_timer;
1009 1012
1013 /* Timer to handle ICMP proto unreachable envets */
1014 struct timer_list proto_unreach_timer;
1015
1010 /* Since we're using per-destination retransmission timers 1016 /* Since we're using per-destination retransmission timers
1011 * (see above), we're also using per-destination "transmitted" 1017 * (see above), we're also using per-destination "transmitted"
1012 * queues. This probably ought to be a private struct 1018 * queues. This probably ought to be a private struct
@@ -1069,6 +1075,8 @@ void sctp_transport_put(struct sctp_transport *);
1069void sctp_transport_update_rto(struct sctp_transport *, __u32); 1075void sctp_transport_update_rto(struct sctp_transport *, __u32);
1070void sctp_transport_raise_cwnd(struct sctp_transport *, __u32, __u32); 1076void sctp_transport_raise_cwnd(struct sctp_transport *, __u32, __u32);
1071void sctp_transport_lower_cwnd(struct sctp_transport *, sctp_lower_cwnd_t); 1077void sctp_transport_lower_cwnd(struct sctp_transport *, sctp_lower_cwnd_t);
1078void sctp_transport_burst_limited(struct sctp_transport *);
1079void sctp_transport_burst_reset(struct sctp_transport *);
1072unsigned long sctp_transport_timeout(struct sctp_transport *); 1080unsigned long sctp_transport_timeout(struct sctp_transport *);
1073void sctp_transport_reset(struct sctp_transport *); 1081void sctp_transport_reset(struct sctp_transport *);
1074void sctp_transport_update_pmtu(struct sctp_transport *, u32); 1082void sctp_transport_update_pmtu(struct sctp_transport *, u32);
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h
index be2334aaf52e..2b2769c5ca9f 100644
--- a/include/net/sctp/user.h
+++ b/include/net/sctp/user.h
@@ -60,96 +60,49 @@ typedef __s32 sctp_assoc_t;
60/* The following symbols come from the Sockets API Extensions for 60/* The following symbols come from the Sockets API Extensions for
61 * SCTP <draft-ietf-tsvwg-sctpsocket-07.txt>. 61 * SCTP <draft-ietf-tsvwg-sctpsocket-07.txt>.
62 */ 62 */
63enum sctp_optname { 63#define SCTP_RTOINFO 0
64 SCTP_RTOINFO, 64#define SCTP_ASSOCINFO 1
65#define SCTP_RTOINFO SCTP_RTOINFO 65#define SCTP_INITMSG 2
66 SCTP_ASSOCINFO, 66#define SCTP_NODELAY 3 /* Get/set nodelay option. */
67#define SCTP_ASSOCINFO SCTP_ASSOCINFO 67#define SCTP_AUTOCLOSE 4
68 SCTP_INITMSG, 68#define SCTP_SET_PEER_PRIMARY_ADDR 5
69#define SCTP_INITMSG SCTP_INITMSG 69#define SCTP_PRIMARY_ADDR 6
70 SCTP_NODELAY, /* Get/set nodelay option. */ 70#define SCTP_ADAPTATION_LAYER 7
71#define SCTP_NODELAY SCTP_NODELAY 71#define SCTP_DISABLE_FRAGMENTS 8
72 SCTP_AUTOCLOSE, 72#define SCTP_PEER_ADDR_PARAMS 9
73#define SCTP_AUTOCLOSE SCTP_AUTOCLOSE 73#define SCTP_DEFAULT_SEND_PARAM 10
74 SCTP_SET_PEER_PRIMARY_ADDR, 74#define SCTP_EVENTS 11
75#define SCTP_SET_PEER_PRIMARY_ADDR SCTP_SET_PEER_PRIMARY_ADDR 75#define SCTP_I_WANT_MAPPED_V4_ADDR 12 /* Turn on/off mapped v4 addresses */
76 SCTP_PRIMARY_ADDR, 76#define SCTP_MAXSEG 13 /* Get/set maximum fragment. */
77#define SCTP_PRIMARY_ADDR SCTP_PRIMARY_ADDR 77#define SCTP_STATUS 14
78 SCTP_ADAPTATION_LAYER, 78#define SCTP_GET_PEER_ADDR_INFO 15
79#define SCTP_ADAPTATION_LAYER SCTP_ADAPTATION_LAYER 79#define SCTP_DELAYED_ACK_TIME 16
80 SCTP_DISABLE_FRAGMENTS, 80#define SCTP_DELAYED_ACK SCTP_DELAYED_ACK_TIME
81#define SCTP_DISABLE_FRAGMENTS SCTP_DISABLE_FRAGMENTS 81#define SCTP_CONTEXT 17
82 SCTP_PEER_ADDR_PARAMS, 82#define SCTP_FRAGMENT_INTERLEAVE 18
83#define SCTP_PEER_ADDR_PARAMS SCTP_PEER_ADDR_PARAMS 83#define SCTP_PARTIAL_DELIVERY_POINT 19 /* Set/Get partial delivery point */
84 SCTP_DEFAULT_SEND_PARAM, 84#define SCTP_MAX_BURST 20 /* Set/Get max burst */
85#define SCTP_DEFAULT_SEND_PARAM SCTP_DEFAULT_SEND_PARAM 85#define SCTP_AUTH_CHUNK 21 /* Set only: add a chunk type to authenticate */
86 SCTP_EVENTS, 86#define SCTP_HMAC_IDENT 22
87#define SCTP_EVENTS SCTP_EVENTS 87#define SCTP_AUTH_KEY 23
88 SCTP_I_WANT_MAPPED_V4_ADDR, /* Turn on/off mapped v4 addresses */ 88#define SCTP_AUTH_ACTIVE_KEY 24
89#define SCTP_I_WANT_MAPPED_V4_ADDR SCTP_I_WANT_MAPPED_V4_ADDR 89#define SCTP_AUTH_DELETE_KEY 25
90 SCTP_MAXSEG, /* Get/set maximum fragment. */ 90#define SCTP_PEER_AUTH_CHUNKS 26 /* Read only */
91#define SCTP_MAXSEG SCTP_MAXSEG 91#define SCTP_LOCAL_AUTH_CHUNKS 27 /* Read only */
92 SCTP_STATUS, 92#define SCTP_GET_ASSOC_NUMBER 28 /* Read only */
93#define SCTP_STATUS SCTP_STATUS 93
94 SCTP_GET_PEER_ADDR_INFO, 94/* Internal Socket Options. Some of the sctp library functions are
95#define SCTP_GET_PEER_ADDR_INFO SCTP_GET_PEER_ADDR_INFO 95 * implemented using these socket options.
96 SCTP_DELAYED_ACK, 96 */
97#define SCTP_DELAYED_ACK_TIME SCTP_DELAYED_ACK 97#define SCTP_SOCKOPT_BINDX_ADD 100 /* BINDX requests for adding addrs */
98#define SCTP_DELAYED_ACK SCTP_DELAYED_ACK 98#define SCTP_SOCKOPT_BINDX_REM 101 /* BINDX requests for removing addrs. */
99 SCTP_CONTEXT, /* Receive Context */ 99#define SCTP_SOCKOPT_PEELOFF 102 /* peel off association. */
100#define SCTP_CONTEXT SCTP_CONTEXT 100/* Options 104-106 are deprecated and removed. Do not use this space */
101 SCTP_FRAGMENT_INTERLEAVE, 101#define SCTP_SOCKOPT_CONNECTX_OLD 107 /* CONNECTX old requests. */
102#define SCTP_FRAGMENT_INTERLEAVE SCTP_FRAGMENT_INTERLEAVE 102#define SCTP_GET_PEER_ADDRS 108 /* Get all peer addresss. */
103 SCTP_PARTIAL_DELIVERY_POINT, /* Set/Get partial delivery point */ 103#define SCTP_GET_LOCAL_ADDRS 109 /* Get all local addresss. */
104#define SCTP_PARTIAL_DELIVERY_POINT SCTP_PARTIAL_DELIVERY_POINT 104#define SCTP_SOCKOPT_CONNECTX 110 /* CONNECTX requests. */
105 SCTP_MAX_BURST, /* Set/Get max burst */ 105#define SCTP_SOCKOPT_CONNECTX3 111 /* CONNECTX requests (updated) */
106#define SCTP_MAX_BURST SCTP_MAX_BURST
107 SCTP_AUTH_CHUNK, /* Set only: add a chunk type to authenticat */
108#define SCTP_AUTH_CHUNK SCTP_AUTH_CHUNK
109 SCTP_HMAC_IDENT,
110#define SCTP_HMAC_IDENT SCTP_HMAC_IDENT
111 SCTP_AUTH_KEY,
112#define SCTP_AUTH_KEY SCTP_AUTH_KEY
113 SCTP_AUTH_ACTIVE_KEY,
114#define SCTP_AUTH_ACTIVE_KEY SCTP_AUTH_ACTIVE_KEY
115 SCTP_AUTH_DELETE_KEY,
116#define SCTP_AUTH_DELETE_KEY SCTP_AUTH_DELETE_KEY
117 SCTP_PEER_AUTH_CHUNKS, /* Read only */
118#define SCTP_PEER_AUTH_CHUNKS SCTP_PEER_AUTH_CHUNKS
119 SCTP_LOCAL_AUTH_CHUNKS, /* Read only */
120#define SCTP_LOCAL_AUTH_CHUNKS SCTP_LOCAL_AUTH_CHUNKS
121 SCTP_GET_ASSOC_NUMBER, /* Read only */
122#define SCTP_GET_ASSOC_NUMBER SCTP_GET_ASSOC_NUMBER
123
124
125 /* Internal Socket Options. Some of the sctp library functions are
126 * implemented using these socket options.
127 */
128 SCTP_SOCKOPT_BINDX_ADD = 100,/* BINDX requests for adding addresses. */
129#define SCTP_SOCKOPT_BINDX_ADD SCTP_SOCKOPT_BINDX_ADD
130 SCTP_SOCKOPT_BINDX_REM, /* BINDX requests for removing addresses. */
131#define SCTP_SOCKOPT_BINDX_REM SCTP_SOCKOPT_BINDX_REM
132 SCTP_SOCKOPT_PEELOFF, /* peel off association. */
133#define SCTP_SOCKOPT_PEELOFF SCTP_SOCKOPT_PEELOFF
134 SCTP_GET_PEER_ADDRS_NUM_OLD, /* Get number of peer addresss. */
135#define SCTP_GET_PEER_ADDRS_NUM_OLD SCTP_GET_PEER_ADDRS_NUM_OLD
136 SCTP_GET_PEER_ADDRS_OLD, /* Get all peer addresss. */
137#define SCTP_GET_PEER_ADDRS_OLD SCTP_GET_PEER_ADDRS_OLD
138 SCTP_GET_LOCAL_ADDRS_NUM_OLD, /* Get number of local addresss. */
139#define SCTP_GET_LOCAL_ADDRS_NUM_OLD SCTP_GET_LOCAL_ADDRS_NUM_OLD
140 SCTP_GET_LOCAL_ADDRS_OLD, /* Get all local addresss. */
141#define SCTP_GET_LOCAL_ADDRS_OLD SCTP_GET_LOCAL_ADDRS_OLD
142 SCTP_SOCKOPT_CONNECTX_OLD, /* CONNECTX old requests. */
143#define SCTP_SOCKOPT_CONNECTX_OLD SCTP_SOCKOPT_CONNECTX_OLD
144 SCTP_GET_PEER_ADDRS, /* Get all peer addresss. */
145#define SCTP_GET_PEER_ADDRS SCTP_GET_PEER_ADDRS
146 SCTP_GET_LOCAL_ADDRS, /* Get all local addresss. */
147#define SCTP_GET_LOCAL_ADDRS SCTP_GET_LOCAL_ADDRS
148 SCTP_SOCKOPT_CONNECTX, /* CONNECTX requests. */
149#define SCTP_SOCKOPT_CONNECTX SCTP_SOCKOPT_CONNECTX
150 SCTP_SOCKOPT_CONNECTX3, /* CONNECTX requests. (new implementation) */
151#define SCTP_SOCKOPT_CONNECTX3 SCTP_SOCKOPT_CONNECTX3
152};
153 106
154/* 107/*
155 * 5.2.1 SCTP Initiation Structure (SCTP_INIT) 108 * 5.2.1 SCTP Initiation Structure (SCTP_INIT)
@@ -206,6 +159,7 @@ enum sctp_sinfo_flags {
206 SCTP_UNORDERED = 1, /* Send/receive message unordered. */ 159 SCTP_UNORDERED = 1, /* Send/receive message unordered. */
207 SCTP_ADDR_OVER = 2, /* Override the primary destination. */ 160 SCTP_ADDR_OVER = 2, /* Override the primary destination. */
208 SCTP_ABORT=4, /* Send an ABORT message to the peer. */ 161 SCTP_ABORT=4, /* Send an ABORT message to the peer. */
162 SCTP_SACK_IMMEDIATELY = 8, /* SACK should be sent without delay */
209 SCTP_EOF=MSG_FIN, /* Initiate graceful shutdown process. */ 163 SCTP_EOF=MSG_FIN, /* Initiate graceful shutdown process. */
210}; 164};
211 165