]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcSupport.h
Fix a bug for vlan ping failure.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / UefiPxeBcDxe / PxeBcSupport.h
CommitLineData
30368135 1/** @file\r
f737cfb9 2 Support routines for PxeBc.\r
57b301b5 3Copyright (c) 2007 - 2011, 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
f737cfb9 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
35 \r
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
41 \r
42 @retval EFI_SUCCESS The configuration settings were set, changed, or reset successfully.\r
43 @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,\r
44 RARP, etc.) is not finished yet.\r
45 @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE:\r
46 @retval EFI_ALREADY_STARTED The EFI UDPv4 Protocol instance is already started/configured\r
47 and must be stopped/reset before it can be reconfigured.\r
48 @retval EFI_ACCESS_DENIED UdpConfigData. AllowDuplicatePort is FALSE\r
49 and UdpConfigData.StationPort is already used by\r
50 other instance.\r
51 @retval EFI_OUT_OF_RESOURCES The EFI UDPv4 Protocol driver cannot allocate memory for this\r
52 EFI UDPv4 Protocol instance.\r
53 @retval EFI_DEVICE_ERROR An unexpected network or system error occurred and this instance\r
54 was not opened.\r
55 @retval Others Please examine the function Udp4->Routes(Udp4, FALSE, &mZeroIp4Addr, &mZeroIp4Addr, Gateway) returns.\r
56 \r
57**/\r
30368135 58EFI_STATUS\r
59PxeBcConfigureUdpWriteInstance (\r
60 IN EFI_UDP4_PROTOCOL *Udp4,\r
61 IN EFI_IPv4_ADDRESS *StationIp,\r
62 IN EFI_IPv4_ADDRESS *SubnetMask,\r
63 IN EFI_IPv4_ADDRESS *Gateway,\r
64 IN OUT UINT16 *SrcPort\r
65 );\r
f737cfb9 66/**\r
67 Convert number to ASCII value.\r
68\r
69 @param Number Numeric value to convert to decimal ASCII value.\r
81b07614 70 @param Buffer Buffer to place ASCII version of the Number.\r
f737cfb9 71 @param Length Length of Buffer.\r
72\r
f737cfb9 73**/\r
30368135 74VOID\r
75CvtNum (\r
76 IN UINTN Number,\r
77 IN UINT8 *Buffer,\r
f737cfb9 78 IN UINTN Length\r
30368135 79 );\r
80\r
81\r
82/**\r
f737cfb9 83 Convert unsigned int number to decimal number.\r
30368135 84\r
d59b8b55 85 @param Number The unsigned int number will be converted.\r
86 @param Buffer Pointer to the buffer to store the decimal number after transform.\r
30368135 87\r
f737cfb9 88 @return the length of the number after transform.\r
30368135 89\r
90**/\r
91UINTN\r
92UtoA10 (\r
f737cfb9 93 IN UINTN Number,\r
94 IN CHAR8 *Buffer\r
d59b8b55 95 );\r
30368135 96\r
97\r
98/**\r
f737cfb9 99 Convert ASCII numeric string to a UINTN value.\r
30368135 100\r
f737cfb9 101 @param Buffer Pointer to the 8-byte unsigned int value.\r
d59b8b55 102\r
f737cfb9 103 @return UINTN value of the ASCII string.\r
30368135 104\r
105**/\r
106UINT64\r
107AtoU64 (\r
f737cfb9 108 IN UINT8 *Buffer\r
d59b8b55 109 );\r
30368135 110\r
111\r
112#endif\r
113\r