]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/IndustryStandard/Dhcp.h
121c48c42dfb6c6b9a3399d3e22e301cda8e28e8
[mirror_edk2.git] / MdePkg / Include / IndustryStandard / Dhcp.h
1 /** @file
2 This file contains the DHCPv4 and DHCPv6 option definitions and other configuration.
3 They are used to carry additional information and parameters in DHCP messages.
4
5 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
6 Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8 **/
9
10 #ifndef _DHCP_H_
11 #define _DHCP_H_
12
13 ///
14 /// Dynamic Host Configuration Protocol for IPv4 (DHCPv4)
15 ///
16 /// Dhcpv4 Options, definitions from RFC 2132
17 ///
18 #define DHCP4_TAG_PAD 0 /// Pad Option
19 #define DHCP4_TAG_EOP 255 /// End Option
20 #define DHCP4_TAG_NETMASK 1 /// Subnet Mask
21 #define DHCP4_TAG_TIME_OFFSET 2 /// Time Offset from UTC
22 #define DHCP4_TAG_ROUTER 3 /// Router option,
23 #define DHCP4_TAG_TIME_SERVER 4 /// Time Server
24 #define DHCP4_TAG_NAME_SERVER 5 /// Name Server
25 #define DHCP4_TAG_DNS_SERVER 6 /// Domain Name Server
26 #define DHCP4_TAG_LOG_SERVER 7 /// Log Server
27 #define DHCP4_TAG_COOKIE_SERVER 8 /// Cookie Server
28 #define DHCP4_TAG_LPR_SERVER 9 /// LPR Print Server
29 #define DHCP4_TAG_IMPRESS_SERVER 10 /// Impress Server
30 #define DHCP4_TAG_RL_SERVER 11 /// Resource Location Server
31 #define DHCP4_TAG_HOSTNAME 12 /// Host Name
32 #define DHCP4_TAG_BOOTFILE_LEN 13 /// Boot File Size
33 #define DHCP4_TAG_DUMP 14 /// Merit Dump File
34 #define DHCP4_TAG_DOMAINNAME 15 /// Domain Name
35 #define DHCP4_TAG_SWAP_SERVER 16 /// Swap Server
36 #define DHCP4_TAG_ROOTPATH 17 /// Root path
37 #define DHCP4_TAG_EXTEND_PATH 18 /// Extensions Path
38 #define DHCP4_TAG_IPFORWARD 19 /// IP Forwarding Enable/Disable
39 #define DHCP4_TAG_NONLOCAL_SRR 20 /// on-Local Source Routing Enable/Disable
40 #define DHCP4_TAG_POLICY_SRR 21 /// Policy Filter
41 #define DHCP4_TAG_EMTU 22 /// Maximum Datagram Reassembly Size
42 #define DHCP4_TAG_TTL 23 /// Default IP Time-to-live
43 #define DHCP4_TAG_PATHMTU_AGE 24 /// Path MTU Aging Timeout
44 #define DHCP4_TAG_PATHMTU_PLATEAU 25 /// Path MTU Plateau Table
45 #define DHCP4_TAG_IFMTU 26 /// Interface MTU
46 #define DHCP4_TAG_SUBNET_LOCAL 27 /// All Subnets are Local
47 #define DHCP4_TAG_BROADCAST 28 /// Broadcast Address
48 #define DHCP4_TAG_DISCOVER_MASK 29 /// Perform Mask Discovery
49 #define DHCP4_TAG_SUPPLY_MASK 30 /// Mask Supplier
50 #define DHCP4_TAG_DISCOVER_ROUTE 31 /// Perform Router Discovery
51 #define DHCP4_TAG_ROUTER_SOLICIT 32 /// Router Solicitation Address
52 #define DHCP4_TAG_STATIC_ROUTE 33 /// Static Route
53 #define DHCP4_TAG_TRAILER 34 /// Trailer Encapsulation
54 #define DHCP4_TAG_ARPAGE 35 /// ARP Cache Timeout
55 #define DHCP4_TAG_ETHER_ENCAP 36 /// Ethernet Encapsulation
56 #define DHCP4_TAG_TCP_TTL 37 /// TCP Default TTL
57 #define DHCP4_TAG_KEEP_INTERVAL 38 /// TCP Keepalive Interval
58 #define DHCP4_TAG_KEEP_GARBAGE 39 /// TCP Keepalive Garbage
59 #define DHCP4_TAG_NIS_DOMAIN 40 /// Network Information Service Domain
60 #define DHCP4_TAG_NIS_SERVER 41 /// Network Information Servers
61 #define DHCP4_TAG_NTP_SERVER 42 /// Network Time Protocol Servers
62 #define DHCP4_TAG_VENDOR 43 /// Vendor Specific Information
63 #define DHCP4_TAG_NBNS 44 /// NetBIOS over TCP/IP Name Server
64 #define DHCP4_TAG_NBDD 45 /// NetBIOS Datagram Distribution Server
65 #define DHCP4_TAG_NBTYPE 46 /// NetBIOS over TCP/IP Node Type
66 #define DHCP4_TAG_NBSCOPE 47 /// NetBIOS over TCP/IP Scope
67 #define DHCP4_TAG_XFONT 48 /// X Window System Font Server
68 #define DHCP4_TAG_XDM 49 /// X Window System Display Manager
69 #define DHCP4_TAG_REQUEST_IP 50 /// Requested IP Address
70 #define DHCP4_TAG_LEASE 51 /// IP Address Lease Time
71 #define DHCP4_TAG_OVERLOAD 52 /// Option Overload
72 #define DHCP4_TAG_MSG_TYPE 53 /// DHCP Message Type
73 #define DHCP4_TAG_SERVER_ID 54 /// Server Identifier
74 #define DHCP4_TAG_PARA_LIST 55 /// Parameter Request List
75 #define DHCP4_TAG_MESSAGE 56 /// Message
76 #define DHCP4_TAG_MAXMSG 57 /// Maximum DHCP Message Size
77 #define DHCP4_TAG_T1 58 /// Renewal (T1) Time Value
78 #define DHCP4_TAG_T2 59 /// Rebinding (T2) Time Value
79 #define DHCP4_TAG_VENDOR_CLASS_ID 60 /// Vendor class identifier
80 #define DHCP4_TAG_CLIENT_ID 61 /// Client-identifier
81 #define DHCP4_TAG_NISPLUS 64 /// Network Information Service+ Domain
82 #define DHCP4_TAG_NISPLUS_SERVER 65 /// Network Information Service+ Servers
83 #define DHCP4_TAG_TFTP 66 /// TFTP server name
84 #define DHCP4_TAG_BOOTFILE 67 /// Bootfile name
85 #define DHCP4_TAG_MOBILEIP 68 /// Mobile IP Home Agent
86 #define DHCP4_TAG_SMTP 69 /// Simple Mail Transport Protocol Server
87 #define DHCP4_TAG_POP3 70 /// Post Office Protocol (POP3) Server
88 #define DHCP4_TAG_NNTP 71 /// Network News Transport Protocol Server
89 #define DHCP4_TAG_WWW 72 /// Default World Wide Web (WWW) Server
90 #define DHCP4_TAG_FINGER 73 /// Default Finger Server
91 #define DHCP4_TAG_IRC 74 /// Default Internet Relay Chat (IRC) Server
92 #define DHCP4_TAG_STTALK 75 /// StreetTalk Server
93 #define DHCP4_TAG_STDA 76 /// StreetTalk Directory Assistance Server
94 #define DHCP4_TAG_USER_CLASS_ID 77 /// User class identifier
95 #define DHCP4_TAG_ARCH 93 /// Client System Architecture Type, RFC 4578
96 #define DHCP4_TAG_UNDI 94 /// Client Network Interface Identifier, RFC 4578
97 #define DHCP4_TAG_UUID 97 /// Client Machine Identifier, RFC 4578
98 #define DHCP4_TAG_CLASSLESS_ROUTE 121 /// Classless Route
99
100
101 ///
102 /// Dynamic Host Configuration Protocol for IPv6 (DHCPv6)
103 ///
104 /// Enumeration of Dhcp6 message type, refers to section-5.3 of rfc-3315.
105 ///
106 typedef enum {
107 Dhcp6MsgSolicit = 1,
108 Dhcp6MsgAdvertise = 2,
109 Dhcp6MsgRequest = 3,
110 Dhcp6MsgConfirm = 4,
111 Dhcp6MsgRenew = 5,
112 Dhcp6MsgRebind = 6,
113 Dhcp6MsgReply = 7,
114 Dhcp6MsgRelease = 8,
115 Dhcp6MsgDecline = 9,
116 Dhcp6MsgReconfigure = 10,
117 Dhcp6MsgInfoRequest = 11
118 } DHCP6_MSG_TYPE;
119
120 ///
121 /// Enumeration of option code in Dhcp6 packet, refers to section-24.3 of rfc-3315.
122 ///
123 typedef enum {
124 Dhcp6OptClientId = 1,
125 Dhcp6OptServerId = 2,
126 Dhcp6OptIana = 3,
127 Dhcp6OptIata = 4,
128 Dhcp6OptIaAddr = 5,
129 Dhcp6OptRequestOption = 6,
130 Dhcp6OptPreference = 7,
131 Dhcp6OptElapsedTime = 8,
132 Dhcp6OptReplayMessage = 9,
133 Dhcp6OptAuthentication = 11,
134 Dhcp6OptServerUnicast = 12,
135 Dhcp6OptStatusCode = 13,
136 Dhcp6OptRapidCommit = 14,
137 Dhcp6OptUserClass = 15,
138 Dhcp6OptVendorClass = 16,
139 Dhcp6OptVendorInfo = 17,
140 Dhcp6OptInterfaceId = 18,
141 Dhcp6OptReconfigMessage = 19,
142 Dhcp6OptReconfigureAccept = 20
143 } DHCP6_OPT_CODE;
144
145 ///
146 /// Enumeration of status code recorded by IANA, refers to section-24.4 of rfc-3315.
147 ///
148 typedef enum {
149 Dhcp6StsSuccess = 0,
150 Dhcp6StsUnspecFail = 1,
151 Dhcp6StsNoAddrsAvail = 2,
152 Dhcp6StsNoBinding = 3,
153 Dhcp6StsNotOnLink = 4,
154 Dhcp6StsUseMulticast = 5
155 } DHCP6_STS_CODE;
156
157 ///
158 /// Enumeration of Duid type recorded by IANA, refers to section-24.5 of rfc-3315.
159 ///
160 typedef enum {
161 Dhcp6DuidTypeLlt = 1,
162 Dhcp6DuidTypeEn = 2,
163 Dhcp6DuidTypeLl = 3,
164 Dhcp6DuidTypeUuid = 4
165 } DHCP6_DUID_TYPE;
166
167 /// Transmission and Retransmission Parameters
168 /// This section presents a table of values used to describe the message
169 /// transmission behavior of clients and servers.
170 ///
171 /// Transmit parameters of solicit message, refers to section-5.5 of rfc-3315.
172 ///
173 #define DHCP6_SOL_MAX_DELAY 1
174 #define DHCP6_SOL_IRT 1
175 #define DHCP6_SOL_MRC 0
176 #define DHCP6_SOL_MRT 120
177 #define DHCP6_SOL_MRD 0
178 ///
179 /// Transmit parameters of request message, refers to section-5.5 of rfc-3315.
180 ///
181 #define DHCP6_REQ_IRT 1
182 #define DHCP6_REQ_MRC 10
183 #define DHCP6_REQ_MRT 30
184 #define DHCP6_REQ_MRD 0
185 ///
186 /// Transmit parameters of confirm message, refers to section-5.5 of rfc-3315.
187 ///
188 #define DHCP6_CNF_MAX_DELAY 1
189 #define DHCP6_CNF_IRT 1
190 #define DHCP6_CNF_MRC 0
191 #define DHCP6_CNF_MRT 4
192 #define DHCP6_CNF_MRD 10
193 ///
194 /// Transmit parameters of renew message, refers to section-5.5 of rfc-3315.
195 ///
196 #define DHCP6_REN_IRT 10
197 #define DHCP6_REN_MRC 0
198 #define DHCP6_REN_MRT 600
199 #define DHCP6_REN_MRD 0
200 ///
201 /// Transmit parameters of rebind message, refers to section-5.5 of rfc-3315.
202 ///
203 #define DHCP6_REB_IRT 10
204 #define DHCP6_REB_MRC 0
205 #define DHCP6_REB_MRT 600
206 #define DHCP6_REB_MRD 0
207 ///
208 /// Transmit parameters of information request message, refers to section-5.5 of rfc-3315.
209 ///
210 #define DHCP6_INF_MAX_DELAY 1
211 #define DHCP6_INF_IRT 1
212 #define DHCP6_INF_MRC 0
213 #define DHCP6_INF_MRT 120
214 #define DHCP6_INF_MRD 0
215 ///
216 /// Transmit parameters of release message, refers to section-5.5 of rfc-3315.
217 ///
218 #define DHCP6_REL_IRT 1
219 #define DHCP6_REL_MRC 5
220 #define DHCP6_REL_MRT 0
221 #define DHCP6_REL_MRD 0
222 ///
223 /// Transmit parameters of decline message, refers to section-5.5 of rfc-3315.
224 ///
225 #define DHCP6_DEC_IRT 1
226 #define DHCP6_DEC_MRC 5
227 #define DHCP6_DEC_MRT 0
228 #define DHCP6_DEC_MRD 0
229
230 ////
231 //// DHCPv6 Options, definitions from RFC 3315,RFC 5970 and RFC 3646.
232 ////
233 #define DHCP6_OPT_CLIENT_ID 1 /// Client Identifier Option
234 #define DHCP6_OPT_SERVER_ID 2 /// Server Identifier Option
235 #define DHCP6_OPT_IA_NA 3 /// The Identity Association for Non-temporary Addresses option
236 #define DHCP6_OPT_IA_TA 4 /// The Identity Association for the Temporary Addresses
237 #define DHCP6_OPT_IAADDR 5 /// IA Address option
238 #define DHCP6_OPT_ORO 6 /// Request option
239 #define DHCP6_OPT_PREFERENCE 7 /// Preference option
240 #define DHCP6_OPT_ELAPSED_TIME 8 /// Elapsed Time Option
241 #define DHCP6_OPT_REPLAY_MSG 9 /// Relay Message option
242 #define DHCP6_OPT_AUTH 11 /// Authentication option
243 #define DHCP6_OPT_UNICAST 12 /// Server Unicast Option
244 #define DHCP6_OPT_STATUS_CODE 13 /// Status Code Option
245 #define DHCP6_OPT_RAPID_COMMIT 14 /// Rapid Commit option
246 #define DHCP6_OPT_USER_CLASS 15 /// User Class option
247 #define DHCP6_OPT_VENDOR_CLASS 16 /// Vendor Class Option
248 #define DHCP6_OPT_VENDOR_OPTS 17 /// Vendor-specific Information Option
249 #define DHCP6_OPT_INTERFACE_ID 18 /// Interface-Id Option
250 #define DHCP6_OPT_RECONFIG_MSG 19 /// Reconfigure Message Option
251 #define DHCP6_OPT_RECONFIG_ACCEPT 20 /// Reconfigure Accept Option
252 #define DHCP6_OPT_DNS_SERVERS 23 /// DNS Configuration options, RFC 3646
253 #define DHCP6_OPT_BOOT_FILE_URL 59 /// Assigned by IANA, RFC 5970
254 #define DHCP6_OPT_BOOT_FILE_PARAM 60 /// Assigned by IANA, RFC 5970
255 #define DHCP6_OPT_ARCH 61 /// Assigned by IANA, RFC 5970
256 #define DHCP6_OPT_UNDI 62 /// Assigned by IANA, RFC 5970
257
258 ///
259 /// Processor Architecture Types
260 /// These identifiers are defined by IETF:
261 /// http://www.ietf.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml
262 ///
263 #define PXE_CLIENT_ARCH_X86_BIOS 0x0000 /// x86 BIOS for PXE
264 #define PXE_CLIENT_ARCH_IPF 0x0002 /// Itanium for PXE
265 #define PXE_CLIENT_ARCH_IA32 0x0006 /// x86 uefi for PXE
266 #define PXE_CLIENT_ARCH_X64 0x0007 /// x64 uefi for PXE
267 #define PXE_CLIENT_ARCH_EBC 0x0009 /// EBC for PXE
268 #define PXE_CLIENT_ARCH_ARM 0x000A /// Arm uefi 32 for PXE
269 #define PXE_CLIENT_ARCH_AARCH64 0x000B /// Arm uefi 64 for PXE
270 #define PXE_CLIENT_ARCH_RISCV32 0x0019 /// RISC-V uefi 32 for PXE
271 #define PXE_CLIENT_ARCH_RISCV64 0x001B /// RISC-V uefi 64 for PXE
272 #define PXE_CLIENT_ARCH_RISCV128 0x001D /// RISC-V uefi 128 for PXE
273
274 #define HTTP_CLIENT_ARCH_IA32 0x000F /// x86 uefi boot from http
275 #define HTTP_CLIENT_ARCH_X64 0x0010 /// x64 uefi boot from http
276 #define HTTP_CLIENT_ARCH_EBC 0x0011 /// EBC boot from http
277 #define HTTP_CLIENT_ARCH_ARM 0x0012 /// Arm uefi 32 boot from http
278 #define HTTP_CLIENT_ARCH_AARCH64 0x0013 /// Arm uefi 64 boot from http
279 #define HTTP_CLIENT_ARCH_RISCV32 0x001A /// RISC-V uefi 32 boot from http
280 #define HTTP_CLIENT_ARCH_RISCV64 0x001C /// RISC-V uefi 64 boot from http
281 #define HTTP_CLIENT_ARCH_RISCV128 0x001E /// RISC-V uefi 128 boot from http
282
283 #endif