Package org.jnetpcap.packet

Examples of org.jnetpcap.packet.JPacket$State


   *
   * @return header's stored checksum
   */
  @Field(length = 4 * BYTE, format = "%x", display = "FCS")
  public long checksum() {
    final JPacket packet = getPacket();
    packet.order(ByteOrder.BIG_ENDIAN);
    return packet.getUInt(getPostfixOffset());
  }
View Full Code Here


  public long calculateChecksum() {
    if (getPostfixLength() < 4) {
      return 0L;
    }
   
    final JPacket packet = getPacket();
    return Checksum.crc32IEEE802(packet, 0, packet.size() - 4);
  }
View Full Code Here

   *
   * @return header's stored checksum
   */
  @Field(length = 4 * BYTE, format = "%x", display = "FCS")
  public long checksum() {
    final JPacket packet = getPacket();
    packet.order(ByteOrder.BIG_ENDIAN);
    return packet.getUInt(getPostfixOffset());
  }
View Full Code Here

  public boolean checksum(long crc) {
    if (getPostfixLength() < 4) {
      return false;
    }

    final JPacket packet = getPacket();
    packet.order(ByteOrder.BIG_ENDIAN);

    packet.setUInt(packet.size() - 4, crc);

    return true;
  }
View Full Code Here

   *
   * @return the long
   */
  public long calculateChecksum() {

    final JPacket packet = getPacket();
    return Checksum.crc32IEEE802(packet, 0, getHeaderLength()
        + getPayloadLength());
  }
View Full Code Here

   *
   * @throws IOException
   *           Signals that an I/O exception has occurred.
   */
  public void test1() throws IOException {
    JPacket packet = getPcapPacket(HTTP, 5);

    JFormatter out = new TextFormatter(System.out);

    out.format(packet);
  }
View Full Code Here

     * Packet extends JBuffer. The packet object is the one that is already
     * created for the scanner in the Pcap.loop call and is already peered. This
     * is better approach than getting the buffer with: JBuffer b = new
     * JBuffer(Type.POINTER); scan.scan_buf(b);
     */
    JPacket packet = scan.scan_packet();

    /*
     * Thats good
     */
    int offset = scan.scan_offset();
View Full Code Here

TOP

Related Classes of org.jnetpcap.packet.JPacket$State

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.