aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
Diffstat (limited to 'include/net')
-rw-r--r--include/net/sctp/command.h7
-rw-r--r--include/net/sctp/structs.h19
2 files changed, 20 insertions, 6 deletions
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h
index dc107ffad483..34a1a09e5aef 100644
--- a/include/net/sctp/command.h
+++ b/include/net/sctp/command.h
@@ -120,6 +120,7 @@ typedef union {
120 int error; 120 int error;
121 sctp_state_t state; 121 sctp_state_t state;
122 sctp_event_timeout_t to; 122 sctp_event_timeout_t to;
123 unsigned long zero;
123 void *ptr; 124 void *ptr;
124 struct sctp_chunk *chunk; 125 struct sctp_chunk *chunk;
125 struct sctp_association *asoc; 126 struct sctp_association *asoc;
@@ -148,17 +149,17 @@ static inline sctp_arg_t SCTP_NULL(void)
148} 149}
149static inline sctp_arg_t SCTP_NOFORCE(void) 150static inline sctp_arg_t SCTP_NOFORCE(void)
150{ 151{
151 sctp_arg_t retval; retval.i32 = 0; return retval; 152 sctp_arg_t retval = {.zero = 0UL}; retval.i32 = 0; return retval;
152} 153}
153static inline sctp_arg_t SCTP_FORCE(void) 154static inline sctp_arg_t SCTP_FORCE(void)
154{ 155{
155 sctp_arg_t retval; retval.i32 = 1; return retval; 156 sctp_arg_t retval = {.zero = 0UL}; retval.i32 = 1; return retval;
156} 157}
157 158
158#define SCTP_ARG_CONSTRUCTOR(name, type, elt) \ 159#define SCTP_ARG_CONSTRUCTOR(name, type, elt) \
159static inline sctp_arg_t \ 160static inline sctp_arg_t \
160SCTP_## name (type arg) \ 161SCTP_## name (type arg) \
161{ sctp_arg_t retval; retval.elt = arg; return retval; } 162{ sctp_arg_t retval = {.zero = 0UL}; retval.elt = arg; return retval; }
162 163
163SCTP_ARG_CONSTRUCTOR(I32, __s32, i32) 164SCTP_ARG_CONSTRUCTOR(I32, __s32, i32)
164SCTP_ARG_CONSTRUCTOR(U32, __u32, u32) 165SCTP_ARG_CONSTRUCTOR(U32, __u32, u32)
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 9c385b6417c7..8e7794ee27ff 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -161,6 +161,13 @@ extern struct sctp_globals {
161 */ 161 */
162 int sndbuf_policy; 162 int sndbuf_policy;
163 163
164 /*
165 * Policy for preforming sctp/socket accounting
166 * 0 - do socket level accounting, all assocs share sk_rcvbuf
167 * 1 - do sctp accounting, each asoc may use sk_rcvbuf bytes
168 */
169 int rcvbuf_policy;
170
164 /* Delayed SACK timeout 200ms default*/ 171 /* Delayed SACK timeout 200ms default*/
165 int sack_timeout; 172 int sack_timeout;
166 173
@@ -218,6 +225,7 @@ extern struct sctp_globals {
218#define sctp_cookie_preserve_enable (sctp_globals.cookie_preserve_enable) 225#define sctp_cookie_preserve_enable (sctp_globals.cookie_preserve_enable)
219#define sctp_max_retrans_association (sctp_globals.max_retrans_association) 226#define sctp_max_retrans_association (sctp_globals.max_retrans_association)
220#define sctp_sndbuf_policy (sctp_globals.sndbuf_policy) 227#define sctp_sndbuf_policy (sctp_globals.sndbuf_policy)
228#define sctp_rcvbuf_policy (sctp_globals.rcvbuf_policy)
221#define sctp_max_retrans_path (sctp_globals.max_retrans_path) 229#define sctp_max_retrans_path (sctp_globals.max_retrans_path)
222#define sctp_max_retrans_init (sctp_globals.max_retrans_init) 230#define sctp_max_retrans_init (sctp_globals.max_retrans_init)
223#define sctp_sack_timeout (sctp_globals.sack_timeout) 231#define sctp_sack_timeout (sctp_globals.sack_timeout)
@@ -1222,11 +1230,11 @@ struct sctp_endpoint {
1222 int last_key; 1230 int last_key;
1223 int key_changed_at; 1231 int key_changed_at;
1224 1232
1225 /* Default timeouts. */
1226 int timeouts[SCTP_NUM_TIMEOUT_TYPES];
1227
1228 /* sendbuf acct. policy. */ 1233 /* sendbuf acct. policy. */
1229 __u32 sndbuf_policy; 1234 __u32 sndbuf_policy;
1235
1236 /* rcvbuf acct. policy. */
1237 __u32 rcvbuf_policy;
1230}; 1238};
1231 1239
1232/* Recover the outter endpoint structure. */ 1240/* Recover the outter endpoint structure. */
@@ -1553,6 +1561,11 @@ struct sctp_association {
1553 */ 1561 */
1554 int sndbuf_used; 1562 int sndbuf_used;
1555 1563
1564 /* This is the amount of memory that this association has allocated
1565 * in the receive path at any given time.
1566 */
1567 atomic_t rmem_alloc;
1568
1556 /* This is the wait queue head for send requests waiting on 1569 /* This is the wait queue head for send requests waiting on
1557 * the association sndbuf space. 1570 * the association sndbuf space.
1558 */ 1571 */