/* Binary search the DhcpOptionFormats array to find the format information about a specific option. */
DHCP_OPTION_FORMAT* DhcpFindOptionFormat(IN UINT8 Tag)
/* Binary search the DhcpOptionFormats array to find the format information about a specific option. */
DHCP_OPTION_FORMAT* DhcpFindOptionFormat(IN UINT8 Tag)
{
  INTN  Left;
  INTN  Right;
  INTN  Middle;
  Left  = 0;
  Right = sizeof (DhcpOptionFormats) / sizeof (DHCP_OPTION_FORMAT) - 1;
  while (Right >= Left) {
    Middle = (Left + Right) / 2;
    if (Tag == DhcpOptionFormats[Middle].Tag) {
      return &DhcpOptionFormats[Middle];
    }
    if (Tag < DhcpOptionFormats[Middle].Tag) {
      Right = Middle - 1;
    } else {
      Left = Middle + 1;
    }
  }
  return NULL;
}