/* Seek the address of the first byte of the option header. */
UINT8* PxeBcDhcp6SeekOption(IN UINT8 *Buf, IN UINT32 SeekLen, IN UINT16 OptType)
/* Seek the address of the first byte of the option header. */
UINT8* PxeBcDhcp6SeekOption(IN UINT8 *Buf, IN UINT32 SeekLen, IN UINT16 OptType)
{
  UINT8   *Cursor;
  UINT8   *Option;
  UINT16  DataLen;
  UINT16  OpCode;
  Option = NULL;
  Cursor = Buf;
  while (Cursor < Buf + SeekLen) {
    OpCode = ReadUnaligned16 ((UINT16 *)Cursor);
    if (OpCode == HTONS (OptType)) {
      Option = Cursor;
      break;
    }
    DataLen = NTOHS (ReadUnaligned16 ((UINT16 *)(Cursor + 2)));
    Cursor += (DataLen + 4);
  }
  return Option;
}