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_port, dst_address, dst_port) ⇒ Redirection

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


29
30
31
32
33
34
35
# File 'lib/bettercap/firewalls/redirection.rb', line 29

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

Instance Attribute Details

#dst_addressObject (readonly)

Destination address.


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

def dst_address
  @dst_address
end

#dst_portObject (readonly)

Destionation port.


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

def dst_port
  @dst_port
end

#interfaceObject (readonly)

Network interface name.


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

def interface
  @interface
end

#protocolObject (readonly)

Protocol name.


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

def protocol
  @protocol
end

#src_portObject (readonly)

Source port.


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

def src_port
  @src_port
end