Package org.jnetpcap

Examples of org.jnetpcap.PcapBpfProgram


    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


    if ((pcap = Pcap.openOffline(file, errbuf)) == null) {
      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

Related Classes of org.jnetpcap.PcapBpfProgram

Copyright © 2018 www.massapicom. 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.