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.h36
1 files changed, 19 insertions, 17 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 6b82fdf4ba71..afa5730fb3bd 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -53,7 +53,6 @@
53#define XFRM_INC_STATS_USER(net, field) ((void)(net)) 53#define XFRM_INC_STATS_USER(net, field) ((void)(net))
54#endif 54#endif
55 55
56extern struct mutex xfrm_cfg_mutex;
57 56
58/* Organization of SPD aka "XFRM rules" 57/* Organization of SPD aka "XFRM rules"
59 ------------------------------------ 58 ------------------------------------
@@ -681,7 +680,7 @@ struct xfrm_spi_skb_cb {
681struct xfrm_audit { 680struct xfrm_audit {
682 u32 secid; 681 u32 secid;
683 kuid_t loginuid; 682 kuid_t loginuid;
684 u32 sessionid; 683 unsigned int sessionid;
685}; 684};
686 685
687#ifdef CONFIG_AUDITSYSCALL 686#ifdef CONFIG_AUDITSYSCALL
@@ -699,7 +698,7 @@ static inline struct audit_buffer *xfrm_audit_start(const char *op)
699 return audit_buf; 698 return audit_buf;
700} 699}
701 700
702static inline void xfrm_audit_helper_usrinfo(kuid_t auid, u32 ses, u32 secid, 701static inline void xfrm_audit_helper_usrinfo(kuid_t auid, unsigned int ses, u32 secid,
703 struct audit_buffer *audit_buf) 702 struct audit_buffer *audit_buf)
704{ 703{
705 char *secctx; 704 char *secctx;
@@ -716,13 +715,13 @@ static inline void xfrm_audit_helper_usrinfo(kuid_t auid, u32 ses, u32 secid,
716} 715}
717 716
718void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, kuid_t auid, 717void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, kuid_t auid,
719 u32 ses, u32 secid); 718 unsigned int ses, u32 secid);
720void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, kuid_t auid, 719void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, kuid_t auid,
721 u32 ses, u32 secid); 720 unsigned int ses, u32 secid);
722void xfrm_audit_state_add(struct xfrm_state *x, int result, kuid_t auid, 721void xfrm_audit_state_add(struct xfrm_state *x, int result, kuid_t auid,
723 u32 ses, u32 secid); 722 unsigned int ses, u32 secid);
724void xfrm_audit_state_delete(struct xfrm_state *x, int result, kuid_t auid, 723void xfrm_audit_state_delete(struct xfrm_state *x, int result, kuid_t auid,
725 u32 ses, u32 secid); 724 unsigned int ses, u32 secid);
726void xfrm_audit_state_replay_overflow(struct xfrm_state *x, 725void xfrm_audit_state_replay_overflow(struct xfrm_state *x,
727 struct sk_buff *skb); 726 struct sk_buff *skb);
728void xfrm_audit_state_replay(struct xfrm_state *x, struct sk_buff *skb, 727void xfrm_audit_state_replay(struct xfrm_state *x, struct sk_buff *skb,
@@ -735,22 +734,22 @@ void xfrm_audit_state_icvfail(struct xfrm_state *x, struct sk_buff *skb,
735#else 734#else
736 735
737static inline void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, 736static inline void xfrm_audit_policy_add(struct xfrm_policy *xp, int result,
738 kuid_t auid, u32 ses, u32 secid) 737 kuid_t auid, unsigned int ses, u32 secid)
739{ 738{
740} 739}
741 740
742static inline void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, 741static inline void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result,
743 kuid_t auid, u32 ses, u32 secid) 742 kuid_t auid, unsigned int ses, u32 secid)
744{ 743{
745} 744}
746 745
747static inline void xfrm_audit_state_add(struct xfrm_state *x, int result, 746static inline void xfrm_audit_state_add(struct xfrm_state *x, int result,
748 kuid_t auid, u32 ses, u32 secid) 747 kuid_t auid, unsigned int ses, u32 secid)
749{ 748{
750} 749}
751 750
752static inline void xfrm_audit_state_delete(struct xfrm_state *x, int result, 751static inline void xfrm_audit_state_delete(struct xfrm_state *x, int result,
753 kuid_t auid, u32 ses, u32 secid) 752 kuid_t auid, unsigned int ses, u32 secid)
754{ 753{
755} 754}
756 755
@@ -1409,7 +1408,7 @@ static inline void xfrm_sysctl_fini(struct net *net)
1409void xfrm_state_walk_init(struct xfrm_state_walk *walk, u8 proto); 1408void xfrm_state_walk_init(struct xfrm_state_walk *walk, u8 proto);
1410int xfrm_state_walk(struct net *net, struct xfrm_state_walk *walk, 1409int xfrm_state_walk(struct net *net, struct xfrm_state_walk *walk,
1411 int (*func)(struct xfrm_state *, int, void*), void *); 1410 int (*func)(struct xfrm_state *, int, void*), void *);
1412void xfrm_state_walk_done(struct xfrm_state_walk *walk); 1411void xfrm_state_walk_done(struct xfrm_state_walk *walk, struct net *net);
1413struct xfrm_state *xfrm_state_alloc(struct net *net); 1412struct xfrm_state *xfrm_state_alloc(struct net *net);
1414struct xfrm_state *xfrm_state_find(const xfrm_address_t *daddr, 1413struct xfrm_state *xfrm_state_find(const xfrm_address_t *daddr,
1415 const xfrm_address_t *saddr, 1414 const xfrm_address_t *saddr,
@@ -1422,6 +1421,8 @@ struct xfrm_state *xfrm_stateonly_find(struct net *net, u32 mark,
1422 xfrm_address_t *saddr, 1421 xfrm_address_t *saddr,
1423 unsigned short family, 1422 unsigned short family,
1424 u8 mode, u8 proto, u32 reqid); 1423 u8 mode, u8 proto, u32 reqid);
1424struct xfrm_state *xfrm_state_lookup_byspi(struct net *net, __be32 spi,
1425 unsigned short family);
1425int xfrm_state_check_expire(struct xfrm_state *x); 1426int xfrm_state_check_expire(struct xfrm_state *x);
1426void xfrm_state_insert(struct xfrm_state *x); 1427void xfrm_state_insert(struct xfrm_state *x);
1427int xfrm_state_add(struct xfrm_state *x); 1428int xfrm_state_add(struct xfrm_state *x);
@@ -1436,12 +1437,12 @@ struct xfrm_state *xfrm_state_lookup_byaddr(struct net *net, u32 mark,
1436 unsigned short family); 1437 unsigned short family);
1437#ifdef CONFIG_XFRM_SUB_POLICY 1438#ifdef CONFIG_XFRM_SUB_POLICY
1438int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n, 1439int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n,
1439 unsigned short family); 1440 unsigned short family, struct net *net);
1440int xfrm_state_sort(struct xfrm_state **dst, struct xfrm_state **src, int n, 1441int xfrm_state_sort(struct xfrm_state **dst, struct xfrm_state **src, int n,
1441 unsigned short family); 1442 unsigned short family);
1442#else 1443#else
1443static inline int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, 1444static inline int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src,
1444 int n, unsigned short family) 1445 int n, unsigned short family, struct net *net)
1445{ 1446{
1446 return -ENOSYS; 1447 return -ENOSYS;
1447} 1448}
@@ -1553,7 +1554,7 @@ void xfrm_policy_walk_init(struct xfrm_policy_walk *walk, u8 type);
1553int xfrm_policy_walk(struct net *net, struct xfrm_policy_walk *walk, 1554int xfrm_policy_walk(struct net *net, struct xfrm_policy_walk *walk,
1554 int (*func)(struct xfrm_policy *, int, int, void*), 1555 int (*func)(struct xfrm_policy *, int, int, void*),
1555 void *); 1556 void *);
1556void xfrm_policy_walk_done(struct xfrm_policy_walk *walk); 1557void xfrm_policy_walk_done(struct xfrm_policy_walk *walk, struct net *net);
1557int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl); 1558int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl);
1558struct xfrm_policy *xfrm_policy_bysel_ctx(struct net *net, u32 mark, 1559struct xfrm_policy *xfrm_policy_bysel_ctx(struct net *net, u32 mark,
1559 u8 type, int dir, 1560 u8 type, int dir,
@@ -1564,6 +1565,7 @@ struct xfrm_policy *xfrm_policy_byid(struct net *net, u32 mark, u8, int dir,
1564 u32 id, int delete, int *err); 1565 u32 id, int delete, int *err);
1565int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info); 1566int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info);
1566u32 xfrm_get_acqseq(void); 1567u32 xfrm_get_acqseq(void);
1568int verify_spi_info(u8 proto, u32 min, u32 max);
1567int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi); 1569int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi);
1568struct xfrm_state *xfrm_find_acq(struct net *net, const struct xfrm_mark *mark, 1570struct xfrm_state *xfrm_find_acq(struct net *net, const struct xfrm_mark *mark,
1569 u8 mode, u32 reqid, u8 proto, 1571 u8 mode, u32 reqid, u8 proto,
@@ -1576,12 +1578,12 @@ int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol);
1576int km_migrate(const struct xfrm_selector *sel, u8 dir, u8 type, 1578int km_migrate(const struct xfrm_selector *sel, u8 dir, u8 type,
1577 const struct xfrm_migrate *m, int num_bundles, 1579 const struct xfrm_migrate *m, int num_bundles,
1578 const struct xfrm_kmaddress *k); 1580 const struct xfrm_kmaddress *k);
1579struct xfrm_state *xfrm_migrate_state_find(struct xfrm_migrate *m); 1581struct xfrm_state *xfrm_migrate_state_find(struct xfrm_migrate *m, struct net *net);
1580struct xfrm_state *xfrm_state_migrate(struct xfrm_state *x, 1582struct xfrm_state *xfrm_state_migrate(struct xfrm_state *x,
1581 struct xfrm_migrate *m); 1583 struct xfrm_migrate *m);
1582int xfrm_migrate(const struct xfrm_selector *sel, u8 dir, u8 type, 1584int xfrm_migrate(const struct xfrm_selector *sel, u8 dir, u8 type,
1583 struct xfrm_migrate *m, int num_bundles, 1585 struct xfrm_migrate *m, int num_bundles,
1584 struct xfrm_kmaddress *k); 1586 struct xfrm_kmaddress *k, struct net *net);
1585#endif 1587#endif
1586 1588
1587int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); 1589int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport);