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