Class: BetterCap::Firewalls::Redirection

Inherits:
Object
  • Object
show all
Defined in:
lib/bettercap/firewalls/redirection.rb

Overview

This class represents a firewall port redirection rule.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(interface, protocol, src_address, src_port, dst_address, dst_port) ⇒ Redirection

Create the redirection rule for the specified interface and protocol. Redirect src_address:src_port to dst_address:dst_port



32
33
34
35
36
37
38
39
# File 'lib/bettercap/firewalls/redirection.rb', line 32

def initialize( interface, protocol, src_address, src_port, dst_address, dst_port )
  @interface   = interface
  @protocol    = protocol
  @src_address = src_address
  @src_port    = src_port
  @dst_address = dst_address
  @dst_port    = dst_port
end

Instance Attribute Details

#dst_addressObject (readonly)

Destination address.



26
27
28
# File 'lib/bettercap/firewalls/redirection.rb', line 26

def dst_address
  @dst_address
end

#dst_portObject (readonly)

Destionation port.



28
29
30
# File 'lib/bettercap/firewalls/redirection.rb', line 28

def dst_port
  @dst_port
end

#interfaceObject (readonly)

Network interface name.



18
19
20
# File 'lib/bettercap/firewalls/redirection.rb', line 18

def interface
  @interface
end

#protocolObject (readonly)

Protocol name.



20
21
22
# File 'lib/bettercap/firewalls/redirection.rb', line 20

def protocol
  @protocol
end

#src_addressObject (readonly)

Source address.



22
23
24
# File 'lib/bettercap/firewalls/redirection.rb', line 22

def src_address
  @src_address
end

#src_portObject (readonly)

Source port.



24
25
26
# File 'lib/bettercap/firewalls/redirection.rb', line 24

def src_port
  @src_port
end