From e4402c048aa4f2d28c46fcc2754e3f0f7fc8bfb7 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 22 Oct 2007 19:32:00 +0000 Subject: [PATCH] added support for all ebtables modules git-svn-id: svn+ssh://foo-projects.org/var/svn/ferm/trunk@867 887c3e53-ddf1-0310-8e39-e0d3fab4ed34 --- src/ferm | 27 ++++++++++++++++++++++++++- test/ebtables/basic.result | 2 +- test/ebtables/negated.result | 2 +- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/ferm b/src/ferm index ab19928..fecf438 100755 --- a/src/ferm +++ b/src/ferm @@ -389,7 +389,32 @@ add_target_def 'ULOG', qw(ulog-nlgroup ulog-prefix ulog-cprange ulog-qthreshold) add_match_def_x 'arp', '', qw(source-mac! destination-mac!), qw(h-length=s opcode=s h-type=s proto-type=s), qw(mangle-ip-s=s mangle-ip-d=s mangle-mac-s=s mangle-mac-d=s mangle-target=s); -add_match_def_x 'eb', '', qw(logical-in! logical-out!); +add_match_def_x 'eb', '', qw(logical-in! logical-out!), + # 802.3 + qw(802_3-sap! 802_3-type!), + # arp + qw(arp-opcode! arp-htype!=ss arp-ptype!=ss), + qw(arp-ip-src! arp-ip-dst! arp-mac-src! arp-mac-dst!), + # ip + qw(ip-source! ip-destination! ip-tos! ip-protocol! ip-sport! ip-dport!), + # mark_m + qw(mark!), + # pkttype + qw(pkttype-type!), + # stp + qw(stp-type! stp-flags! stp-root-prio! stp-root-addr! stp-root-cost!), + qw(stp-sender-prio! stp-sender-addr! stp-port! stp-msg-age! stp-max-age!), + qw(stp-hello-time! stp-forward-delay!), + # vlan + qw(vlan-id! vlan-prio! vlan-encap!), + # log + qw(log*0 log-level=s log-prefix=s log-ip*0 log-arp*0); + +add_target_def_x 'eb', 'arpreply', qw(arpreply-mac arpreply-target); +add_target_def_x 'eb', 'dnat', qw(to-destination dnat-target); +add_target_def_x 'eb', 'mark', qw(set-mark mark-target); +add_target_def_x 'eb', 'redirect', qw(redirect-target); +add_target_def_x 'eb', 'snat', qw(to-source snat-target); # parameter parser for ipt_multiport sub multiport_params { diff --git a/test/ebtables/basic.result b/test/ebtables/basic.result index 1b4066f..4b0f20e 100644 --- a/test/ebtables/basic.result +++ b/test/ebtables/basic.result @@ -3,5 +3,5 @@ ebtables -t filter -F ebtables -t filter -X ebtables -t filter -A INPUT -s 192.168.1.1 -j DROP ebtables -t filter -A INPUT -p ARP -j ACCEPT -ebtables -t filter -A INPUT -i eth0 -o eth1 --logical-out br1 --logical-in br0 -j ACCEPT +ebtables -t filter -A INPUT -i eth0 -o eth1 --logical-in br0 --logical-out br1 -j ACCEPT ebtables -t filter -A INPUT -s Multicast -d Broadcast -j DROP diff --git a/test/ebtables/negated.result b/test/ebtables/negated.result index ea359ba..62d6a28 100644 --- a/test/ebtables/negated.result +++ b/test/ebtables/negated.result @@ -2,5 +2,5 @@ ebtables -t filter -P INPUT ACCEPT ebtables -t filter -F ebtables -t filter -X ebtables -t filter -A INPUT -p ! ARP -j ACCEPT -ebtables -t filter -A INPUT -i ! eth0 -o ! eth1 --logical-out ! br1 --logical-in ! br0 -j ACCEPT +ebtables -t filter -A INPUT -i ! eth0 -o ! eth1 --logical-in ! br0 --logical-out ! br1 -j ACCEPT ebtables -t filter -A INPUT -s ! Multicast -d ! Broadcast -j DROP -- 2.11.4.GIT