Module: IdentifyUtil

Extended by:
IdentifyUtil
Included in:
IdentifyUtil
Defined in:
lib/identify_util.rb

Instance Method Summary collapse

Instance Method Details

#ip_protocol_port(ip, protocol, port) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/identify_util.rb', line 5

def ip_protocol_port(ip, protocol, port)
  {
    ip: ip,
    protocol: protocol,
    port: port,
    service_name: (
      Socket.getservbyport(port.to_i, protocol) rescue nil
    ),
    host: (
      Resolv.getname(ip) rescue nil
    )
  }
end