Kea  2.3.4-git
dhcp4.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2004-2022 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, /* RFC2132 */
131  DHO_NWIP_DOMAIN_NAME = 62, /* RFC2242 */
132  DHO_NWIP_SUBOPTIONS = 63, /* RFC2242 */
133  DHO_NISP_DOMAIN_NAME = 64, /* RFC2132 */
146  DHO_USER_CLASS = 77, /* RFC3004 */
147  DHO_DIRECTORY_AGENT = 78, /* RFC2610 */
148  DHO_SERVICE_SCOPE = 79, /* RFC2610 */
149 // DHO_RAPID_COMMIT = 80, /* RFC4702 */
150  DHO_FQDN = 81, /* RFC4702 */
151  DHO_DHCP_AGENT_OPTIONS = 82, /* RFC3046 */
152 // DHO_ISNS = 83, /* RFC4174 */
153  // 84 is removed/unassigned
154  DHO_NDS_SERVERS = 85, /* RFC2241 */
155  DHO_NDS_TREE_NAME = 86, /* RFC2241 */
156  DHO_NDS_CONTEXT = 87, /* RFC2241 */
157  DHO_BCMCS_DOMAIN_NAME_LIST = 88, /* RFC4280 */
158  DHO_BCMCS_IPV4_ADDR = 89, /* RFC4280 */
159  DHO_AUTHENTICATE = 90, /* RFC3118 */
161  DHO_ASSOCIATED_IP = 92, /* RFC4388 */
162  DHO_SYSTEM = 93, /* RFC4578 */
163  DHO_NDI = 94, /* RFC4578 */
164 // DHO_LDAP = 95, /* RFC3679 */
165  // 96 is removed/unassigned
166  DHO_UUID_GUID = 97, /* RFC4578 */
167  DHO_USER_AUTH = 98, /* RFC2485 */
168  DHO_GEOCONF_CIVIC = 99, /* RFC4776 */
169  DHO_PCODE = 100, /* RFC4833 */
170  DHO_TCODE = 101, /* RFC4833 */
171  // 102-107 are removed/unassigned
172  DHO_V6_ONLY_PREFERRED = 108, /* RFC8925 */
173  // 109-111 are removed/unassigned
174  DHO_NETINFO_ADDR = 112, /* RFC3679 */
175  DHO_NETINFO_TAG = 113, /* RFC3679 */
176  // URL option was replaced with captive portal.
177  // DHO_URL = 114, /* RFC3679 */
178  DHO_V4_CAPTIVE_PORTAL = 114, /* RFC8910 */
179 
180  // 115 is removed/unassigned
181  DHO_AUTO_CONFIG = 116, /* RFC2563 */
182  DHO_NAME_SERVICE_SEARCH = 117, /* RFC2937 */
183  DHO_SUBNET_SELECTION = 118, /* RFC3011 */
184  DHO_DOMAIN_SEARCH = 119, /* RFC3397 */
185 // DHO_SIP_SERVERS = 120, /* RFC3361 */
186 // DHO_CLASSLESS_STATIC_ROUTE = 121, /* RFC3442 */
187 // DHO_CCC = 122, /* RFC3495 */
188 // DHO_GEOCONF = 123, /* RFC3825 */
189  DHO_VIVCO_SUBOPTIONS = 124, /* RFC3925 */
190  DHO_VIVSO_SUBOPTIONS = 125, /* RFC3925 */
191  // 126-127 are removed/unassigned
192  // 128-135 have multiple definitions including PXE
193  DHO_PANA_AGENT = 136, /* RFC5192 */
194  DHO_V4_LOST = 137, /* RFC5223 */
195  DHO_CAPWAP_AC_V4 = 138, /* RFC5417 */
196 // DHO_IPV4_ADDR_MOS = 139, /* RFC5678 */
197 // DHO_IPV4_FQDN_MOS = 140, /* RFC5678 */
198  DHO_SIP_UA_CONF_SERVICE_DOMAINS = 141, /* RFC6011 */
199 // DHO_IPV4_ADDR_ANDSF = 142, /* RFC6153 */
200  // 143 is removed/unassigned
201 // DHO_GEOLOC = 144,
202 // DHO_FORCERENEW_NONCE_CAPABLE = 145, /* RFC5859 */
204  // 147-149 are removed/unassigned
205  // 150 have multiple definitions
206  DHO_STATUS_CODE = 151, /* RFC6926 */
207  DHO_BASE_TIME = 152, /* RFC6926 */
208  DHO_START_TIME_OF_STATE = 153, /* RFC6926 */
209  DHO_QUERY_START_TIME = 154, /* RFC6926 */
210  DHO_QUERY_END_TIME = 155, /* RFC6926 */
211  DHO_DHCP_STATE = 156, /* RFC6926 */
212  DHO_DATA_SOURCE = 157, /* RFC6926 */
213 // DHO_V4_PCP_SERVER = 158,
215  // 160 used to be assigned in RFC7710, but was removed in RFC8910
216  // The Captive Portal option now uses code 114.
217  // 160-209 are removed/unassigned
218 // DHO_PATH_PREFIX = 210, /* RFC5071 */
219 // DHO_REBOOT_TIME = 211, /* RFC5071 */
220  DHO_6RD = 212, /* RFC5969 */
221  DHO_V4_ACCESS_DOMAIN = 213, /* RFC5986 */
222  // 214-219 are removed/unassigned
223 // DHO_SUBNET_ALLOC = 220,
224 // DHO_VSS = 221, /* RFC6607 */
225  // 222-223 are removed/unassigned
226  // 224-254 are reserved for private use
227 
228  DHO_END = 255 /* RFC2132 */
229 };
230 
231 /* DHCP message types. */
238  DHCPACK = 5,
239  DHCPNAK = 6,
242 // DHCPFORCERENEW = 9,
249 // DHCPACTIVELEASEQUERY = 16,
251  DHCPTLS = 18,
253 };
254 
255 static const uint16_t DHCP4_CLIENT_PORT = 68;
256 static const uint16_t DHCP4_SERVER_PORT = 67;
257 
260 static const uint32_t DHCP_OPTIONS_COOKIE = 0x63825363;
261 
265  RAI_OPTION_REMOTE_ID = 2, // RFC3046
266  /* option 3 is reserved and will never be assigned */
269  RAI_OPTION_SUBSCRIBER_ID = 6, // RFC3993
270  RAI_OPTION_RADIUS = 7, // RFC4014
271  RAI_OPTION_AUTH = 8, // RFC4030
272  RAI_OPTION_VSI = 9, // RFC4243
273  RAI_OPTION_RELAY_FLAGS = 10, // RFC5010
275  RAI_OPTION_RELAY_ID = 12, // RFC6925
280  RAI_OPTION_OPERATOR_ID = 17, // RFC7839
281  RAI_OPTION_OPERATOR_REALM = 18, // RFC7839
282  RAI_OPTION_RELAY_PORT = 19, // RFC8357
285 };
286 
287 // TODO: Following are leftovers from dhcp.h import from ISC DHCP
288 // They will be converted to C++-style defines once they will start
289 // to be used.
290 #if 0
291 /* FQDN suboptions: */
292 #define FQDN_NO_CLIENT_UPDATE 1
293 #define FQDN_SERVER_UPDATE 2
294 #define FQDN_ENCODED 3
295 #define FQDN_RCODE1 4
296 #define FQDN_RCODE2 5
297 #define FQDN_HOSTNAME 6
298 #define FQDN_DOMAINNAME 7
299 #define FQDN_FQDN 8
300 #define FQDN_SUBOPTION_COUNT 8
301 
302 /* Enterprise Suboptions: */
303 #define VENDOR_ISC_SUBOPTIONS 2495
304 
305 #endif
306 
307 /* Client identifier types */
308 static const uint8_t CLIENT_ID_OPTION_TYPE_DUID = 255;
309 
310 } // end of isc::dhcp namespace
311 } // end of isc namespace
312 
313 #endif /* DHCP_H */
Message Type option missing.
Definition: dhcp4.h:233
BOOTPTypes
Definition: dhcp4.h:45
The traffic captures we have from cable modems as well as this list by IANA: http://www.iana.org/assignments/ arp-parameters/arp-parameters.xhtml suggest that Ethernet (1) should be used in DOCSIS environment.
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-lfc.
RAISubOptionType
Relay Agent Information suboption types.
Definition: dhcp4.h:263
IEEE 802.2 Token Ring.
Definition: dhcp4.h:62
DHCPMessageType
Definition: dhcp4.h:232