Class PcapReader

java.lang.Object
nl.sidnlabs.pcap.PcapReader

public class PcapReader extends Object
Read all data from a pcap file and decode all the packets
  • Field Details

  • Constructor Details

  • Method Details

    • stream

      public Stream<Packet> stream()
    • iter

      public Iterable<Packet> iter()
    • clearCache

      public void clearCache(int tcpCacheTTL, int ipCacheTTL)
      Clear expired cache entries in order to avoid memory problems
      Parameters:
      tcpCacheTTL - timeout for tcp flows
      ipCacheTTL - timeout for IP fragments
    • close

      public void close()
    • validateMagicNumber

      protected boolean validateMagicNumber(byte[] pcapHeader)
    • getLinkType

      protected PcapReader.LinkType getLinkType(long linkTypeVal)
    • findIPStart

      protected int findIPStart(byte[] packet)
    • readBytes

      protected boolean readBytes(byte[] buf)
    • setTcpFlows

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

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

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