Object
This holds session information, such as runtime, Nmap’s arguments, and verbosity/debugging
Returns the total number of hosts that were scanned or, if an argument is given, returns the number of hosts scanned that were matching status (e.g. “up” or “down”)
NOTE: Calling parser.sessions.numhosts(status) can be very different than running parser.hosts(status).size because the information there and here are coming from different places in the XML. Nmap will not typically list individual hosts which it doesn’t know or assume are “up”.
# File lib/nmap/parser.rb, line 589 def numhosts(state = "") @numhosts[state.empty? ? "total" : state] end
Returns the total number of services that were scanned or, if an argument is given, returns the number of services scanned for type (e.g. “syn”)
# File lib/nmap/parser.rb, line 596 def numservices(type = "") @scaninfo.find_all { |info| type.empty? or info.type == type }.inject(0) { |acc, info| acc + info.numservices } end
Returns the protocol associated with the specified scan type (e.g. “tcp” for type “syn”)
# File lib/nmap/parser.rb, line 606 def scan_type_proto(type) @scaninfo.each do |info| return info.proto if info.type == type end nil end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.