diff options
Diffstat (limited to 'include/net/xfrm.h')
-rw-r--r-- | include/net/xfrm.h | 36 |
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 | ||
56 | extern 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 { | |||
681 | struct xfrm_audit { | 680 | struct 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 | ||
702 | static inline void xfrm_audit_helper_usrinfo(kuid_t auid, u32 ses, u32 secid, | 701 | static 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 | ||
718 | void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, kuid_t auid, | 717 | void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, kuid_t auid, |
719 | u32 ses, u32 secid); | 718 | unsigned int ses, u32 secid); |
720 | void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, kuid_t auid, | 719 | void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, kuid_t auid, |
721 | u32 ses, u32 secid); | 720 | unsigned int ses, u32 secid); |
722 | void xfrm_audit_state_add(struct xfrm_state *x, int result, kuid_t auid, | 721 | void xfrm_audit_state_add(struct xfrm_state *x, int result, kuid_t auid, |
723 | u32 ses, u32 secid); | 722 | unsigned int ses, u32 secid); |
724 | void xfrm_audit_state_delete(struct xfrm_state *x, int result, kuid_t auid, | 723 | void xfrm_audit_state_delete(struct xfrm_state *x, int result, kuid_t auid, |
725 | u32 ses, u32 secid); | 724 | unsigned int ses, u32 secid); |
726 | void xfrm_audit_state_replay_overflow(struct xfrm_state *x, | 725 | void xfrm_audit_state_replay_overflow(struct xfrm_state *x, |
727 | struct sk_buff *skb); | 726 | struct sk_buff *skb); |
728 | void xfrm_audit_state_replay(struct xfrm_state *x, struct sk_buff *skb, | 727 | void 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 | ||
737 | static inline void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, | 736 | static 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 | ||
742 | static inline void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, | 741 | static 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 | ||
747 | static inline void xfrm_audit_state_add(struct xfrm_state *x, int result, | 746 | static 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 | ||
752 | static inline void xfrm_audit_state_delete(struct xfrm_state *x, int result, | 751 | static 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) | |||
1409 | void xfrm_state_walk_init(struct xfrm_state_walk *walk, u8 proto); | 1408 | void xfrm_state_walk_init(struct xfrm_state_walk *walk, u8 proto); |
1410 | int xfrm_state_walk(struct net *net, struct xfrm_state_walk *walk, | 1409 | int 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 *); |
1412 | void xfrm_state_walk_done(struct xfrm_state_walk *walk); | 1411 | void xfrm_state_walk_done(struct xfrm_state_walk *walk, struct net *net); |
1413 | struct xfrm_state *xfrm_state_alloc(struct net *net); | 1412 | struct xfrm_state *xfrm_state_alloc(struct net *net); |
1414 | struct xfrm_state *xfrm_state_find(const xfrm_address_t *daddr, | 1413 | struct 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); |
1424 | struct xfrm_state *xfrm_state_lookup_byspi(struct net *net, __be32 spi, | ||
1425 | unsigned short family); | ||
1425 | int xfrm_state_check_expire(struct xfrm_state *x); | 1426 | int xfrm_state_check_expire(struct xfrm_state *x); |
1426 | void xfrm_state_insert(struct xfrm_state *x); | 1427 | void xfrm_state_insert(struct xfrm_state *x); |
1427 | int xfrm_state_add(struct xfrm_state *x); | 1428 | int 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 |
1438 | int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n, | 1439 | int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n, |
1439 | unsigned short family); | 1440 | unsigned short family, struct net *net); |
1440 | int xfrm_state_sort(struct xfrm_state **dst, struct xfrm_state **src, int n, | 1441 | int 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 |
1443 | static inline int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, | 1444 | static 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); | |||
1553 | int xfrm_policy_walk(struct net *net, struct xfrm_policy_walk *walk, | 1554 | int 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 *); |
1556 | void xfrm_policy_walk_done(struct xfrm_policy_walk *walk); | 1557 | void xfrm_policy_walk_done(struct xfrm_policy_walk *walk, struct net *net); |
1557 | int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl); | 1558 | int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl); |
1558 | struct xfrm_policy *xfrm_policy_bysel_ctx(struct net *net, u32 mark, | 1559 | struct 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); |
1565 | int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info); | 1566 | int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info); |
1566 | u32 xfrm_get_acqseq(void); | 1567 | u32 xfrm_get_acqseq(void); |
1568 | int verify_spi_info(u8 proto, u32 min, u32 max); | ||
1567 | int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi); | 1569 | int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi); |
1568 | struct xfrm_state *xfrm_find_acq(struct net *net, const struct xfrm_mark *mark, | 1570 | struct 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); | |||
1576 | int km_migrate(const struct xfrm_selector *sel, u8 dir, u8 type, | 1578 | int 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); |
1579 | struct xfrm_state *xfrm_migrate_state_find(struct xfrm_migrate *m); | 1581 | struct xfrm_state *xfrm_migrate_state_find(struct xfrm_migrate *m, struct net *net); |
1580 | struct xfrm_state *xfrm_state_migrate(struct xfrm_state *x, | 1582 | struct xfrm_state *xfrm_state_migrate(struct xfrm_state *x, |
1581 | struct xfrm_migrate *m); | 1583 | struct xfrm_migrate *m); |
1582 | int xfrm_migrate(const struct xfrm_selector *sel, u8 dir, u8 type, | 1584 | int 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 | ||
1587 | int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); | 1589 | int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); |