Examples of dumpOpen()


Examples of org.pcap4j.core.PcapHandle.dumpOpen()

      filter,
      BpfCompileMode.OPTIMIZE
    );

    int num = 0;
    PcapDumper dumper = handle.dumpOpen(PCAP_FILE);
    while (true) {
      Packet packet = handle.getNextPacket();
      if (packet == null) {
        continue;
      }
View Full Code Here

Examples of org.pcap4j.core.PcapHandle.dumpOpen()

    handle.setFilter(
      filter,
      BpfCompileMode.OPTIMIZE
    );

    PcapDumper dumper = handle.dumpOpen(PCAP_FILE);
    try {
      handle.loop(COUNT, dumper);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
View Full Code Here

Examples of org.pcap4j.core.PcapHandle.dumpOpen()

               .correctLengthAtBuild(true)
           )
          .build();

    PcapHandle handle = Pcaps.openDead(DataLinkType.EN10MB, 65536);
    PcapDumper dumper = handle.dumpOpen(dumpFile);
    dumper.dump(ep1, 0, 0);
    dumper.dump(ep2, 0, 0);
    dumper.close();
    handle.close();
View Full Code Here

Examples of org.pcap4j.core.PcapHandle.dumpOpen()

      .paddingAtBuild(true);

    EthernetPacket orgPacket = eb.build();

    PcapHandle handle = Pcaps.openDead(DataLinkType.EN10MB, 65536);
    PcapDumper dumper = handle.dumpOpen(dumpFile);
    dumper.dump(orgPacket, 0, 0);

    List<IpV4Packet> list = new ArrayList<IpV4Packet>();
    for (IpV4Packet p: IpV4Helper.fragment((IpV4Packet)orgPacket.getPayload(), 987)) {
      EthernetPacket ep = eb.payloadBuilder(new SimpleBuilder(p)).build();
View Full Code Here

Examples of org.pcap4j.core.PcapHandle.dumpOpen()

    PcapDumper dumper = null;
    for (String pcapFile: args) {
      PcapHandle handle = Pcaps.openOffline(pcapFile);

      if (dumper == null) {
        dumper = handle.dumpOpen(PcapFileMerger.class.getSimpleName() + ".pcap");
      }

      Packet packet;
      while ((packet = handle.getNextPacket()) != null) {
        dumper.dump(
View Full Code Here

Examples of org.pcap4j.core.PcapHandle.dumpOpen()

    ipV6b.payloadBuilder(packet2.getBuilder());
    EthernetPacket ep2 = eb.build();


    PcapHandle handle = Pcaps.openDead(DataLinkType.EN10MB, 65536);
    PcapDumper dumper = handle.dumpOpen(dumpFile);
    dumper.dump(ep1, 0, 0);
    dumper.dump(ep2, 0, 0);
    dumper.close();
    handle.close();
View Full Code Here

Examples of org.pcap4j.core.PcapHandle.dumpOpen()

                        .append(getClass().getSimpleName()).append(".pcap")
                        .toString();
    Packet p = getWholePacket();

    PcapHandle handle = Pcaps.openDead(getDataLinkType(), 65536);
    PcapDumper dumper = handle.dumpOpen(dumpFile);
    dumper.dump(p, 0, 0);
    dumper.close();
    handle.close();

    PcapHandle reader = Pcaps.openOffline(dumpFile);
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.