@Test public void serializeTest() throws PacketException { byte[] output = arp.serialize(); Assert.assertEquals(htype, Ints.fromBytes((byte) 0, (byte) 0, output[0], output[1])); Assert.assertEquals(ptype, Ints.fromBytes((byte) 0, (byte) 0, output[2], output[3])); Assert.assertEquals(hlen, output[4]); Assert.assertEquals(plen, output[5]); Assert.assertEquals(operation, Ints.fromBytes((byte) 0, (byte) 0, output[6], output[7])); Assert.assertArrayEquals(sha, Arrays.copyOfRange(output, 8, 14)); Assert.assertArrayEquals(spa, Arrays.copyOfRange(output, 14, 18)); Assert.assertArrayEquals(tha, Arrays.copyOfRange(output, 18, 24)); Assert.assertArrayEquals(tpa, Arrays.copyOfRange(output, 24, 28)); }
@Override public byte[] serialize() throws PacketException { return super.serialize(); }
Arp extends Packet { @Override public byte[] serialize() throws PacketException { return super.serialize(); } }
Arp extends Packet { @Override public byte[] serialize() throws PacketException { return super.serialize(); } Arp(); }
Arp extends Packet { @Override public byte[] serialize() throws PacketException { return super.serialize(); } Arp(); Pair<Integer, Integer> setSHAFieldCoordinate(Pair<Integer, Integer> bitOffsetAndBitLength); Pair<Integer, Integer> setSPAFieldCoordinate(Pair<Integer, Integer> bitOffsetAndBitLength); Pair<Integer, Integer> setTHAFieldCoordinate(Pair<Integer, Integer> bitOffsetAndBitLength); Pair<Integer, Integer> setTPAFieldCoordinate(Pair<Integer, Integer> bitOffsetAndBitLength); @Override Packet deserialize(byte[] data, int bitOffset, int size); @Override byte[] serialize(); @Override int getfieldnumBits(String fieldName); Arp setHardwareType(int value); Arp setProtocolType(int value); Arp setHardwareLength(short value); Arp setProtocolLength(short value); Arp setOperation(int value); Arp setSenderHardwareAddress(byte[] value); Arp setSenderProtocolAddress(byte[] value); Arp setTargetHardwareAddress(byte[] value); Arp setTargetProtocolAddress(byte[] value); int getHardwareType(); int getProtocolType(); short getHardwareLength(); short getProtocolLength(); int getOperation(); byte[] getSenderHardwareAddress(); byte[] getSenderProtocolAddress(); byte[] getTargetHardwareAddress(); byte[] getTargetProtocolAddress(); }
Arp extends Packet { @Override public byte[] serialize() throws PacketException { return super.serialize(); } Arp(); Pair<Integer, Integer> setSHAFieldCoordinate(Pair<Integer, Integer> bitOffsetAndBitLength); Pair<Integer, Integer> setSPAFieldCoordinate(Pair<Integer, Integer> bitOffsetAndBitLength); Pair<Integer, Integer> setTHAFieldCoordinate(Pair<Integer, Integer> bitOffsetAndBitLength); Pair<Integer, Integer> setTPAFieldCoordinate(Pair<Integer, Integer> bitOffsetAndBitLength); @Override Packet deserialize(byte[] data, int bitOffset, int size); @Override byte[] serialize(); @Override int getfieldnumBits(String fieldName); Arp setHardwareType(int value); Arp setProtocolType(int value); Arp setHardwareLength(short value); Arp setProtocolLength(short value); Arp setOperation(int value); Arp setSenderHardwareAddress(byte[] value); Arp setSenderProtocolAddress(byte[] value); Arp setTargetHardwareAddress(byte[] value); Arp setTargetProtocolAddress(byte[] value); int getHardwareType(); int getProtocolType(); short getHardwareLength(); short getProtocolLength(); int getOperation(); byte[] getSenderHardwareAddress(); byte[] getSenderProtocolAddress(); byte[] getTargetHardwareAddress(); byte[] getTargetProtocolAddress();  }