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
eth.destination(new byte[] {(byte) 0xaa, 0x0c, 0x08, 11, 22, 33});
eth.source(new byte[] {(byte) 0xaa, 0x0c, 0x08, 11, 22, 34});
ip.flags(0);
ip.tos(0);
ip.source(new byte[] {(byte) 192, (byte) 168, 18, (byte) 218});
ip.setByteArray(16, new byte[] {(byte) 192,(byte) 168, 18, (byte) 219});
ip.checksum(0);
System.out.printf("crc=0x%X ip.len=%d\n", Checksum.inChecksum(ip, 0, ip.size()), ip.size());
ip.checksum(Checksum.inChecksum(ip, 0, ip.size()));
System.out.println(packet.getState().toDebugString());
System.out.printf("crc=0x%X\n", Checksum.inChecksum(ip, 0, ip.size()));
JBuffer b = new JBuffer(4);
b.order(ByteOrder.LITTLE_ENDIAN);
b.setUInt(0, 0x14010100);