Read list of tables/targets/matches

This commit is contained in:
Brian Candler
2011-05-06 15:23:01 +01:00
parent 15d26f5595
commit 7d3671e9d1
2 changed files with 21 additions and 0 deletions

View File

@@ -60,6 +60,10 @@ module Linux
# Class for handling iptables. Note that this doesn't actually use
# Netlink at all :-(
class Iptables4 < Iptables
PROC_TABLES = "/proc/net/ip_tables_names"
PROC_TARGETS = "/proc/net/ip_tables_targets"
PROC_MATCHES = "/proc/net/ip_tables_matches"
TABLE_MAXNAMELEN = IPT_TABLE_MAXNAMELEN
TC_AF = Socket::AF_INET
TC_IPPROTO = Socket::IPPROTO_IP
@@ -73,5 +77,6 @@ end
if __FILE__ == $0
require 'pp'
pp Linux::Iptables4.tables
pp Linux::Iptables4.table("filter").rules
end