]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcSupport.h
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Universal / Network / UefiPxeBcDxe / PxeBcSupport.h
1 /** @file
2 Support routines for PxeBc.
3 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
4 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 /**
19 The common notify function associated with various PxeBc events.
20
21 @param Event The event signaled.
22 @param Context The context.
23
24 **/
25 VOID
26 EFIAPI
27 PxeBcCommonNotify (
28 IN EFI_EVENT Event,
29 IN VOID *Context
30 );
31
32
33 /**
34 This function initialize(or configure) the Udp4Write instance.
35
36 @param Udp4 Pointer to the EFI_UDP4_PROTOCOL instance.
37 @param StationIp Pointer to the station ip address.
38 @param SubnetMask Pointer to the subnetmask of the station ip address.
39 @param Gateway Pointer to the gateway ip address.
40 @param SrcPort Pointer to the srouce port of the station.
41 @param Ttl The time to live field of the IP header.
42 @param ToS The type of service field of the IP header.
43
44 @retval EFI_SUCCESS The configuration settings were set, changed, or reset successfully.
45 @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
46 RARP, etc.) is not finished yet.
47 @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE:
48 @retval EFI_ALREADY_STARTED The EFI UDPv4 Protocol instance is already started/configured
49 and must be stopped/reset before it can be reconfigured.
50 @retval EFI_ACCESS_DENIED UdpConfigData. AllowDuplicatePort is FALSE
51 and UdpConfigData.StationPort is already used by
52 other instance.
53 @retval EFI_OUT_OF_RESOURCES The EFI UDPv4 Protocol driver cannot allocate memory for this
54 EFI UDPv4 Protocol instance.
55 @retval EFI_DEVICE_ERROR An unexpected network or system error occurred and this instance
56 was not opened.
57 @retval Others Please examine the function Udp4->Routes(Udp4, FALSE, &mZeroIp4Addr, &mZeroIp4Addr, Gateway) returns.
58
59 **/
60 EFI_STATUS
61 PxeBcConfigureUdpWriteInstance (
62 IN EFI_UDP4_PROTOCOL *Udp4,
63 IN EFI_IPv4_ADDRESS *StationIp,
64 IN EFI_IPv4_ADDRESS *SubnetMask,
65 IN EFI_IPv4_ADDRESS *Gateway,
66 IN OUT UINT16 *SrcPort,
67 IN UINT8 Ttl,
68 IN UINT8 ToS
69 );
70
71
72 /**
73 This function is to display the IPv4 address.
74
75 @param[in] Ip The pointer to the IPv4 address.
76
77 **/
78 VOID
79 PxeBcShowIp4Addr (
80 IN EFI_IPv4_ADDRESS *Ip
81 );
82
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 @param[in] BufferSize The maxsize of the buffer.
106
107 @return the length of the number after transform.
108
109 **/
110 UINTN
111 UtoA10 (
112 IN UINTN Number,
113 IN CHAR8 *Buffer,
114 IN UINTN BufferSize
115
116 );
117
118
119 /**
120 Convert ASCII numeric string to a UINTN value.
121
122 @param Buffer Pointer to the 8-byte unsigned int value.
123
124 @return UINTN value of the ASCII string.
125
126 **/
127 UINT64
128 AtoU64 (
129 IN UINT8 *Buffer
130 );
131
132
133 #endif
134