refPacketFromHex = DHCPPacket.getPacket(refBuf, 0, refBuf.length, true);
refPacketFromHex.setComment("foobar");
refPacketFromHex.setAddress(InetAddress.getByName("10.11.12.13"));
refPacketFromHex.setPort(6767);
DHCPPacket packet = new DHCPPacket();
packet.setComment("foobar");
packet.setOp(BOOTREQUEST);
packet.setHtype(HTYPE_ETHER);
packet.setHlen((byte) 6);
packet.setHops((byte) 0);
packet.setSecs((short)0);
packet.setXid(0x11223344);
packet.setFlags((short) 0x8000);
packet.setCiaddr("10.0.0.1");
packet.setYiaddr("10.0.0.2");
packet.setSiaddr("10.0.0.3");
packet.setGiaddr("10.0.0.4");
packet.setChaddr(HexUtils.hexToBytes("00112233445566778899AABBCCDDEEFF"));
packet.setSname(STR200.substring(0, 64));
packet.setFile (STR200.substring(0, 128));
packet.setDHCPMessageType(DHCPDISCOVER);
packet.setOptionAsInetAddress(DHO_DHCP_SERVER_IDENTIFIER, "12.34.56.68");
packet.setOptionAsInt(DHO_DHCP_LEASE_TIME, 86400);
packet.setOptionAsInetAddress(DHO_SUBNET_MASK, "255.255.255.0");
packet.setOptionAsInetAddress(DHO_ROUTERS, "10.0.0.254");
InetAddress[] staticRoutes = new InetAddress[2];
staticRoutes[0] = InetAddress.getByName("22.33.44.55");
staticRoutes[1] = InetAddress.getByName("10.0.0.254");
packet.setOptionAsInetAddresses(DHO_STATIC_ROUTES, staticRoutes);
packet.setOptionAsInetAddress(DHO_NTP_SERVERS, "10.0.0.5");
packet.setOptionAsInetAddress(DHO_WWW_SERVER, "10.0.0.6");
packet.setPaddingWithZeroes(256);
packet.setAddress(InetAddress.getByName("10.11.12.13"));
packet.setPort(6767);
refPacketFromSratch = packet;
}