mirror of
https://github.com/nmap/nmap.git
synced 2025-12-11 10:19:03 +00:00
Remove some unused functions
This commit is contained in:
@@ -228,18 +228,6 @@ local function get_quoted_string(s, offset, crlf)
|
||||
return nil
|
||||
end
|
||||
|
||||
-- Get a ( token | quoted-string ) starting at offset.
|
||||
-- @return the first index following the token or quoted-string, or nil if
|
||||
-- nothing was found.
|
||||
-- @return the token or quoted-string.
|
||||
local function get_token_or_quoted_string(s, offset, crlf)
|
||||
if s:sub(offset, offset) == "\"" then
|
||||
return get_quoted_string(s, offset)
|
||||
else
|
||||
return get_token(s, offset)
|
||||
end
|
||||
end
|
||||
|
||||
-- Returns the index just past the end of LWS.
|
||||
local function skip_lws(s, pos)
|
||||
local _, e
|
||||
|
||||
@@ -172,17 +172,6 @@ end
|
||||
local function dbg(str,...)
|
||||
stdnse.debug1("Json:"..str, ...)
|
||||
end
|
||||
local function d4(str,...)
|
||||
if nmap.debugging() > 3 then dbg(str, ...) end
|
||||
end
|
||||
local function d3(str,...)
|
||||
if nmap.debugging() > 2 then dbg(str, ...) end
|
||||
end
|
||||
|
||||
--local dbg =stdnse.debug
|
||||
local function dbg_err(str,...)
|
||||
stdnse.debug1("json-ERR:"..str, ...)
|
||||
end
|
||||
|
||||
-- See section 2.5 for escapes.
|
||||
-- For convenience, ESCAPE_TABLE maps to escape sequences complete with
|
||||
|
||||
@@ -57,13 +57,6 @@ local function dbg_err(str,...)
|
||||
end
|
||||
--local err =stdnse.log_error
|
||||
|
||||
-- Packs data into nullterminated string
|
||||
--@param input the string to pack
|
||||
--@return the packed nullterminated string
|
||||
local function make_nullterminated_string(input)
|
||||
return bin.pack("z",input)
|
||||
end
|
||||
|
||||
--Converts an element (key, value) into bson binary data
|
||||
--@param key the key name, must *NOT* contain . (period) or start with $
|
||||
--@param value, the element value
|
||||
@@ -644,42 +637,5 @@ function queryResultToTable( resultTable )
|
||||
return result
|
||||
|
||||
end
|
||||
----------------------------------------------------------------------------------
|
||||
-- Test-code for debugging purposes below
|
||||
----------------------------------------------------------------------------------
|
||||
|
||||
|
||||
--- Prints data (string) as Hex values, e.g so it more easily can
|
||||
-- be compared with a packet dump
|
||||
-- @param strData the data in a string format
|
||||
|
||||
local function printBuffer(strData)
|
||||
local out = ''
|
||||
local ch
|
||||
for i = 1,strData:len() do
|
||||
out = out .." "
|
||||
ch =strData:byte(i)
|
||||
if(ch < 16) then
|
||||
ch = string.format("0%x",ch)
|
||||
else ch = string.format("%x",ch)
|
||||
end
|
||||
--if ch > 64 and ch < 123 then
|
||||
-- out = out .. string.char(ch)
|
||||
--else
|
||||
out = out .. ch
|
||||
--end
|
||||
end
|
||||
print(out)
|
||||
end
|
||||
|
||||
-- function test()
|
||||
-- local res
|
||||
-- res = versionQuery()
|
||||
-- print(type(res),res:len(),res)
|
||||
-- local _, out= bin.unpack('C'..#res,res)
|
||||
-- printBuffer(res)
|
||||
-- end
|
||||
--test()
|
||||
|
||||
|
||||
return _ENV;
|
||||
|
||||
@@ -108,21 +108,6 @@ end
|
||||
local SSL_MAX_RECORD_LENGTH_2_BYTE_HEADER = 32767
|
||||
local SSL_MAX_RECORD_LENGTH_3_BYTE_HEADER = 16383
|
||||
|
||||
local function parse_record_header_1_2(header_1_2)
|
||||
local _, b0, b1 = bin.unpack(">CC", header_1_2)
|
||||
local msb = bit.band(b0, 0x80) == 0x80
|
||||
local header_length
|
||||
local record_length
|
||||
if msb then
|
||||
header_length = 2
|
||||
record_length = bit.bor(bit.lshift(bit.band(b0, 0x7f), 8), b1)
|
||||
else
|
||||
header_length = 3
|
||||
record_length = bit.bor(bit.lshift(bit.band(b0, 0x3f), 8), b1)
|
||||
end
|
||||
return header_length, record_length
|
||||
end
|
||||
|
||||
-- 2 bytes of length minimum
|
||||
local SSL_MIN_HEADER = 2
|
||||
|
||||
|
||||
Reference in New Issue
Block a user