aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/xfrm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/xfrm.h')
-rw-r--r--include/net/xfrm.h47
1 files changed, 24 insertions, 23 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 223e90a44824..6d85861ab990 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -19,6 +19,9 @@
19#include <net/route.h> 19#include <net/route.h>
20#include <net/ipv6.h> 20#include <net/ipv6.h>
21#include <net/ip6_fib.h> 21#include <net/ip6_fib.h>
22
23#include <linux/interrupt.h>
24
22#ifdef CONFIG_XFRM_STATISTICS 25#ifdef CONFIG_XFRM_STATISTICS
23#include <net/snmp.h> 26#include <net/snmp.h>
24#endif 27#endif
@@ -121,8 +124,7 @@ struct xfrm_state_walk {
121}; 124};
122 125
123/* Full description of state of transformer. */ 126/* Full description of state of transformer. */
124struct xfrm_state 127struct xfrm_state {
125{
126#ifdef CONFIG_NET_NS 128#ifdef CONFIG_NET_NS
127 struct net *xs_net; 129 struct net *xs_net;
128#endif 130#endif
@@ -160,7 +162,7 @@ struct xfrm_state
160 struct xfrm_lifetime_cfg lft; 162 struct xfrm_lifetime_cfg lft;
161 163
162 /* Data for transformer */ 164 /* Data for transformer */
163 struct xfrm_algo *aalg; 165 struct xfrm_algo_auth *aalg;
164 struct xfrm_algo *ealg; 166 struct xfrm_algo *ealg;
165 struct xfrm_algo *calg; 167 struct xfrm_algo *calg;
166 struct xfrm_algo_aead *aead; 168 struct xfrm_algo_aead *aead;
@@ -199,7 +201,7 @@ struct xfrm_state
199 struct xfrm_stats stats; 201 struct xfrm_stats stats;
200 202
201 struct xfrm_lifetime_cur curlft; 203 struct xfrm_lifetime_cur curlft;
202 struct timer_list timer; 204 struct tasklet_hrtimer mtimer;
203 205
204 /* Last used time */ 206 /* Last used time */
205 unsigned long lastused; 207 unsigned long lastused;
@@ -237,8 +239,7 @@ enum {
237}; 239};
238 240
239/* callback structure passed from either netlink or pfkey */ 241/* callback structure passed from either netlink or pfkey */
240struct km_event 242struct km_event {
241{
242 union { 243 union {
243 u32 hard; 244 u32 hard;
244 u32 proto; 245 u32 proto;
@@ -313,8 +314,7 @@ extern int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo);
313 314
314extern void xfrm_state_delete_tunnel(struct xfrm_state *x); 315extern void xfrm_state_delete_tunnel(struct xfrm_state *x);
315 316
316struct xfrm_type 317struct xfrm_type {
317{
318 char *description; 318 char *description;
319 struct module *owner; 319 struct module *owner;
320 __u8 proto; 320 __u8 proto;
@@ -420,8 +420,7 @@ static inline struct xfrm_mode *xfrm_ip2inner_mode(struct xfrm_state *x, int ipp
420 return x->inner_mode_iaf; 420 return x->inner_mode_iaf;
421} 421}
422 422
423struct xfrm_tmpl 423struct xfrm_tmpl {
424{
425/* id in template is interpreted as: 424/* id in template is interpreted as:
426 * daddr - destination of tunnel, may be zero for transport mode. 425 * daddr - destination of tunnel, may be zero for transport mode.
427 * spi - zero to acquire spi. Not zero if spi is static, then 426 * spi - zero to acquire spi. Not zero if spi is static, then
@@ -468,8 +467,7 @@ struct xfrm_policy_walk {
468 u32 seq; 467 u32 seq;
469}; 468};
470 469
471struct xfrm_policy 470struct xfrm_policy {
472{
473#ifdef CONFIG_NET_NS 471#ifdef CONFIG_NET_NS
474 struct net *xp_net; 472 struct net *xp_net;
475#endif 473#endif
@@ -538,8 +536,7 @@ struct xfrm_migrate {
538/* default seq threshold size */ 536/* default seq threshold size */
539#define XFRM_AE_SEQT_SIZE 2 537#define XFRM_AE_SEQT_SIZE 2
540 538
541struct xfrm_mgr 539struct xfrm_mgr {
542{
543 struct list_head list; 540 struct list_head list;
544 char *id; 541 char *id;
545 int (*notify)(struct xfrm_state *x, struct km_event *c); 542 int (*notify)(struct xfrm_state *x, struct km_event *c);
@@ -626,8 +623,7 @@ struct xfrm_spi_skb_cb {
626#define XFRM_SPI_SKB_CB(__skb) ((struct xfrm_spi_skb_cb *)&((__skb)->cb[0])) 623#define XFRM_SPI_SKB_CB(__skb) ((struct xfrm_spi_skb_cb *)&((__skb)->cb[0]))
627 624
628/* Audit Information */ 625/* Audit Information */
629struct xfrm_audit 626struct xfrm_audit {
630{
631 u32 secid; 627 u32 secid;
632 uid_t loginuid; 628 uid_t loginuid;
633 u32 sessionid; 629 u32 sessionid;
@@ -871,8 +867,7 @@ static inline int xfrm_sec_ctx_match(struct xfrm_sec_ctx *s1, struct xfrm_sec_ct
871 * bundles differing by session id. All the bundles grow from a parent 867 * bundles differing by session id. All the bundles grow from a parent
872 * policy rule. 868 * policy rule.
873 */ 869 */
874struct xfrm_dst 870struct xfrm_dst {
875{
876 union { 871 union {
877 struct dst_entry dst; 872 struct dst_entry dst;
878 struct rtable rt; 873 struct rtable rt;
@@ -907,8 +902,7 @@ static inline void xfrm_dst_destroy(struct xfrm_dst *xdst)
907 902
908extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev); 903extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev);
909 904
910struct sec_path 905struct sec_path {
911{
912 atomic_t refcnt; 906 atomic_t refcnt;
913 int len; 907 int len;
914 struct xfrm_state *xvec[XFRM_MAX_DEPTH]; 908 struct xfrm_state *xvec[XFRM_MAX_DEPTH];
@@ -1500,9 +1494,6 @@ struct scatterlist;
1500typedef int (icv_update_fn_t)(struct hash_desc *, struct scatterlist *, 1494typedef int (icv_update_fn_t)(struct hash_desc *, struct scatterlist *,
1501 unsigned int); 1495 unsigned int);
1502 1496
1503extern int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *tfm,
1504 int offset, int len, icv_update_fn_t icv_update);
1505
1506static inline int xfrm_addr_cmp(xfrm_address_t *a, xfrm_address_t *b, 1497static inline int xfrm_addr_cmp(xfrm_address_t *a, xfrm_address_t *b,
1507 int family) 1498 int family)
1508{ 1499{
@@ -1541,12 +1532,22 @@ static inline int xfrm_alg_len(struct xfrm_algo *alg)
1541 return sizeof(*alg) + ((alg->alg_key_len + 7) / 8); 1532 return sizeof(*alg) + ((alg->alg_key_len + 7) / 8);
1542} 1533}
1543 1534
1535static inline int xfrm_alg_auth_len(struct xfrm_algo_auth *alg)
1536{
1537 return sizeof(*alg) + ((alg->alg_key_len + 7) / 8);
1538}
1539
1544#ifdef CONFIG_XFRM_MIGRATE 1540#ifdef CONFIG_XFRM_MIGRATE
1545static inline struct xfrm_algo *xfrm_algo_clone(struct xfrm_algo *orig) 1541static inline struct xfrm_algo *xfrm_algo_clone(struct xfrm_algo *orig)
1546{ 1542{
1547 return kmemdup(orig, xfrm_alg_len(orig), GFP_KERNEL); 1543 return kmemdup(orig, xfrm_alg_len(orig), GFP_KERNEL);
1548} 1544}
1549 1545
1546static inline struct xfrm_algo_auth *xfrm_algo_auth_clone(struct xfrm_algo_auth *orig)
1547{
1548 return kmemdup(orig, xfrm_alg_auth_len(orig), GFP_KERNEL);
1549}
1550
1550static inline void xfrm_states_put(struct xfrm_state **states, int n) 1551static inline void xfrm_states_put(struct xfrm_state **states, int n)
1551{ 1552{
1552 int i; 1553 int i;