Skip to contentSkip to conversation

: addrtype match

PATCH In review Harald Welte 1 participant 1 message Jun 21, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 12/14 : addrtype match

This patch for 2.6 adds the addrtype match.

Author: Patrick McHardy <[email protected]>

--
- Harald Welte <[email protected]> http://www.netfilter.org/
============================================================================
"Fragmentation is like classful addressing -- an interesting early
architectural error that shows how much experimentation was going
on while IP was being designed." -- Paul Vixie

# This is a BitKeeper generated diff -Nru style patch. #
# ChangeSet
# 2004/06/20 22:48:11+02:00 [email protected]
# [NETFILTER]: Add addrtype match
#

# net/ipv4/netfilter/ipt_addrtype.c
#   2004/06/20 22:48:01+02:00 [email protected] +77 -0
# 
# include/linux/netfilter_ipv4/ipt_addrtype.h
#   2004/06/20 22:48:01+02:00 [email protected] +11 -0
# 
# net/ipv4/netfilter/ipt_addrtype.c
#   2004/06/20 22:48:01+02:00 [email protected] +0 -0
#   BitKeeper file /home/kaber/src/nf/pending/linux-2.6/net/ipv4/netfilter/ipt_addrtype.c
# 
# net/ipv4/netfilter/Makefile
#   2004/06/20 22:48:01+02:00 [email protected] +1 -0
#   [NETFILTER]: Add addrtype match
# 
# net/ipv4/netfilter/Kconfig
#   2004/06/20 22:48:01+02:00 [email protected] +10 -0
#   [NETFILTER]: Add addrtype match
# 
# include/linux/netfilter_ipv4/ipt_addrtype.h
#   2004/06/20 22:48:01+02:00 [email protected] +0 -0
#   BitKeeper file /home/kaber/src/nf/pending/linux-2.6/include/linux/netfilter_ipv4/ipt_addrtype.h
# 
diff -Nru a/include/linux/netfilter_ipv4/ipt_addrtype.h b/include/linux/netfilter_ipv4/ipt_addrtype.h
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/include/linux/netfilter_ipv4/ipt_addrtype.h	2004-06-20 23:01:12 +02:00
@@ -0,0 +1,11 @@
+#ifndef _IPT_ADDRTYPE_H
+#define _IPT_ADDRTYPE_H
+
+struct ipt_addrtype_info {
+	u_int16_t	source;		/* source-type mask */
+	u_int16_t	dest;		/* dest-type mask */
+	u_int32_t	invert_source;
+	u_int32_t	invert_dest;
+};
+
+#endif
diff -Nru a/net/ipv4/netfilter/Kconfig b/net/ipv4/netfilter/Kconfig
--- a/net/ipv4/netfilter/Kconfig	2004-06-20 23:01:12 +02:00
+++ b/net/ipv4/netfilter/Kconfig	2004-06-20 23:01:12 +02:00
@@ -603,5 +603,15 @@
 	  <file:Documentation/modules.txt>.  If unsure, say `N'.
 	  help

+config IP_NF_MATCH_ADDRTYPE
+ tristate 'address type match support'
+ depends on IP_NF_IPTABLES
+ help
+ This option allows you to match what routing thinks of an address,
+ eg. UNICAST, LOCAL, BROADCAST, ...
+
+ If you want to compile it as a module, say M here and read
+ Documentation/modules.txt. If unsure, say `N'.
+
endmenu

net/ipv4/netfilter/Makefile +1 -0
diff -Nru a/net/ipv4/netfilter/Makefile b/net/ipv4/netfilter/Makefile
@@ -64,6 +64,7 @@
 obj-$(CONFIG_IP_NF_MATCH_STATE) += ipt_state.o
 obj-$(CONFIG_IP_NF_MATCH_CONNTRACK) += ipt_conntrack.o
 obj-$(CONFIG_IP_NF_MATCH_TCPMSS) += ipt_tcpmss.o
+obj-$(CONFIG_IP_NF_MATCH_ADDRTYPE) += ipt_addrtype.o
 
 obj-$(CONFIG_IP_NF_MATCH_PHYSDEV) += ipt_physdev.o
 
net/ipv4/netfilter/ipt_addrtype.c new file +77 -0

77 lines not on this page · raw message