Skip to contentSkip to conversation

ipt_account update

PATCH Superseded Piotr Gasidło 1 participant 1 message Aug 28, 2004 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipt_account update

Hello,

New ipt_account version 0.1.17:
- convert ipt_account to use seq_file API
- code cleanup

Attached patch includes patches for both 2.4 and (new) 2.6 kernel tree. Please apply.

Signature · 4 lines
Piotr 'QuakeR' Gasidło, BOFH @ pandora.barbara.eu.org
############## sending lusers to /dev/null since 1998
##### Waiting for tomorrow, for a little ray of light
### Waiting for tomorrow just to see your smile again
account/linux/Documentation/Configure.help.ladd +44 -0
diff -uNr patch-o-matic-ng.clean/account/linux/Documentation/Configure.help.ladd patch-o-matic-ng/account/linux/Documentation/Configure.help.ladd
@@ -0,0 +1,44 @@
+CONFIG_IP_NF_MATCH_TOS
+account match support
+CONFIG_IP_NF_MATCH_ACCOUNT
+  This match is used for accounting traffic for all hosts in
+  defined network/netmask. 
+  
+  Features:
+  - long (one counter per protocol TCP/UDP/IMCP/Other) and short statistics
+  - one iptables rule for all hosts in network/netmask
+  - loading/saving counters (by reading/writting to procfs entries)
+  
+  Example usage:
+  
+  account traffic for/to 192.168.0.0/24 network into table mynetwork:
+  
+  # iptables -A FORWARD -m account --aname mynetwork --aaddr 192.168.0.0/24
+  
+  account traffic for/to WWW serwer for 192.168.0.0/24 network into table 
+  mywwwserver:
+  
+  # iptables -A INPUT -p tcp --dport 80 
+    -m account --aname mywwwserver --aaddr 192.168.0.0/24 --ashort
+  # iptables -A OUTPUT -p tcp --sport 80
+    -m account --aname mywwwserver --aaddr 192.168.0.0/24 --ashort    
+  
+  read counters:
+  
+  # cat /proc/net/ipt_account/mynetwork
+  # cat /proc/net/ipt_account/mywwwserver
+  
+  set counters:
+  
+  # echo "ip = 192.168.0.1 packets_src = 0" > /proc/net/ipt_account/mywwserver
+  
+  Webpage: 
+    http://www.barbara.eu.org/~quaker/ipt_account/    
+ 
+  If you want to compile it as a module, say M here and read
+  Documentation/modules.txt.  If unsure, say `N'.
+
+account debugging output
+CONFIG_IP_NF_MATCH_ACCOUNT_DEBUG
+  Say Y to get lots of debugging output.
+
account/linux/include/linux/netfilter_ipv4/ipt_account.h +2 -2
diff -uNr patch-o-matic-ng.clean/account/linux/include/linux/netfilter_ipv4/ipt_account.h patch-o-matic-ng/account/linux/include/linux/netfilter_ipv4/ipt_account.h
@@ -2,7 +2,7 @@
  * accounting match (ipt_account.c)
  * (C) 2003,2004 by Piotr Gasidlo ([email protected])
  *
- * Version: 0.1.6
+ * Version: 0.1.7
  *
  * This software is distributed under the terms of GNU GPL
  */
@@ -13,7 +13,7 @@
 #define IPT_ACCOUNT_NAME_LEN 64
 
 #define IPT_ACCOUNT_NAME "ipt_account"
-#define IPT_ACCOUNT_VERSION  "0.1.6"
+#define IPT_ACCOUNT_VERSION  "0.1.7"
 
 struct t_ipt_account_info {
 	char name[IPT_ACCOUNT_NAME_LEN];
account/linux/net/ipv4/netfilter/ipt_account.c +168 -161

553 lines not on this page · raw message

account/linux-2.6/include/linux/netfilter_ipv4/ipt_account.h +26 -0
diff -uNr patch-o-matic-ng.clean/account/linux-2.6/include/linux/netfilter_ipv4/ipt_account.h patch-o-matic-ng/account/linux-2.6/include/linux/netfilter_ipv4/ipt_account.h
@@ -0,0 +1,26 @@
+/* 
+ * accounting match (ipt_account.c)
+ * (C) 2003,2004 by Piotr Gasidlo ([email protected])
+ *
+ * Version: 0.1.7
+ *
+ * This software is distributed under the terms of GNU GPL
+ */
+
+#ifndef _IPT_ACCOUNT_H_
+#define _IPT_ACCOUNT_H_
+
+#define IPT_ACCOUNT_NAME_LEN 64
+
+#define IPT_ACCOUNT_NAME "ipt_account"
+#define IPT_ACCOUNT_VERSION  "0.1.7"
+
+struct t_ipt_account_info {
+	char name[IPT_ACCOUNT_NAME_LEN];
+	u_int32_t network;
+	u_int32_t netmask;
+	int shortlisting:1;
+};
+
+#endif
+
account/linux-2.6/net/ipv4/netfilter/Kconfig.ladd +45 -0

45 lines not on this page · raw message

account/linux-2.6/net/ipv4/netfilter/Makefile.ladd +2 -0
diff -uNr patch-o-matic-ng.clean/account/linux-2.6/net/ipv4/netfilter/Makefile.ladd patch-o-matic-ng/account/linux-2.6/net/ipv4/netfilter/Makefile.ladd
@@ -0,0 +1,2 @@
+obj-$(CONFIG_IP_NF_MATCH_TOS) += ipt_tos.o
+obj-$(CONFIG_IP_NF_MATCH_ACCOUNT) += ipt_account.o
account/linux-2.6/net/ipv4/netfilter/ipt_account.c +929 -0

929 lines not on this page · raw message