aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ipv6.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/ipv6.h')
-rw-r--r--include/net/ipv6.h67
1 files changed, 32 insertions, 35 deletions
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 9573c8d19153..31b3f1b45a2b 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -112,45 +112,28 @@ struct frag_hdr {
112extern int sysctl_ipv6_bindv6only; 112extern int sysctl_ipv6_bindv6only;
113extern int sysctl_mld_max_msf; 113extern int sysctl_mld_max_msf;
114 114
115/* MIBs */ 115#define _DEVINC(statname, modifier, idev, field) \
116DECLARE_SNMP_STAT(struct ipstats_mib, ipv6_statistics); 116({ \
117#define IP6_INC_STATS(idev,field) ({ \
118 struct inet6_dev *_idev = (idev); \ 117 struct inet6_dev *_idev = (idev); \
119 if (likely(_idev != NULL)) \ 118 if (likely(_idev != NULL)) \
120 SNMP_INC_STATS(_idev->stats.ipv6, field); \ 119 SNMP_INC_STATS##modifier((_idev)->stats.statname, (field)); \
121 SNMP_INC_STATS(ipv6_statistics, field); \ 120 SNMP_INC_STATS##modifier(statname##_statistics, (field)); \
122})
123#define IP6_INC_STATS_BH(idev,field) ({ \
124 struct inet6_dev *_idev = (idev); \
125 if (likely(_idev != NULL)) \
126 SNMP_INC_STATS_BH(_idev->stats.ipv6, field); \
127 SNMP_INC_STATS_BH(ipv6_statistics, field); \
128})
129#define IP6_INC_STATS_USER(idev,field) ({ \
130 struct inet6_dev *_idev = (idev); \
131 if (likely(_idev != NULL)) \
132 SNMP_INC_STATS_USER(_idev->stats.ipv6, field); \
133 SNMP_INC_STATS_USER(ipv6_statistics, field); \
134}) 121})
122
123/* MIBs */
124DECLARE_SNMP_STAT(struct ipstats_mib, ipv6_statistics);
125
126#define IP6_INC_STATS(idev,field) _DEVINC(ipv6, , idev, field)
127#define IP6_INC_STATS_BH(idev,field) _DEVINC(ipv6, _BH, idev, field)
128#define IP6_INC_STATS_USER(idev,field) _DEVINC(ipv6, _USER, idev, field)
129
135DECLARE_SNMP_STAT(struct icmpv6_mib, icmpv6_statistics); 130DECLARE_SNMP_STAT(struct icmpv6_mib, icmpv6_statistics);
136#define ICMP6_INC_STATS(idev, field) ({ \ 131DECLARE_SNMP_STAT(struct icmpv6msg_mib, icmpv6msg_statistics);
137 struct inet6_dev *_idev = (idev); \ 132
138 if (likely(_idev != NULL)) \ 133#define ICMP6_INC_STATS(idev, field) _DEVINC(icmpv6, , idev, field)
139 SNMP_INC_STATS(idev->stats.icmpv6, field); \ 134#define ICMP6_INC_STATS_BH(idev, field) _DEVINC(icmpv6, _BH, idev, field)
140 SNMP_INC_STATS(icmpv6_statistics, field); \ 135#define ICMP6_INC_STATS_USER(idev, field) _DEVINC(icmpv6, _USER, idev, field)
141}) 136
142#define ICMP6_INC_STATS_BH(idev, field) ({ \
143 struct inet6_dev *_idev = (idev); \
144 if (likely(_idev != NULL)) \
145 SNMP_INC_STATS_BH((_idev)->stats.icmpv6, field); \
146 SNMP_INC_STATS_BH(icmpv6_statistics, field); \
147})
148#define ICMP6_INC_STATS_USER(idev, field) ({ \
149 struct inet6_dev *_idev = (idev); \
150 if (likely(_idev != NULL)) \
151 SNMP_INC_STATS_USER(_idev->stats.icmpv6, field); \
152 SNMP_INC_STATS_USER(icmpv6_statistics, field); \
153})
154#define ICMP6_INC_STATS_OFFSET_BH(idev, field, offset) ({ \ 137#define ICMP6_INC_STATS_OFFSET_BH(idev, field, offset) ({ \
155 struct inet6_dev *_idev = idev; \ 138 struct inet6_dev *_idev = idev; \
156 __typeof__(offset) _offset = (offset); \ 139 __typeof__(offset) _offset = (offset); \
@@ -158,6 +141,20 @@ DECLARE_SNMP_STAT(struct icmpv6_mib, icmpv6_statistics);
158 SNMP_INC_STATS_OFFSET_BH(_idev->stats.icmpv6, field, _offset); \ 141 SNMP_INC_STATS_OFFSET_BH(_idev->stats.icmpv6, field, _offset); \
159 SNMP_INC_STATS_OFFSET_BH(icmpv6_statistics, field, _offset); \ 142 SNMP_INC_STATS_OFFSET_BH(icmpv6_statistics, field, _offset); \
160}) 143})
144
145#define ICMP6MSGOUT_INC_STATS(idev, field) \
146 _DEVINC(icmpv6msg, , idev, field +256)
147#define ICMP6MSGOUT_INC_STATS_BH(idev, field) \
148 _DEVINC(icmpv6msg, _BH, idev, field +256)
149#define ICMP6MSGOUT_INC_STATS_USER(idev, field) \
150 _DEVINC(icmpv6msg, _USER, idev, field +256)
151#define ICMP6MSGIN_INC_STATS(idev, field) \
152 _DEVINC(icmpv6msg, , idev, field)
153#define ICMP6MSGIN_INC_STATS_BH(idev, field) \
154 _DEVINC(icmpv6msg, _BH, idev, field)
155#define ICMP6MSGIN_INC_STATS_USER(idev, field) \
156 _DEVINC(icmpv6msg, _USER, idev, field)
157
161DECLARE_SNMP_STAT(struct udp_mib, udp_stats_in6); 158DECLARE_SNMP_STAT(struct udp_mib, udp_stats_in6);
162DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6); 159DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6);
163#define UDP6_INC_STATS_BH(field, is_udplite) do { \ 160#define UDP6_INC_STATS_BH(field, is_udplite) do { \