mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 22:21:29 +00:00
nselib stdnse.print_debug -> stdnse.debug
$ f() { find -name \*.lua -exec /bin/echo sed -i "$1" {} \; ; }
$ f 's/stdnse.print_debug( *\([0-9]*\) *, */stdnse.debug\1(/'
$ f 's/stdnse.print_debug( *"\(.*\))/stdnse.debug1("\1)/'
This commit is contained in:
@@ -93,11 +93,11 @@ EIGRP = {
|
||||
-- @return response table Structured eigrp packet.
|
||||
parse = function(eigrp_raw)
|
||||
if type(eigrp_raw) ~= 'string' then
|
||||
stdnse.print_debug("eigrp.lua: parse input should be string.")
|
||||
stdnse.debug1("eigrp.lua: parse input should be string.")
|
||||
return
|
||||
end
|
||||
if #eigrp_raw < 20 then
|
||||
stdnse.print_debug("eigrp.lua: raw packet size lower then 20.")
|
||||
stdnse.debug1("eigrp.lua: raw packet size lower then 20.")
|
||||
return
|
||||
end
|
||||
local tlv
|
||||
@@ -118,7 +118,7 @@ EIGRP = {
|
||||
index, tlv.length = bin.unpack(">S", eigrp_raw, index)
|
||||
if tlv.length == 0x00 then
|
||||
-- In case someone wants to DoS us :)
|
||||
stdnse.print_debug("eigrp.lua: stopped parsing due to null TLV length.")
|
||||
stdnse.debug1("eigrp.lua: stopped parsing due to null TLV length.")
|
||||
break
|
||||
end
|
||||
if tlv.type == TLV.PARAM then
|
||||
@@ -153,19 +153,19 @@ EIGRP = {
|
||||
index = index + tlv.length - 8
|
||||
elseif tlv.type == TLV.STUB then
|
||||
-- TODO
|
||||
stdnse.print_debug("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
stdnse.debug1("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
index = index + tlv.length - 4
|
||||
elseif tlv.type == TLV.TERM then
|
||||
-- TODO
|
||||
stdnse.print_debug("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
stdnse.debug1("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
index = index + tlv.length - 4
|
||||
elseif tlv.type == TLV.TIDLIST then
|
||||
-- TODO
|
||||
stdnse.print_debug("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
stdnse.debug1("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
index = index + tlv.length - 4
|
||||
elseif tlv.type == TLV.REQ then
|
||||
-- TODO
|
||||
stdnse.print_debug("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
stdnse.debug1("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
index = index + tlv.length - 4
|
||||
elseif tlv.type == TLV.INT then
|
||||
-- Internal Route
|
||||
@@ -215,22 +215,22 @@ EIGRP = {
|
||||
tlv.dst = dst[1] .. '.' .. dst[2] .. '.' .. dst[3] .. '.' .. dst[4]
|
||||
elseif tlv.type == TLV.COM then
|
||||
-- TODO
|
||||
stdnse.print_debug("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
stdnse.debug1("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
index = index + tlv.length - 4
|
||||
elseif tlv.type == TLV.INT6 then
|
||||
-- TODO
|
||||
stdnse.print_debug("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
stdnse.debug1("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
index = index + tlv.length - 4
|
||||
elseif tlv.type == TLV.EXT6 then
|
||||
-- TODO
|
||||
stdnse.print_debug("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
stdnse.debug1("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
index = index + tlv.length - 4
|
||||
elseif tlv.type == TLV.COM6 then
|
||||
-- TODO
|
||||
stdnse.print_debug("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
stdnse.debug1("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
index = index + tlv.length - 4
|
||||
else
|
||||
stdnse.print_debug("eigrp.lua: eigrp.lua: TLV type %d unknown.", tlv.type)
|
||||
stdnse.debug1("eigrp.lua: eigrp.lua: TLV type %d unknown.", tlv.type)
|
||||
index = index + tlv.length - 4
|
||||
end
|
||||
table.insert(eigrp_packet.tlvs, tlv)
|
||||
@@ -244,7 +244,7 @@ EIGRP = {
|
||||
if type(tlv) == 'table' then
|
||||
table.insert(self.tlvs, tlv)
|
||||
else
|
||||
stdnse.print_debug("eigrp.lua: TLV should be a table, not %s", type(tlv))
|
||||
stdnse.debug1("eigrp.lua: TLV should be a table, not %s", type(tlv))
|
||||
end
|
||||
end,
|
||||
|
||||
@@ -332,10 +332,10 @@ EIGRP = {
|
||||
data = data .. bin.pack(">S", tlv.htime)
|
||||
elseif tlv.type == TLV.AUTH then
|
||||
-- TODO
|
||||
stdnse.print_debug("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
stdnse.debug1("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
elseif tlv.type == TLV.SEQ then
|
||||
-- TODO
|
||||
stdnse.print_debug("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
stdnse.debug1("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
elseif tlv.type == TLV.SWVER then
|
||||
data = data .. bin.pack(">S", TLV.SWVER)
|
||||
data = data .. bin.pack(">S", 0x0008)
|
||||
@@ -343,39 +343,39 @@ EIGRP = {
|
||||
data = data .. bin.pack(">CC", tonumber(tlv.majtlv), tonumber(tlv.mintlv))
|
||||
elseif tlv.type == TLV.MSEQ then
|
||||
-- TODO
|
||||
stdnse.print_debug("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
stdnse.debug1("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
elseif tlv.type == TLV.STUB then
|
||||
-- TODO
|
||||
stdnse.print_debug("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
stdnse.debug1("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
elseif tlv.type == TLV.TERM then
|
||||
-- TODO
|
||||
stdnse.print_debug("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
stdnse.debug1("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
elseif tlv.type == TLV.TIDLIST then
|
||||
-- TODO
|
||||
stdnse.print_debug("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
stdnse.debug1("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
elseif tlv.type == TLV.REQ then
|
||||
-- TODO
|
||||
stdnse.print_debug("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
stdnse.debug1("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
elseif tlv.type == TLV.INT then
|
||||
-- TODO
|
||||
stdnse.print_debug("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
stdnse.debug1("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
elseif tlv.type == TLV.EXT then
|
||||
-- TODO
|
||||
stdnse.print_debug("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
stdnse.debug1("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
elseif tlv.type == TLV.COM then
|
||||
-- TODO
|
||||
stdnse.print_debug("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
stdnse.debug1("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
elseif tlv.type == TLV.INT6 then
|
||||
-- TODO
|
||||
stdnse.print_debug("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
stdnse.debug1("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
elseif tlv.type == TLV.EXT6 then
|
||||
-- TODO
|
||||
stdnse.print_debug("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
stdnse.debug1("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
elseif tlv.type == TLV.COM6 then
|
||||
-- TODO
|
||||
stdnse.print_debug("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
stdnse.debug1("eigrp.lua: TLV type %d skipped due to no parser.", tlv.type)
|
||||
else
|
||||
stdnse.print_debug("eigrp.lua: TLV type %d unknown.", tlv.type)
|
||||
stdnse.debug1("eigrp.lua: TLV type %d unknown.", tlv.type)
|
||||
end
|
||||
end
|
||||
-- In the end, correct the checksum if not manually set
|
||||
|
||||
Reference in New Issue
Block a user