diff options
author | Harald Welte <laforge@netfilter.org> | 2005-10-11 00:21:10 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-10-11 00:21:10 -0400 |
commit | a051a8f7306476af0a74370ad56e793cb6c43bf7 (patch) | |
tree | 3dc8bc67e6c16a28a0161ed7f7fb55008da3d7d5 /include | |
parent | d4875b049b2e6401a6e1fae90b7f09e20a636fcf (diff) |
[NETFILTER]: Use only 32bit counters for CONNTRACK_ACCT
Initially we used 64bit counters for conntrack-based accounting, since we
had no event mechanism to tell userspace that our counters are about to
overflow. With nfnetlink_conntrack, we now have such a event mechanism and
thus can save 16bytes per connection.
Signed-off-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/netfilter/nfnetlink_conntrack.h | 6 | ||||
-rw-r--r-- | include/linux/netfilter_ipv4/ip_conntrack.h | 8 |
2 files changed, 10 insertions, 4 deletions
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h index fb5511030185..116fcaced909 100644 --- a/include/linux/netfilter/nfnetlink_conntrack.h +++ b/include/linux/netfilter/nfnetlink_conntrack.h | |||
@@ -84,8 +84,10 @@ enum ctattr_protoinfo_tcp { | |||
84 | 84 | ||
85 | enum ctattr_counters { | 85 | enum ctattr_counters { |
86 | CTA_COUNTERS_UNSPEC, | 86 | CTA_COUNTERS_UNSPEC, |
87 | CTA_COUNTERS_PACKETS, | 87 | CTA_COUNTERS_PACKETS, /* old 64bit counters */ |
88 | CTA_COUNTERS_BYTES, | 88 | CTA_COUNTERS_BYTES, /* old 64bit counters */ |
89 | CTA_COUNTERS32_PACKETS, | ||
90 | CTA_COUNTERS32_BYTES, | ||
89 | __CTA_COUNTERS_MAX | 91 | __CTA_COUNTERS_MAX |
90 | }; | 92 | }; |
91 | #define CTA_COUNTERS_MAX (__CTA_COUNTERS_MAX - 1) | 93 | #define CTA_COUNTERS_MAX (__CTA_COUNTERS_MAX - 1) |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h index 4ced38736813..d078bb91d9e5 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack.h +++ b/include/linux/netfilter_ipv4/ip_conntrack.h | |||
@@ -117,6 +117,10 @@ enum ip_conntrack_events | |||
117 | /* NAT info */ | 117 | /* NAT info */ |
118 | IPCT_NATINFO_BIT = 10, | 118 | IPCT_NATINFO_BIT = 10, |
119 | IPCT_NATINFO = (1 << IPCT_NATINFO_BIT), | 119 | IPCT_NATINFO = (1 << IPCT_NATINFO_BIT), |
120 | |||
121 | /* Counter highest bit has been set */ | ||
122 | IPCT_COUNTER_FILLING_BIT = 11, | ||
123 | IPCT_COUNTER_FILLING = (1 << IPCT_COUNTER_FILLING_BIT), | ||
120 | }; | 124 | }; |
121 | 125 | ||
122 | enum ip_conntrack_expect_events { | 126 | enum ip_conntrack_expect_events { |
@@ -192,8 +196,8 @@ do { \ | |||
192 | 196 | ||
193 | struct ip_conntrack_counter | 197 | struct ip_conntrack_counter |
194 | { | 198 | { |
195 | u_int64_t packets; | 199 | u_int32_t packets; |
196 | u_int64_t bytes; | 200 | u_int32_t bytes; |
197 | }; | 201 | }; |
198 | 202 | ||
199 | struct ip_conntrack_helper; | 203 | struct ip_conntrack_helper; |