Kea  2.1.6-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 // RFC7618 DHCPv4 Port Parameter option.
97 //
98 // PSID offset, PSID-len and PSID
99 RECORD_DECL(V4_PORTPARAMS_RECORDS, OPT_UINT8_TYPE, OPT_PSID_TYPE);
100 
101 // RFC5969 DHCPv6 6RD option.
102 //
103 // two 8 bit lengthes, an IPv6 address and one or more IPv4 addresses
104 RECORD_DECL(OPT_6RD_RECORDS, OPT_UINT8_TYPE, OPT_UINT8_TYPE,
106 
108 const OptionDefParams STANDARD_V4_OPTION_DEFINITIONS[] = {
109  { "subnet-mask", DHO_SUBNET_MASK, DHCP4_OPTION_SPACE,
110  OPT_IPV4_ADDRESS_TYPE, false, NO_RECORD_DEF, "" },
112  false, NO_RECORD_DEF, "" },
114  NO_RECORD_DEF, "" },
115  { "time-servers", DHO_TIME_SERVERS, DHCP4_OPTION_SPACE,
117  { "name-servers", DHO_NAME_SERVERS, DHCP4_OPTION_SPACE,
119  { "domain-name-servers", DHO_DOMAIN_NAME_SERVERS, DHCP4_OPTION_SPACE,
121  { "log-servers", DHO_LOG_SERVERS, DHCP4_OPTION_SPACE,
123  { "cookie-servers", DHO_COOKIE_SERVERS, DHCP4_OPTION_SPACE,
125  { "lpr-servers", DHO_LPR_SERVERS, DHCP4_OPTION_SPACE,
127  { "impress-servers", DHO_IMPRESS_SERVERS, DHCP4_OPTION_SPACE,
129  { "resource-location-servers", DHO_RESOURCE_LOCATION_SERVERS,
131  { "host-name", DHO_HOST_NAME, DHCP4_OPTION_SPACE, OPT_STRING_TYPE, false,
132  NO_RECORD_DEF, "" },
133  { "boot-size", DHO_BOOT_SIZE, DHCP4_OPTION_SPACE, OPT_UINT16_TYPE, false,
134  NO_RECORD_DEF, "" },
136  false, NO_RECORD_DEF, "" },
138  false, NO_RECORD_DEF, "" },
139  { "swap-server", DHO_SWAP_SERVER, DHCP4_OPTION_SPACE,
140  OPT_IPV4_ADDRESS_TYPE, false, NO_RECORD_DEF, "" },
141  { "root-path", DHO_ROOT_PATH, DHCP4_OPTION_SPACE, OPT_STRING_TYPE, false,
142  NO_RECORD_DEF, "" },
143  { "extensions-path", DHO_EXTENSIONS_PATH, DHCP4_OPTION_SPACE,
144  OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
146  false, NO_RECORD_DEF, "" },
147  { "non-local-source-routing", DHO_NON_LOCAL_SOURCE_ROUTING,
149  { "policy-filter", DHO_POLICY_FILTER, DHCP4_OPTION_SPACE,
151  { "max-dgram-reassembly", DHO_MAX_DGRAM_REASSEMBLY, DHCP4_OPTION_SPACE,
152  OPT_UINT16_TYPE, false, NO_RECORD_DEF, "" },
154  false, NO_RECORD_DEF, "" },
155  { "path-mtu-aging-timeout", DHO_PATH_MTU_AGING_TIMEOUT, DHCP4_OPTION_SPACE,
156  OPT_UINT32_TYPE, false, NO_RECORD_DEF, "" },
157  { "path-mtu-plateau-table", DHO_PATH_MTU_PLATEAU_TABLE, DHCP4_OPTION_SPACE,
158  OPT_UINT16_TYPE, true, NO_RECORD_DEF, "" },
160  false, NO_RECORD_DEF, "" },
161  { "all-subnets-local", DHO_ALL_SUBNETS_LOCAL, DHCP4_OPTION_SPACE,
162  OPT_BOOLEAN_TYPE, false, NO_RECORD_DEF, "" },
163  { "broadcast-address", DHO_BROADCAST_ADDRESS, DHCP4_OPTION_SPACE,
164  OPT_IPV4_ADDRESS_TYPE, false, NO_RECORD_DEF, "" },
165  { "perform-mask-discovery", DHO_PERFORM_MASK_DISCOVERY, DHCP4_OPTION_SPACE,
166  OPT_BOOLEAN_TYPE, false, NO_RECORD_DEF, "" },
168  false, NO_RECORD_DEF, "" },
169  { "router-discovery", DHO_ROUTER_DISCOVERY, DHCP4_OPTION_SPACE,
170  OPT_BOOLEAN_TYPE, false, NO_RECORD_DEF, "" },
171  { "router-solicitation-address", DHO_ROUTER_SOLICITATION_ADDRESS,
173  { "static-routes", DHO_STATIC_ROUTES, DHCP4_OPTION_SPACE,
175  { "trailer-encapsulation", DHO_TRAILER_ENCAPSULATION, DHCP4_OPTION_SPACE,
176  OPT_BOOLEAN_TYPE, false, NO_RECORD_DEF, "" },
177  { "arp-cache-timeout", DHO_ARP_CACHE_TIMEOUT, DHCP4_OPTION_SPACE,
178  OPT_UINT32_TYPE, false, NO_RECORD_DEF, "" },
179  { "ieee802-3-encapsulation", DHO_IEEE802_3_ENCAPSULATION,
181  { "default-tcp-ttl", DHO_DEFAULT_TCP_TTL, DHCP4_OPTION_SPACE,
182  OPT_UINT8_TYPE, false, NO_RECORD_DEF, "" },
183  { "tcp-keepalive-interval", DHO_TCP_KEEPALIVE_INTERVAL, DHCP4_OPTION_SPACE,
184  OPT_UINT32_TYPE, false, NO_RECORD_DEF, "" },
185  { "tcp-keepalive-garbage", DHO_TCP_KEEPALIVE_GARBAGE, DHCP4_OPTION_SPACE,
186  OPT_BOOLEAN_TYPE, false, NO_RECORD_DEF, "" },
187  { "nis-domain", DHO_NIS_DOMAIN, DHCP4_OPTION_SPACE, OPT_STRING_TYPE, false,
188  NO_RECORD_DEF, "" },
189  { "nis-servers", DHO_NIS_SERVERS, DHCP4_OPTION_SPACE,
191  { "ntp-servers", DHO_NTP_SERVERS, DHCP4_OPTION_SPACE,
194  { "netbios-name-servers", DHO_NETBIOS_NAME_SERVERS, DHCP4_OPTION_SPACE,
196  { "netbios-dd-server", DHO_NETBIOS_DD_SERVER, DHCP4_OPTION_SPACE,
198  { "netbios-node-type", DHO_NETBIOS_NODE_TYPE, DHCP4_OPTION_SPACE,
199  OPT_UINT8_TYPE, false, NO_RECORD_DEF, "" },
201  false, NO_RECORD_DEF, "" },
202  { "font-servers", DHO_FONT_SERVERS, DHCP4_OPTION_SPACE,
204  { "x-display-manager", DHO_X_DISPLAY_MANAGER, DHCP4_OPTION_SPACE,
206  { "dhcp-requested-address", DHO_DHCP_REQUESTED_ADDRESS, DHCP4_OPTION_SPACE,
207  OPT_IPV4_ADDRESS_TYPE, false, NO_RECORD_DEF, "" },
208  { "dhcp-lease-time", DHO_DHCP_LEASE_TIME, DHCP4_OPTION_SPACE,
209  OPT_UINT32_TYPE, false, NO_RECORD_DEF, "" },
210  { "dhcp-option-overload", DHO_DHCP_OPTION_OVERLOAD, DHCP4_OPTION_SPACE,
211  OPT_UINT8_TYPE, false, NO_RECORD_DEF, "" },
212  { "dhcp-message-type", DHO_DHCP_MESSAGE_TYPE, DHCP4_OPTION_SPACE,
213  OPT_UINT8_TYPE, false, NO_RECORD_DEF, "" },
214  { "dhcp-server-identifier", DHO_DHCP_SERVER_IDENTIFIER, DHCP4_OPTION_SPACE,
215  OPT_IPV4_ADDRESS_TYPE, false, NO_RECORD_DEF, "" },
216  { "dhcp-parameter-request-list", DHO_DHCP_PARAMETER_REQUEST_LIST,
219  false, NO_RECORD_DEF, "" },
220  { "dhcp-max-message-size", DHO_DHCP_MAX_MESSAGE_SIZE, DHCP4_OPTION_SPACE,
221  OPT_UINT16_TYPE, false, NO_RECORD_DEF, "" },
222  { "dhcp-renewal-time", DHO_DHCP_RENEWAL_TIME, DHCP4_OPTION_SPACE,
223  OPT_UINT32_TYPE, false, NO_RECORD_DEF, "" },
224  { "dhcp-rebinding-time", DHO_DHCP_REBINDING_TIME, DHCP4_OPTION_SPACE,
225  OPT_UINT32_TYPE, false, NO_RECORD_DEF, "" },
226  { "vendor-class-identifier", DHO_VENDOR_CLASS_IDENTIFIER,
228  { "dhcp-client-identifier", DHO_DHCP_CLIENT_IDENTIFIER, DHCP4_OPTION_SPACE,
229  OPT_BINARY_TYPE, false, NO_RECORD_DEF, "" },
230  { "nwip-domain-name", DHO_NWIP_DOMAIN_NAME, DHCP4_OPTION_SPACE,
231  OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
232  { "nwip-suboptions", DHO_NWIP_SUBOPTIONS, DHCP4_OPTION_SPACE,
233  OPT_BINARY_TYPE, false, NO_RECORD_DEF, "" },
234  { "nisplus-domain-name", DHO_NISP_DOMAIN_NAME, DHCP4_OPTION_SPACE,
235  OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
236  { "nisplus-servers", DHO_NISP_SERVER_ADDR, DHCP4_OPTION_SPACE,
238  { "tftp-server-name", DHO_TFTP_SERVER_NAME, DHCP4_OPTION_SPACE,
239  OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
240  { "boot-file-name", DHO_BOOT_FILE_NAME, DHCP4_OPTION_SPACE,
241  OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
242  { "mobile-ip-home-agent", DHO_HOME_AGENT_ADDRS, DHCP4_OPTION_SPACE,
244  { "smtp-server", DHO_SMTP_SERVER, DHCP4_OPTION_SPACE,
247  true, NO_RECORD_DEF, "" },
248  { "nntp-server", DHO_NNTP_SERVER, DHCP4_OPTION_SPACE,
251  true, NO_RECORD_DEF, "" },
252  { "finger-server", DHO_FINGER_SERVER, DHCP4_OPTION_SPACE,
255  true, NO_RECORD_DEF, "" },
256  { "streettalk-server", DHO_STREETTALK_SERVER, DHCP4_OPTION_SPACE,
258  { "streettalk-directory-assistance-server", DHO_STDASERVER,
260  { "user-class", DHO_USER_CLASS, DHCP4_OPTION_SPACE, OPT_BINARY_TYPE, false,
261  NO_RECORD_DEF, "" },
262  { "slp-directory-agent", DHO_DIRECTORY_AGENT, DHCP4_OPTION_SPACE,
263  OPT_RECORD_TYPE, true, RECORD_DEF(DIRECTORY_AGENT_RECORDS), "" },
264  { "slp-service-scope", DHO_SERVICE_SCOPE, DHCP4_OPTION_SPACE,
265  OPT_RECORD_TYPE, false, RECORD_DEF(SERVICE_SCOPE_RECORDS), "" },
266  { "fqdn", DHO_FQDN, DHCP4_OPTION_SPACE, OPT_RECORD_TYPE, false,
267  RECORD_DEF(FQDN_RECORDS), "" },
268  { "dhcp-agent-options", DHO_DHCP_AGENT_OPTIONS, DHCP4_OPTION_SPACE,
270  { "nds-servers", DHO_NDS_SERVERS, DHCP4_OPTION_SPACE,
273  false, NO_RECORD_DEF, "" },
275  false, NO_RECORD_DEF, "" },
276  { "bcms-controller-names", DHO_BCMCS_DOMAIN_NAME_LIST, DHCP4_OPTION_SPACE,
277  OPT_FQDN_TYPE, true, NO_RECORD_DEF, "" },
278  { "bcms-controller-address", DHO_BCMCS_IPV4_ADDR, DHCP4_OPTION_SPACE,
280  // Unfortunately the AUTHENTICATE option contains a 64-bit
281  // data field called 'replay-detection' that can't be added
282  // as a record field to a custom option. Also, there is no
283  // dedicated option class to handle it so we simply return
284  // binary option type for now.
285  // @todo implement a class to handle AUTH option.
287  false, NO_RECORD_DEF, "" },
288  { "client-last-transaction-time", DHO_CLIENT_LAST_TRANSACTION_TIME,
290  { "associated-ip", DHO_ASSOCIATED_IP, DHCP4_OPTION_SPACE,
292  { "client-system", DHO_SYSTEM, DHCP4_OPTION_SPACE, OPT_UINT16_TYPE, true,
293  NO_RECORD_DEF, "" },
294  { "client-ndi", DHO_NDI, DHCP4_OPTION_SPACE, OPT_RECORD_TYPE, false,
295  RECORD_DEF(CLIENT_NDI_RECORDS), "" },
296  { "uuid-guid", DHO_UUID_GUID, DHCP4_OPTION_SPACE, OPT_RECORD_TYPE, false,
297  RECORD_DEF(UUID_GUID_RECORDS), "" },
298  { "uap-servers", DHO_USER_AUTH, DHCP4_OPTION_SPACE, OPT_STRING_TYPE, false,
299  NO_RECORD_DEF, "" },
301  false, NO_RECORD_DEF, "" },
302  { "pcode", DHO_PCODE, DHCP4_OPTION_SPACE, OPT_STRING_TYPE, false,
303  NO_RECORD_DEF, "" },
304  { "tcode", DHO_TCODE, DHCP4_OPTION_SPACE, OPT_STRING_TYPE, false,
305  NO_RECORD_DEF, "" },
306  { "v6-only-preferred", DHO_V6_ONLY_PREFERRED, DHCP4_OPTION_SPACE,
307  OPT_UINT32_TYPE, false, NO_RECORD_DEF, "" },
308  { "netinfo-server-address", DHO_NETINFO_ADDR, DHCP4_OPTION_SPACE,
310  { "netinfo-server-tag", DHO_NETINFO_TAG, DHCP4_OPTION_SPACE,
311  OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
312  { "v4-captive-portal", DHO_V4_CAPTIVE_PORTAL, DHCP4_OPTION_SPACE,
313  OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
315  false, NO_RECORD_DEF, "" },
316  { "name-service-search", DHO_NAME_SERVICE_SEARCH, DHCP4_OPTION_SPACE,
317  OPT_UINT16_TYPE, true, NO_RECORD_DEF, "" },
318  { "subnet-selection", DHO_SUBNET_SELECTION, DHCP4_OPTION_SPACE,
319  OPT_IPV4_ADDRESS_TYPE, false, NO_RECORD_DEF, "" },
321  true, NO_RECORD_DEF, "" },
322  { "vivco-suboptions", DHO_VIVCO_SUBOPTIONS, DHCP4_OPTION_SPACE,
323  OPT_RECORD_TYPE, false, RECORD_DEF(VIVCO_RECORDS), "" },
324  // Vendor-Identifying Vendor Specific Information option payload begins with a
325  // 32-bit log enterprise number, followed by a tuple of data-len/option-data.
326  // The format defined here includes 32-bit field holding enterprise number.
327  // This allows for specifying option-data information where the enterprise-id
328  // is represented by a uint32_t value. Previously we represented this option
329  // as a binary, but that would imply that enterprise number would have to be
330  // represented in binary format in the server configuration. That would be
331  // inconvenient and non-intuitive.
336  { "vivso-suboptions", DHO_VIVSO_SUBOPTIONS, DHCP4_OPTION_SPACE,
337  OPT_UINT32_TYPE, false, NO_RECORD_DEF, "" },
339  true, NO_RECORD_DEF, "" },
340  { "v4-lost", DHO_V4_LOST, DHCP4_OPTION_SPACE, OPT_FQDN_TYPE, false,
341  NO_RECORD_DEF, "" },
342  { "capwap-ac-v4", DHO_CAPWAP_AC_V4, DHCP4_OPTION_SPACE,
344  { "sip-ua-cs-domains", DHO_SIP_UA_CONF_SERVICE_DOMAINS, DHCP4_OPTION_SPACE,
345  OPT_FQDN_TYPE, true, NO_RECORD_DEF, "" },
346  { "rdnss-selection", DHO_RDNSS_SELECT, DHCP4_OPTION_SPACE, OPT_RECORD_TYPE,
347  true, RECORD_DEF(V4_RDNSS_SELECT_RECORDS), "" },
349  false, RECORD_DEF(V4_PORTPARAMS_RECORDS), "" },
350  { "option-6rd", DHO_6RD, DHCP4_OPTION_SPACE, OPT_RECORD_TYPE, true,
351  RECORD_DEF(OPT_6RD_RECORDS), "" },
352  { "v4-access-domain", DHO_V4_ACCESS_DOMAIN, DHCP4_OPTION_SPACE,
353  OPT_FQDN_TYPE, false, NO_RECORD_DEF, "" }
354 
355  // @todo add definitions for all remaining options.
356 };
357 
359 const int STANDARD_V4_OPTION_DEFINITIONS_SIZE =
360  sizeof(STANDARD_V4_OPTION_DEFINITIONS) /
361  sizeof(STANDARD_V4_OPTION_DEFINITIONS[0]);
362 
365 const OptionDefParams LAST_RESORT_V4_OPTION_DEFINITIONS[] = {
366  { "vendor-encapsulated-options", DHO_VENDOR_ENCAPSULATED_OPTIONS,
369 };
370 
371 const int LAST_RESORT_V4_OPTION_DEFINITIONS_SIZE =
372  sizeof(LAST_RESORT_V4_OPTION_DEFINITIONS) /
373  sizeof(LAST_RESORT_V4_OPTION_DEFINITIONS[0]);
374 
376 
377 // client-fqdn
378 RECORD_DECL(CLIENT_FQDN_RECORDS, OPT_UINT8_TYPE, OPT_FQDN_TYPE);
379 // geoconf-civic
380 RECORD_DECL(GEOCONF_CIVIC_RECORDS, OPT_UINT8_TYPE, OPT_UINT16_TYPE,
382 // iaddr
385 // ia-na
387 // ia-pd
389 // ia-prefix
390 RECORD_DECL(IA_PREFIX_RECORDS, OPT_UINT32_TYPE, OPT_UINT32_TYPE,
392 // lq-query
394 // lq-relay-data
395 RECORD_DECL(LQ_RELAY_DATA_RECORDS, OPT_IPV6_ADDRESS_TYPE, OPT_BINARY_TYPE);
396 // remote-id
397 RECORD_DECL(REMOTE_ID_RECORDS, OPT_UINT32_TYPE, OPT_BINARY_TYPE);
398 // s46-rule
401 // s46-v4v6bind
403 // s46-portparams
404 RECORD_DECL(S46_PORTPARAMS, OPT_UINT8_TYPE, OPT_PSID_TYPE);
405 // status-code
406 RECORD_DECL(STATUS_CODE_RECORDS, OPT_UINT16_TYPE, OPT_STRING_TYPE);
407 // vendor-class
408 RECORD_DECL(VENDOR_CLASS_RECORDS, OPT_UINT32_TYPE, OPT_BINARY_TYPE);
409 // rdnss-selection
410 RECORD_DECL(V6_RDNSS_SELECT_RECORDS, OPT_IPV6_ADDRESS_TYPE, OPT_UINT8_TYPE,
411  OPT_FQDN_TYPE);
412 // sedhcpv6 signature
413 RECORD_DECL(SIGNATURE_RECORDS, OPT_UINT8_TYPE, OPT_UINT8_TYPE,
415 
416 // RFC5970 (PXE) Class record fields
417 //
418 // Three 1 byte fileds to describe a network interface: type, major and minor
420 
431 const OptionDefParams STANDARD_V6_OPTION_DEFINITIONS[] = {
432  { "clientid", D6O_CLIENTID, DHCP6_OPTION_SPACE, OPT_BINARY_TYPE, false,
433  NO_RECORD_DEF, "" },
434  { "serverid", D6O_SERVERID, DHCP6_OPTION_SPACE, OPT_BINARY_TYPE, false,
435  NO_RECORD_DEF, "" },
436  { "ia-na", D6O_IA_NA, DHCP6_OPTION_SPACE, OPT_RECORD_TYPE, false,
437  RECORD_DEF(IA_NA_RECORDS), "" },
438  { "ia-ta", D6O_IA_TA, DHCP6_OPTION_SPACE, OPT_UINT32_TYPE, false,
439  NO_RECORD_DEF, "" },
440  { "iaaddr", D6O_IAADDR, DHCP6_OPTION_SPACE, OPT_RECORD_TYPE, false,
441  RECORD_DEF(IAADDR_RECORDS), "" },
443  "" },
444  { "preference", D6O_PREFERENCE, DHCP6_OPTION_SPACE, OPT_UINT8_TYPE, false,
445  NO_RECORD_DEF, "" },
447  false, NO_RECORD_DEF, "" },
448  { "relay-msg", D6O_RELAY_MSG, DHCP6_OPTION_SPACE, OPT_BINARY_TYPE, false,
449  NO_RECORD_DEF, "" },
450  // Unfortunately the AUTH option contains a 64-bit data field
451  // called 'replay-detection' that can't be added as a record
452  // field to a custom option. Also, there is no dedicated
453  // option class to handle it so we simply return binary
454  // option type for now.
455  // @todo implement a class to handle AUTH option.
456  { "auth", D6O_AUTH, DHCP6_OPTION_SPACE, OPT_BINARY_TYPE, false,
457  NO_RECORD_DEF, "" },
459  false, NO_RECORD_DEF, "" },
461  false, RECORD_DEF(STATUS_CODE_RECORDS), "" },
463  false, NO_RECORD_DEF, "" },
465  false, NO_RECORD_DEF, "" },
467  false, RECORD_DEF(VENDOR_CLASS_RECORDS), "" },
469  false, NO_RECORD_DEF, "" },
471  false, NO_RECORD_DEF, "" },
472  { "reconf-msg", D6O_RECONF_MSG, DHCP6_OPTION_SPACE, OPT_UINT8_TYPE, false,
473  NO_RECORD_DEF, "" },
475  false, NO_RECORD_DEF, "" },
477  true, NO_RECORD_DEF, "" },
478  { "sip-server-addr", D6O_SIP_SERVERS_ADDR, DHCP6_OPTION_SPACE,
480  { "dns-servers", D6O_NAME_SERVERS, DHCP6_OPTION_SPACE,
483  true, NO_RECORD_DEF, "" },
484  { "ia-pd", D6O_IA_PD, DHCP6_OPTION_SPACE, OPT_RECORD_TYPE, false,
485  RECORD_DEF(IA_PD_RECORDS), "" },
486  { "iaprefix", D6O_IAPREFIX, DHCP6_OPTION_SPACE, OPT_RECORD_TYPE, false,
487  RECORD_DEF(IA_PREFIX_RECORDS), "" },
488  { "nis-servers", D6O_NIS_SERVERS, DHCP6_OPTION_SPACE,
490  { "nisp-servers", D6O_NISP_SERVERS, DHCP6_OPTION_SPACE,
492  { "nis-domain-name", D6O_NIS_DOMAIN_NAME, DHCP6_OPTION_SPACE,
493  OPT_FQDN_TYPE, true, NO_RECORD_DEF, "" },
494  { "nisp-domain-name", D6O_NISP_DOMAIN_NAME, DHCP6_OPTION_SPACE,
495  OPT_FQDN_TYPE, true, NO_RECORD_DEF, "" },
496  { "sntp-servers", D6O_SNTP_SERVERS, DHCP6_OPTION_SPACE,
498  { "information-refresh-time", D6O_INFORMATION_REFRESH_TIME,
500  { "bcmcs-server-dns", D6O_BCMCS_SERVER_D, DHCP6_OPTION_SPACE,
501  OPT_FQDN_TYPE, true, NO_RECORD_DEF, "" },
502  { "bcmcs-server-addr", D6O_BCMCS_SERVER_A, DHCP6_OPTION_SPACE,
504  { "geoconf-civic", D6O_GEOCONF_CIVIC, DHCP6_OPTION_SPACE,
505  OPT_RECORD_TYPE, false, RECORD_DEF(GEOCONF_CIVIC_RECORDS), "" },
506  { "remote-id", D6O_REMOTE_ID, DHCP6_OPTION_SPACE, OPT_RECORD_TYPE, false,
507  RECORD_DEF(REMOTE_ID_RECORDS), "" },
509  false, NO_RECORD_DEF, "" },
511  false, RECORD_DEF(CLIENT_FQDN_RECORDS), "" },
513  true, NO_RECORD_DEF, "" },
514  { "new-posix-timezone", D6O_NEW_POSIX_TIMEZONE, DHCP6_OPTION_SPACE,
515  OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
516  { "new-tzdb-timezone", D6O_NEW_TZDB_TIMEZONE, DHCP6_OPTION_SPACE,
517  OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
518  { "ero", D6O_ERO, DHCP6_OPTION_SPACE, OPT_UINT16_TYPE, true,
519  NO_RECORD_DEF, "" },
520  { "lq-query", D6O_LQ_QUERY, DHCP6_OPTION_SPACE, OPT_RECORD_TYPE, false,
521  RECORD_DEF(LQ_QUERY_RECORDS), DHCP6_OPTION_SPACE },
523  false, NO_RECORD_DEF, DHCP6_OPTION_SPACE },
524  { "clt-time", D6O_CLT_TIME, DHCP6_OPTION_SPACE, OPT_UINT32_TYPE, false,
525  NO_RECORD_DEF, "" },
527  false, RECORD_DEF(LQ_RELAY_DATA_RECORDS), "" },
528  { "lq-client-link", D6O_LQ_CLIENT_LINK, DHCP6_OPTION_SPACE,
530  { "v6-lost", D6O_V6_LOST, DHCP6_OPTION_SPACE, OPT_FQDN_TYPE, false,
531  NO_RECORD_DEF, "" },
532  { "capwap-ac-v6", D6O_CAPWAP_AC_V6, DHCP6_OPTION_SPACE,
534  { "relay-id", D6O_RELAY_ID, DHCP6_OPTION_SPACE, OPT_BINARY_TYPE, false,
535  NO_RECORD_DEF, "" },
536  { "v6-access-domain", D6O_V6_ACCESS_DOMAIN, DHCP6_OPTION_SPACE,
537  OPT_FQDN_TYPE, false, NO_RECORD_DEF, "" },
538  { "sip-ua-cs-list", D6O_SIP_UA_CS_LIST, DHCP6_OPTION_SPACE,
539  OPT_FQDN_TYPE, true, NO_RECORD_DEF, "" },
541  false, NO_RECORD_DEF, "" },
543  true, NO_RECORD_DEF, "" },
544  { "client-arch-type", D6O_CLIENT_ARCH_TYPE, DHCP6_OPTION_SPACE,
545  OPT_UINT16_TYPE, true, NO_RECORD_DEF, "" },
546  { "nii", D6O_NII, DHCP6_OPTION_SPACE, OPT_RECORD_TYPE, false,
547  RECORD_DEF(CLIENT_NII_RECORDS), "" },
548  { "aftr-name", D6O_AFTR_NAME, DHCP6_OPTION_SPACE, OPT_FQDN_TYPE, false,
549  NO_RECORD_DEF, "" },
550  { "erp-local-domain-name", D6O_ERP_LOCAL_DOMAIN_NAME, DHCP6_OPTION_SPACE
551  , OPT_FQDN_TYPE, false, NO_RECORD_DEF, "" },
552  { "rsoo", D6O_RSOO, DHCP6_OPTION_SPACE, OPT_EMPTY_TYPE, false,
553  NO_RECORD_DEF, "rsoo-opts" },
555  false, NO_RECORD_DEF, "" },
556  { "rdnss-selection", D6O_RDNSS_SELECTION, DHCP6_OPTION_SPACE,
557  OPT_RECORD_TYPE, true, RECORD_DEF(V6_RDNSS_SELECT_RECORDS), "" },
558  { "client-linklayer-addr", D6O_CLIENT_LINKLAYER_ADDR, DHCP6_OPTION_SPACE,
559  OPT_BINARY_TYPE, false, NO_RECORD_DEF, "" },
560  { "link-address", D6O_LINK_ADDRESS, DHCP6_OPTION_SPACE,
561  OPT_IPV6_ADDRESS_TYPE, false, NO_RECORD_DEF, "" },
562  { "solmax-rt", D6O_SOL_MAX_RT, DHCP6_OPTION_SPACE, OPT_UINT32_TYPE, false,
563  NO_RECORD_DEF, "" },
564  { "inf-max-rt", D6O_INF_MAX_RT, DHCP6_OPTION_SPACE, OPT_UINT32_TYPE, false,
565  NO_RECORD_DEF, "" },
566  { "dhcpv4-message", D6O_DHCPV4_MSG, DHCP6_OPTION_SPACE, OPT_BINARY_TYPE,
567  false, NO_RECORD_DEF, "" },
568  { "dhcp4o6-server-addr", D6O_DHCPV4_O_DHCPV6_SERVER, DHCP6_OPTION_SPACE,
570  { "v6-captive-portal", D6O_V6_CAPTIVE_PORTAL, DHCP6_OPTION_SPACE,
571  OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
572  { "relay-source-port", D6O_RELAY_SOURCE_PORT, DHCP6_OPTION_SPACE,
573  OPT_UINT16_TYPE, false, NO_RECORD_DEF, "" },
574  { "ipv6-address-andsf", D6O_IPV6_ADDRESS_ANDSF, DHCP6_OPTION_SPACE,
582 
583  // @todo There is still a bunch of options for which we have to provide
584  // definitions but we don't do it because they are not really
585  // critical right now.
586 };
587 
589 const int STANDARD_V6_OPTION_DEFINITIONS_SIZE =
590  sizeof(STANDARD_V6_OPTION_DEFINITIONS) /
591  sizeof(STANDARD_V6_OPTION_DEFINITIONS[0]);
592 
599 const OptionDefParams ISC_V6_OPTION_DEFINITIONS[] = {
600  { "4o6-interface", ISC_V6_4O6_INTERFACE, ISC_V6_OPTION_SPACE,
601  OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
602  { "4o6-source-address", ISC_V6_4O6_SRC_ADDRESS, ISC_V6_OPTION_SPACE,
603  OPT_IPV6_ADDRESS_TYPE, false, NO_RECORD_DEF, "" },
604  { "4o6-source-port", ISC_V6_4O6_SRC_PORT, ISC_V6_OPTION_SPACE,
605  OPT_UINT16_TYPE, false, NO_RECORD_DEF, "" }
606 };
607 
608 const int ISC_V6_OPTION_DEFINITIONS_SIZE =
609  sizeof(ISC_V6_OPTION_DEFINITIONS) /
610  sizeof(ISC_V6_OPTION_DEFINITIONS[0]);
611 
613 const OptionDefParams MAPE_V6_OPTION_DEFINITIONS[] = {
615  NO_RECORD_DEF, "" },
616  { "s46-rule", D6O_S46_RULE, MAPE_V6_OPTION_SPACE, OPT_RECORD_TYPE, false,
618 };
619 
620 const int MAPE_V6_OPTION_DEFINITIONS_SIZE =
621  sizeof(MAPE_V6_OPTION_DEFINITIONS) /
622  sizeof(MAPE_V6_OPTION_DEFINITIONS[0]);
623 
625 const OptionDefParams MAPT_V6_OPTION_DEFINITIONS[] = {
626  { "s46-rule", D6O_S46_RULE, MAPT_V6_OPTION_SPACE, OPT_RECORD_TYPE, false,
627  RECORD_DEF(S46_RULE), V4V6_RULE_OPTION_SPACE },
629  false, NO_RECORD_DEF, "" }
630 };
631 
632 const int MAPT_V6_OPTION_DEFINITIONS_SIZE =
633  sizeof(MAPT_V6_OPTION_DEFINITIONS) /
634  sizeof(MAPT_V6_OPTION_DEFINITIONS[0]);
635 
637 const OptionDefParams LW_V6_OPTION_DEFINITIONS[] = {
639  NO_RECORD_DEF, "" },
641  false, RECORD_DEF(S46_V4V6BIND), V4V6_BIND_OPTION_SPACE }
642 };
643 
644 const int LW_V6_OPTION_DEFINITIONS_SIZE =
645  sizeof(LW_V6_OPTION_DEFINITIONS) /
646  sizeof(LW_V6_OPTION_DEFINITIONS[0]);
647 
649 const OptionDefParams V4V6_RULE_OPTION_DEFINITIONS[] = {
650  { "s46-portparams", D6O_S46_PORTPARAMS, V4V6_RULE_OPTION_SPACE,
651  OPT_RECORD_TYPE, false, RECORD_DEF(S46_PORTPARAMS), "" }
652 };
653 
654 const int V4V6_RULE_OPTION_DEFINITIONS_SIZE =
655  sizeof(V4V6_RULE_OPTION_DEFINITIONS) /
656  sizeof(V4V6_RULE_OPTION_DEFINITIONS[0]);
657 
659 const OptionDefParams V4V6_BIND_OPTION_DEFINITIONS[] = {
660  { "s46-portparams", D6O_S46_PORTPARAMS, V4V6_BIND_OPTION_SPACE,
661  OPT_RECORD_TYPE, false, RECORD_DEF(S46_PORTPARAMS), "" }
662 };
663 
664 const int V4V6_BIND_OPTION_DEFINITIONS_SIZE =
665  sizeof(V4V6_BIND_OPTION_DEFINITIONS) /
666  sizeof(V4V6_BIND_OPTION_DEFINITIONS[0]);
667 
668 } // namespace
669 
670 } // namespace dhcp
671 } // namespace isc
672 
673 #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