Class IPDecoder

java.lang.Object
nl.sidnlabs.pcap.decoder.IPDecoder

public class IPDecoder extends Object
Decode the IP header
  • Field Details

  • Constructor Details

  • Method Details

    • printStats

      public void printStats()
    • decode

      public Packet decode(byte[] packetData, int ipStart, long packetTimestampSecs, long packetTimestampMicros, boolean partial)
    • decode

      public Packet decode(Packet packet)
    • decode

      public Packet decode(Packet packet, byte[] packetData, int ipStart)
    • createPacket

      public Packet createPacket(byte[] packetData, int ipStart)
    • reassemble

      public byte[] reassemble(Packet packet, byte[] packetData)
      Reassemble the IP packet is it is fragmented. If it is not fragmented then the packetData bytes are returned as result. If the packet is fragmented and this packet is the final fragment then all the bytes from the fragments are concatenated and returned. if fragmented and current fragment is not yet the final fragment then an empty byte array is returned. the
      Parameters:
      packet - the current packet
      packetData - the payload of the current packet
      Returns:
      input, reassembled or no bytes
    • getDatagrams

      public com.google.common.collect.Multimap<Datagram,DatagramPayload> getDatagrams()
    • setDatagrams

      public void setDatagrams(com.google.common.collect.Multimap<Datagram,DatagramPayload> datagrams)
    • setTcpFlows

      public void setTcpFlows(Map<TCPFlow,FlowData> flows)
    • clearCache

      public void clearCache(int ipFragmentTTL)
      Clear expired cache entries in order to avoid memory problems
      Parameters:
      ipFragmentTTL - timeout for IP fragments
    • reset

      public void reset()