mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Removed packet.hextobin and packet.bintohex. Both are unnecessary
with the struct (bin) library available:
function hextobin(str) return bin.pack("H", str) end
function bintohex(str) return bin.unpack("H", str) end
Also removed a commented copy that was in the sniffer-detect.nse script.
This commit is contained in:
@@ -24,16 +24,6 @@ hostrule = function(host, port)
|
||||
nmap.get_interface_link(host.interface) == 'ethernet'
|
||||
end
|
||||
|
||||
--[[
|
||||
function bintohex(str)
|
||||
local b = ""
|
||||
for c in string.gmatch(str, ".") do
|
||||
b = string.format('%s%02x',b, string.byte(c))
|
||||
end
|
||||
return b
|
||||
end
|
||||
--]]
|
||||
|
||||
callback = function(packetsz, layer2, layer3)
|
||||
return string.sub(layer2, 0, 12)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user