]>
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 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 #define FORMAT_NUMBER 0x1
20 #define FORMAT_STRING 0x2
23 Helper function called to change input parameter in string format to number.
25 @param[in] FlagStr The pointer to the flag string.
26 @param[in] Maximum most value number.
27 @param[in, out] ValuePtr The pointer to the input parameter in string format.
28 @param[in] ByteCount The valid byte count
29 @param[in] Map The pointer to the STR2INT table.
30 @param[in] ParamPackage The pointer to the ParamPackage list.
31 @param[in] FormatMask The bit mask.
32 BIT 0 set indicates the value of flag might be number.
33 BIT 1 set indicates the value of flag might be a string that needs to be looked up.
35 @retval EFI_SUCCESS The operation completed successfully.
36 @retval EFI_NOT_FOUND The input parameter can't be found.
37 @retval EFI_INVALID_PARAMETER The input parameter is an invalid input.
43 IN OUT VOID
*ValuePtr
,
46 IN LIST_ENTRY
*ParamPackage
,
51 Helper function called to convert a string containing an (Ipv4) Internet Protocol dotted address
52 into a proper address for the EFI_IP_ADDRESS structure.
54 @param[in] Ptr The pointer to the string containing an (Ipv4) Internet Protocol dotted address.
55 @param[out] Ip The pointer to the Ip address structure to contain the result.
57 @retval EFI_SUCCESS The operation completed successfully.
58 @retval EFI_INVALID_PARAMETER Invalid parameter.
63 OUT EFI_IP_ADDRESS
*Ip
67 Helper function called to calculate the prefix length associated with the string
68 containing an Ipv4 or Ipv6 Internet Protocol address.
70 @param[in] Ptr The pointer to the string containing an Ipv4 or Ipv6 Internet Protocol address.
71 @param[out] Addr The pointer to the EFI_IP_ADDRESS_INFO structure to contain the result.
73 @retval EFI_SUCCESS The operation completed successfully.
74 @retval EFI_INVALID_PARAMETER Invalid parameter.
75 @retval Others Other mistake case.
80 OUT EFI_IP_ADDRESS_INFO
*Addr
84 Helper function called to calculate the port range associated with the string.
86 @param[in] Ptr The pointer to the string containing a port and range.
87 @param[out] Port The pointer to the Port to contain the result.
88 @param[out] PortRange The pointer to the PortRange to contain the result.
90 @retval EFI_SUCCESS The operation completed successfully.
91 @retval EFI_INVALID_PARAMETER Invalid parameter.
92 @retval Others Other mistake case.
102 Helper function called to transfer a string to an unsigned integer.
104 @param[in] Str The pointer to the string.
105 @param[out] Status The operation status.
107 @return The integer value of a converted str.
111 IN CONST CHAR16
*Str
,
112 OUT EFI_STATUS
*Status
116 Helper function called to transfer a string to an unsigned integer according to the map table.
118 @param[in] Str The pointer to the string.
119 @param[in] Map The pointer to the map table.
121 @return The integer value of converted str. If not found, then return -1.
125 IN CONST CHAR16
*Str
,
130 Helper function called to transfer an unsigned integer to a string according to the map table.
132 @param[in] Integer The pointer to the string.
133 @param[in] Map The pointer to the map table.
135 @return The converted str. If not found, then return NULL.