2 EFI PXE DHCPv4 protocol definition
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
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.
19 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
21 // PXE DHCPv4 GUID definition
24 #define EFI_PXE_DHCP4_PROTOCOL_GUID \
25 { 0x03c4e624, 0xac28, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x29, 0x3f, 0xc1, 0x4d } }
28 // Interface definition
30 typedef struct _EFI_PXE_DHCP4_PROTOCOL EFI_PXE_DHCP4_PROTOCOL
;
33 // Descriptions of the DHCP version 4 header and options can be found
34 // in RFC-2131 and RFC-2132 at www.ietf.org
40 #define BOOTP_REQUEST 1
52 #define DHCP4_INITIAL_SECONDS 4
55 #define DHCP4_BROADCAST_FLAG 0x8000
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.
82 #define DHCP4_MAGIK_NUMBER 0x63825363
90 // DHCPv4 packet definition. Room for 576 bytes including IP and
93 #define DHCP4_MAX_PACKET_SIZE 576
94 #define DHCP4_UDP_HEADER_SIZE 8
95 #define DHCP4_IP_HEADER_SIZE 20
98 typedef union _DHCP4_PACKET
{
99 UINT32 _force_data_alignment
;
107 #define DHCP4_SERVER_PORT 67
108 #define DHCP4_CLIENT_PORT 68
111 // DHCPv4 and PXE option numbers.
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
235 DHCP4_PACKET Discover
;
237 DHCP4_PACKET Request
;
239 BOOLEAN SetupCompleted
;
240 BOOLEAN InitCompleted
;
241 BOOLEAN SelectCompleted
;
244 } EFI_PXE_DHCP4_DATA
;
248 (EFIAPI
*EFI_PXE_DHCP4_RUN
)(
249 IN EFI_PXE_DHCP4_PROTOCOL
*This
,
250 IN OPTIONAL UINTN OpLen
,
251 IN OPTIONAL VOID
*OpList
256 (EFIAPI
*EFI_PXE_DHCP4_SETUP
)(
257 IN EFI_PXE_DHCP4_PROTOCOL
*This
,
258 IN OPTIONAL EFI_PXE_DHCP4_DATA
* NewData
263 (EFIAPI
*EFI_PXE_DHCP4_INIT
)(
264 IN EFI_PXE_DHCP4_PROTOCOL
*This
,
265 IN UINTN SecondsTimeout
,
267 OUT DHCP4_PACKET
**OfferList
270 #define DHCP4_MIN_SECONDS 1
271 #define DHCP4_MAX_SECONDS 60
275 (EFIAPI
*EFI_PXE_DHCP4_SELECT
)(
276 IN EFI_PXE_DHCP4_PROTOCOL
*This
,
277 IN UINTN SecondsTimeout
,
278 IN DHCP4_PACKET
* offer
283 (EFIAPI
*EFI_PXE_DHCP4_RENEW
)(
284 IN EFI_PXE_DHCP4_PROTOCOL
*This
,
285 UINTN seconds_timeout
290 (EFIAPI
*EFI_PXE_DHCP4_REBIND
)(
291 IN EFI_PXE_DHCP4_PROTOCOL
*This
,
292 UINTN seconds_timeout
297 (EFIAPI
*EFI_PXE_DHCP4_RELEASE
)(
298 IN EFI_PXE_DHCP4_PROTOCOL
* This
301 #define EFI_PXE_DHCP4_PROTOCOL_REVISION 0x00010000
303 struct _EFI_PXE_DHCP4_PROTOCOL
{
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
;
315 extern EFI_GUID gEfiPxeDhcp4ProtocolGuid
;