Adds IPTables specific details to a Redirectrule.
# File lib/packetthief/impl/netfilter.rb, line 62 def initialize(handler, table, chain) super(handler) @table = table @chain = chain end
# File lib/packetthief/impl/netfilter.rb, line 68 def to_netfilter_command args = [] if self.rulespec args << '-p' << self.rulespec[:protocol].to_s if self.rulespec.has_key? :protocol args << '--destination-port' << self.rulespec[:dest_port].to_s if self.rulespec.has_key? :dest_port args << '--in-interface' << self.rulespec[:in_interface].to_s if self.rulespec.has_key? :in_interface end if self.redirectspec args << '-j' << 'REDIRECT' args << '--to-ports' << self.redirectspec[:to_ports].to_s if self.redirectspec.has_key? :to_ports end args end