]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Efi/Protocol/Dhcp4/Dhcp4.h
Update the copyright notice format
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Efi / Protocol / Dhcp4 / Dhcp4.h
1 /*++
2
3 Copyright (c) 2006, 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 Module Name:
13
14 Dhcp4.h
15
16 Abstract:
17
18 UEFI Dynamic Host Configuration Protocol 4 Definition
19
20 --*/
21
22 #ifndef _DHCP4_H_
23 #define _DHCP4_H_
24
25 #include EFI_PROTOCOL_DEFINITION (ServiceBinding)
26 #include EFI_PROTOCOL_DEFINITION (Udp4)
27
28 //GUID definitions
29 #define EFI_DHCP4_PROTOCOL_GUID \
30 {0x8a219718, 0x4ef5, 0x4761, {0x91, 0xc8, 0xc0, 0xf0, 0x4b, 0xda, 0x9e, 0x56}}
31
32 #define EFI_DHCP4_SERVICE_BINDING_PROTOCOL_GUID \
33 {0x9d9a39d8, 0xbd42, 0x4a73, {0xa4, 0xd5, 0x8e, 0xe9, 0x4b, 0xe1, 0x13, 0x80}}
34
35 extern EFI_GUID gEfiDhcp4ProtocolGuid;
36 extern EFI_GUID gEfiDhcp4ServiceBindingProtocolGuid;
37
38 EFI_FORWARD_DECLARATION (EFI_DHCP4_PROTOCOL);
39
40 #pragma pack(1)
41 typedef struct {
42 UINT8 OpCode;
43 UINT8 Length;
44 UINT8 Data[1];
45 } EFI_DHCP4_PACKET_OPTION;
46
47 typedef struct{
48 UINT8 OpCode;
49 UINT8 HwType;
50 UINT8 HwAddrLen;
51 UINT8 Hops;
52 UINT32 Xid;
53 UINT16 Seconds;
54 UINT16 Reserved;
55 EFI_IPv4_ADDRESS ClientAddr;
56 EFI_IPv4_ADDRESS YourAddr;
57 EFI_IPv4_ADDRESS ServerAddr;
58 EFI_IPv4_ADDRESS GwAddr;
59 UINT8 ClientHwAddr[16];
60 CHAR8 ServerName[64];
61 CHAR8 BootFileName[128];
62 }EFI_DHCP4_HEADER;
63
64 typedef struct {
65 UINT32 Size;
66 UINT32 Length;
67 struct {
68 EFI_DHCP4_HEADER Header;
69 UINT32 Magik;
70 UINT8 Option[1];
71 } Dhcp4;
72 } EFI_DHCP4_PACKET;
73 #pragma pack()
74
75 typedef enum {
76 Dhcp4Stopped = 0x0,
77 Dhcp4Init = 0x1,
78 Dhcp4Selecting = 0x2,
79 Dhcp4Requesting = 0x3,
80 Dhcp4Bound = 0x4,
81 Dhcp4Renewing = 0x5,
82 Dhcp4Rebinding = 0x6,
83 Dhcp4InitReboot = 0x7,
84 Dhcp4Rebooting = 0x8
85 } EFI_DHCP4_STATE;
86
87 typedef enum{
88 Dhcp4SendDiscover = 0x01,
89 Dhcp4RcvdOffer = 0x02,
90 Dhcp4SelectOffer = 0x03,
91 Dhcp4SendRequest = 0x04,
92 Dhcp4RcvdAck = 0x05,
93 Dhcp4RcvdNak = 0x06,
94 Dhcp4SendDecline = 0x07,
95 Dhcp4BoundCompleted = 0x08,
96 Dhcp4EnterRenewing = 0x09,
97 Dhcp4EnterRebinding = 0x0a,
98 Dhcp4AddressLost = 0x0b,
99 Dhcp4Fail = 0x0c
100 } EFI_DHCP4_EVENT;
101
102 typedef EFI_STATUS (*EFI_DHCP4_CALLBACK) (
103 IN EFI_DHCP4_PROTOCOL *This,
104 IN VOID *Context,
105 IN EFI_DHCP4_STATE CurrentState,
106 IN EFI_DHCP4_EVENT Dhcp4Event,
107 IN EFI_DHCP4_PACKET *Packet OPTIONAL,
108 OUT EFI_DHCP4_PACKET **NewPacket OPTIONAL
109 );
110
111 typedef struct {
112 UINT32 DiscoverTryCount;
113 UINT32 *DiscoverTimeout;
114 UINT32 RequestTryCount;
115 UINT32 *RequestTimeout;
116 EFI_IPv4_ADDRESS ClientAddress;
117 EFI_DHCP4_CALLBACK Dhcp4Callback;
118 VOID *CallbackContext;
119 UINT32 OptionCount;
120 EFI_DHCP4_PACKET_OPTION **OptionList;
121 }EFI_DHCP4_CONFIG_DATA;
122
123 typedef struct {
124 EFI_DHCP4_STATE State;
125 EFI_DHCP4_CONFIG_DATA ConfigData;
126 EFI_IPv4_ADDRESS ClientAddress;
127 EFI_MAC_ADDRESS ClientMacAddress;
128 EFI_IPv4_ADDRESS ServerAddress;
129 EFI_IPv4_ADDRESS RouterAddress;
130 EFI_IPv4_ADDRESS SubnetMask;
131 UINT32 LeaseTime;
132 EFI_DHCP4_PACKET *ReplyPacket;
133 } EFI_DHCP4_MODE_DATA;
134
135 typedef struct {
136 EFI_IPv4_ADDRESS ListenAddress;
137 EFI_IPv4_ADDRESS SubnetMask;
138 UINT16 ListenPort;
139 } EFI_DHCP4_LISTEN_POINT;
140
141 typedef struct {
142 EFI_STATUS Status;
143 EFI_EVENT CompletionEvent;
144 EFI_IPv4_ADDRESS RemoteAddress;
145 UINT16 RemotePort;
146 EFI_IPv4_ADDRESS GatewayAddress;
147 UINT32 ListenPointCount;
148 EFI_DHCP4_LISTEN_POINT *ListenPoints;
149 UINT32 TimeoutValue;
150 EFI_DHCP4_PACKET *Packet;
151 UINT32 ResponseCount;
152 EFI_DHCP4_PACKET *ResponseList;
153 } EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN;
154
155 typedef
156 EFI_STATUS
157 (EFIAPI *EFI_DHCP4_GET_MODE_DATA) (
158 IN EFI_DHCP4_PROTOCOL *This,
159 OUT EFI_DHCP4_MODE_DATA *Dhcp4ModeData
160 );
161
162 typedef
163 EFI_STATUS
164 (EFIAPI *EFI_DHCP4_CONFIGURE) (
165 IN EFI_DHCP4_PROTOCOL *This,
166 IN EFI_DHCP4_CONFIG_DATA *Dhcp4CfgData OPTIONAL
167 );
168
169
170 typedef EFI_STATUS
171 (EFIAPI *EFI_DHCP4_START) (
172 IN EFI_DHCP4_PROTOCOL *This,
173 IN EFI_EVENT CompletionEvent OPTIONAL
174 );
175
176 typedef
177 EFI_STATUS
178 (EFIAPI *EFI_DHCP4_RENEW_REBIND) (
179 IN EFI_DHCP4_PROTOCOL *This,
180 IN BOOLEAN RebindRequest,
181 IN EFI_EVENT CompletionEvent OPTIONAL
182 );
183
184 typedef
185 EFI_STATUS
186 (EFIAPI *EFI_DHCP4_RELEASE) (
187 IN EFI_DHCP4_PROTOCOL *This
188 );
189
190 typedef EFI_STATUS
191 (EFIAPI *EFI_DHCP4_STOP) (
192 IN EFI_DHCP4_PROTOCOL *This
193 );
194
195 typedef
196 EFI_STATUS
197 (EFIAPI *EFI_DHCP4_BUILD) (
198 IN EFI_DHCP4_PROTOCOL *This,
199 IN EFI_DHCP4_PACKET *SeedPacket,
200 IN UINT32 DeleteCount,
201 IN UINT8 *DeleteList OPTIONAL,
202 IN UINT32 AppendCount,
203 IN EFI_DHCP4_PACKET_OPTION *AppendList[] OPTIONAL,
204 OUT EFI_DHCP4_PACKET **NewPacket
205 );
206
207 typedef
208 EFI_STATUS
209 (EFIAPI *EFI_DHCP4_TRANSMIT_RECEIVE) (
210 IN EFI_DHCP4_PROTOCOL *This,
211 IN EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN *Token
212 );
213
214 typedef
215 EFI_STATUS
216 (EFIAPI *EFI_DHCP4_PARSE) (
217 IN EFI_DHCP4_PROTOCOL *This,
218 IN EFI_DHCP4_PACKET *Packet,
219 IN OUT UINT32 *OptionCount,
220 OUT EFI_DHCP4_PACKET_OPTION *PacketOptionList[] OPTIONAL
221 );
222
223 struct _EFI_DHCP4_PROTOCOL {
224 EFI_DHCP4_GET_MODE_DATA GetModeData;
225 EFI_DHCP4_CONFIGURE Configure;
226 EFI_DHCP4_START Start;
227 EFI_DHCP4_RENEW_REBIND RenewRebind;
228 EFI_DHCP4_RELEASE Release;
229 EFI_DHCP4_STOP Stop;
230 EFI_DHCP4_BUILD Build;
231 EFI_DHCP4_TRANSMIT_RECEIVE TransmitReceive;
232 EFI_DHCP4_PARSE Parse;
233 };
234
235 #endif