diff options
Diffstat (limited to 'include/net/sctp/structs.h')
-rw-r--r-- | include/net/sctp/structs.h | 43 |
1 files changed, 28 insertions, 15 deletions
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 994009bbe3b4..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) |
@@ -446,7 +454,7 @@ struct sctp_ssnmap { | |||
446 | }; | 454 | }; |
447 | 455 | ||
448 | struct sctp_ssnmap *sctp_ssnmap_new(__u16 in, __u16 out, | 456 | struct sctp_ssnmap *sctp_ssnmap_new(__u16 in, __u16 out, |
449 | unsigned int __nocast gfp); | 457 | gfp_t gfp); |
450 | void sctp_ssnmap_free(struct sctp_ssnmap *map); | 458 | void sctp_ssnmap_free(struct sctp_ssnmap *map); |
451 | void sctp_ssnmap_clear(struct sctp_ssnmap *map); | 459 | void sctp_ssnmap_clear(struct sctp_ssnmap *map); |
452 | 460 | ||
@@ -947,7 +955,7 @@ struct sctp_transport { | |||
947 | }; | 955 | }; |
948 | 956 | ||
949 | struct sctp_transport *sctp_transport_new(const union sctp_addr *, | 957 | struct sctp_transport *sctp_transport_new(const union sctp_addr *, |
950 | unsigned int __nocast); | 958 | gfp_t); |
951 | void sctp_transport_set_owner(struct sctp_transport *, | 959 | void sctp_transport_set_owner(struct sctp_transport *, |
952 | struct sctp_association *); | 960 | struct sctp_association *); |
953 | void sctp_transport_route(struct sctp_transport *, union sctp_addr *, | 961 | void sctp_transport_route(struct sctp_transport *, union sctp_addr *, |
@@ -1095,10 +1103,10 @@ void sctp_bind_addr_init(struct sctp_bind_addr *, __u16 port); | |||
1095 | void sctp_bind_addr_free(struct sctp_bind_addr *); | 1103 | void sctp_bind_addr_free(struct sctp_bind_addr *); |
1096 | int sctp_bind_addr_copy(struct sctp_bind_addr *dest, | 1104 | int sctp_bind_addr_copy(struct sctp_bind_addr *dest, |
1097 | const struct sctp_bind_addr *src, | 1105 | const struct sctp_bind_addr *src, |
1098 | sctp_scope_t scope, unsigned int __nocast gfp, | 1106 | sctp_scope_t scope, gfp_t gfp, |
1099 | int flags); | 1107 | int flags); |
1100 | int sctp_add_bind_addr(struct sctp_bind_addr *, union sctp_addr *, | 1108 | int sctp_add_bind_addr(struct sctp_bind_addr *, union sctp_addr *, |
1101 | unsigned int __nocast gfp); | 1109 | gfp_t gfp); |
1102 | int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *); | 1110 | int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *); |
1103 | int sctp_bind_addr_match(struct sctp_bind_addr *, const union sctp_addr *, | 1111 | int sctp_bind_addr_match(struct sctp_bind_addr *, const union sctp_addr *, |
1104 | struct sctp_sock *); | 1112 | struct sctp_sock *); |
@@ -1108,9 +1116,9 @@ union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp, | |||
1108 | struct sctp_sock *opt); | 1116 | struct sctp_sock *opt); |
1109 | union sctp_params sctp_bind_addrs_to_raw(const struct sctp_bind_addr *bp, | 1117 | union sctp_params sctp_bind_addrs_to_raw(const struct sctp_bind_addr *bp, |
1110 | int *addrs_len, | 1118 | int *addrs_len, |
1111 | unsigned int __nocast gfp); | 1119 | gfp_t gfp); |
1112 | int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw, int len, | 1120 | int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw, int len, |
1113 | __u16 port, unsigned int __nocast gfp); | 1121 | __u16 port, gfp_t gfp); |
1114 | 1122 | ||
1115 | sctp_scope_t sctp_scope(const union sctp_addr *); | 1123 | sctp_scope_t sctp_scope(const union sctp_addr *); |
1116 | int sctp_in_scope(const union sctp_addr *addr, const sctp_scope_t scope); | 1124 | int sctp_in_scope(const union sctp_addr *addr, const sctp_scope_t scope); |
@@ -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. */ |
@@ -1239,7 +1247,7 @@ static inline struct sctp_endpoint *sctp_ep(struct sctp_ep_common *base) | |||
1239 | } | 1247 | } |
1240 | 1248 | ||
1241 | /* These are function signatures for manipulating endpoints. */ | 1249 | /* These are function signatures for manipulating endpoints. */ |
1242 | struct sctp_endpoint *sctp_endpoint_new(struct sock *, unsigned int __nocast); | 1250 | struct sctp_endpoint *sctp_endpoint_new(struct sock *, gfp_t); |
1243 | void sctp_endpoint_free(struct sctp_endpoint *); | 1251 | void sctp_endpoint_free(struct sctp_endpoint *); |
1244 | void sctp_endpoint_put(struct sctp_endpoint *); | 1252 | void sctp_endpoint_put(struct sctp_endpoint *); |
1245 | void sctp_endpoint_hold(struct sctp_endpoint *); | 1253 | void sctp_endpoint_hold(struct sctp_endpoint *); |
@@ -1260,7 +1268,7 @@ int sctp_verify_init(const struct sctp_association *asoc, sctp_cid_t, | |||
1260 | struct sctp_chunk **err_chunk); | 1268 | struct sctp_chunk **err_chunk); |
1261 | int sctp_process_init(struct sctp_association *, sctp_cid_t cid, | 1269 | int sctp_process_init(struct sctp_association *, sctp_cid_t cid, |
1262 | const union sctp_addr *peer, | 1270 | const union sctp_addr *peer, |
1263 | sctp_init_chunk_t *init, unsigned int __nocast gfp); | 1271 | sctp_init_chunk_t *init, gfp_t gfp); |
1264 | __u32 sctp_generate_tag(const struct sctp_endpoint *); | 1272 | __u32 sctp_generate_tag(const struct sctp_endpoint *); |
1265 | __u32 sctp_generate_tsn(const struct sctp_endpoint *); | 1273 | __u32 sctp_generate_tsn(const struct sctp_endpoint *); |
1266 | 1274 | ||
@@ -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 | */ |
@@ -1723,7 +1736,7 @@ static inline struct sctp_association *sctp_assoc(struct sctp_ep_common *base) | |||
1723 | 1736 | ||
1724 | struct sctp_association * | 1737 | struct sctp_association * |
1725 | sctp_association_new(const struct sctp_endpoint *, const struct sock *, | 1738 | sctp_association_new(const struct sctp_endpoint *, const struct sock *, |
1726 | sctp_scope_t scope, unsigned int __nocast gfp); | 1739 | sctp_scope_t scope, gfp_t gfp); |
1727 | void sctp_association_free(struct sctp_association *); | 1740 | void sctp_association_free(struct sctp_association *); |
1728 | void sctp_association_put(struct sctp_association *); | 1741 | void sctp_association_put(struct sctp_association *); |
1729 | void sctp_association_hold(struct sctp_association *); | 1742 | void sctp_association_hold(struct sctp_association *); |
@@ -1739,7 +1752,7 @@ int sctp_assoc_lookup_laddr(struct sctp_association *asoc, | |||
1739 | const union sctp_addr *laddr); | 1752 | const union sctp_addr *laddr); |
1740 | struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *, | 1753 | struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *, |
1741 | const union sctp_addr *address, | 1754 | const union sctp_addr *address, |
1742 | const unsigned int __nocast gfp, | 1755 | const gfp_t gfp, |
1743 | const int peer_state); | 1756 | const int peer_state); |
1744 | void sctp_assoc_del_peer(struct sctp_association *asoc, | 1757 | void sctp_assoc_del_peer(struct sctp_association *asoc, |
1745 | const union sctp_addr *addr); | 1758 | const union sctp_addr *addr); |
@@ -1764,10 +1777,10 @@ void sctp_assoc_rwnd_decrease(struct sctp_association *, unsigned); | |||
1764 | void sctp_assoc_set_primary(struct sctp_association *, | 1777 | void sctp_assoc_set_primary(struct sctp_association *, |
1765 | struct sctp_transport *); | 1778 | struct sctp_transport *); |
1766 | int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *, | 1779 | int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *, |
1767 | unsigned int __nocast); | 1780 | gfp_t); |
1768 | int sctp_assoc_set_bind_addr_from_cookie(struct sctp_association *, | 1781 | int sctp_assoc_set_bind_addr_from_cookie(struct sctp_association *, |
1769 | struct sctp_cookie*, | 1782 | struct sctp_cookie*, |
1770 | unsigned int __nocast gfp); | 1783 | gfp_t gfp); |
1771 | 1784 | ||
1772 | int sctp_cmp_addr_exact(const union sctp_addr *ss1, | 1785 | int sctp_cmp_addr_exact(const union sctp_addr *ss1, |
1773 | const union sctp_addr *ss2); | 1786 | const union sctp_addr *ss2); |