Examples of toHexdump()


Examples of org.jnetpcap.nio.JBuffer.toHexdump()

   
    JBuffer b = new JBuffer(4);
   
    b.order(ByteOrder.LITTLE_ENDIAN);
    b.setUInt(0, 0x14010100)
    System.out.printf("0x%X\n%s", 0x14010100, b.toHexdump());
   
    b.order(ByteOrder.BIG_ENDIAN);
    b.setUInt(0, 0x14010100)
    System.out.printf("0x%X\n%s", 0x14010100, b.toHexdump());
  }
View Full Code Here

Examples of org.jnetpcap.nio.JBuffer.toHexdump()

    b.setUInt(0, 0x14010100)
    System.out.printf("0x%X\n%s", 0x14010100, b.toHexdump());
   
    b.order(ByteOrder.BIG_ENDIAN);
    b.setUInt(0, 0x14010100)
    System.out.printf("0x%X\n%s", 0x14010100, b.toHexdump());
  }

}
View Full Code Here

Examples of org.jnetpcap.packet.JMemoryPacket.toHexdump()

   
    JMemoryPacket packet = new JMemoryPacket(64);
    packet.order(ByteOrder.BIG_ENDIAN);
    packet.setUShort(0 + 12, 0x800);
    packet.setUByte(14 + 0, 0x45);
    System.out.println(packet.toHexdump());
    packet.setUByte(14 + 9, 0x11); //UDP
    System.out.println(packet.toHexdump());
    packet.scan(JProtocol.ETHERNET_ID);
    Ethernet eth = packet.getHeader(new Ethernet());
    Ip4 ip = packet.getHeader(new Ip4());
View Full Code Here

Examples of org.jnetpcap.packet.JMemoryPacket.toHexdump()

    packet.order(ByteOrder.BIG_ENDIAN);
    packet.setUShort(0 + 12, 0x800);
    packet.setUByte(14 + 0, 0x45);
    System.out.println(packet.toHexdump());
    packet.setUByte(14 + 9, 0x11); //UDP
    System.out.println(packet.toHexdump());
    packet.scan(JProtocol.ETHERNET_ID);
    Ethernet eth = packet.getHeader(new Ethernet());
    Ip4 ip = packet.getHeader(new Ip4());
    Udp udp = packet.getHeader(new Udp());
//    udp.transferFrom(getFakeData(1460)); //Generate Random bytes
View Full Code Here

Examples of org.jnetpcap.packet.PcapPacket.toHexdump()

      PcapPacket p1 = l1.get(i);
      PcapPacket p2 = l2.get(i);

      if (p1.size() != p2.size()) {
        System.out.printf("#%d p1=%d p2=%d\n%s\n%s\n", i, l1.size(), l2.size(),
            p1.toHexdump(), p2.toHexdump());

        System.out.println(p1.toString());
        System.out.println(p2.toString());
      }
View Full Code Here

Examples of org.jnetpcap.packet.PcapPacket.toHexdump()

                  .toDebugString());

          System.out.println("---------------------------");

          System.out.printf(
              "P2: %s\nheader2=%s\n\nstate2=%s\npacket2=%s\n\nip2=%s\n\n", p2
                  .toHexdump(), p2.getCaptureHeader().toDebugString(), p2
                  .getState().toDebugString(), p2.toDebugString(), ip2
                  .toDebugString());

          System.out.println("p1-p2.memory.diff=\n"
View Full Code Here

Examples of org.jnetpcap.packet.PcapPacket.toHexdump()

   */
  public void testIcmpDestUnreachable() {
    // Wireshark packet # 29 (1-based)
    PcapPacket packet = TestUtils.getPcapPacket("tests/test-afs.pcap", 29 - 1);

    System.out.println(packet.toHexdump(128, false, false, true));
    System.out.println(packet.getState().toDebugString());

    Ip4 ip = new Ip4();
    Icmp icmp = new Icmp(); // Need an instance so we can check on sub header
    Icmp.DestinationUnreachable unreach = new Icmp.DestinationUnreachable();
View Full Code Here

Examples of org.jnetpcap.packet.PcapPacket.toHexdump()

  public void testDiameterHeader() {
    Diameter diameter = new Diameter(); // Need an instance so we can check on sub header
    // Wireshark packet # 29 (1-based)
    PcapPacket packet = TestUtils.getPcapPacket("tests/tc_TC_IDPRE_EXT0140.pcap", 43 - 1);

    System.out.println(packet.toHexdump(128, false, false, true));

    long map = packet.getState().get64BitHeaderMap(0);
   
    JRegistry.addBindings(Diameter.class);
    System.out.println(JRegistry.toDebugString());
View Full Code Here

Examples of org.jnetpcap.protocol.network.Ip4.toHexdump()

          System.out.println(packet.getState().toDebugString());
          e.printStackTrace();
        }
        System.out
            .printf("#%d: ip.crc=%x computed=%x\n", f, ip.checksum(), crc);
        System.out.println(ip.toHexdump());
      }

      assertEquals("Frame #" + f, ip.checksum(), crc);
    }
  }
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.