diff options
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/snmp.h | 5 | ||||
-rw-r--r-- | include/net/xfrm.h | 18 |
2 files changed, 23 insertions, 0 deletions
diff --git a/include/net/snmp.h b/include/net/snmp.h index fbb66663a42c..ce2f48507510 100644 --- a/include/net/snmp.h +++ b/include/net/snmp.h | |||
@@ -118,6 +118,11 @@ struct linux_mib { | |||
118 | unsigned long mibs[LINUX_MIB_MAX]; | 118 | unsigned long mibs[LINUX_MIB_MAX]; |
119 | }; | 119 | }; |
120 | 120 | ||
121 | /* Linux Xfrm */ | ||
122 | #define LINUX_MIB_XFRMMAX __LINUX_MIB_XFRMMAX | ||
123 | struct linux_xfrm_mib { | ||
124 | unsigned long mibs[LINUX_MIB_XFRMMAX]; | ||
125 | }; | ||
121 | 126 | ||
122 | /* | 127 | /* |
123 | * FIXME: On x86 and some other CPUs the split into user and softirq parts | 128 | * FIXME: On x86 and some other CPUs the split into user and softirq parts |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index eea1c327c93e..a79702bcdcd0 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 | #ifdef CONFIG_XFRM_STATISTICS | ||
23 | #include <net/snmp.h> | ||
24 | #endif | ||
22 | 25 | ||
23 | #define XFRM_PROTO_ESP 50 | 26 | #define XFRM_PROTO_ESP 50 |
24 | #define XFRM_PROTO_AH 51 | 27 | #define XFRM_PROTO_AH 51 |
@@ -34,6 +37,17 @@ | |||
34 | #define MODULE_ALIAS_XFRM_TYPE(family, proto) \ | 37 | #define MODULE_ALIAS_XFRM_TYPE(family, proto) \ |
35 | MODULE_ALIAS("xfrm-type-" __stringify(family) "-" __stringify(proto)) | 38 | MODULE_ALIAS("xfrm-type-" __stringify(family) "-" __stringify(proto)) |
36 | 39 | ||
40 | #ifdef CONFIG_XFRM_STATISTICS | ||
41 | DECLARE_SNMP_STAT(struct linux_xfrm_mib, xfrm_statistics); | ||
42 | #define XFRM_INC_STATS(field) SNMP_INC_STATS(xfrm_statistics, field) | ||
43 | #define XFRM_INC_STATS_BH(field) SNMP_INC_STATS_BH(xfrm_statistics, field) | ||
44 | #define XFRM_INC_STATS_USER(field) SNMP_INC_STATS_USER(xfrm_statistics, field) | ||
45 | #else | ||
46 | #define XFRM_INC_STATS(field) | ||
47 | #define XFRM_INC_STATS_BH(field) | ||
48 | #define XFRM_INC_STATS_USER(field) | ||
49 | #endif | ||
50 | |||
37 | extern struct sock *xfrm_nl; | 51 | extern struct sock *xfrm_nl; |
38 | extern u32 sysctl_xfrm_aevent_etime; | 52 | extern u32 sysctl_xfrm_aevent_etime; |
39 | extern u32 sysctl_xfrm_aevent_rseqth; | 53 | extern u32 sysctl_xfrm_aevent_rseqth; |
@@ -1139,6 +1153,10 @@ static inline void xfrm6_fini(void) | |||
1139 | } | 1153 | } |
1140 | #endif | 1154 | #endif |
1141 | 1155 | ||
1156 | #ifdef CONFIG_XFRM_STATISTICS | ||
1157 | extern int xfrm_proc_init(void); | ||
1158 | #endif | ||
1159 | |||
1142 | extern int xfrm_state_walk(u8 proto, int (*func)(struct xfrm_state *, int, void*), void *); | 1160 | extern int xfrm_state_walk(u8 proto, int (*func)(struct xfrm_state *, int, void*), void *); |
1143 | extern struct xfrm_state *xfrm_state_alloc(void); | 1161 | extern struct xfrm_state *xfrm_state_alloc(void); |
1144 | extern struct xfrm_state *xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, | 1162 | extern struct xfrm_state *xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, |