Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions ethereum.lua
Original file line number Diff line number Diff line change
Expand Up @@ -478,11 +478,24 @@ function devp2p.dissector (tvb, pinfo, tree)
payloadtree:set_text("PING " .. string.toip(string.remove_quoted(toip)) .. ":" .. string.toport(string.remove_quoted(toport)))
elseif types[ptype] == "PONG" then
payloadtree:set_text(decodedvalue)
--message('PONG: ' .. decodedvalue)
local toip,toudpport,totcpport,replyhash, expiration = string.match(decodedvalue, '%[%[([^,]+), ([^,]+), ([^%]]+)%], ([^,]+), ([^%]]+)%]')
payloadtree:add("To:", string.toip(string.remove_quoted(toip)), string.toport(string.remove_quoted(toudpport)), string.toport(string.remove_quoted(totcpport)))
if toip == nil
then
-- Try it without the totcpport field.
toip,toudpport,replyhash, expiration = string.match(decodedvalue, '%[%[([^,]+), ([^%]]+)%], ([^,]+), ([^%]]+)%]')
end
toip_d = string.toip(string.remove_quoted(toip))
toudpport_d = string.toport(string.remove_quoted(toudpport))
totcpport_d = ''
if (totcpport ~= nil)
then
totcpport_d = string.toport(string.remove_quoted(totcpport))
end
payloadtree:add("To:", toip_d, toudpport_d, totcpport_d)
payloadtree:add("Hash:", string.remove_quoted(replyhash))
payloadtree:add("Expiration:", string.remove_quoted(expiration))
payloadtree:set_text("PONG " .. string.toip(string.remove_quoted(toip)) .. ":" .. string.toport(string.remove_quoted(toudpport)) .. "/" .. string.toport(string.remove_quoted(totcpport)))
payloadtree:set_text("PONG " .. toip_d .. ":" .. toudpport_d .. "/" .. totcpport_d)
elseif types[ptype] == "FindNode" then
payloadtree:set_text(decodedvalue)
local hash, expiration = string.match(decodedvalue, '%[([^,]+), ([^%]]+)%]')
Expand Down