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