function Packet_GetPayloadLength (dpiMsg, packet) require 'LOG' require 'HexString'
if GetLatestApplication(dpiMsg) == "http" then -- Get ICMP type (byte 20 for IPv4 packets) local longPayloadThreshold = 20000 local payloadLength = GetPayloadLength(packet) if payloadLength > longPayloadThreshold then EZINFO("Session: ", GetUuid(dpiMsg), ", long payload length: ", payloadLength) endPayload = GetPayloadString(packet, longPayloadThreshold, payloadLength-1) endPayloadHex = StringToHex(endPayload) EZINFO("Session: ", GetUuid(dpiMsg), ", end payload:\n", endPayloadHex) end end end |