]>
git.proxmox.com Git - mirror_edk2.git/blob - NetworkPkg/Application/IpsecConfig/Helper.h
2 The assistant function declaration for IpSecConfig application.
4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
13 #define FORMAT_NUMBER 0x1
14 #define FORMAT_STRING 0x2
17 Helper function called to change input parameter in string format to number.
19 @param[in] FlagStr The pointer to the flag string.
20 @param[in] Maximum most value number.
21 @param[in, out] ValuePtr The pointer to the input parameter in string format.
22 @param[in] ByteCount The valid byte count
23 @param[in] Map The pointer to the STR2INT table.
24 @param[in] ParamPackage The pointer to the ParamPackage list.
25 @param[in] FormatMask The bit mask.
26 BIT 0 set indicates the value of flag might be number.
27 BIT 1 set indicates the value of flag might be a string that needs to be looked up.
29 @retval EFI_SUCCESS The operation completed successfully.
30 @retval EFI_NOT_FOUND The input parameter can't be found.
31 @retval EFI_INVALID_PARAMETER The input parameter is an invalid input.
37 IN OUT VOID
*ValuePtr
,
40 IN LIST_ENTRY
*ParamPackage
,
45 Helper function called to convert a string containing an (Ipv4) Internet Protocol dotted address
46 into a proper address for the EFI_IP_ADDRESS structure.
48 @param[in] Ptr The pointer to the string containing an (Ipv4) Internet Protocol dotted address.
49 @param[out] Ip The pointer to the Ip address structure to contain the result.
51 @retval EFI_SUCCESS The operation completed successfully.
52 @retval EFI_INVALID_PARAMETER Invalid parameter.
57 OUT EFI_IP_ADDRESS
*Ip
61 Helper function called to calculate the prefix length associated with the string
62 containing an Ipv4 or Ipv6 Internet Protocol address.
64 @param[in] Ptr The pointer to the string containing an Ipv4 or Ipv6 Internet Protocol address.
65 @param[out] Addr The pointer to the EFI_IP_ADDRESS_INFO structure to contain the result.
67 @retval EFI_SUCCESS The operation completed successfully.
68 @retval EFI_INVALID_PARAMETER Invalid parameter.
69 @retval Others Other mistake case.
74 OUT EFI_IP_ADDRESS_INFO
*Addr
78 Helper function called to calculate the port range associated with the string.
80 @param[in] Ptr The pointer to the string containing a port and range.
81 @param[out] Port The pointer to the Port to contain the result.
82 @param[out] PortRange The pointer to the PortRange to contain the result.
84 @retval EFI_SUCCESS The operation completed successfully.
85 @retval EFI_INVALID_PARAMETER Invalid parameter.
86 @retval Others Other mistake case.
96 Helper function called to transfer a string to an unsigned integer.
98 @param[in] Str The pointer to the string.
99 @param[out] Status The operation status.
101 @return The integer value of a converted str.
105 IN CONST CHAR16
*Str
,
106 OUT EFI_STATUS
*Status
110 Helper function called to transfer a string to an unsigned integer according to the map table.
112 @param[in] Str The pointer to the string.
113 @param[in] Map The pointer to the map table.
115 @return The integer value of converted str. If not found, then return -1.
119 IN CONST CHAR16
*Str
,
124 Helper function called to transfer an unsigned integer to a string according to the map table.
126 @param[in] Integer The pointer to the string.
127 @param[in] Map The pointer to the map table.
129 @return The converted str. If not found, then return NULL.