Display Hex Dump for DNS Traffic

This function displays a Wireshark-style Hex Dump for all DNS traffic.

function DnsHexDump (msg, packet)


require 'HexString'

require 'LOG'


if packet ~= nil and GetLatestApplication(msg) == "dns" then

if GetPacketLength(packet) > 0 then

local packetString = GetPacketString(packet)

local packetHexDump = HexDump(packetString)

EZINFO('DNS Packet\n', GetUuid(msg), "\n", packetHexDump)

end

end

end