mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 06:01:28 +00:00
Replace some print calls with proper debug functions. See #1774
This commit is contained in:
@@ -542,9 +542,10 @@ UrlQueue = {
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
-- dumps the contents of the UrlQueue
|
-- dumps the contents of the UrlQueue
|
||||||
dump = function(self)
|
dump = function(self, printer)
|
||||||
|
printer = printer or print
|
||||||
for _, url in ipairs(self.urls) do
|
for _, url in ipairs(self.urls) do
|
||||||
print("url:", url)
|
printer("url:", url)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
|||||||
@@ -74,8 +74,7 @@ IAX2 = {
|
|||||||
local header = IAX2.Header:new()
|
local header = IAX2.Header:new()
|
||||||
local frame_type, pos = string.unpack("B", data)
|
local frame_type, pos = string.unpack("B", data)
|
||||||
if ( (frame_type & 0x80) == 0 ) then
|
if ( (frame_type & 0x80) == 0 ) then
|
||||||
print("frame_type", stdnse.tohex(frame_type))
|
stdnse.debug2("Frametype %x not supported", frame_type)
|
||||||
stdnse.debug2("Frametype not supported")
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
header.type = IAX2.PacketType.FULL
|
header.type = IAX2.PacketType.FULL
|
||||||
|
|||||||
@@ -563,13 +563,13 @@ end
|
|||||||
function Packet:ip_parse(force_continue)
|
function Packet:ip_parse(force_continue)
|
||||||
self.ip_offset = 0
|
self.ip_offset = 0
|
||||||
if #self.buf < 20 then -- too short
|
if #self.buf < 20 then -- too short
|
||||||
print("too short")
|
stdnse.debug2("Packet.ip_parse: too short")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
self.ip_v = (self:u8(self.ip_offset + 0) & 0xF0) >> 4
|
self.ip_v = (self:u8(self.ip_offset + 0) & 0xF0) >> 4
|
||||||
self.ip_hl = (self:u8(self.ip_offset + 0) & 0x0F) -- header_length or data_offset
|
self.ip_hl = (self:u8(self.ip_offset + 0) & 0x0F) -- header_length or data_offset
|
||||||
if self.ip_v ~= 4 then -- not ip
|
if self.ip_v ~= 4 then -- not ip
|
||||||
print("not v4")
|
stdnse.debug2("Packet.ip_parse: Not IPv4")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
self.ip = true
|
self.ip = true
|
||||||
|
|||||||
Reference in New Issue
Block a user