Class: Dcmgr::VNet::Netfilter::IptablesRule
- Defined in:
- lib/dcmgr/vnet/netfilter/iptables_rule.rb
Instance Attribute Summary collapse
-
#bound ⇒ Object
Should be either :incoming or :outgoing.
-
#chain ⇒ Object
Returns the value of attribute chain.
-
#protocol ⇒ Object
Returns the value of attribute protocol.
-
#rule ⇒ Object
Returns the value of attribute rule.
-
#table ⇒ Object
Returns the value of attribute table.
Class Method Summary collapse
-
.protocols ⇒ Object
Getter for the protocols iptables supports.
Instance Method Summary collapse
-
#initialize(table = nil, chain = nil, protocol = nil, bound = nil, rule = nil) ⇒ IptablesRule
constructor
A new instance of IptablesRule.
Constructor Details
#initialize(table = nil, chain = nil, protocol = nil, bound = nil, rule = nil) ⇒ IptablesRule
Returns a new instance of IptablesRule.
15 16 17 18 19 20 21 22 23 |
# File 'lib/dcmgr/vnet/netfilter/iptables_rule.rb', line 15 def initialize(table = nil, chain = nil, protocol = nil, bound = nil, rule = nil) super() raise ArgumentError, "table does not exist: #{table}" unless IptablesChain.pre_made.keys.member?(table) self.table = table self.chain = chain self.protocol = protocol self.bound = bound self.rule = rule end |
Instance Attribute Details
#bound ⇒ Object
Should be either :incoming or :outgoing
12 13 14 |
# File 'lib/dcmgr/vnet/netfilter/iptables_rule.rb', line 12 def bound @bound end |
#chain ⇒ Object
Returns the value of attribute chain.
9 10 11 |
# File 'lib/dcmgr/vnet/netfilter/iptables_rule.rb', line 9 def chain @chain end |
#protocol ⇒ Object
Returns the value of attribute protocol.
13 14 15 |
# File 'lib/dcmgr/vnet/netfilter/iptables_rule.rb', line 13 def protocol @protocol end |
#rule ⇒ Object
Returns the value of attribute rule.
10 11 12 |
# File 'lib/dcmgr/vnet/netfilter/iptables_rule.rb', line 10 def rule @rule end |
#table ⇒ Object
Returns the value of attribute table.
8 9 10 |
# File 'lib/dcmgr/vnet/netfilter/iptables_rule.rb', line 8 def table @table end |
Class Method Details
.protocols ⇒ Object
Getter for the protocols iptables supports
34 35 36 37 38 39 40 |
# File 'lib/dcmgr/vnet/netfilter/iptables_rule.rb', line 34 def self.protocols { 'tcp' => 'tcp', 'udp' => 'udp', 'icmp' => 'icmp', } end |