Class: Dcmgr::VNet::Tasks::AcceptARPFromFriends
- Inherits:
-
Dcmgr::VNet::Task
- Object
- Dcmgr::VNet::Task
- Dcmgr::VNet::Tasks::AcceptARPFromFriends
- Includes:
- Netfilter
- Defined in:
- lib/dcmgr/vnet/tasks/accept_arp_from_friends.rb
Overview
Explicitely allows ARP traffic between “friend” instances Friends are decided by an Isolator class
Instance Attribute Summary collapse
-
#enable_logging ⇒ Object
readonly
Returns the value of attribute enable_logging.
-
#friend_ips ⇒ Object
readonly
Returns the value of attribute friend_ips.
-
#inst_ip ⇒ Object
readonly
Returns the value of attribute inst_ip.
-
#log_prefix ⇒ Object
readonly
Returns the value of attribute log_prefix.
Attributes inherited from Dcmgr::VNet::Task
Instance Method Summary collapse
-
#initialize(inst_ip, friend_ips, enable_logging, log_prefix) ⇒ AcceptARPFromFriends
constructor
A new instance of AcceptARPFromFriends.
Constructor Details
#initialize(inst_ip, friend_ips, enable_logging, log_prefix) ⇒ AcceptARPFromFriends
Returns a new instance of AcceptARPFromFriends.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/dcmgr/vnet/tasks/accept_arp_from_friends.rb', line 16 def initialize(inst_ip,friend_ips,enable_logging,log_prefix) super() @enable_logging = enable_logging @log_prefix = log_prefix @inst_ip = inst_ip @friend_ips = friend_ips friend_ips.each { |friend_ip| # Log traffic self.rules << EbtablesRule.new(:filter,:forward,:arp,:incoming,"--protocol arp --arp-ip-src #{friend_ip} --arp-ip-dst #{self.inst_ip} --log-ip --log-arp --log-prefix '#{self.log_prefix}' -j CONTINUE") if self.enable_logging self.rules << EbtablesRule.new(:filter,:forward,:arp,:incoming,"--protocol arp --arp-ip-src #{friend_ip} --arp-ip-dst #{self.inst_ip} -j ACCEPT") } end |
Instance Attribute Details
#enable_logging ⇒ Object (readonly)
Returns the value of attribute enable_logging.
13 14 15 |
# File 'lib/dcmgr/vnet/tasks/accept_arp_from_friends.rb', line 13 def enable_logging @enable_logging end |
#friend_ips ⇒ Object (readonly)
Returns the value of attribute friend_ips.
12 13 14 |
# File 'lib/dcmgr/vnet/tasks/accept_arp_from_friends.rb', line 12 def friend_ips @friend_ips end |
#inst_ip ⇒ Object (readonly)
Returns the value of attribute inst_ip.
11 12 13 |
# File 'lib/dcmgr/vnet/tasks/accept_arp_from_friends.rb', line 11 def inst_ip @inst_ip end |
#log_prefix ⇒ Object (readonly)
Returns the value of attribute log_prefix.
14 15 16 |
# File 'lib/dcmgr/vnet/tasks/accept_arp_from_friends.rb', line 14 def log_prefix @log_prefix end |