Skip to main content
Skip table of contents

Get Payload Length

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
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.