3 Copyright (c) 2006, Intel Corporation
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
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.
16 EFI PXE DHCPv4 protocol definition
24 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
26 // PXE DHCPv4 GUID definition
29 #define EFI_PXE_DHCP4_PROTOCOL_GUID \
30 { 0x03c4e624, 0xac28, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x29, 0x3f, 0xc1, 0x4d } }
32 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
34 // Interface definition
37 typedef struct _EFI_PXE_DHCP4_PROTOCOL EFI_PXE_DHCP4_PROTOCOL
;
39 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
41 // Descriptions of the DHCP version 4 header and options can be found
42 // in RFC-2131 and RFC-2132 at www.ietf.org
49 #define BOOTP_REQUEST 1
61 #define DHCP4_INITIAL_SECONDS 4
64 #define DHCP4_BROADCAST_FLAG 0x8000
81 // This is the minimum option length as specified in RFC-2131.
82 // The packet must be padded out this far with DHCP4_PAD.
83 // DHCPv4 packets are usually 576 bytes in length. This length
84 // includes the IPv4 and UDPv4 headers but not the media header.
85 // Note: Not all DHCP relay agents will forward DHCPv4 packets
86 // if they are less than 384 bytes or exceed 576 bytes. Even if
87 // the underlying hardware can handle smaller and larger packets,
88 // many older relay agents will not accept them.
91 #define DHCP4_MAGIK_NUMBER 0x63825363
98 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
100 // DHCPv4 packet definition. Room for 576 bytes including IP and
104 #define DHCP4_MAX_PACKET_SIZE 576
105 #define DHCP4_UDP_HEADER_SIZE 8
106 #define DHCP4_IP_HEADER_SIZE 20
109 typedef union _DHCP4_PACKET
{
110 UINT32 _force_data_alignment
;
118 #define DHCP4_SERVER_PORT 67
119 #define DHCP4_CLIENT_PORT 68
121 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
123 // DHCPv4 and PXE option numbers.
127 #define DHCP4_END 255
128 #define DHCP4_SUBNET_MASK 1
129 #define DHCP4_TIME_OFFSET 2
130 #define DHCP4_ROUTER_LIST 3
131 #define DHCP4_TIME_SERVERS 4
132 #define DHCP4_NAME_SERVERS 5
133 #define DHCP4_DNS_SERVERS 6
134 #define DHCP4_LOG_SERVERS 7
135 #define DHCP4_COOKIE_SERVERS 8
136 #define DHCP4_LPR_SREVERS 9
137 #define DHCP4_IMPRESS_SERVERS 10
138 #define DHCP4_RESOURCE_LOCATION_SERVERS 11
139 #define DHCP4_HOST_NAME 12
140 #define DHCP4_BOOT_FILE_SIZE 13
141 #define DHCP4_DUMP_FILE 14
142 #define DHCP4_DOMAIN_NAME 15
143 #define DHCP4_SWAP_SERVER 16
144 #define DHCP4_ROOT_PATH 17
145 #define DHCP4_EXTENSION_PATH 18
146 #define DHCP4_IP_FORWARDING 19
147 #define DHCP4_NON_LOCAL_SOURCE_ROUTE 20
148 #define DHCP4_POLICY_FILTER 21
149 #define DHCP4_MAX_DATAGRAM_SIZE 22
150 #define DHCP4_DEFAULT_TTL 23
151 #define DHCP4_MTU_AGING_TIMEOUT 24
152 #define DHCP4_MTU_SIZES 25
153 #define DHCP4_MTU_TO_USE 26
154 #define DHCP4_ALL_SUBNETS_LOCAL 27
155 #define DHCP4_BROADCAST_ADDRESS 28
156 #define DHCP4_PERFORM_MASK_DISCOVERY 29
157 #define DHCP4_RESPOND_TO_MASK_REQ 30
158 #define DHCP4_PERFORM_ROUTER_DISCOVERY 31
159 #define DHCP4_ROUTER_SOLICIT_ADDRESS 32
160 #define DHCP4_STATIC_ROUTER_LIST 33
161 #define DHCP4_USE_ARP_TRAILERS 34
162 #define DHCP4_ARP_CACHE_TIMEOUT 35
163 #define DHCP4_ETHERNET_ENCAPSULATION 36
164 #define DHCP4_TCP_DEFAULT_TTL 37
165 #define DHCP4_TCP_KEEP_ALIVE_INT 38
166 #define DHCP4_KEEP_ALIVE_GARBAGE 39
167 #define DHCP4_NIS_DOMAIN_NAME 40
168 #define DHCP4_NIS_SERVERS 41
169 #define DHCP4_NTP_SERVERS 42
170 #define DHCP4_VENDOR_SPECIFIC 43
171 # define PXE_MTFTP_IP 1
172 # define PXE_MTFTP_CPORT 2
173 # define PXE_MTFTP_SPORT 3
174 # define PXE_MTFTP_TMOUT 4
175 # define PXE_MTFTP_DELAY 5
176 # define PXE_DISCOVERY_CONTROL 6
177 # define PXE_DISABLE_BROADCAST_DISCOVERY 0x01
178 # define PXE_DISABLE_MULTICAST_DISCOVERY 0x02
179 # define PXE_ACCEPT_ONLY_PXE_BOOT_SERVERS 0x04
180 # define PXE_DO_NOT_PROMPT 0x08
181 # define PXE_DISCOVERY_MCAST_ADDR 7
182 # define PXE_BOOT_SERVERS 8
183 # define PXE_BOOT_MENU 9
184 # define PXE_BOOT_PROMPT 10
185 # define PXE_MCAST_ADDRS_ALLOC 11
186 # define PXE_CREDENTIAL_TYPES 12
187 # define PXE_BOOT_ITEM 71
188 #define DHCP4_NBNS_SERVERS 44
189 #define DHCP4_NBDD_SERVERS 45
190 #define DHCP4_NETBIOS_NODE_TYPE 46
191 #define DHCP4_NETBIOS_SCOPE 47
192 #define DHCP4_XWINDOW_SYSTEM_FONT_SERVERS 48
193 #define DHCP4_XWINDOW_SYSTEM_DISPLAY_MANAGERS 49
194 #define DHCP4_REQUESTED_IP_ADDRESS 50
195 #define DHCP4_LEASE_TIME 51
196 #define DHCP4_OPTION_OVERLOAD 52
197 # define DHCP4_OVERLOAD_FNAME 1
198 # define DHCP4_OVERLOAD_SNAME 2
199 # define DHCP4_OVERLOAD_FNAME_AND_SNAME 3
200 #define DHCP4_MESSAGE_TYPE 53
201 # define DHCP4_MESSAGE_TYPE_DISCOVER 1
202 # define DHCP4_MESSAGE_TYPE_OFFER 2
203 # define DHCP4_MESSAGE_TYPE_REQUEST 3
204 # define DHCP4_MESSAGE_TYPE_DECLINE 4
205 # define DHCP4_MESSAGE_TYPE_ACK 5
206 # define DHCP4_MESSAGE_TYPE_NAK 6
207 # define DHCP4_MESSAGE_TYPE_RELEASE 7
208 # define DHCP4_MESSAGE_TYPE_INFORM 8
209 #define DHCP4_SERVER_IDENTIFIER 54
210 #define DHCP4_PARAMETER_REQUEST_LIST 55
211 #define DHCP4_ERROR_MESSAGE 56
212 #define DHCP4_MAX_MESSAGE_SIZE 57
213 # define DHCP4_DEFAULT_MAX_MESSAGE_SIZE 576
214 #define DHCP4_RENEWAL_TIME 58
215 #define DHCP4_REBINDING_TIME 59
216 #define DHCP4_CLASS_IDENTIFIER 60
217 #define DHCP4_CLIENT_IDENTIFIER 61
218 #define DHCP4_NISPLUS_DOMAIN_NAME 64
219 #define DHCP4_NISPLUS_SERVERS 65
220 #define DHCP4_TFTP_SERVER_NAME 66
221 #define DHCP4_BOOTFILE 67
222 #define DHCP4_MOBILE_IP_HOME_AGENTS 68
223 #define DHCP4_SMPT_SERVERS 69
224 #define DHCP4_POP3_SERVERS 70
225 #define DHCP4_NNTP_SERVERS 71
226 #define DHCP4_WWW_SERVERS 72
227 #define DHCP4_FINGER_SERVERS 73
228 #define DHCP4_IRC_SERVERS 74
229 #define DHCP4_STREET_TALK_SERVERS 75
230 #define DHCP4_STREET_TALK_DIR_ASSIST_SERVERS 76
231 #define DHCP4_NDS_SERVERS 85
232 #define DHCP4_NDS_TREE_NAME 86
233 #define DHCP4_NDS_CONTEXT 87
234 #define DHCP4_SYSTEM_ARCHITECTURE 93
235 #define DHCP4_NETWORK_ARCHITECTURE 94
236 #define DHCP4_PLATFORM_ID 97
238 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
240 // DHCP4 option format.
251 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
254 DHCP4_PACKET Discover
;
256 DHCP4_PACKET Request
;
258 BOOLEAN SetupCompleted
;
259 BOOLEAN InitCompleted
;
260 BOOLEAN SelectCompleted
;
263 } EFI_PXE_DHCP4_DATA
;
265 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
268 (EFIAPI
*EFI_PXE_DHCP4_RUN
) (
269 IN EFI_PXE_DHCP4_PROTOCOL
*This
,
270 IN OPTIONAL UINTN OpLen
,
271 IN OPTIONAL VOID
*OpList
274 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
277 (EFIAPI
*EFI_PXE_DHCP4_SETUP
) (
278 IN EFI_PXE_DHCP4_PROTOCOL
*This
,
279 IN OPTIONAL EFI_PXE_DHCP4_DATA
* NewData
282 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
285 (EFIAPI
*EFI_PXE_DHCP4_INIT
) (
286 IN EFI_PXE_DHCP4_PROTOCOL
*This
,
287 IN UINTN SecondsTimeout
,
289 OUT DHCP4_PACKET
**OfferList
292 #define DHCP4_MIN_SECONDS 1
293 #define DHCP4_MAX_SECONDS 60
295 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
298 (EFIAPI
*EFI_PXE_DHCP4_SELECT
) (
299 IN EFI_PXE_DHCP4_PROTOCOL
*This
,
300 IN UINTN SecondsTimeout
,
301 IN DHCP4_PACKET
* offer
304 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
307 (EFIAPI
*EFI_PXE_DHCP4_RENEW
) (
308 IN EFI_PXE_DHCP4_PROTOCOL
*This
,
309 UINTN seconds_timeout
312 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
315 (EFIAPI
*EFI_PXE_DHCP4_REBIND
) (
316 IN EFI_PXE_DHCP4_PROTOCOL
*This
,
317 UINTN seconds_timeout
320 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
323 (EFIAPI
*EFI_PXE_DHCP4_RELEASE
) (
324 IN EFI_PXE_DHCP4_PROTOCOL
* This
327 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
329 #define EFI_PXE_DHCP4_PROTOCOL_REVISION 0x00010000
331 struct _EFI_PXE_DHCP4_PROTOCOL
{
333 EFI_PXE_DHCP4_RUN Run
;
334 EFI_PXE_DHCP4_SETUP Setup
;
335 EFI_PXE_DHCP4_INIT Init
;
336 EFI_PXE_DHCP4_SELECT Select
;
337 EFI_PXE_DHCP4_RENEW Renew
;
338 EFI_PXE_DHCP4_REBIND Rebind
;
339 EFI_PXE_DHCP4_RELEASE Release
;
340 EFI_PXE_DHCP4_DATA
*Data
;
347 extern EFI_GUID gEfiPxeDhcp4ProtocolGuid
;
349 #endif /* _PXEDHCP4_H_ */
350 /* EOF - PxeDhcp4.h */