1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-30 19:39:07 +00:00

Update timeout script-args to use standard timespec

Many scripts were documented as using timespecs (10s, 5000ms, etc) for
timeout script-args, but one 1 or 2 actually did. Now all timeout
script-args will accept timespecs, except those which took a number of
milliseconds, which remain unchanged.

Also fixed some documentation issues (missing script name in arg
description, missing nsedoc for args, etc)
This commit is contained in:
dmiller
2013-03-05 21:34:25 +00:00
parent 3150d2fff6
commit fdb0f775e2
32 changed files with 113 additions and 108 deletions

View File

@@ -42,9 +42,9 @@ is 0. The payload is consisted of random bytes.
-- nmap -e <interface> [--ttl <ttl>] [--data-length <payload_length>]
-- --script broadcast-ping [--script-args [broadcast-ping.timeout=<ms>],[num-probes=<n>]]
--
-- @arg interface string specifying which interface to use for this script
-- @arg num_probes number specifying how many ICMP probes should be sent
-- @arg timeout number specifying how long to wait for response in miliseconds
-- @args broadcast-ping.interface string specifying which interface to use for this script (default all interfaces)
-- @args broadcast-ping.num_probes number specifying how many ICMP probes should be sent (default 1)
-- @args broadcast-ping.timeout number specifying how long to wait for response in milliseconds (default 3000)
--
-- @output
-- | broadcast-ping:
@@ -139,8 +139,7 @@ end
local broadcast_if = function(if_table,icmp_responders)
local condvar = nmap.condvar(icmp_responders)
local num_probes = stdnse.get_script_args(SCRIPT_NAME .. ".num-probes")
if not num_probes then num_probes = 1 end
local num_probes = tonumber(stdnse.get_script_args(SCRIPT_NAME .. ".num-probes")) or 1
local timeout = stdnse.get_script_args(SCRIPT_NAME .. ".timeout")
if not timeout then timeout = 3000 end