Kea  2.3.2-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 
382 const OptionDefParams LAST_RESORT_V4_OPTION_DEFINITIONS[] = {
383  { "vendor-encapsulated-options", DHO_VENDOR_ENCAPSULATED_OPTIONS,
386 };
387 
388 const int LAST_RESORT_V4_OPTION_DEFINITIONS_SIZE =
389  sizeof(LAST_RESORT_V4_OPTION_DEFINITIONS) /
390  sizeof(LAST_RESORT_V4_OPTION_DEFINITIONS[0]);
391 
393 
394 // client-fqdn
395 RECORD_DECL(CLIENT_FQDN_RECORDS, OPT_UINT8_TYPE, OPT_FQDN_TYPE);
396 // geoconf-civic
397 RECORD_DECL(GEOCONF_CIVIC_RECORDS, OPT_UINT8_TYPE, OPT_UINT16_TYPE,
399 // iaddr
402 // ia-na
404 // ia-pd
406 // ia-prefix
407 RECORD_DECL(IA_PREFIX_RECORDS, OPT_UINT32_TYPE, OPT_UINT32_TYPE,
409 // lq-query
411 // lq-relay-data
412 RECORD_DECL(LQ_RELAY_DATA_RECORDS, OPT_IPV6_ADDRESS_TYPE, OPT_BINARY_TYPE);
413 // remote-id
414 RECORD_DECL(REMOTE_ID_RECORDS, OPT_UINT32_TYPE, OPT_BINARY_TYPE);
415 // s46-rule
418 // s46-v4v6bind
420 // s46-portparams
421 RECORD_DECL(S46_PORTPARAMS, OPT_UINT8_TYPE, OPT_PSID_TYPE);
422 // status-code
423 RECORD_DECL(V6_STATUS_CODE_RECORDS, OPT_UINT16_TYPE, OPT_STRING_TYPE);
424 // vendor-class
425 RECORD_DECL(VENDOR_CLASS_RECORDS, OPT_UINT32_TYPE, OPT_BINARY_TYPE);
426 // rdnss-selection
427 RECORD_DECL(V6_RDNSS_SELECT_RECORDS, OPT_IPV6_ADDRESS_TYPE, OPT_UINT8_TYPE,
428  OPT_FQDN_TYPE);
429 // sedhcpv6 signature
430 RECORD_DECL(SIGNATURE_RECORDS, OPT_UINT8_TYPE, OPT_UINT8_TYPE,
432 
433 // RFC5970 (PXE) Class record fields
434 //
435 // Three 1 byte fileds to describe a network interface: type, major and minor
437 
448 const OptionDefParams STANDARD_V6_OPTION_DEFINITIONS[] = {
449  { "clientid", D6O_CLIENTID, DHCP6_OPTION_SPACE, OPT_BINARY_TYPE, false,
450  NO_RECORD_DEF, "" },
451  { "serverid", D6O_SERVERID, DHCP6_OPTION_SPACE, OPT_BINARY_TYPE, false,
452  NO_RECORD_DEF, "" },
453  { "ia-na", D6O_IA_NA, DHCP6_OPTION_SPACE, OPT_RECORD_TYPE, false,
454  RECORD_DEF(IA_NA_RECORDS), "" },
455  { "ia-ta", D6O_IA_TA, DHCP6_OPTION_SPACE, OPT_UINT32_TYPE, false,
456  NO_RECORD_DEF, "" },
457  { "iaaddr", D6O_IAADDR, DHCP6_OPTION_SPACE, OPT_RECORD_TYPE, false,
458  RECORD_DEF(IAADDR_RECORDS), "" },
460  "" },
461  { "preference", D6O_PREFERENCE, DHCP6_OPTION_SPACE, OPT_UINT8_TYPE, false,
462  NO_RECORD_DEF, "" },
464  false, NO_RECORD_DEF, "" },
465  { "relay-msg", D6O_RELAY_MSG, DHCP6_OPTION_SPACE, OPT_BINARY_TYPE, false,
466  NO_RECORD_DEF, "" },
467  // Unfortunately the AUTH option contains a 64-bit data field
468  // called 'replay-detection' that can't be added as a record
469  // field to a custom option. Also, there is no dedicated
470  // option class to handle it so we simply return binary
471  // option type for now.
472  // @todo implement a class to handle AUTH option.
473  { "auth", D6O_AUTH, DHCP6_OPTION_SPACE, OPT_BINARY_TYPE, false,
474  NO_RECORD_DEF, "" },
476  false, NO_RECORD_DEF, "" },
478  false, RECORD_DEF(V6_STATUS_CODE_RECORDS), "" },
480  false, NO_RECORD_DEF, "" },
482  false, NO_RECORD_DEF, "" },
484  false, RECORD_DEF(VENDOR_CLASS_RECORDS), "" },
486  false, NO_RECORD_DEF, "" },
488  false, NO_RECORD_DEF, "" },
489  { "reconf-msg", D6O_RECONF_MSG, DHCP6_OPTION_SPACE, OPT_UINT8_TYPE, false,
490  NO_RECORD_DEF, "" },
492  false, NO_RECORD_DEF, "" },
494  true, NO_RECORD_DEF, "" },
495  { "sip-server-addr", D6O_SIP_SERVERS_ADDR, DHCP6_OPTION_SPACE,
497  { "dns-servers", D6O_NAME_SERVERS, DHCP6_OPTION_SPACE,
500  true, NO_RECORD_DEF, "" },
501  { "ia-pd", D6O_IA_PD, DHCP6_OPTION_SPACE, OPT_RECORD_TYPE, false,
502  RECORD_DEF(IA_PD_RECORDS), "" },
503  { "iaprefix", D6O_IAPREFIX, DHCP6_OPTION_SPACE, OPT_RECORD_TYPE, false,
504  RECORD_DEF(IA_PREFIX_RECORDS), "" },
505  { "nis-servers", D6O_NIS_SERVERS, DHCP6_OPTION_SPACE,
507  { "nisp-servers", D6O_NISP_SERVERS, DHCP6_OPTION_SPACE,
509  { "nis-domain-name", D6O_NIS_DOMAIN_NAME, DHCP6_OPTION_SPACE,
510  OPT_FQDN_TYPE, true, NO_RECORD_DEF, "" },
511  { "nisp-domain-name", D6O_NISP_DOMAIN_NAME, DHCP6_OPTION_SPACE,
512  OPT_FQDN_TYPE, true, NO_RECORD_DEF, "" },
513  { "sntp-servers", D6O_SNTP_SERVERS, DHCP6_OPTION_SPACE,
515  { "information-refresh-time", D6O_INFORMATION_REFRESH_TIME,
517  { "bcmcs-server-dns", D6O_BCMCS_SERVER_D, DHCP6_OPTION_SPACE,
518  OPT_FQDN_TYPE, true, NO_RECORD_DEF, "" },
519  { "bcmcs-server-addr", D6O_BCMCS_SERVER_A, DHCP6_OPTION_SPACE,
521  { "geoconf-civic", D6O_GEOCONF_CIVIC, DHCP6_OPTION_SPACE,
522  OPT_RECORD_TYPE, false, RECORD_DEF(GEOCONF_CIVIC_RECORDS), "" },
523  { "remote-id", D6O_REMOTE_ID, DHCP6_OPTION_SPACE, OPT_RECORD_TYPE, false,
524  RECORD_DEF(REMOTE_ID_RECORDS), "" },
526  false, NO_RECORD_DEF, "" },
528  false, RECORD_DEF(CLIENT_FQDN_RECORDS), "" },
530  true, NO_RECORD_DEF, "" },
531  { "new-posix-timezone", D6O_NEW_POSIX_TIMEZONE, DHCP6_OPTION_SPACE,
532  OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
533  { "new-tzdb-timezone", D6O_NEW_TZDB_TIMEZONE, DHCP6_OPTION_SPACE,
534  OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
535  { "ero", D6O_ERO, DHCP6_OPTION_SPACE, OPT_UINT16_TYPE, true,
536  NO_RECORD_DEF, "" },
537  { "lq-query", D6O_LQ_QUERY, DHCP6_OPTION_SPACE, OPT_RECORD_TYPE, false,
538  RECORD_DEF(LQ_QUERY_RECORDS), DHCP6_OPTION_SPACE },
540  false, NO_RECORD_DEF, DHCP6_OPTION_SPACE },
541  { "clt-time", D6O_CLT_TIME, DHCP6_OPTION_SPACE, OPT_UINT32_TYPE, false,
542  NO_RECORD_DEF, "" },
544  false, RECORD_DEF(LQ_RELAY_DATA_RECORDS), "" },
545  { "lq-client-link", D6O_LQ_CLIENT_LINK, DHCP6_OPTION_SPACE,
547  { "v6-lost", D6O_V6_LOST, DHCP6_OPTION_SPACE, OPT_FQDN_TYPE, false,
548  NO_RECORD_DEF, "" },
549  { "capwap-ac-v6", D6O_CAPWAP_AC_V6, DHCP6_OPTION_SPACE,
551  { "relay-id", D6O_RELAY_ID, DHCP6_OPTION_SPACE, OPT_BINARY_TYPE, false,
552  NO_RECORD_DEF, "" },
553  { "v6-access-domain", D6O_V6_ACCESS_DOMAIN, DHCP6_OPTION_SPACE,
554  OPT_FQDN_TYPE, false, NO_RECORD_DEF, "" },
555  { "sip-ua-cs-list", D6O_SIP_UA_CS_LIST, DHCP6_OPTION_SPACE,
556  OPT_FQDN_TYPE, true, NO_RECORD_DEF, "" },
558  false, NO_RECORD_DEF, "" },
560  true, NO_RECORD_DEF, "" },
561  { "client-arch-type", D6O_CLIENT_ARCH_TYPE, DHCP6_OPTION_SPACE,
562  OPT_UINT16_TYPE, true, NO_RECORD_DEF, "" },
563  { "nii", D6O_NII, DHCP6_OPTION_SPACE, OPT_RECORD_TYPE, false,
564  RECORD_DEF(CLIENT_NII_RECORDS), "" },
565  { "aftr-name", D6O_AFTR_NAME, DHCP6_OPTION_SPACE, OPT_FQDN_TYPE, false,
566  NO_RECORD_DEF, "" },
567  { "erp-local-domain-name", D6O_ERP_LOCAL_DOMAIN_NAME, DHCP6_OPTION_SPACE
568  , OPT_FQDN_TYPE, false, NO_RECORD_DEF, "" },
569  { "rsoo", D6O_RSOO, DHCP6_OPTION_SPACE, OPT_EMPTY_TYPE, false,
570  NO_RECORD_DEF, "rsoo-opts" },
572  false, NO_RECORD_DEF, "" },
573  { "rdnss-selection", D6O_RDNSS_SELECTION, DHCP6_OPTION_SPACE,
574  OPT_RECORD_TYPE, true, RECORD_DEF(V6_RDNSS_SELECT_RECORDS), "" },
575  { "client-linklayer-addr", D6O_CLIENT_LINKLAYER_ADDR, DHCP6_OPTION_SPACE,
576  OPT_BINARY_TYPE, false, NO_RECORD_DEF, "" },
577  { "link-address", D6O_LINK_ADDRESS, DHCP6_OPTION_SPACE,
578  OPT_IPV6_ADDRESS_TYPE, false, NO_RECORD_DEF, "" },
579  { "solmax-rt", D6O_SOL_MAX_RT, DHCP6_OPTION_SPACE, OPT_UINT32_TYPE, false,
580  NO_RECORD_DEF, "" },
581  { "inf-max-rt", D6O_INF_MAX_RT, DHCP6_OPTION_SPACE, OPT_UINT32_TYPE, false,
582  NO_RECORD_DEF, "" },
583  { "dhcpv4-message", D6O_DHCPV4_MSG, DHCP6_OPTION_SPACE, OPT_BINARY_TYPE,
584  false, NO_RECORD_DEF, "" },
585  { "dhcp4o6-server-addr", D6O_DHCPV4_O_DHCPV6_SERVER, DHCP6_OPTION_SPACE,
587  { "v6-captive-portal", D6O_V6_CAPTIVE_PORTAL, DHCP6_OPTION_SPACE,
588  OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
589  { "relay-source-port", D6O_RELAY_SOURCE_PORT, DHCP6_OPTION_SPACE,
590  OPT_UINT16_TYPE, false, NO_RECORD_DEF, "" },
591  { "ipv6-address-andsf", D6O_IPV6_ADDRESS_ANDSF, DHCP6_OPTION_SPACE,
599 
600  // @todo There is still a bunch of options for which we have to provide
601  // definitions but we don't do it because they are not really
602  // critical right now.
603 };
604 
606 const int STANDARD_V6_OPTION_DEFINITIONS_SIZE =
607  sizeof(STANDARD_V6_OPTION_DEFINITIONS) /
608  sizeof(STANDARD_V6_OPTION_DEFINITIONS[0]);
609 
616 const OptionDefParams ISC_V6_OPTION_DEFINITIONS[] = {
617  { "4o6-interface", ISC_V6_4O6_INTERFACE, ISC_V6_OPTION_SPACE,
618  OPT_STRING_TYPE, false, NO_RECORD_DEF, "" },
619  { "4o6-source-address", ISC_V6_4O6_SRC_ADDRESS, ISC_V6_OPTION_SPACE,
620  OPT_IPV6_ADDRESS_TYPE, false, NO_RECORD_DEF, "" },
621  { "4o6-source-port", ISC_V6_4O6_SRC_PORT, ISC_V6_OPTION_SPACE,
622  OPT_UINT16_TYPE, false, NO_RECORD_DEF, "" }
623 };
624 
625 const int ISC_V6_OPTION_DEFINITIONS_SIZE =
626  sizeof(ISC_V6_OPTION_DEFINITIONS) /
627  sizeof(ISC_V6_OPTION_DEFINITIONS[0]);
628 
630 const OptionDefParams MAPE_V6_OPTION_DEFINITIONS[] = {
632  NO_RECORD_DEF, "" },
633  { "s46-rule", D6O_S46_RULE, MAPE_V6_OPTION_SPACE, OPT_RECORD_TYPE, false,
635 };
636 
637 const int MAPE_V6_OPTION_DEFINITIONS_SIZE =
638  sizeof(MAPE_V6_OPTION_DEFINITIONS) /
639  sizeof(MAPE_V6_OPTION_DEFINITIONS[0]);
640 
642 const OptionDefParams MAPT_V6_OPTION_DEFINITIONS[] = {
643  { "s46-rule", D6O_S46_RULE, MAPT_V6_OPTION_SPACE, OPT_RECORD_TYPE, false,
644  RECORD_DEF(S46_RULE), V4V6_RULE_OPTION_SPACE },
646  false, NO_RECORD_DEF, "" }
647 };
648 
649 const int MAPT_V6_OPTION_DEFINITIONS_SIZE =
650  sizeof(MAPT_V6_OPTION_DEFINITIONS) /
651  sizeof(MAPT_V6_OPTION_DEFINITIONS[0]);
652 
654 const OptionDefParams LW_V6_OPTION_DEFINITIONS[] = {
656  NO_RECORD_DEF, "" },
658  false, RECORD_DEF(S46_V4V6BIND), V4V6_BIND_OPTION_SPACE }
659 };
660 
661 const int LW_V6_OPTION_DEFINITIONS_SIZE =
662  sizeof(LW_V6_OPTION_DEFINITIONS) /
663  sizeof(LW_V6_OPTION_DEFINITIONS[0]);
664 
666 const OptionDefParams V4V6_RULE_OPTION_DEFINITIONS[] = {
667  { "s46-portparams", D6O_S46_PORTPARAMS, V4V6_RULE_OPTION_SPACE,
668  OPT_RECORD_TYPE, false, RECORD_DEF(S46_PORTPARAMS), "" }
669 };
670 
671 const int V4V6_RULE_OPTION_DEFINITIONS_SIZE =
672  sizeof(V4V6_RULE_OPTION_DEFINITIONS) /
673  sizeof(V4V6_RULE_OPTION_DEFINITIONS[0]);
674 
676 const OptionDefParams V4V6_BIND_OPTION_DEFINITIONS[] = {
677  { "s46-portparams", D6O_S46_PORTPARAMS, V4V6_BIND_OPTION_SPACE,
678  OPT_RECORD_TYPE, false, RECORD_DEF(S46_PORTPARAMS), "" }
679 };
680 
681 const int V4V6_BIND_OPTION_DEFINITIONS_SIZE =
682  sizeof(V4V6_BIND_OPTION_DEFINITIONS) /
683  sizeof(V4V6_BIND_OPTION_DEFINITIONS[0]);
684 
685 } // namespace
686 
687 } // namespace dhcp
688 } // namespace isc
689 
690 #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