Kea  2.3.5-git
std_option_defs.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2022 Internet Systems Consortium, Inc. ("ISC")
2 //
3 // This Source Code Form is subject to the terms of the Mozilla Public
4 // License, v. 2.0. If a copy of the MPL was not distributed with this
5 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 
7 #ifndef STD_OPTION_DEFS_H
8 #define STD_OPTION_DEFS_H
9 
10 #include <dhcp/option_data_types.h>
11 #include <dhcp/dhcp4.h>
12 #include <dhcp/dhcp6.h>
13 #include <dhcp/option_space.h>
14 
16 #define DHCP4_OPTION_SPACE "dhcp4"
17 #define DHCP6_OPTION_SPACE "dhcp6"
18 #define ISC_V6_OPTION_SPACE "4o6"
19 #define MAPE_V6_OPTION_SPACE "s46-cont-mape-options"
20 #define MAPT_V6_OPTION_SPACE "s46-cont-mapt-options"
21 #define LW_V6_OPTION_SPACE "s46-cont-lw-options"
22 #define V4V6_RULE_OPTION_SPACE "s46-rule-options"
23 #define V4V6_BIND_OPTION_SPACE "s46-v4v6bind-options"
24 #define LAST_RESORT_V4_OPTION_SPACE "last-resort-v4"
25 
27 #define DHCP_AGENT_OPTION_SPACE "dhcp-agent-options-space"
28 #define VENDOR_ENCAPSULATED_OPTION_SPACE "vendor-encapsulated-options-space"
29 
30 // NOTE:
31 // When adding a new space, make sure you also update
32 // src/lib/yang/adaptor_option.cc
33 
34 namespace isc {
35 namespace dhcp {
36 
37 namespace {
38 
43 #ifndef RECORD_DECL
44 #define RECORD_DECL(name, ...) const OptionDataType name[] = { __VA_ARGS__ }
45 #endif
46 
51 #ifndef RECORD_DEF
52 #define RECORD_DEF(name) name, sizeof(name) / sizeof(name[0])
53 #endif
54 
55 #ifndef NO_RECORD_DEF
56 #define NO_RECORD_DEF 0, 0
57 #endif
58 
59 // SLP Directory Agent option.
60 RECORD_DECL(DIRECTORY_AGENT_RECORDS, OPT_BOOLEAN_TYPE, OPT_IPV4_ADDRESS_TYPE);
61 
62 // SLP Service Scope option.
63 //
64 // The scope list is optional.
65 RECORD_DECL(SERVICE_SCOPE_RECORDS, OPT_BOOLEAN_TYPE, OPT_STRING_TYPE);
66 
67 // fqdn option record fields.
68 //
69 // Note that the flags field indicates the type of domain
70 // name encoding. There is a choice between deprecated
71 // ASCII encoding and compressed encoding described in
72 // RFC 1035, section 3.1. The latter could be handled
73 // by OPT_FQDN_TYPE but we can't use it here because
74 // clients may request ASCII encoding.
77 
78 // V-I Vendor Class record fields.
79 //
80 // Opaque data is represented here by the binary data field.
82 
83 // RFC4578 (PXE) record fields
84 //
85 // Three 1 byte fields to describe a network interface: type, major and minor
87 // A client identifier: a 1 byte type field followed by opaque data depending on the type
88 RECORD_DECL(UUID_GUID_RECORDS, OPT_UINT8_TYPE, OPT_BINARY_TYPE);
89 
90 // RFC6731 DHCPv4 Recursive DNS Server Selection option.
91 //
92 // Flag, two addresses and domain list
93 RECORD_DECL(V4_RDNSS_SELECT_RECORDS, OPT_UINT8_TYPE, OPT_IPV4_ADDRESS_TYPE,
95 
96 // RFC6926 DHCPv4 Bulk Leasequery Status Code option.
97 RECORD_DECL(V4_STATUS_CODE_RECORDS, OPT_UINT8_TYPE, OPT_STRING_TYPE);
98 
99 // RFC7618 DHCPv4 Port Parameter option.
100 //
101 // PSID offset, PSID-len and PSID
102 RECORD_DECL(V4_PORTPARAMS_RECORDS, OPT_UINT8_TYPE, OPT_PSID_TYPE);
103 
104 // RFC5969 DHCPv6 6RD option.
105 //
106 // two 8 bit lengthes, an IPv6 address and one or more IPv4 addresses
107 RECORD_DECL(OPT_6RD_RECORDS, OPT_UINT8_TYPE, OPT_UINT8_TYPE,
109 
111 const OptionDefParams STANDARD_V4_OPTION_DEFINITIONS[] = {
112  { "subnet-mask", DHO_SUBNET_MASK, DHCP4_OPTION_SPACE,
113  OPT_IPV4_ADDRESS_TYPE, false, NO_RECORD_DEF, "" },
115  false, NO_RECORD_DEF, "" },
117  NO_RECORD_DEF, "" },
118  { "time-servers", DHO_TIME_SERVERS, DHCP4_OPTION_SPACE,
120  { "name-servers", DHO_NAME_SERVERS, DHCP4_OPTION_SPACE,
122  { "domain-name-servers", DHO_DOMAIN_NAME_SERVERS, DHCP4_OPTION_SPACE,
124  { "log-servers", DHO_LOG_SERVERS, DHCP4_OPTION_SPACE,
126  { "cookie-servers", DHO_COOKIE_SERVERS, DHCP4_OPTION_SPACE,
128  { "lpr-servers", DHO_LPR_SERVERS, DHCP4_OPTION_SPACE,
130  { "impress-servers", DHO_IMPRESS_SERVERS, DHCP4_OPTION_SPACE,
132  { "resource-location-servers", DHO_RESOURCE_LOCATION_SERVERS,
134  { "host-name", DHO_HOST_NAME, DHCP4_OPTION_SPACE, OPT_STRING_TYPE, false,
135  NO_RECORD_DEF, "" },
136  { "boot-size", DHO_BOOT_SIZE, DHCP4_OPTION_SPACE, OPT_UINT16_TYPE, false,
137  NO_RECORD_DEF, "" },
139  false, NO_RECORD_DEF, "" },
141  false, NO_RECORD_DEF, "" },
142  { "swap-server", DHO_SWAP_SERVER, DHCP4_OPTION_SPACE,
143  OPT_IPV4_ADDRESS_TYPE, false, NO_RECORD_DEF, "" },
144  { "root-path", DHO_ROOT_PATH, DHCP4_OPTION_SPACE, OPT_STRING_TYPE, false,
145  NO_RECORD_DEF, "" },
146  { "extensions-path", DHO_EXTENSIONS_PATH, DHCP4_OPTION_SPACE,
147  OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
149  false, NO_RECORD_DEF, "" },
150  { "non-local-source-routing", DHO_NON_LOCAL_SOURCE_ROUTING,
152  { "policy-filter", DHO_POLICY_FILTER, DHCP4_OPTION_SPACE,
154  { "max-dgram-reassembly", DHO_MAX_DGRAM_REASSEMBLY, DHCP4_OPTION_SPACE,
155  OPT_UINT16_TYPE, false, NO_RECORD_DEF, "" },
157  false, NO_RECORD_DEF, "" },
158  { "path-mtu-aging-timeout", DHO_PATH_MTU_AGING_TIMEOUT, DHCP4_OPTION_SPACE,
159  OPT_UINT32_TYPE, false, NO_RECORD_DEF, "" },
160  { "path-mtu-plateau-table", DHO_PATH_MTU_PLATEAU_TABLE, DHCP4_OPTION_SPACE,
161  OPT_UINT16_TYPE, true, NO_RECORD_DEF, "" },
163  false, NO_RECORD_DEF, "" },
164  { "all-subnets-local", DHO_ALL_SUBNETS_LOCAL, DHCP4_OPTION_SPACE,
165  OPT_BOOLEAN_TYPE, false, NO_RECORD_DEF, "" },
166  { "broadcast-address", DHO_BROADCAST_ADDRESS, DHCP4_OPTION_SPACE,
167  OPT_IPV4_ADDRESS_TYPE, false, NO_RECORD_DEF, "" },
168  { "perform-mask-discovery", DHO_PERFORM_MASK_DISCOVERY, DHCP4_OPTION_SPACE,
169  OPT_BOOLEAN_TYPE, false, NO_RECORD_DEF, "" },
171  false, NO_RECORD_DEF, "" },
172  { "router-discovery", DHO_ROUTER_DISCOVERY, DHCP4_OPTION_SPACE,
173  OPT_BOOLEAN_TYPE, false, NO_RECORD_DEF, "" },
174  { "router-solicitation-address", DHO_ROUTER_SOLICITATION_ADDRESS,
176  { "static-routes", DHO_STATIC_ROUTES, DHCP4_OPTION_SPACE,
178  { "trailer-encapsulation", DHO_TRAILER_ENCAPSULATION, DHCP4_OPTION_SPACE,
179  OPT_BOOLEAN_TYPE, false, NO_RECORD_DEF, "" },
180  { "arp-cache-timeout", DHO_ARP_CACHE_TIMEOUT, DHCP4_OPTION_SPACE,
181  OPT_UINT32_TYPE, false, NO_RECORD_DEF, "" },
182  { "ieee802-3-encapsulation", DHO_IEEE802_3_ENCAPSULATION,
184  { "default-tcp-ttl", DHO_DEFAULT_TCP_TTL, DHCP4_OPTION_SPACE,
185  OPT_UINT8_TYPE, false, NO_RECORD_DEF, "" },
186  { "tcp-keepalive-interval", DHO_TCP_KEEPALIVE_INTERVAL, DHCP4_OPTION_SPACE,
187  OPT_UINT32_TYPE, false, NO_RECORD_DEF, "" },
188  { "tcp-keepalive-garbage", DHO_TCP_KEEPALIVE_GARBAGE, DHCP4_OPTION_SPACE,
189  OPT_BOOLEAN_TYPE, false, NO_RECORD_DEF, "" },
190  { "nis-domain", DHO_NIS_DOMAIN, DHCP4_OPTION_SPACE, OPT_STRING_TYPE, false,
191  NO_RECORD_DEF, "" },
192  { "nis-servers", DHO_NIS_SERVERS, DHCP4_OPTION_SPACE,
194  { "ntp-servers", DHO_NTP_SERVERS, DHCP4_OPTION_SPACE,
197  { "netbios-name-servers", DHO_NETBIOS_NAME_SERVERS, DHCP4_OPTION_SPACE,
199  { "netbios-dd-server", DHO_NETBIOS_DD_SERVER, DHCP4_OPTION_SPACE,
201  { "netbios-node-type", DHO_NETBIOS_NODE_TYPE, DHCP4_OPTION_SPACE,
202  OPT_UINT8_TYPE, false, NO_RECORD_DEF, "" },
204  false, NO_RECORD_DEF, "" },
205  { "font-servers", DHO_FONT_SERVERS, DHCP4_OPTION_SPACE,
207  { "x-display-manager", DHO_X_DISPLAY_MANAGER, DHCP4_OPTION_SPACE,
209  { "dhcp-requested-address", DHO_DHCP_REQUESTED_ADDRESS, DHCP4_OPTION_SPACE,
210  OPT_IPV4_ADDRESS_TYPE, false, NO_RECORD_DEF, "" },
211  { "dhcp-lease-time", DHO_DHCP_LEASE_TIME, DHCP4_OPTION_SPACE,
212  OPT_UINT32_TYPE, false, NO_RECORD_DEF, "" },
213  { "dhcp-option-overload", DHO_DHCP_OPTION_OVERLOAD, DHCP4_OPTION_SPACE,
214  OPT_UINT8_TYPE, false, NO_RECORD_DEF, "" },
215  { "dhcp-message-type", DHO_DHCP_MESSAGE_TYPE, DHCP4_OPTION_SPACE,
216  OPT_UINT8_TYPE, false, NO_RECORD_DEF, "" },
217  { "dhcp-server-identifier", DHO_DHCP_SERVER_IDENTIFIER, DHCP4_OPTION_SPACE,
218  OPT_IPV4_ADDRESS_TYPE, false, NO_RECORD_DEF, "" },
219  { "dhcp-parameter-request-list", DHO_DHCP_PARAMETER_REQUEST_LIST,
222  false, NO_RECORD_DEF, "" },
223  { "dhcp-max-message-size", DHO_DHCP_MAX_MESSAGE_SIZE, DHCP4_OPTION_SPACE,
224  OPT_UINT16_TYPE, false, NO_RECORD_DEF, "" },
225  { "dhcp-renewal-time", DHO_DHCP_RENEWAL_TIME, DHCP4_OPTION_SPACE,
226  OPT_UINT32_TYPE, false, NO_RECORD_DEF, "" },
227  { "dhcp-rebinding-time", DHO_DHCP_REBINDING_TIME, DHCP4_OPTION_SPACE,
228  OPT_UINT32_TYPE, false, NO_RECORD_DEF, "" },
229  { "vendor-class-identifier", DHO_VENDOR_CLASS_IDENTIFIER,
231  { "dhcp-client-identifier", DHO_DHCP_CLIENT_IDENTIFIER, DHCP4_OPTION_SPACE,
232  OPT_BINARY_TYPE, false, NO_RECORD_DEF, "" },
233  { "nwip-domain-name", DHO_NWIP_DOMAIN_NAME, DHCP4_OPTION_SPACE,
234  OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
235  { "nwip-suboptions", DHO_NWIP_SUBOPTIONS, DHCP4_OPTION_SPACE,
236  OPT_BINARY_TYPE, false, NO_RECORD_DEF, "" },
237  { "nisplus-domain-name", DHO_NISP_DOMAIN_NAME, DHCP4_OPTION_SPACE,
238  OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
239  { "nisplus-servers", DHO_NISP_SERVER_ADDR, DHCP4_OPTION_SPACE,
241  { "tftp-server-name", DHO_TFTP_SERVER_NAME, DHCP4_OPTION_SPACE,
242  OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
243  { "boot-file-name", DHO_BOOT_FILE_NAME, DHCP4_OPTION_SPACE,
244  OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
245  { "mobile-ip-home-agent", DHO_HOME_AGENT_ADDRS, DHCP4_OPTION_SPACE,
247  { "smtp-server", DHO_SMTP_SERVER, DHCP4_OPTION_SPACE,
250  true, NO_RECORD_DEF, "" },
251  { "nntp-server", DHO_NNTP_SERVER, DHCP4_OPTION_SPACE,
254  true, NO_RECORD_DEF, "" },
255  { "finger-server", DHO_FINGER_SERVER, DHCP4_OPTION_SPACE,
258  true, NO_RECORD_DEF, "" },
259  { "streettalk-server", DHO_STREETTALK_SERVER, DHCP4_OPTION_SPACE,
261  { "streettalk-directory-assistance-server", DHO_STDASERVER,
263  { "user-class", DHO_USER_CLASS, DHCP4_OPTION_SPACE, OPT_BINARY_TYPE, false,
264  NO_RECORD_DEF, "" },
265  { "slp-directory-agent", DHO_DIRECTORY_AGENT, DHCP4_OPTION_SPACE,
266  OPT_RECORD_TYPE, true, RECORD_DEF(DIRECTORY_AGENT_RECORDS), "" },
267  { "slp-service-scope", DHO_SERVICE_SCOPE, DHCP4_OPTION_SPACE,
268  OPT_RECORD_TYPE, false, RECORD_DEF(SERVICE_SCOPE_RECORDS), "" },
269  { "fqdn", DHO_FQDN, DHCP4_OPTION_SPACE, OPT_RECORD_TYPE, false,
270  RECORD_DEF(FQDN_RECORDS), "" },
271  { "dhcp-agent-options", DHO_DHCP_AGENT_OPTIONS, DHCP4_OPTION_SPACE,
273  { "nds-servers", DHO_NDS_SERVERS, DHCP4_OPTION_SPACE,
276  false, NO_RECORD_DEF, "" },
278  false, NO_RECORD_DEF, "" },
279  { "bcms-controller-names", DHO_BCMCS_DOMAIN_NAME_LIST, DHCP4_OPTION_SPACE,
280  OPT_FQDN_TYPE, true, NO_RECORD_DEF, "" },
281  { "bcms-controller-address", DHO_BCMCS_IPV4_ADDR, DHCP4_OPTION_SPACE,
283  // Unfortunately the AUTHENTICATE option contains a 64-bit
284  // data field called 'replay-detection' that can't be added
285  // as a record field to a custom option. Also, there is no
286  // dedicated option class to handle it so we simply return
287  // binary option type for now.
288  // @todo implement a class to handle AUTH option.
290  false, NO_RECORD_DEF, "" },
291  { "client-last-transaction-time", DHO_CLIENT_LAST_TRANSACTION_TIME,
293  { "associated-ip", DHO_ASSOCIATED_IP, DHCP4_OPTION_SPACE,
295  { "client-system", DHO_SYSTEM, DHCP4_OPTION_SPACE, OPT_UINT16_TYPE, true,
296  NO_RECORD_DEF, "" },
297  { "client-ndi", DHO_NDI, DHCP4_OPTION_SPACE, OPT_RECORD_TYPE, false,
298  RECORD_DEF(CLIENT_NDI_RECORDS), "" },
299  { "uuid-guid", DHO_UUID_GUID, DHCP4_OPTION_SPACE, OPT_RECORD_TYPE, false,
300  RECORD_DEF(UUID_GUID_RECORDS), "" },
301  { "uap-servers", DHO_USER_AUTH, DHCP4_OPTION_SPACE, OPT_STRING_TYPE, false,
302  NO_RECORD_DEF, "" },
304  false, NO_RECORD_DEF, "" },
305  { "pcode", DHO_PCODE, DHCP4_OPTION_SPACE, OPT_STRING_TYPE, false,
306  NO_RECORD_DEF, "" },
307  { "tcode", DHO_TCODE, DHCP4_OPTION_SPACE, OPT_STRING_TYPE, false,
308  NO_RECORD_DEF, "" },
309  { "v6-only-preferred", DHO_V6_ONLY_PREFERRED, DHCP4_OPTION_SPACE,
310  OPT_UINT32_TYPE, false, NO_RECORD_DEF, "" },
311  { "netinfo-server-address", DHO_NETINFO_ADDR, DHCP4_OPTION_SPACE,
313  { "netinfo-server-tag", DHO_NETINFO_TAG, DHCP4_OPTION_SPACE,
314  OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
315  { "v4-captive-portal", DHO_V4_CAPTIVE_PORTAL, DHCP4_OPTION_SPACE,
316  OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
318  false, NO_RECORD_DEF, "" },
319  { "name-service-search", DHO_NAME_SERVICE_SEARCH, DHCP4_OPTION_SPACE,
320  OPT_UINT16_TYPE, true, NO_RECORD_DEF, "" },
321  { "subnet-selection", DHO_SUBNET_SELECTION, DHCP4_OPTION_SPACE,
322  OPT_IPV4_ADDRESS_TYPE, false, NO_RECORD_DEF, "" },
324  true, NO_RECORD_DEF, "" },
325  { "vivco-suboptions", DHO_VIVCO_SUBOPTIONS, DHCP4_OPTION_SPACE,
326  OPT_RECORD_TYPE, false, RECORD_DEF(VIVCO_RECORDS), "" },
327  // Vendor-Identifying Vendor Specific Information option payload begins with a
328  // 32-bit log enterprise number, followed by a tuple of data-len/option-data.
329  // The format defined here includes 32-bit field holding enterprise number.
330  // This allows for specifying option-data information where the enterprise-id
331  // is represented by a uint32_t value. Previously we represented this option
332  // as a binary, but that would imply that enterprise number would have to be
333  // represented in binary format in the server configuration. That would be
334  // inconvenient and non-intuitive.
339  { "vivso-suboptions", DHO_VIVSO_SUBOPTIONS, DHCP4_OPTION_SPACE,
340  OPT_UINT32_TYPE, false, NO_RECORD_DEF, "" },
342  true, NO_RECORD_DEF, "" },
343  { "v4-lost", DHO_V4_LOST, DHCP4_OPTION_SPACE, OPT_FQDN_TYPE, false,
344  NO_RECORD_DEF, "" },
345  { "capwap-ac-v4", DHO_CAPWAP_AC_V4, DHCP4_OPTION_SPACE,
347  { "sip-ua-cs-domains", DHO_SIP_UA_CONF_SERVICE_DOMAINS, DHCP4_OPTION_SPACE,
348  OPT_FQDN_TYPE, true, NO_RECORD_DEF, "" },
349  { "rdnss-selection", DHO_RDNSS_SELECT, DHCP4_OPTION_SPACE, OPT_RECORD_TYPE,
350  true, RECORD_DEF(V4_RDNSS_SELECT_RECORDS), "" },
351  { "status-code", DHO_STATUS_CODE, DHCP4_OPTION_SPACE,
352  OPT_RECORD_TYPE, false, RECORD_DEF(V4_STATUS_CODE_RECORDS), "" },
353  { "base-time", DHO_BASE_TIME, DHCP4_OPTION_SPACE,
354  OPT_UINT32_TYPE, false, NO_RECORD_DEF, "" },
355  { "start-time-of-state", DHO_START_TIME_OF_STATE, DHCP4_OPTION_SPACE,
356  OPT_UINT32_TYPE, false, NO_RECORD_DEF, "" },
357  { "query-start-time", DHO_QUERY_START_TIME, DHCP4_OPTION_SPACE,
358  OPT_UINT32_TYPE, false, NO_RECORD_DEF, "" },
359  { "query-end-time", DHO_QUERY_END_TIME, DHCP4_OPTION_SPACE,
360  OPT_UINT32_TYPE, false, NO_RECORD_DEF, "" },
361  { "dhcp-state", DHO_DHCP_STATE, DHCP4_OPTION_SPACE,
362  OPT_UINT8_TYPE, false, NO_RECORD_DEF, "" },
363  { "data-source", DHO_DATA_SOURCE, DHCP4_OPTION_SPACE,
364  OPT_UINT8_TYPE, false, NO_RECORD_DEF, "" },
366  false, RECORD_DEF(V4_PORTPARAMS_RECORDS), "" },
367  { "option-6rd", DHO_6RD, DHCP4_OPTION_SPACE, OPT_RECORD_TYPE, true,
368  RECORD_DEF(OPT_6RD_RECORDS), "" },
369  { "v4-access-domain", DHO_V4_ACCESS_DOMAIN, DHCP4_OPTION_SPACE,
370  OPT_FQDN_TYPE, false, NO_RECORD_DEF, "" }
371 
372  // @todo add definitions for all remaining options.
373 };
374 
376 const int STANDARD_V4_OPTION_DEFINITIONS_SIZE =
377  sizeof(STANDARD_V4_OPTION_DEFINITIONS) /
378  sizeof(STANDARD_V4_OPTION_DEFINITIONS[0]);
379 
381 const OptionDefParams DHCP_AGENT_OPTION_DEFINITIONS[] = {
382  { "circuit-id", RAI_OPTION_AGENT_CIRCUIT_ID,
384  { "remote-id", RAI_OPTION_REMOTE_ID,
386  { "docsis-device-class", RAI_OPTION_DOCSIS_DEVICE_CLASS,
388  { "link-selection", RAI_OPTION_LINK_SELECTION,
390  NO_RECORD_DEF, "" },
391  { "subscriber-id", RAI_OPTION_SUBSCRIBER_ID,
393  { "radius", RAI_OPTION_RADIUS,
395  { "auth", RAI_OPTION_AUTH,
397  { "vendor-specific-info", RAI_OPTION_VSI,
399  { "relay-flags", RAI_OPTION_RELAY_FLAGS,
401  { "server-id-override", RAI_OPTION_SERVER_ID_OVERRIDE,
403  NO_RECORD_DEF, "" },
404  { "relay-id", RAI_OPTION_RELAY_ID,
406  { "access-techno-type", RAI_OPTION_ACCESS_TECHNO_TYPE,
408  { "access-network-name", RAI_OPTION_ACCESS_NETWORK_NAME,
410  { "access-point-name", RAI_OPTION_ACCESS_POINT_NAME,
412  { "access-point-bssid", RAI_OPTION_ACCESS_POINT_BSSID,
414  { "operator-id", RAI_OPTION_OPERATOR_ID,
416  { "operator-realm", RAI_OPTION_OPERATOR_REALM,
418  { "relay-port", RAI_OPTION_RELAY_PORT,
420  { "virtual-subnet-select", RAI_OPTION_VIRTUAL_SUBNET_SELECT,
422  { "virtual-subnet-select-ctrl", RAI_OPTION_VIRTUAL_SUBNET_SELECT_CTRL,
424 };
425 
426 const int DHCP_AGENT_OPTION_DEFINITIONS_SIZE =
427  sizeof(DHCP_AGENT_OPTION_DEFINITIONS) /
428  sizeof(DHCP_AGENT_OPTION_DEFINITIONS[0]);
429 
432 const OptionDefParams LAST_RESORT_V4_OPTION_DEFINITIONS[] = {
433  { "vendor-encapsulated-options", DHO_VENDOR_ENCAPSULATED_OPTIONS,
436 };
437 
438 const int LAST_RESORT_V4_OPTION_DEFINITIONS_SIZE =
439  sizeof(LAST_RESORT_V4_OPTION_DEFINITIONS) /
440  sizeof(LAST_RESORT_V4_OPTION_DEFINITIONS[0]);
441 
443 
444 // client-fqdn
445 RECORD_DECL(CLIENT_FQDN_RECORDS, OPT_UINT8_TYPE, OPT_FQDN_TYPE);
446 // geoconf-civic
447 RECORD_DECL(GEOCONF_CIVIC_RECORDS, OPT_UINT8_TYPE, OPT_UINT16_TYPE,
449 // iaddr
452 // ia-na
454 // ia-pd
456 // ia-prefix
457 RECORD_DECL(IA_PREFIX_RECORDS, OPT_UINT32_TYPE, OPT_UINT32_TYPE,
459 // lq-query
461 // lq-relay-data
462 RECORD_DECL(LQ_RELAY_DATA_RECORDS, OPT_IPV6_ADDRESS_TYPE, OPT_BINARY_TYPE);
463 // remote-id
464 RECORD_DECL(REMOTE_ID_RECORDS, OPT_UINT32_TYPE, OPT_BINARY_TYPE);
465 // s46-rule
468 // s46-v4v6bind
470 // s46-portparams
471 RECORD_DECL(S46_PORTPARAMS, OPT_UINT8_TYPE, OPT_PSID_TYPE);
472 // status-code
473 RECORD_DECL(V6_STATUS_CODE_RECORDS, OPT_UINT16_TYPE, OPT_STRING_TYPE);
474 // vendor-class
475 RECORD_DECL(VENDOR_CLASS_RECORDS, OPT_UINT32_TYPE, OPT_BINARY_TYPE);
476 // rdnss-selection
477 RECORD_DECL(V6_RDNSS_SELECT_RECORDS, OPT_IPV6_ADDRESS_TYPE, OPT_UINT8_TYPE,
478  OPT_FQDN_TYPE);
479 // sedhcpv6 signature
480 RECORD_DECL(SIGNATURE_RECORDS, OPT_UINT8_TYPE, OPT_UINT8_TYPE,
482 
483 // RFC5970 (PXE) Class record fields
484 //
485 // Three 1 byte fileds to describe a network interface: type, major and minor
487 
498 const OptionDefParams STANDARD_V6_OPTION_DEFINITIONS[] = {
499  { "clientid", D6O_CLIENTID, DHCP6_OPTION_SPACE, OPT_BINARY_TYPE, false,
500  NO_RECORD_DEF, "" },
501  { "serverid", D6O_SERVERID, DHCP6_OPTION_SPACE, OPT_BINARY_TYPE, false,
502  NO_RECORD_DEF, "" },
503  { "ia-na", D6O_IA_NA, DHCP6_OPTION_SPACE, OPT_RECORD_TYPE, false,
504  RECORD_DEF(IA_NA_RECORDS), "" },
505  { "ia-ta", D6O_IA_TA, DHCP6_OPTION_SPACE, OPT_UINT32_TYPE, false,
506  NO_RECORD_DEF, "" },
507  { "iaaddr", D6O_IAADDR, DHCP6_OPTION_SPACE, OPT_RECORD_TYPE, false,
508  RECORD_DEF(IAADDR_RECORDS), "" },
510  "" },
511  { "preference", D6O_PREFERENCE, DHCP6_OPTION_SPACE, OPT_UINT8_TYPE, false,
512  NO_RECORD_DEF, "" },
514  false, NO_RECORD_DEF, "" },
515  { "relay-msg", D6O_RELAY_MSG, DHCP6_OPTION_SPACE, OPT_BINARY_TYPE, false,
516  NO_RECORD_DEF, "" },
517  // Unfortunately the AUTH option contains a 64-bit data field
518  // called 'replay-detection' that can't be added as a record
519  // field to a custom option. Also, there is no dedicated
520  // option class to handle it so we simply return binary
521  // option type for now.
522  // @todo implement a class to handle AUTH option.
523  { "auth", D6O_AUTH, DHCP6_OPTION_SPACE, OPT_BINARY_TYPE, false,
524  NO_RECORD_DEF, "" },
526  false, NO_RECORD_DEF, "" },
528  false, RECORD_DEF(V6_STATUS_CODE_RECORDS), "" },
530  false, NO_RECORD_DEF, "" },
532  false, NO_RECORD_DEF, "" },
534  false, RECORD_DEF(VENDOR_CLASS_RECORDS), "" },
536  false, NO_RECORD_DEF, "" },
538  false, NO_RECORD_DEF, "" },
539  { "reconf-msg", D6O_RECONF_MSG, DHCP6_OPTION_SPACE, OPT_UINT8_TYPE, false,
540  NO_RECORD_DEF, "" },
542  false, NO_RECORD_DEF, "" },
544  true, NO_RECORD_DEF, "" },
545  { "sip-server-addr", D6O_SIP_SERVERS_ADDR, DHCP6_OPTION_SPACE,
547  { "dns-servers", D6O_NAME_SERVERS, DHCP6_OPTION_SPACE,
550  true, NO_RECORD_DEF, "" },
551  { "ia-pd", D6O_IA_PD, DHCP6_OPTION_SPACE, OPT_RECORD_TYPE, false,
552  RECORD_DEF(IA_PD_RECORDS), "" },
553  { "iaprefix", D6O_IAPREFIX, DHCP6_OPTION_SPACE, OPT_RECORD_TYPE, false,
554  RECORD_DEF(IA_PREFIX_RECORDS), "" },
555  { "nis-servers", D6O_NIS_SERVERS, DHCP6_OPTION_SPACE,
557  { "nisp-servers", D6O_NISP_SERVERS, DHCP6_OPTION_SPACE,
559  { "nis-domain-name", D6O_NIS_DOMAIN_NAME, DHCP6_OPTION_SPACE,
560  OPT_FQDN_TYPE, true, NO_RECORD_DEF, "" },
561  { "nisp-domain-name", D6O_NISP_DOMAIN_NAME, DHCP6_OPTION_SPACE,
562  OPT_FQDN_TYPE, true, NO_RECORD_DEF, "" },
563  { "sntp-servers", D6O_SNTP_SERVERS, DHCP6_OPTION_SPACE,
565  { "information-refresh-time", D6O_INFORMATION_REFRESH_TIME,
567  { "bcmcs-server-dns", D6O_BCMCS_SERVER_D, DHCP6_OPTION_SPACE,
568  OPT_FQDN_TYPE, true, NO_RECORD_DEF, "" },
569  { "bcmcs-server-addr", D6O_BCMCS_SERVER_A, DHCP6_OPTION_SPACE,
571  { "geoconf-civic", D6O_GEOCONF_CIVIC, DHCP6_OPTION_SPACE,
572  OPT_RECORD_TYPE, false, RECORD_DEF(GEOCONF_CIVIC_RECORDS), "" },
573  { "remote-id", D6O_REMOTE_ID, DHCP6_OPTION_SPACE, OPT_RECORD_TYPE, false,
574  RECORD_DEF(REMOTE_ID_RECORDS), "" },
576  false, NO_RECORD_DEF, "" },
578  false, RECORD_DEF(CLIENT_FQDN_RECORDS), "" },
580  true, NO_RECORD_DEF, "" },
581  { "new-posix-timezone", D6O_NEW_POSIX_TIMEZONE, DHCP6_OPTION_SPACE,
582  OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
583  { "new-tzdb-timezone", D6O_NEW_TZDB_TIMEZONE, DHCP6_OPTION_SPACE,
584  OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
585  { "ero", D6O_ERO, DHCP6_OPTION_SPACE, OPT_UINT16_TYPE, true,
586  NO_RECORD_DEF, "" },
587  { "lq-query", D6O_LQ_QUERY, DHCP6_OPTION_SPACE, OPT_RECORD_TYPE, false,
588  RECORD_DEF(LQ_QUERY_RECORDS), DHCP6_OPTION_SPACE },
590  false, NO_RECORD_DEF, DHCP6_OPTION_SPACE },
591  { "clt-time", D6O_CLT_TIME, DHCP6_OPTION_SPACE, OPT_UINT32_TYPE, false,
592  NO_RECORD_DEF, "" },
594  false, RECORD_DEF(LQ_RELAY_DATA_RECORDS), "" },
595  { "lq-client-link", D6O_LQ_CLIENT_LINK, DHCP6_OPTION_SPACE,
597  { "v6-lost", D6O_V6_LOST, DHCP6_OPTION_SPACE, OPT_FQDN_TYPE, false,
598  NO_RECORD_DEF, "" },
599  { "capwap-ac-v6", D6O_CAPWAP_AC_V6, DHCP6_OPTION_SPACE,
601  { "relay-id", D6O_RELAY_ID, DHCP6_OPTION_SPACE, OPT_BINARY_TYPE, false,
602  NO_RECORD_DEF, "" },
603  { "v6-access-domain", D6O_V6_ACCESS_DOMAIN, DHCP6_OPTION_SPACE,
604  OPT_FQDN_TYPE, false, NO_RECORD_DEF, "" },
605  { "sip-ua-cs-list", D6O_SIP_UA_CS_LIST, DHCP6_OPTION_SPACE,
606  OPT_FQDN_TYPE, true, NO_RECORD_DEF, "" },
608  false, NO_RECORD_DEF, "" },
610  true, NO_RECORD_DEF, "" },
611  { "client-arch-type", D6O_CLIENT_ARCH_TYPE, DHCP6_OPTION_SPACE,
612  OPT_UINT16_TYPE, true, NO_RECORD_DEF, "" },
613  { "nii", D6O_NII, DHCP6_OPTION_SPACE, OPT_RECORD_TYPE, false,
614  RECORD_DEF(CLIENT_NII_RECORDS), "" },
615  { "aftr-name", D6O_AFTR_NAME, DHCP6_OPTION_SPACE, OPT_FQDN_TYPE, false,
616  NO_RECORD_DEF, "" },
617  { "erp-local-domain-name", D6O_ERP_LOCAL_DOMAIN_NAME, DHCP6_OPTION_SPACE
618  , OPT_FQDN_TYPE, false, NO_RECORD_DEF, "" },
619  { "rsoo", D6O_RSOO, DHCP6_OPTION_SPACE, OPT_EMPTY_TYPE, false,
620  NO_RECORD_DEF, "rsoo-opts" },
622  false, NO_RECORD_DEF, "" },
623  { "rdnss-selection", D6O_RDNSS_SELECTION, DHCP6_OPTION_SPACE,
624  OPT_RECORD_TYPE, true, RECORD_DEF(V6_RDNSS_SELECT_RECORDS), "" },
625  { "client-linklayer-addr", D6O_CLIENT_LINKLAYER_ADDR, DHCP6_OPTION_SPACE,
626  OPT_BINARY_TYPE, false, NO_RECORD_DEF, "" },
627  { "link-address", D6O_LINK_ADDRESS, DHCP6_OPTION_SPACE,
628  OPT_IPV6_ADDRESS_TYPE, false, NO_RECORD_DEF, "" },
629  { "solmax-rt", D6O_SOL_MAX_RT, DHCP6_OPTION_SPACE, OPT_UINT32_TYPE, false,
630  NO_RECORD_DEF, "" },
631  { "inf-max-rt", D6O_INF_MAX_RT, DHCP6_OPTION_SPACE, OPT_UINT32_TYPE, false,
632  NO_RECORD_DEF, "" },
633  { "dhcpv4-message", D6O_DHCPV4_MSG, DHCP6_OPTION_SPACE, OPT_BINARY_TYPE,
634  false, NO_RECORD_DEF, "" },
635  { "dhcp4o6-server-addr", D6O_DHCPV4_O_DHCPV6_SERVER, DHCP6_OPTION_SPACE,
637  { "v6-captive-portal", D6O_V6_CAPTIVE_PORTAL, DHCP6_OPTION_SPACE,
638  OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
639  { "relay-source-port", D6O_RELAY_SOURCE_PORT, DHCP6_OPTION_SPACE,
640  OPT_UINT16_TYPE, false, NO_RECORD_DEF, "" },
641  { "ipv6-address-andsf", D6O_IPV6_ADDRESS_ANDSF, DHCP6_OPTION_SPACE,
649 
650  // @todo There is still a bunch of options for which we have to provide
651  // definitions but we don't do it because they are not really
652  // critical right now.
653 };
654 
656 const int STANDARD_V6_OPTION_DEFINITIONS_SIZE =
657  sizeof(STANDARD_V6_OPTION_DEFINITIONS) /
658  sizeof(STANDARD_V6_OPTION_DEFINITIONS[0]);
659 
666 const OptionDefParams ISC_V6_OPTION_DEFINITIONS[] = {
667  { "4o6-interface", ISC_V6_4O6_INTERFACE, ISC_V6_OPTION_SPACE,
668  OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
669  { "4o6-source-address", ISC_V6_4O6_SRC_ADDRESS, ISC_V6_OPTION_SPACE,
670  OPT_IPV6_ADDRESS_TYPE, false, NO_RECORD_DEF, "" },
671  { "4o6-source-port", ISC_V6_4O6_SRC_PORT, ISC_V6_OPTION_SPACE,
672  OPT_UINT16_TYPE, false, NO_RECORD_DEF, "" }
673 };
674 
675 const int ISC_V6_OPTION_DEFINITIONS_SIZE =
676  sizeof(ISC_V6_OPTION_DEFINITIONS) /
677  sizeof(ISC_V6_OPTION_DEFINITIONS[0]);
678 
680 const OptionDefParams MAPE_V6_OPTION_DEFINITIONS[] = {
682  NO_RECORD_DEF, "" },
683  { "s46-rule", D6O_S46_RULE, MAPE_V6_OPTION_SPACE, OPT_RECORD_TYPE, false,
685 };
686 
687 const int MAPE_V6_OPTION_DEFINITIONS_SIZE =
688  sizeof(MAPE_V6_OPTION_DEFINITIONS) /
689  sizeof(MAPE_V6_OPTION_DEFINITIONS[0]);
690 
692 const OptionDefParams MAPT_V6_OPTION_DEFINITIONS[] = {
693  { "s46-rule", D6O_S46_RULE, MAPT_V6_OPTION_SPACE, OPT_RECORD_TYPE, false,
694  RECORD_DEF(S46_RULE), V4V6_RULE_OPTION_SPACE },
696  false, NO_RECORD_DEF, "" }
697 };
698 
699 const int MAPT_V6_OPTION_DEFINITIONS_SIZE =
700  sizeof(MAPT_V6_OPTION_DEFINITIONS) /
701  sizeof(MAPT_V6_OPTION_DEFINITIONS[0]);
702 
704 const OptionDefParams LW_V6_OPTION_DEFINITIONS[] = {
706  NO_RECORD_DEF, "" },
708  false, RECORD_DEF(S46_V4V6BIND), V4V6_BIND_OPTION_SPACE }
709 };
710 
711 const int LW_V6_OPTION_DEFINITIONS_SIZE =
712  sizeof(LW_V6_OPTION_DEFINITIONS) /
713  sizeof(LW_V6_OPTION_DEFINITIONS[0]);
714 
716 const OptionDefParams V4V6_RULE_OPTION_DEFINITIONS[] = {
717  { "s46-portparams", D6O_S46_PORTPARAMS, V4V6_RULE_OPTION_SPACE,
718  OPT_RECORD_TYPE, false, RECORD_DEF(S46_PORTPARAMS), "" }
719 };
720 
721 const int V4V6_RULE_OPTION_DEFINITIONS_SIZE =
722  sizeof(V4V6_RULE_OPTION_DEFINITIONS) /
723  sizeof(V4V6_RULE_OPTION_DEFINITIONS[0]);
724 
726 const OptionDefParams V4V6_BIND_OPTION_DEFINITIONS[] = {
727  { "s46-portparams", D6O_S46_PORTPARAMS, V4V6_BIND_OPTION_SPACE,
728  OPT_RECORD_TYPE, false, RECORD_DEF(S46_PORTPARAMS), "" }
729 };
730 
731 const int V4V6_BIND_OPTION_DEFINITIONS_SIZE =
732  sizeof(V4V6_BIND_OPTION_DEFINITIONS) /
733  sizeof(V4V6_BIND_OPTION_DEFINITIONS[0]);
734 
735 } // namespace
736 
737 } // namespace dhcp
738 } // namespace isc
739 
740 #endif // STD_OPTION_DEFS_H
#define V4V6_BIND_OPTION_SPACE
#define V4V6_RULE_OPTION_SPACE
#define RECORD_DECL(name,...)
Declare an array holding parameters used to create instance of a definition for option comprising a r...
#define LW_V6_OPTION_SPACE
Definition: dhcp6.h:31
#define MAPT_V6_OPTION_SPACE
#define MAPE_V6_OPTION_SPACE
#define ISC_V6_OPTION_SPACE
#define DHCP_AGENT_OPTION_SPACE
encapsulated option spaces
Definition: dhcp6.h:82
Definition: dhcp6.h:26
Defines the logger used by the top-level component of kea-lfc.
#define VENDOR_ENCAPSULATED_OPTION_SPACE
#define DHCP6_OPTION_SPACE
#define DHCP4_OPTION_SPACE
global std option spaces
#define NO_RECORD_DEF
Definition: dhcp6.h:63
#define RECORD_DEF(name)
A pair of values: one pointing to the array holding types of data fields belonging to the record...
Definition: dhcp6.h:86