Kea  1.5.0
dhcp4.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2004-2018 Internet Systems Consortium, Inc. ("ISC")
3  * Copyright (c) 1995-2003 by Internet Software Consortium
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * Internet Systems Consortium, Inc.
10  * 950 Charter Street
11  * Redwood City, CA 94063
12  * <info@isc.org>
13  * https://www.isc.org/
14  *
15  * This software has been written for Internet Systems Consortium
16  * by Ted Lemon in cooperation with Vixie Enterprises. To learn more
17  * about Internet Systems Consortium, see ``https://www.isc.org''.
18  * To learn more about Vixie Enterprises, see ``http://www.vix.com''.
19  */
20 
21 /*
22  * NOTE: This files is imported from ISC DHCP. It uses C notation.
23  * Format kept for easier merge.
24  */
25 
26 #ifndef DHCP_H
27 #define DHCP_H
28 
29 #include <stdint.h>
30 
37 
38 namespace isc {
39 namespace dhcp {
40 
41 /* IPv4 Broadcast address */
42 #define DHCP_IPV4_BROADCAST_ADDRESS "255.255.255.255"
43 
44 /* BOOTP (rfc951) message types */
45 enum BOOTPTypes {
48 };
49 
50 /* Possible values for flags field... */
51 static const uint16_t BOOTP_BROADCAST = 32768L;
52 
54 enum HType {
58  HTYPE_IEEE802 = 6,
64 };
66 
67 /* DHCP Option codes: */
69  DHO_PAD = 0,
149 // DHO_RAPID_COMMIT = 80,
150  DHO_FQDN = 81,
152 // DHO_ISNS = 83,
153  // 84 is removed/unassigned
159  DHO_AUTHENTICATE = 90, /* RFC3118, was 210 */
162  DHO_SYSTEM = 93, /* RFC4578 */
163  DHO_NDI = 94, /* RFC4578 */
164 // DHO_LDAP = 95,
165  // 96 is removed/unassigned
166  DHO_UUID_GUID = 97, /* RFC4578 */
169  DHO_PCODE = 100,
170  DHO_TCODE = 101,
171  // 102-111 are removed/unassigned
174  DHO_URL = 114,
175  // 115 is removed/unassigned
178  DHO_SUBNET_SELECTION = 118, /* RFC3011 */
179  DHO_DOMAIN_SEARCH = 119, /* RFC3397 */
180 // DHO_SIP_SERVERS = 120,
181 // DHO_CLASSLESS_STATIC_ROUTE = 121,
182 // DHO_CCC = 122,
183 // DHO_GEOCONF = 123,
186  // 126-127 are removed/unassigned
187  // 128-135 have multiple definitions including PXE
189  DHO_V4_LOST = 137,
191 // DHO_IPV4_ADDR_MOS = 139,
192 // DHO_IPV4_FQDN_MOS = 140,
194 // DHO_IPV4_ADDR_ANDSF = 142,
195  // 143 is removed/unassigned
196 // DHO_GEOLOC = 144,
197 // DHO_FORCERENEW_NONCE_CAPABLE = 145,
199  // 147-149 are removed/unassigned
200  // 150 have multiple definitions
201 // DHO_STATUS_CODE = 151,
202 // DHO_BASE_TIME = 152,
203 // DHO_START_TIME_OF_STATE = 153,
204 // DHO_QUERY_START_TIME = 154,
205 // DHO_QUERY_END_TIME = 155,
206 // DHO_DHCP_STATE = 156,
207 // DHO_DATA_SOURCE = 157,
208 // DHO_V4_PCP_SERVER = 158,
211  // 161-209 are removed/unassigned
212 // DHO_PATH_PREFIX = 210,
213 // DHO_REBOOT_TIME = 211,
214  DHO_6RD = 212,
216  // 214-219 are removed/unassigned
217 // DHO_SUBNET_ALLOC = 220,
218 // DHO_VSS = 221,
219  // 222-223 are removed/unassigned
220  // 224-254 are reserved for private use
221 
222  DHO_END = 255
223 };
224 
225 /* DHCP message types. */
232  DHCPACK = 5,
233  DHCPNAK = 6,
236 // DHCPFORCERENEW = 9,
243 // DHCPACTIVELEASEQUERY = 16,
245  DHCPTLS = 18,
247 };
248 
249 static const uint16_t DHCP4_CLIENT_PORT = 68;
250 static const uint16_t DHCP4_SERVER_PORT = 67;
251 
254 static const uint32_t DHCP_OPTIONS_COOKIE = 0x63825363;
255 
256 /* Relay Agent Information option subtypes: */
257 
258 static const uint16_t RAI_OPTION_AGENT_CIRCUIT_ID = 1; // RFC3046
259 static const uint16_t RAI_OPTION_REMOTE_ID = 2; // RFC3046
260 /* option 3 is reserved and will never be assigned */
261 static const uint16_t RAI_OPTION_DOCSIS_DEVICE_CLASS = 4; // RFC3256
262 static const uint16_t RAI_OPTION_LINK_SELECTION = 5; // RFC3527
263 static const uint16_t RAI_OPTION_SUBSCRIBER_ID = 6; //RFC3993
264 static const uint16_t RAI_OPTION_RADIUS = 7; //RFC4014
265 static const uint16_t RAI_OPTION_AUTH = 8; //RFC4030
266 static const uint16_t RAI_OPTION_VSI = 9; // RFC4243
267 static const uint16_t RAI_OPTION_RELAY_FLAGS = 10; // RFC5010
268 static const uint16_t RAI_OPTION_SERVER_ID_OVERRIDE = 11; // RFC5107
269 static const uint16_t RAI_OPTION_RELAY_ID = 12; //RFC6925
270 static const uint16_t RAI_OPTION_ACCESS_TECHNO_TYPE = 13; // RFC7839
271 static const uint16_t RAI_OPTION_ACCESS_NETWORK_NAME = 14; // RFC7839
272 static const uint16_t RAI_OPTION_ACCESS_POINT_NAME = 15; // RFC7839
273 static const uint16_t RAI_OPTION_ACCESS_POINT_BSSID = 16; // RFC7839
274 static const uint16_t RAI_OPTION_OPERATOR_ID = 17; // RFC7839
275 static const uint16_t RAI_OPTION_OPERATOR_REALM = 18; // RFC7839
276 static const uint16_t RAI_OPTION_RELAY_PORT = 19; // RFC8357
277 static const uint16_t RAI_OPTION_VIRTUAL_SUBNET_SELECT = 151; //RFC6607
278 static const uint16_t RAI_OPTION_VIRTUAL_SUBNET_SELECT_CTRL = 152; //RFC6607
279 
280 // TODO: Following are leftovers from dhcp.h import from ISC DHCP
281 // They will be converted to C++-style defines once they will start
282 // to be used.
283 #if 0
284 /* FQDN suboptions: */
285 #define FQDN_NO_CLIENT_UPDATE 1
286 #define FQDN_SERVER_UPDATE 2
287 #define FQDN_ENCODED 3
288 #define FQDN_RCODE1 4
289 #define FQDN_RCODE2 5
290 #define FQDN_HOSTNAME 6
291 #define FQDN_DOMAINNAME 7
292 #define FQDN_FQDN 8
293 #define FQDN_SUBOPTION_COUNT 8
294 
295 /* Enterprise Suboptions: */
296 #define VENDOR_ISC_SUBOPTIONS 2495
297 
298 #endif
299 
300 /* Client identifier types */
301 static const uint8_t CLIENT_ID_OPTION_TYPE_DUID = 255;
302 
303 } // end of isc::dhcp namespace
304 } // end of isc namespace
305 
306 #endif /* DHCP_H */
Message Type option missing.
Definition: dhcp4.h:227
BOOTPTypes
Definition: dhcp4.h:45
The traffic captures we have from cable modems as well as this list by IANA: http://www....
Definition: dhcp4.h:57
not specified or undefined
Definition: dhcp4.h:55
HType
Possible values for hardware type (htype) field.
Definition: dhcp4.h:54
DHCPOptionType
Definition: dhcp4.h:68
Ethernet 10Mbps.
Definition: dhcp4.h:56
Defines the logger used by the top-level component of kea-dhcp-ddns.
IEEE 802.2 Token Ring.
Definition: dhcp4.h:62
DHCPMessageType
Definition: dhcp4.h:226