Class: Infrataster::Plugin::Firewall::Transfer

Inherits:
Object
  • Object
show all
Defined in:
lib/infrataster/plugin/firewall/transfer.rb

Overview

Represent transfer

Instance Method Summary collapse

Constructor Details

#initialize(src_node, dest_node, options = {}) ⇒ Transfer

Returns a new instance of Transfer.



7
8
9
10
11
12
13
14
# File 'lib/infrataster/plugin/firewall/transfer.rb', line 7

def initialize(src_node, dest_node, options = {})
  @src_node = src_node
  @dest_node = dest_node
  @protocol = options[:protocol] ? options[:protocol] : :icmp
  @dest_port = options[:dest_port] ? options[:dest_port] : 80
  @source_port = options[:source_port] ? options[:source_port] : nil
  @ack = options[:ack] ? options[:ack] : nil
end

Instance Method Details

#reachable?Boolean

Returns:

  • (Boolean)


16
17
18
19
20
21
22
23
# File 'lib/infrataster/plugin/firewall/transfer.rb', line 16

def reachable?
  case @protocol
  when :icmp
    icmp_reachable?
  when :tcp, :udp
    transport_reachable?
  end
end