Class: ListeningPortCommand

Inherits:
AbstractCommand show all
Defined in:
lib/audit/lib/parser/command/listening_port_command.rb

Constant Summary collapse

COMMAND =
"OPEN_PORT"

Instance Attribute Summary

Attributes inherited from AbstractCommand

#check, #message, #severity

Instance Method Summary collapse

Methods inherited from AbstractCommand

#process

Constructor Details

#initialize(check, severity, args) ⇒ ListeningPortCommand

Returns a new instance of ListeningPortCommand.



34
35
36
37
38
39
40
41
# File 'lib/audit/lib/parser/command/listening_port_command.rb', line 34

def initialize(check, severity, args)
   @port = args[0].to_i if (args.length >= 1 and /^[0-9]+$/.match(args[0])) or raise ParseException "#{COMMAND} did not supply the port argument: '#{text}'"
   @process = (args[1] if args.length >= 2) || ""
   @interface = (args[2] if args.length >= 3) || ""
	message = args[3 .. -1].join if args.length >= 4

   super(check, severity, message)
end

Instance Method Details

#resultObject



43
44
45
# File 'lib/audit/lib/parser/command/listening_port_command.rb', line 43

def result()
  return  ListeningPortCommandResult.new(@check, @severity, @message, @port, @interface, @process)
end