Parent

Nmap::Parser::Host::Port

This holds the information about an individual port or protocol

Attributes

num[R]

Port number

reason[R]

Why the port is in the state

reason_ip[R]

The host that responded, if different than the target

reason_ttl[R]

TTL from the responding host

service[R]

Service object for this port

state[R]

Port state ("open", "closed", "filtered", etc)

Public Class Methods

new(portinfo) click to toggle source
# File lib/nmap/parser.rb, line 1024
def initialize(portinfo)
        parse(portinfo)
end

Public Instance Methods

<=>(port) click to toggle source

Compares port numbers

# File lib/nmap/parser.rb, line 1018
def <=>(port)
        @num <=> port.num
end
script(name) click to toggle source

Returns the Script object with the specified name

# File lib/nmap/parser.rb, line 996
def script(name)
        @scripts.find { |script| script.id == name }
end
script_output(name) click to toggle source

Returns the output of the script name

# File lib/nmap/parser.rb, line 1009
def script_output(name)
        @scripts.each do |script|
                return script.output if script.id == name
        end

        nil
end
scripts() click to toggle source

Returns an array of Script objects associated with this port, and passes them each to a block if one is given

# File lib/nmap/parser.rb, line 1002
def scripts
        @scripts.each { |script| yield script } if block_given?

        @scripts
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.