RandomPacketTester.testClass(IpV4Packet.class, packet1);
}
@Test
public void testGetHeader() {
IpV4Header h = packet1.getHeader();
assertEquals(version, h.getVersion());
assertEquals(ihl, h.getIhl());
assertEquals(tos, h.getTos());
assertEquals(totalLength, h.getTotalLength());
assertEquals(identification, h.getIdentification());
assertEquals(reservedFlag, h.getReservedFlag());
assertEquals(dontFragmentFlag, h.getDontFragmentFlag());
assertEquals(moreFragmentFlag, h.getMoreFragmentFlag());
assertEquals(flagmentOffset, h.getFlagmentOffset());
assertEquals(ttl, h.getTtl());
assertEquals(protocol, h.getProtocol());
assertEquals(headerChecksum, h.getHeaderChecksum());
assertEquals(srcAddr, h.getSrcAddr());
assertEquals(dstAddr, h.getDstAddr());
assertEquals(options.size(), h.getOptions().size());
Iterator<IpV4Option> iter = h.getOptions().iterator();
for (IpV4Option expected: options) {
IpV4Option actual = iter.next();
assertEquals(expected, actual);
}
assertArrayEquals(padding, h.getPadding());
IpV4Packet.Builder b = packet1.getBuilder();
IpV4Packet p;
b.ihl((byte)0);