/* Parse InterfaceId in string format and convert it to EFI_IP6_CONFIG_INTERFACE_ID. */
EFI_STATUS Ip6ParseInterfaceIdFromString(IN CONST CHAR16 *String, OUT EFI_IP6_CONFIG_INTERFACE_ID *IfId)
/* Parse InterfaceId in string format and convert it to EFI_IP6_CONFIG_INTERFACE_ID. */
EFI_STATUS Ip6ParseInterfaceIdFromString(IN CONST CHAR16 *String, OUT EFI_IP6_CONFIG_INTERFACE_ID *IfId)
{
  UINT8   Index;
  CHAR16  *IfIdStr;
  CHAR16  *TempStr;
  UINTN   NodeVal;
  if ((String == NULL) || (IfId == NULL)) {
    return EFI_INVALID_PARAMETER;
  }
  IfIdStr = (CHAR16 *)String;
  ZeroMem (IfId, sizeof (EFI_IP6_CONFIG_INTERFACE_ID));
  for (Index = 0; Index < 8; Index++) {
    TempStr = IfIdStr;
    while ((*IfIdStr != L'\0') && (*IfIdStr != L':')) {
      IfIdStr++;
    }
    if ((*IfIdStr == ':') && (Index == 7)) {
      return EFI_INVALID_PARAMETER;
    }
    NodeVal = StrHexToUintn (TempStr);
    if (NodeVal > 0xFF) {
      return EFI_INVALID_PARAMETER;
    }
    IfId->Id[Index] = (UINT8)NodeVal;
    IfIdStr++;
  }
  return EFI_SUCCESS;
}