/* Seek the address of the first byte of the Ia option header. */
UINT8* Dhcp6SeekIaOption(IN UINT8 *Buf, IN UINT32 SeekLen, IN EFI_DHCP6_IA_DESCRIPTOR *IaDesc)
/* Seek the address of the first byte of the Ia option header. */
UINT8* Dhcp6SeekIaOption(IN UINT8 *Buf, IN UINT32 SeekLen, IN EFI_DHCP6_IA_DESCRIPTOR *IaDesc)
{
  UINT8   *Cursor;
  UINT8   *Option;
  UINT16  DataLen;
  UINT16  OpCode;
  UINT32  IaId;
  Option = NULL;
  Cursor = Buf;
  while (Cursor < Buf + SeekLen) {
    OpCode = ReadUnaligned16 ((UINT16 *)Cursor);
    IaId   = ReadUnaligned32 ((UINT32 *)(Cursor + 4));
    if ((OpCode == HTONS (IaDesc->Type)) && (IaId == HTONL (IaDesc->IaId))) {
      Option = Cursor;
      break;
    }
    DataLen = NTOHS (ReadUnaligned16 ((UINT16 *)(Cursor + 2)));
    Cursor += (DataLen + 4);
  }
  return Option;
}