Examples of PcapPacket


Examples of org.jnetpcap.packet.PcapPacket

   * @param user
   *          a custom opaque user object
   * @return number of packet captured
   */
  public <T> int dispatch(int cnt, JPacketHandler<T> handler, T user) {
    final PcapPacket packet = new PcapPacket(Type.POINTER);
    return dispatch(cnt,
        datalinkToId(),
        handler,
        user,
        packet,
        packet.getState(),
        packet.getCaptureHeader(),
        JScanner.getThreadLocal());
  }
View Full Code Here

Examples of org.jnetstream.capture.file.pcap.PcapPacket

      public PcapPacket next() throws IOException {
        final ByteBuffer buffer = raw.next();
        final long position = 0;

        final PcapPacket packet =
            new PcapPacketImpl(BitBuffer.wrap(BufferUtils.slice(buffer)),
                position, dlt);

        return packet;
      }
View Full Code Here

Examples of org.krakenapps.pcap.packet.PcapPacket

    }

    private PcapPacket readPacket(int magicNumber) throws IOException {
        PacketHeader packetHeader = readPacketHeader(magicNumber);
        Buffer packetData = readPacketData(packetHeader.getInclLen());
        return new PcapPacket(packetHeader, packetData);
    }
View Full Code Here

Examples of org.krakenapps.pcap.packet.PcapPacket

            return true;
        }

        try {
            // keep going until the decoder says it found a good one.
            PcapPacket packet;

            do {
                packet = is.getPacket();
                eth.decode(packet);
            } while (!valid);

            long tv_sec = packet.getPacketHeader().getTsSec();
            long tv_usec = packet.getPacketHeader().getTsUsec();
            long ts = tv_sec * 1000 + tv_usec / 1000;
            key = new Date(ts).getTime() / 1000;

            int id = dns.getHeader().getID();
            String mode = dns.getHeader().getFlag(Flags.QR) ? "response" : "question";
View Full Code Here

Examples of org.krakenapps.pcap.packet.PcapPacket

            // oh, hadoop :(
        }

        taskAttemptContext.progress();

        PcapPacket packet;

        try {
            packet = is.getPacket();
        } catch (NegativeArraySizeException ignored) {
            return null;
View Full Code Here

Examples of org.krakenapps.pcap.packet.PcapPacket

                ipData = tcpData = udpData = null;
                ipPacket = null;
                tcpPacket = null;
                udpPacket = null;

                PcapPacket packet = is.getPacket();
                eth.decode(packet);

                if (filter.matches(packet, ipPacket, tcpPacket, udpPacket)) {
                    switch (filter.getProto()) {
                        case InternetProtocol.TCP:
View Full Code Here

Examples of org.krakenapps.pcap.packet.PcapPacket

            return true;
        }

        try {
            // keep going until the decoder says it found a good one.
            PcapPacket packet;

            do {
                packet = is.getPacket();
                eth.decode(packet);
            } while (!valid);

            long tv_sec = packet.getPacketHeader().getTsSec();
            long tv_usec = packet.getPacketHeader().getTsUsec();
            long ts = tv_sec * 1000 + tv_usec / 1000;
            key = new Date(ts).getTime() / 1000;

            int id = dns.getHeader().getID();
            String mode = dns.getHeader().getFlag(Flags.QR) ? "response" : "question";
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.