]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Include/Protocol/PxeDhcp4.h
remove EFI 1.10 network stack.
[mirror_edk2.git] / MdeModulePkg / Include / Protocol / PxeDhcp4.h
1 /** @file
2 EFI PXE DHCPv4 protocol definition
3
4 Copyright (c) 2006 - 2008, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef _PXEDHCP4_H_
16 #define _PXEDHCP4_H_
17
18
19 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
20 //
21 // PXE DHCPv4 GUID definition
22 //
23
24 #define EFI_PXE_DHCP4_PROTOCOL_GUID \
25 { 0x03c4e624, 0xac28, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x29, 0x3f, 0xc1, 0x4d } }
26
27 //
28 // Interface definition
29 //
30 typedef struct _EFI_PXE_DHCP4_PROTOCOL EFI_PXE_DHCP4_PROTOCOL;
31
32 //
33 // Descriptions of the DHCP version 4 header and options can be found
34 // in RFC-2131 and RFC-2132 at www.ietf.org
35 //
36 #pragma pack(1)
37 typedef struct {
38
39 UINT8 op;
40 #define BOOTP_REQUEST 1
41 #define BOOTP_REPLY 2
42
43 UINT8 htype;
44
45 UINT8 hlen;
46
47 UINT8 hops;
48
49 UINT32 xid;
50
51 UINT16 secs;
52 #define DHCP4_INITIAL_SECONDS 4
53
54 UINT16 flags;
55 #define DHCP4_BROADCAST_FLAG 0x8000
56
57 UINT32 ciaddr;
58
59 UINT32 yiaddr;
60
61 UINT32 siaddr;
62
63 UINT32 giaddr;
64
65 UINT8 chaddr[16];
66
67 UINT8 sname[64];
68
69 UINT8 fname[128];
70
71 //
72 // This is the minimum option length as specified in RFC-2131.
73 // The packet must be padded out this far with DHCP4_PAD.
74 // DHCPv4 packets are usually 576 bytes in length. This length
75 // includes the IPv4 and UDPv4 headers but not the media header.
76 // Note: Not all DHCP relay agents will forward DHCPv4 packets
77 // if they are less than 384 bytes or exceed 576 bytes. Even if
78 // the underlying hardware can handle smaller and larger packets,
79 // many older relay agents will not accept them.
80 //
81 UINT32 magik;
82 #define DHCP4_MAGIK_NUMBER 0x63825363
83
84 UINT8 options[308];
85
86 } DHCP4_HEADER;
87 #pragma pack()
88
89 //
90 // DHCPv4 packet definition. Room for 576 bytes including IP and
91 // UDP header.
92 //
93 #define DHCP4_MAX_PACKET_SIZE 576
94 #define DHCP4_UDP_HEADER_SIZE 8
95 #define DHCP4_IP_HEADER_SIZE 20
96
97 #pragma pack(1)
98 typedef union _DHCP4_PACKET {
99 UINT32 _force_data_alignment;
100
101 UINT8 raw[1500];
102
103 DHCP4_HEADER dhcp4;
104 } DHCP4_PACKET;
105 #pragma pack()
106
107 #define DHCP4_SERVER_PORT 67
108 #define DHCP4_CLIENT_PORT 68
109
110 //
111 // DHCPv4 and PXE option numbers.
112 //
113 #define DHCP4_PAD 0
114 #define DHCP4_END 255
115 #define DHCP4_SUBNET_MASK 1
116 #define DHCP4_TIME_OFFSET 2
117 #define DHCP4_ROUTER_LIST 3
118 #define DHCP4_TIME_SERVERS 4
119 #define DHCP4_NAME_SERVERS 5
120 #define DHCP4_DNS_SERVERS 6
121 #define DHCP4_LOG_SERVERS 7
122 #define DHCP4_COOKIE_SERVERS 8
123 #define DHCP4_LPR_SREVERS 9
124 #define DHCP4_IMPRESS_SERVERS 10
125 #define DHCP4_RESOURCE_LOCATION_SERVERS 11
126 #define DHCP4_HOST_NAME 12
127 #define DHCP4_BOOT_FILE_SIZE 13
128 #define DHCP4_DUMP_FILE 14
129 #define DHCP4_DOMAIN_NAME 15
130 #define DHCP4_SWAP_SERVER 16
131 #define DHCP4_ROOT_PATH 17
132 #define DHCP4_EXTENSION_PATH 18
133 #define DHCP4_IP_FORWARDING 19
134 #define DHCP4_NON_LOCAL_SOURCE_ROUTE 20
135 #define DHCP4_POLICY_FILTER 21
136 #define DHCP4_MAX_DATAGRAM_SIZE 22
137 #define DHCP4_DEFAULT_TTL 23
138 #define DHCP4_MTU_AGING_TIMEOUT 24
139 #define DHCP4_MTU_SIZES 25
140 #define DHCP4_MTU_TO_USE 26
141 #define DHCP4_ALL_SUBNETS_LOCAL 27
142 #define DHCP4_BROADCAST_ADDRESS 28
143 #define DHCP4_PERFORM_MASK_DISCOVERY 29
144 #define DHCP4_RESPOND_TO_MASK_REQ 30
145 #define DHCP4_PERFORM_ROUTER_DISCOVERY 31
146 #define DHCP4_ROUTER_SOLICIT_ADDRESS 32
147 #define DHCP4_STATIC_ROUTER_LIST 33
148 #define DHCP4_USE_ARP_TRAILERS 34
149 #define DHCP4_ARP_CACHE_TIMEOUT 35
150 #define DHCP4_ETHERNET_ENCAPSULATION 36
151 #define DHCP4_TCP_DEFAULT_TTL 37
152 #define DHCP4_TCP_KEEP_ALIVE_INT 38
153 #define DHCP4_KEEP_ALIVE_GARBAGE 39
154 #define DHCP4_NIS_DOMAIN_NAME 40
155 #define DHCP4_NIS_SERVERS 41
156 #define DHCP4_NTP_SERVERS 42
157 #define DHCP4_VENDOR_SPECIFIC 43
158 #define PXE_MTFTP_IP 1
159 #define PXE_MTFTP_CPORT 2
160 #define PXE_MTFTP_SPORT 3
161 #define PXE_MTFTP_TMOUT 4
162 #define PXE_MTFTP_DELAY 5
163 #define PXE_DISCOVERY_CONTROL 6
164 #define PXE_DISABLE_BROADCAST_DISCOVERY 0x01
165 #define PXE_DISABLE_MULTICAST_DISCOVERY 0x02
166 #define PXE_ACCEPT_ONLY_PXE_BOOT_SERVERS 0x04
167 #define PXE_DO_NOT_PROMPT 0x08
168 #define PXE_DISCOVERY_MCAST_ADDR 7
169 #define PXE_BOOT_SERVERS 8
170 #define PXE_BOOT_MENU 9
171 #define PXE_BOOT_PROMPT 10
172 #define PXE_MCAST_ADDRS_ALLOC 11
173 #define PXE_CREDENTIAL_TYPES 12
174 #define PXE_BOOT_ITEM 71
175 #define DHCP4_NBNS_SERVERS 44
176 #define DHCP4_NBDD_SERVERS 45
177 #define DHCP4_NETBIOS_NODE_TYPE 46
178 #define DHCP4_NETBIOS_SCOPE 47
179 #define DHCP4_XWINDOW_SYSTEM_FONT_SERVERS 48
180 #define DHCP4_XWINDOW_SYSTEM_DISPLAY_MANAGERS 49
181 #define DHCP4_REQUESTED_IP_ADDRESS 50
182 #define DHCP4_LEASE_TIME 51
183 #define DHCP4_OPTION_OVERLOAD 52
184 #define DHCP4_OVERLOAD_FNAME 1
185 #define DHCP4_OVERLOAD_SNAME 2
186 #define DHCP4_OVERLOAD_FNAME_AND_SNAME 3
187 #define DHCP4_MESSAGE_TYPE 53
188 #define DHCP4_MESSAGE_TYPE_DISCOVER 1
189 #define DHCP4_MESSAGE_TYPE_OFFER 2
190 #define DHCP4_MESSAGE_TYPE_REQUEST 3
191 #define DHCP4_MESSAGE_TYPE_DECLINE 4
192 #define DHCP4_MESSAGE_TYPE_ACK 5
193 #define DHCP4_MESSAGE_TYPE_NAK 6
194 #define DHCP4_MESSAGE_TYPE_RELEASE 7
195 #define DHCP4_MESSAGE_TYPE_INFORM 8
196 #define DHCP4_SERVER_IDENTIFIER 54
197 #define DHCP4_PARAMETER_REQUEST_LIST 55
198 #define DHCP4_ERROR_MESSAGE 56
199 #define DHCP4_MAX_MESSAGE_SIZE 57
200 #define DHCP4_DEFAULT_MAX_MESSAGE_SIZE 576
201 #define DHCP4_RENEWAL_TIME 58
202 #define DHCP4_REBINDING_TIME 59
203 #define DHCP4_CLASS_IDENTIFIER 60
204 #define DHCP4_CLIENT_IDENTIFIER 61
205 #define DHCP4_NISPLUS_DOMAIN_NAME 64
206 #define DHCP4_NISPLUS_SERVERS 65
207 #define DHCP4_TFTP_SERVER_NAME 66
208 #define DHCP4_BOOTFILE 67
209 #define DHCP4_MOBILE_IP_HOME_AGENTS 68
210 #define DHCP4_SMPT_SERVERS 69
211 #define DHCP4_POP3_SERVERS 70
212 #define DHCP4_NNTP_SERVERS 71
213 #define DHCP4_WWW_SERVERS 72
214 #define DHCP4_FINGER_SERVERS 73
215 #define DHCP4_IRC_SERVERS 74
216 #define DHCP4_STREET_TALK_SERVERS 75
217 #define DHCP4_STREET_TALK_DIR_ASSIST_SERVERS 76
218 #define DHCP4_NDS_SERVERS 85
219 #define DHCP4_NDS_TREE_NAME 86
220 #define DHCP4_NDS_CONTEXT 87
221 #define DHCP4_SYSTEM_ARCHITECTURE 93
222 #define DHCP4_NETWORK_ARCHITECTURE 94
223 #define DHCP4_PLATFORM_ID 97
224
225 #pragma pack(1)
226 typedef struct {
227 UINT8 op;
228 UINT8 len;
229 UINT8 data[1];
230 } DHCP4_OP;
231 #pragma pack()
232
233
234 typedef struct {
235 DHCP4_PACKET Discover;
236 DHCP4_PACKET Offer;
237 DHCP4_PACKET Request;
238 DHCP4_PACKET AckNak;
239 BOOLEAN SetupCompleted;
240 BOOLEAN InitCompleted;
241 BOOLEAN SelectCompleted;
242 BOOLEAN IsBootp;
243 BOOLEAN IsAck;
244 } EFI_PXE_DHCP4_DATA;
245
246 typedef
247 EFI_STATUS
248 (EFIAPI *EFI_PXE_DHCP4_RUN)(
249 IN EFI_PXE_DHCP4_PROTOCOL *This,
250 IN OPTIONAL UINTN OpLen,
251 IN OPTIONAL VOID *OpList
252 );
253
254 typedef
255 EFI_STATUS
256 (EFIAPI *EFI_PXE_DHCP4_SETUP)(
257 IN EFI_PXE_DHCP4_PROTOCOL *This,
258 IN OPTIONAL EFI_PXE_DHCP4_DATA * NewData
259 );
260
261 typedef
262 EFI_STATUS
263 (EFIAPI *EFI_PXE_DHCP4_INIT)(
264 IN EFI_PXE_DHCP4_PROTOCOL *This,
265 IN UINTN SecondsTimeout,
266 OUT UINTN *Offers,
267 OUT DHCP4_PACKET **OfferList
268 );
269
270 #define DHCP4_MIN_SECONDS 1
271 #define DHCP4_MAX_SECONDS 60
272
273 typedef
274 EFI_STATUS
275 (EFIAPI *EFI_PXE_DHCP4_SELECT)(
276 IN EFI_PXE_DHCP4_PROTOCOL *This,
277 IN UINTN SecondsTimeout,
278 IN DHCP4_PACKET * offer
279 );
280
281 typedef
282 EFI_STATUS
283 (EFIAPI *EFI_PXE_DHCP4_RENEW)(
284 IN EFI_PXE_DHCP4_PROTOCOL *This,
285 UINTN seconds_timeout
286 );
287
288 typedef
289 EFI_STATUS
290 (EFIAPI *EFI_PXE_DHCP4_REBIND)(
291 IN EFI_PXE_DHCP4_PROTOCOL *This,
292 UINTN seconds_timeout
293 );
294
295 typedef
296 EFI_STATUS
297 (EFIAPI *EFI_PXE_DHCP4_RELEASE)(
298 IN EFI_PXE_DHCP4_PROTOCOL * This
299 );
300
301 #define EFI_PXE_DHCP4_PROTOCOL_REVISION 0x00010000
302
303 struct _EFI_PXE_DHCP4_PROTOCOL {
304 UINT64 Revision;
305 EFI_PXE_DHCP4_RUN Run;
306 EFI_PXE_DHCP4_SETUP Setup;
307 EFI_PXE_DHCP4_INIT Init;
308 EFI_PXE_DHCP4_SELECT Select;
309 EFI_PXE_DHCP4_RENEW Renew;
310 EFI_PXE_DHCP4_REBIND Rebind;
311 EFI_PXE_DHCP4_RELEASE Release;
312 EFI_PXE_DHCP4_DATA *Data;
313 };
314
315 extern EFI_GUID gEfiPxeDhcp4ProtocolGuid;
316
317 #endif