Package org.jnetpcap

Examples of org.jnetpcap.Pcap.compile()


    final Pcap pcap = Pcap.openOffline(file, errbuf);
    assertNotNull(errbuf.toString());

    if (filter != null) {
      PcapBpfProgram prog = new PcapBpfProgram();
      if (pcap.compile(prog, filter, 0, 0xffffff00) != Pcap.OK) {
        System.err.printf("pcap filter %s: %s\n", pcap.getErr(), filter);
        return null;
      }
      pcap.setFilter(prog);
    }
View Full Code Here


      fail(errbuf.toString());
    }

    if (filter != null) {
      PcapBpfProgram program = new PcapBpfProgram();
      if (pcap.compile(program, filter, 0, 0) != Pcap.OK) {
        System.err.printf("pcap filter err: %s\n", pcap.getErr());
      }

      pcap.setFilter(program);
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.