+++ /dev/null
-/** @file\r
- The assistant function declaration for IpSecConfig application.\r
-\r
- Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
-\r
- SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-\r
-#ifndef _HELPER_H_\r
-#define _HELPER_H_\r
-\r
-#define FORMAT_NUMBER 0x1\r
-#define FORMAT_STRING 0x2\r
-\r
-/**\r
- Helper function called to change input parameter in string format to number.\r
-\r
- @param[in] FlagStr The pointer to the flag string.\r
- @param[in] Maximum most value number.\r
- @param[in, out] ValuePtr The pointer to the input parameter in string format.\r
- @param[in] ByteCount The valid byte count\r
- @param[in] Map The pointer to the STR2INT table.\r
- @param[in] ParamPackage The pointer to the ParamPackage list.\r
- @param[in] FormatMask The bit mask.\r
- BIT 0 set indicates the value of flag might be number.\r
- BIT 1 set indicates the value of flag might be a string that needs to be looked up.\r
-\r
- @retval EFI_SUCCESS The operation completed successfully.\r
- @retval EFI_NOT_FOUND The input parameter can't be found.\r
- @retval EFI_INVALID_PARAMETER The input parameter is an invalid input.\r
-**/\r
-EFI_STATUS\r
-GetNumber (\r
- IN CHAR16 *FlagStr,\r
- IN UINT64 Maximum,\r
- IN OUT VOID *ValuePtr,\r
- IN UINTN ByteCount,\r
- IN STR2INT *Map,\r
- IN LIST_ENTRY *ParamPackage,\r
- IN UINT32 FormatMask\r
- );\r
-\r
-/**\r
- Helper function called to convert a string containing an (Ipv4) Internet Protocol dotted address\r
- into a proper address for the EFI_IP_ADDRESS structure.\r
-\r
- @param[in] Ptr The pointer to the string containing an (Ipv4) Internet Protocol dotted address.\r
- @param[out] Ip The pointer to the Ip address structure to contain the result.\r
-\r
- @retval EFI_SUCCESS The operation completed successfully.\r
- @retval EFI_INVALID_PARAMETER Invalid parameter.\r
-**/\r
-EFI_STATUS\r
-EfiInetAddr2 (\r
- IN CHAR16 *Ptr,\r
- OUT EFI_IP_ADDRESS *Ip\r
- );\r
-\r
-/**\r
- Helper function called to calculate the prefix length associated with the string\r
- containing an Ipv4 or Ipv6 Internet Protocol address.\r
-\r
- @param[in] Ptr The pointer to the string containing an Ipv4 or Ipv6 Internet Protocol address.\r
- @param[out] Addr The pointer to the EFI_IP_ADDRESS_INFO structure to contain the result.\r
-\r
- @retval EFI_SUCCESS The operation completed successfully.\r
- @retval EFI_INVALID_PARAMETER Invalid parameter.\r
- @retval Others Other mistake case.\r
-**/\r
-EFI_STATUS\r
-EfiInetAddrRange (\r
- IN CHAR16 *Ptr,\r
- OUT EFI_IP_ADDRESS_INFO *Addr\r
- );\r
-\r
-/**\r
- Helper function called to calculate the port range associated with the string.\r
-\r
- @param[in] Ptr The pointer to the string containing a port and range.\r
- @param[out] Port The pointer to the Port to contain the result.\r
- @param[out] PortRange The pointer to the PortRange to contain the result.\r
-\r
- @retval EFI_SUCCESS The operation completed successfully.\r
- @retval EFI_INVALID_PARAMETER Invalid parameter.\r
- @retval Others Other mistake case.\r
-**/\r
-EFI_STATUS\r
-EfiInetPortRange (\r
- IN CHAR16 *Ptr,\r
- OUT UINT16 *Port,\r
- OUT UINT16 *PortRange\r
- );\r
-\r
-/**\r
- Helper function called to transfer a string to an unsigned integer.\r
-\r
- @param[in] Str The pointer to the string.\r
- @param[out] Status The operation status.\r
-\r
- @return The integer value of a converted str.\r
-**/\r
-UINT64\r
-StrToUInteger (\r
- IN CONST CHAR16 *Str,\r
- OUT EFI_STATUS *Status\r
- );\r
-\r
-/**\r
- Helper function called to transfer a string to an unsigned integer according to the map table.\r
-\r
- @param[in] Str The pointer to the string.\r
- @param[in] Map The pointer to the map table.\r
-\r
- @return The integer value of converted str. If not found, then return -1.\r
-**/\r
-UINT32\r
-MapStringToInteger (\r
- IN CONST CHAR16 *Str,\r
- IN STR2INT *Map\r
- );\r
-\r
-/**\r
- Helper function called to transfer an unsigned integer to a string according to the map table.\r
-\r
- @param[in] Integer The pointer to the string.\r
- @param[in] Map The pointer to the map table.\r
-\r
- @return The converted str. If not found, then return NULL.\r
-**/\r
-CHAR16 *\r
-MapIntegerToString (\r
- IN UINT32 Integer,\r
- IN STR2INT *Map\r
- );\r
-\r
-#endif\r