Class: Masscan::Status

Inherits:
Struct
  • Object
show all
Defined in:
lib/masscan/status.rb

Overview

Represents a port status record.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status:, protocol:, port:, reason: nil, ttl: nil, ip:, timestamp:, mac: nil) ⇒ Status

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Initializes the status record.

Parameters:

  • status (:open, :closed)

    The status of the port.

  • protocol (:icmp, :tcp, :udp, :sctp)

    The IP protocol.

  • port (Integer)

    The port number.

  • reason (Array<:fin, :syn, :rst, :psh, :ack, :urg, :ece, :cwr>, nil) (defaults to: nil)

    Flags indicating why the port was open or closed.

  • ttl (Integer, nil) (defaults to: nil)

    TTL.

  • ip (IPAddr)

    The IP address.

  • timestamp (Time)

    The record timestamp.

  • mac (String, nil) (defaults to: nil)

    Optional mac address.



38
39
40
# File 'lib/masscan/status.rb', line 38

def initialize(status: , protocol: , port: , reason: nil, ttl: nil, ip: , timestamp: , mac: nil)
  super(status,protocol,port,reason,ttl,ip,timestamp,mac)
end

Instance Attribute Details

#ipObject

Returns the value of attribute ip

Returns:

  • (Object)

    the current value of ip



7
8
9
# File 'lib/masscan/status.rb', line 7

def ip
  @ip
end

#macObject

Returns the value of attribute mac

Returns:

  • (Object)

    the current value of mac



7
8
9
# File 'lib/masscan/status.rb', line 7

def mac
  @mac
end

#portObject

Returns the value of attribute port

Returns:

  • (Object)

    the current value of port



7
8
9
# File 'lib/masscan/status.rb', line 7

def port
  @port
end

#protocolObject

Returns the value of attribute protocol

Returns:

  • (Object)

    the current value of protocol



7
8
9
# File 'lib/masscan/status.rb', line 7

def protocol
  @protocol
end

#reasonObject

Returns the value of attribute reason

Returns:

  • (Object)

    the current value of reason



7
8
9
# File 'lib/masscan/status.rb', line 7

def reason
  @reason
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



7
8
9
# File 'lib/masscan/status.rb', line 7

def status
  @status
end

#timestampObject

Returns the value of attribute timestamp

Returns:

  • (Object)

    the current value of timestamp



7
8
9
# File 'lib/masscan/status.rb', line 7

def timestamp
  @timestamp
end

#ttlObject

Returns the value of attribute ttl

Returns:

  • (Object)

    the current value of ttl



7
8
9
# File 'lib/masscan/status.rb', line 7

def ttl
  @ttl
end