if (! (ipv4.getPayload() instanceof UDP) )
return;
UDP udp = (UDP) ipv4.getPayload();
if (!(udp.getPayload() instanceof DHCP))
return;
DHCP dhcp = (DHCP) udp.getPayload();
byte opcode = dhcp.getOpCode();
if (opcode == DHCP.OPCODE_REQUEST) {
DHCPOption dhcpOption = dhcp.getOption(
DHCPOptionCode.OptionCode_Hostname);
if (dhcpOption != null) {
cntDhcpClientNameSnooped.updateCounterNoFlush();
srcDevice.dhcpClientName = new String(dhcpOption.getData());
}