1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-10 09:49:05 +00:00

Re-indent some NSE libraries.

https://secwiki.org/w/Nmap/Code_Standards
This commit is contained in:
dmiller
2014-02-03 19:47:34 +00:00
parent 63db1bfd12
commit 961ea25225
55 changed files with 12863 additions and 12863 deletions

View File

@@ -26,7 +26,7 @@ local b32standard = {
'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z', '2', '3', '4', '5', '6', '7', 'Y', 'Z', '2', '3', '4', '5', '6', '7',
} }
local b32dcstandard = {} -- efficency local b32dcstandard = {} -- efficency
b32dcstandard['A'] = '00000' b32dcstandard['A'] = '00000'
@@ -192,7 +192,7 @@ function dec(b32data, hexExtend)
append(bdataBuf, bpack("B", substr(nbyte, 1, 8))) append(bdataBuf, bpack("B", substr(nbyte, 1, 8)))
nbyte = substr(nbyte, 9) nbyte = substr(nbyte, 9)
end end
-- pos = pos + 1 -- pos = pos + 1
end end
return concat(bdataBuf) return concat(bdataBuf)
end end

View File

@@ -24,7 +24,7 @@ local b64table = {
'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
'w', 'x', 'y', 'z', '0', '1', '2', '3', 'w', 'x', 'y', 'z', '0', '1', '2', '3',
'4', '5', '6', '7', '8', '9', '+', '/' '4', '5', '6', '7', '8', '9', '+', '/'
} }
local b64dctable = {} -- efficency local b64dctable = {} -- efficency
b64dctable['A'] = '000000' b64dctable['A'] = '000000'
@@ -173,7 +173,7 @@ function dec(b64data)
append(bdataBuf, bpack("B", substr(nbyte, 1, 8))) append(bdataBuf, bpack("B", substr(nbyte, 1, 8)))
nbyte = substr(nbyte, 9) nbyte = substr(nbyte, 9)
end end
-- pos = pos + 1 -- pos = pos + 1
end end
return concat(bdataBuf) return concat(bdataBuf)
end end

View File

@@ -384,6 +384,6 @@ EIGRP = {
end end
return data return data
end, end,
} }
return _ENV; return _ENV;

View File

@@ -46,7 +46,7 @@ local function dbg_err(str,...)
stdnse.print_debug("json-ERR:"..str, ...) stdnse.print_debug("json-ERR:"..str, ...)
end end
-- Javascript null representation, see explanation above -- Javascript null representation, see explanation above
NULL = {} NULL = {}
-- See section 2.5 for escapes. -- See section 2.5 for escapes.
@@ -468,8 +468,8 @@ function Json:parseString()
else -- Char else -- Char
val = val .. c val = val .. c
end end
end end
return val return val
end end
--- Parses json data into an object form --- Parses json data into an object form
-- This is the method you probably want to use if you -- This is the method you probably want to use if you

View File

@@ -152,8 +152,8 @@ version_port_or_service = function(ports, services, protos, states)
end end
--[[ --[[
Apache Tomcat HTTP server default ports: 8180 and 8000 Apache Tomcat HTTP server default ports: 8180 and 8000
Litespeed webserver default ports: 8088 and 7080 Litespeed webserver default ports: 8088 and 7080
--]] --]]
LIKELY_HTTP_PORTS = { LIKELY_HTTP_PORTS = {
80, 443, 631, 7080, 8080, 8088, 5800, 3872, 8180, 8000 80, 443, 631, 7080, 8080, 8088, 5800, 3872, 8180, 8000

View File

@@ -308,7 +308,7 @@ function concat_iterators (iter1, iter2)
end end
end end
return iterator return iterator
end end
--- Returns a new iterator that filters it's results based on the filter. --- Returns a new iterator that filters it's results based on the filter.
-- @param iterator Iterator that needs to be filtered -- @param iterator Iterator that needs to be filtered
@@ -324,6 +324,6 @@ function filter_iterator (iterator, filter)
return helper(iterator(command)) return helper(iterator(command))
end end
return filter return filter
end end
return _ENV; return _ENV;

View File

@@ -43,7 +43,7 @@ _ENV = stdnse.module("url", stdnse.seeall)
_VERSION = "URL 1.0" _VERSION = "URL 1.0"
--[[ Internal functions --]] --[[ Internal functions --]]
local function make_set(t) local function make_set(t)
local s = {} local s = {}
@@ -100,7 +100,7 @@ local function absolute_path(base_path, relative_path)
end end
--[[ External functions --]] --[[ External functions --]]
--- ---
-- Encodes a string into its escaped hexadecimal representation. -- Encodes a string into its escaped hexadecimal representation.