Class: Dcmgr::VNet::Tasks::DropArpForwarding

Inherits:
Dcmgr::VNet::Task show all
Includes:
Netfilter
Defined in:
lib/dcmgr/vnet/tasks/drop_arp_forwarding.rb

Overview

Drops all ARP packet forwarding

Instance Attribute Summary collapse

Attributes inherited from Dcmgr::VNet::Task

#rules

Instance Method Summary collapse

Constructor Details

#initialize(enable_logging, log_prefix) ⇒ DropArpForwarding

Returns a new instance of DropArpForwarding.



13
14
15
16
17
18
19
20
21
22
# File 'lib/dcmgr/vnet/tasks/drop_arp_forwarding.rb', line 13

def initialize(enable_logging,log_prefix)
  super()
  
  @enable_logging = enable_logging
  @log_prefix = log_prefix
  
  # Drop forwarding to other instances
  #self.rules << EbtablesRule.new(:filter,:forward,:arp,:incoming,"--log-level 4 --log-ip --log-arp --log-prefix 'D d_#{self.log_prefix}_arp:' -j CONTINUE") if self.enable_logging
  self.rules << EbtablesRule.new(:filter,:forward,:arp,:incoming,"#{EbtablesRule.log_arp(self.log_prefix) if self.enable_logging} -j DROP")
end

Instance Attribute Details

#enable_loggingObject (readonly)

Returns the value of attribute enable_logging.



10
11
12
# File 'lib/dcmgr/vnet/tasks/drop_arp_forwarding.rb', line 10

def enable_logging
  @enable_logging
end

#log_prefixObject (readonly)

Returns the value of attribute log_prefix.



11
12
13
# File 'lib/dcmgr/vnet/tasks/drop_arp_forwarding.rb', line 11

def log_prefix
  @log_prefix
end