/* Call back function to DhcpIterateOptions to consolidate each option's data. There are maybe several occurrence of the same option. */
EFI_STATUS DhcpFillOption(IN UINT8 Tag, IN UINT8 Len, IN UINT8 *Data, IN VOID *Context)
/* Call back function to DhcpIterateOptions to consolidate each option's data. There are maybe several occurrence of the same option. */
EFI_STATUS DhcpFillOption(IN UINT8 Tag, IN UINT8 Len, IN UINT8 *Data, IN VOID *Context)
{
  DHCP_OPTION_CONTEXT  *OptContext;
  DHCP_OPTION_COUNT    *OptCount;
  DHCP_OPTION          *Options;
  UINT8                *Buf;
  UINT8                Index;
  OptContext = (DHCP_OPTION_CONTEXT *)Context;
  OptCount = OptContext->OpCount;
  Index    = OptCount[Tag].Index;
  Options  = OptContext->Options;
  Buf      = OptContext->Buf;
  if (Options[Index].Data == NULL) {
    Options[Index].Tag  = Tag;
    Options[Index].Data = Buf + OptCount[Tag].Offset;
  }
  CopyMem (Buf + OptCount[Tag].Offset, Data, Len);
  OptCount[Tag].Offset = (UINT16)(OptCount[Tag].Offset + Len);
  Options[Index].Len   = (UINT16)(Options[Index].Len + Len);
  return EFI_SUCCESS;
}