Class: Dcmgr::VNet::Netfilter::IptablesChain

Inherits:
Chain
  • Object
show all
Defined in:
lib/dcmgr/vnet/netfilter/chain.rb

Overview

}

Instance Attribute Summary

Attributes inherited from Chain

#name, #table

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table, name) ⇒ IptablesChain

Returns a new instance of IptablesChain.

Raises:

  • (ArgumentError)


25
26
27
28
29
30
# File 'lib/dcmgr/vnet/netfilter/chain.rb', line 25

def initialize(table,name)
  raise ArgumentError, "table #{table} doesn't exist. Existing tables are '#{self.class.pre_made.keys.join(",")}'." unless self.class.pre_made.keys.member?(table)
  raise ArgumentError, "name can not be any of the following: '#{self.class.pre_made[table].join(",")}'." if self.class.pre_made[table].member?(name)
  
  super
end

Class Method Details

.pre_madeObject



32
33
34
35
36
37
38
39
# File 'lib/dcmgr/vnet/netfilter/chain.rb', line 32

def self.pre_made
  {
    :filter => [:input,:output,:forward],
    :nat => [:prerouting,:postrouting,:output],
    :mangle => [:prerouting,:output,:input,:postrouting],
    :raw => [:prerouting, :output]
  }
end