]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcSupport.h
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Universal / Network / UefiPxeBcDxe / PxeBcSupport.h
CommitLineData
30368135 1/** @file\r
f737cfb9 2 Support routines for PxeBc.\r
d1102dba 3Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
e5eed7d3 4This program and the accompanying materials\r
30368135 5are licensed and made available under the terms and conditions of the BSD License\r
6which accompanies this distribution. The full text of the license may be found at\r
7http://opensource.org/licenses/bsd-license.php\r
8\r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11\r
f737cfb9 12**/\r
30368135 13\r
f737cfb9 14#ifndef __EFI_PXEBC_SUPPORT_H__\r
15#define __EFI_PXEBC_SUPPORT_H__\r
30368135 16\r
30368135 17\r
18/**\r
d1102dba 19 The common notify function associated with various PxeBc events.\r
30368135 20\r
f737cfb9 21 @param Event The event signaled.\r
22 @param Context The context.\r
30368135 23\r
30368135 24**/\r
25VOID\r
6d3ea23f 26EFIAPI\r
30368135 27PxeBcCommonNotify (\r
28 IN EFI_EVENT Event,\r
29 IN VOID *Context\r
d59b8b55 30 );\r
30368135 31\r
f737cfb9 32\r
33/**\r
34 This function initialize(or configure) the Udp4Write instance.\r
60de3c19 35\r
f737cfb9 36 @param Udp4 Pointer to the EFI_UDP4_PROTOCOL instance.\r
37 @param StationIp Pointer to the station ip address.\r
38 @param SubnetMask Pointer to the subnetmask of the station ip address.\r
39 @param Gateway Pointer to the gateway ip address.\r
40 @param SrcPort Pointer to the srouce port of the station.\r
d1102dba 41 @param Ttl The time to live field of the IP header.\r
60de3c19
FS
42 @param ToS The type of service field of the IP header.\r
43\r
f737cfb9 44 @retval EFI_SUCCESS The configuration settings were set, changed, or reset successfully.\r
45 @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,\r
46 RARP, etc.) is not finished yet.\r
47 @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE:\r
48 @retval EFI_ALREADY_STARTED The EFI UDPv4 Protocol instance is already started/configured\r
49 and must be stopped/reset before it can be reconfigured.\r
50 @retval EFI_ACCESS_DENIED UdpConfigData. AllowDuplicatePort is FALSE\r
51 and UdpConfigData.StationPort is already used by\r
52 other instance.\r
53 @retval EFI_OUT_OF_RESOURCES The EFI UDPv4 Protocol driver cannot allocate memory for this\r
54 EFI UDPv4 Protocol instance.\r
55 @retval EFI_DEVICE_ERROR An unexpected network or system error occurred and this instance\r
56 was not opened.\r
57 @retval Others Please examine the function Udp4->Routes(Udp4, FALSE, &mZeroIp4Addr, &mZeroIp4Addr, Gateway) returns.\r
60de3c19 58\r
f737cfb9 59**/\r
30368135 60EFI_STATUS\r
61PxeBcConfigureUdpWriteInstance (\r
62 IN EFI_UDP4_PROTOCOL *Udp4,\r
63 IN EFI_IPv4_ADDRESS *StationIp,\r
64 IN EFI_IPv4_ADDRESS *SubnetMask,\r
65 IN EFI_IPv4_ADDRESS *Gateway,\r
60de3c19 66 IN OUT UINT16 *SrcPort,\r
0a28d02d 67 IN UINT8 Ttl,\r
60de3c19 68 IN UINT8 ToS\r
30368135 69 );\r
52250844
JW
70\r
71\r
72/**\r
73 This function is to display the IPv4 address.\r
74\r
75 @param[in] Ip The pointer to the IPv4 address.\r
76\r
77**/\r
78VOID\r
79PxeBcShowIp4Addr (\r
80 IN EFI_IPv4_ADDRESS *Ip\r
81 );\r
d1102dba 82\r
52250844 83\r
f737cfb9 84/**\r
85 Convert number to ASCII value.\r
86\r
87 @param Number Numeric value to convert to decimal ASCII value.\r
81b07614 88 @param Buffer Buffer to place ASCII version of the Number.\r
f737cfb9 89 @param Length Length of Buffer.\r
90\r
f737cfb9 91**/\r
30368135 92VOID\r
93CvtNum (\r
94 IN UINTN Number,\r
95 IN UINT8 *Buffer,\r
f737cfb9 96 IN UINTN Length\r
30368135 97 );\r
98\r
99\r
100/**\r
f737cfb9 101 Convert unsigned int number to decimal number.\r
30368135 102\r
206b5f51
ZL
103 @param Number The unsigned int number will be converted.\r
104 @param Buffer Pointer to the buffer to store the decimal number after transform.\r
105 @param[in] BufferSize The maxsize of the buffer.\r
d1102dba 106\r
f737cfb9 107 @return the length of the number after transform.\r
30368135 108\r
109**/\r
110UINTN\r
111UtoA10 (\r
f737cfb9 112 IN UINTN Number,\r
206b5f51
ZL
113 IN CHAR8 *Buffer,\r
114 IN UINTN BufferSize\r
d1102dba 115\r
d59b8b55 116 );\r
30368135 117\r
118\r
119/**\r
f737cfb9 120 Convert ASCII numeric string to a UINTN value.\r
30368135 121\r
f737cfb9 122 @param Buffer Pointer to the 8-byte unsigned int value.\r
d59b8b55 123\r
f737cfb9 124 @return UINTN value of the ASCII string.\r
30368135 125\r
126**/\r
127UINT64\r
128AtoU64 (\r
f737cfb9 129 IN UINT8 *Buffer\r
d59b8b55 130 );\r
30368135 131\r
132\r
133#endif\r
134\r