diff options
author | Francis Dupont <fdupont@isc.org> | 2024-09-26 16:40:38 +0200 |
---|---|---|
committer | Tomek Mrugalski <tomek@isc.org> | 2024-10-28 12:26:17 +0100 |
commit | 3851df7e7bb1d7d593f727ccc9f5c7a9681d0223 (patch) | |
tree | 6c93cf8e3e83ff6535e08c34bacbb272d22f06b7 /src | |
parent | [#3631] fixed option_def_data_type int8 entry with id 3 (diff) | |
download | kea-3851df7e7bb1d7d593f727ccc9f5c7a9681d0223.tar.xz kea-3851df7e7bb1d7d593f727ccc9f5c7a9681d0223.zip |
[#3404] Checkpoint: added definitions
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/dhcp/dhcp4.h | 16 | ||||
-rw-r--r-- | src/lib/dhcp/libdhcp++.cc | 30 | ||||
-rw-r--r-- | src/lib/dhcp/std_option_defs.h | 36 |
3 files changed, 67 insertions, 15 deletions
diff --git a/src/lib/dhcp/dhcp4.h b/src/lib/dhcp/dhcp4.h index ffa3d974ca..11487a0b3c 100644 --- a/src/lib/dhcp/dhcp4.h +++ b/src/lib/dhcp/dhcp4.h @@ -183,7 +183,7 @@ enum DHCPOptionType { DHO_DOMAIN_SEARCH = 119, /* RFC3397 */ // DHO_SIP_SERVERS = 120, /* RFC3361 */ DHO_CLASSLESS_STATIC_ROUTE = 121, /* RFC3442 */ -// DHO_CCC = 122, /* RFC3495 */ + DHO_CCC = 122, /* RFC3495 */ // DHO_GEOCONF = 123, /* RFC6225 */ DHO_VIVCO_SUBOPTIONS = 124, /* RFC3925 */ DHO_VIVSO_SUBOPTIONS = 125, /* RFC3925 */ @@ -285,6 +285,20 @@ enum RAISubOptionType { RAI_OPTION_VIRTUAL_SUBNET_SELECT_CTRL = 152 // RFC6607 }; +/// CableLabs client conf suboption types. +enum CableLabsClientConfType { + TSP_PRIMARY_SERVER = 1, // RFC3495 + TSP_SECONDARY_SERVER = 2, // RFC3495 +// TSP_PROVISIONING_SERVER = 3, // RFC3495 + TSP_AS_PARAMETERS = 4, // RFC3495 + TSP_AP_PARAMETERS = 5, // RFC3495 + TSP_REALM = 6, // RFC3495 (and errata) + TSP_USE_TGT = 7, // RFC3495 + TSP_PROVISIONING_TIMER = 8, // RFC3495 + TSP_SCT = 9, // RFC3594 + KDC_SERVER = 10 // RFC3634 +}; + // TODO: Following are leftovers from dhcp.h import from ISC DHCP // They will be converted to C++-style defines once they will start // to be used. diff --git a/src/lib/dhcp/libdhcp++.cc b/src/lib/dhcp/libdhcp++.cc index 1e3bb3c485..db64d3653b 100644 --- a/src/lib/dhcp/libdhcp++.cc +++ b/src/lib/dhcp/libdhcp++.cc @@ -47,20 +47,22 @@ namespace { /// /// used for easier initialization of option definitions by space name const OptionDefParamsEncapsulation OPTION_DEF_PARAMS[] = { - { STANDARD_V4_OPTION_DEFINITIONS, STANDARD_V4_OPTION_DEFINITIONS_SIZE, DHCP4_OPTION_SPACE }, - { STANDARD_V6_OPTION_DEFINITIONS, STANDARD_V6_OPTION_DEFINITIONS_SIZE, DHCP6_OPTION_SPACE }, - { DOCSIS3_V4_OPTION_DEFINITIONS, DOCSIS3_V4_OPTION_DEFINITIONS_SIZE, DOCSIS3_V4_OPTION_SPACE }, - { DOCSIS3_V6_OPTION_DEFINITIONS, DOCSIS3_V6_OPTION_DEFINITIONS_SIZE, DOCSIS3_V6_OPTION_SPACE }, - { ISC_V6_OPTION_DEFINITIONS, ISC_V6_OPTION_DEFINITIONS_SIZE, ISC_V6_OPTION_SPACE }, - { MAPE_V6_OPTION_DEFINITIONS, MAPE_V6_OPTION_DEFINITIONS_SIZE, MAPE_V6_OPTION_SPACE }, - { MAPT_V6_OPTION_DEFINITIONS, MAPT_V6_OPTION_DEFINITIONS_SIZE, MAPT_V6_OPTION_SPACE }, - { LW_V6_OPTION_DEFINITIONS, LW_V6_OPTION_DEFINITIONS_SIZE, LW_V6_OPTION_SPACE }, - { V4V6_RULE_OPTION_DEFINITIONS, V4V6_RULE_OPTION_DEFINITIONS_SIZE, V4V6_RULE_OPTION_SPACE }, - { V4V6_BIND_OPTION_DEFINITIONS, V4V6_BIND_OPTION_DEFINITIONS_SIZE, V4V6_BIND_OPTION_SPACE }, - { V6_NTP_SERVER_DEFINITIONS, V6_NTP_SERVER_DEFINITIONS_SIZE, V6_NTP_SERVER_SPACE }, - { LAST_RESORT_V4_OPTION_DEFINITIONS, LAST_RESORT_V4_OPTION_DEFINITIONS_SIZE, LAST_RESORT_V4_OPTION_SPACE }, - { DHCP_AGENT_OPTION_DEFINITIONS, DHCP_AGENT_OPTION_DEFINITIONS_SIZE, DHCP_AGENT_OPTION_SPACE }, - { NULL, 0, "" } + { STANDARD_V4_OPTION_DEFINITIONS, STANDARD_V4_OPTION_DEFINITIONS_SIZE, DHCP4_OPTION_SPACE }, + { STANDARD_V6_OPTION_DEFINITIONS, STANDARD_V6_OPTION_DEFINITIONS_SIZE, DHCP6_OPTION_SPACE }, + { DOCSIS3_V4_OPTION_DEFINITIONS, DOCSIS3_V4_OPTION_DEFINITIONS_SIZE, DOCSIS3_V4_OPTION_SPACE }, + { DOCSIS3_V6_OPTION_DEFINITIONS, DOCSIS3_V6_OPTION_DEFINITIONS_SIZE, DOCSIS3_V6_OPTION_SPACE }, + { ISC_V6_OPTION_DEFINITIONS, ISC_V6_OPTION_DEFINITIONS_SIZE, ISC_V6_OPTION_SPACE }, + { MAPE_V6_OPTION_DEFINITIONS, MAPE_V6_OPTION_DEFINITIONS_SIZE, MAPE_V6_OPTION_SPACE }, + { MAPT_V6_OPTION_DEFINITIONS, MAPT_V6_OPTION_DEFINITIONS_SIZE, MAPT_V6_OPTION_SPACE }, + { LW_V6_OPTION_DEFINITIONS, LW_V6_OPTION_DEFINITIONS_SIZE, LW_V6_OPTION_SPACE }, + { V4V6_RULE_OPTION_DEFINITIONS, V4V6_RULE_OPTION_DEFINITIONS_SIZE, V4V6_RULE_OPTION_SPACE }, + { V4V6_BIND_OPTION_DEFINITIONS, V4V6_BIND_OPTION_DEFINITIONS_SIZE, V4V6_BIND_OPTION_SPACE }, + { V6_NTP_SERVER_DEFINITIONS, V6_NTP_SERVER_DEFINITIONS_SIZE, V6_NTP_SERVER_SPACE }, + { CABLELABS_CLIENT_CONF_DEFINITIONS, CABLELABS_CLIENT_CONF_DEFINITIONS_SIZE, + CABLELABS_CLIENT_CONF_SPACE }, + { LAST_RESORT_V4_OPTION_DEFINITIONS, LAST_RESORT_V4_OPTION_DEFINITIONS_SIZE, LAST_RESORT_V4_OPTION_SPACE }, + { DHCP_AGENT_OPTION_DEFINITIONS, DHCP_AGENT_OPTION_DEFINITIONS_SIZE, DHCP_AGENT_OPTION_SPACE }, + { NULL, 0, "" } }; } // namespace diff --git a/src/lib/dhcp/std_option_defs.h b/src/lib/dhcp/std_option_defs.h index 6ead5f6fe4..ad125a2a1c 100644 --- a/src/lib/dhcp/std_option_defs.h +++ b/src/lib/dhcp/std_option_defs.h @@ -22,6 +22,7 @@ #define V4V6_RULE_OPTION_SPACE "s46-rule-options" #define V4V6_BIND_OPTION_SPACE "s46-v4v6bind-options" #define V6_NTP_SERVER_SPACE "v6-ntp-server-suboptions" +#define CABLELABS_CLIENT_CONF_SPACE "cablelabs-client-conf" #define LAST_RESORT_V4_OPTION_SPACE "last-resort-v4" /// @brief encapsulated option spaces @@ -325,6 +326,8 @@ const OptionDefParams STANDARD_V4_OPTION_DEFINITIONS[] = { true, NO_RECORD_DEF, "" }, { "classless-static-route", DHO_CLASSLESS_STATIC_ROUTE, DHCP4_OPTION_SPACE, OPT_INTERNAL_TYPE, false, NO_RECORD_DEF, "" }, + { "cablelabs-client-conf", DHO_CCC, DHCP4_OPTION_SPACE, OPT_EMPTY_TYPE, + false, NO_RECORD_DEF, CABLELABS_CLIENT_CONF_SPACE }, { "vivco-suboptions", DHO_VIVCO_SUBOPTIONS, DHCP4_OPTION_SPACE, OPT_RECORD_TYPE, false, RECORD_DEF(VIVCO_RECORDS), "" }, // Vendor-Identifying Vendor Specific Information option payload begins with a @@ -759,6 +762,39 @@ const int V6_NTP_SERVER_DEFINITIONS_SIZE = sizeof(V6_NTP_SERVER_DEFINITIONS) / sizeof(V6_NTP_SERVER_DEFINITIONS[0]); +/// @brief TSP's AS-REQ/AS-REP Backoff and Retry aka tsp-as-parameters record +/// (nominal timeout, maximum timeout, maximum retries) +/// Reused for TSP's AP-REQ/AP-REP Backoff and Retry record +RECORD_DECL(TSP_AS_RECORDS, OPT_UINT32_TYPE, OPT_UINT32_TYPE, OPT_UINT32_TYPE); + +/// @brief CableLabs client conf suboption definitions +const OptionDefParams CABLELABS_CLIENT_CONF_DEFINITIONS[] = { + { "tsp-primary-server", TSP_PRIMARY_SERVER, CABLELABS_CLIENT_CONF_SPACE, + OPT_IPV4_ADDRESS_TYPE, false, NO_RECORD_DEF, "" }, + { "tsp-secondary-server", TSP_SECONDARY_SERVER, CABLELABS_CLIENT_CONF_SPACE, + OPT_IPV4_ADDRESS_TYPE, false, NO_RECORD_DEF, "" }, + // No tsp-provisioning-server as it has a variant record type + { "tsp-as-parameters", TSP_AS_PARAMETERS, CABLELABS_CLIENT_CONF_SPACE, + OPT_RECORD_TYPE, false, RECORD_DEF(TSP_AS_RECORDS), "" }, + { "tsp-ap-parameters", TSP_AP_PARAMETERS, CABLELABS_CLIENT_CONF_SPACE, + OPT_RECORD_TYPE, false, RECORD_DEF(TSP_AS_RECORDS), "" }, + // RFC 3495 rrata says fqdn (vs string) + { "tsp-realm", TSP_REALM, CABLELABS_CLIENT_CONF_SPACE, OPT_FQDN_TYPE, + false, NO_RECORD_DEF, "" }, + { "tsp-use-tgt", TSP_USE_TGT, CABLELABS_CLIENT_CONF_SPACE, + OPT_BOOLEAN_TYPE, false, NO_RECORD_DEF, "" }, + { "tsp-provisioning-timer", TSP_PROVISIONING_TIMER, + CABLELABS_CLIENT_CONF_SPACE, OPT_UINT8_TYPE, false, NO_RECORD_DEF, "" }, + { "tsp-sct", TSP_SCT, CABLELABS_CLIENT_CONF_SPACE, OPT_UINT16_TYPE, false, + NO_RECORD_DEF, "" }, + { "kdc-server", KDC_SERVER, CABLELABS_CLIENT_CONF_SPACE, + OPT_IPV4_ADDRESS_TYPE, true, NO_RECORD_DEF, "" } +}; + +const int CABLELABS_CLIENT_CONF_DEFINITIONS_SIZE = + sizeof(CABLELABS_CLIENT_CONF_DEFINITIONS) / + sizeof(CABLELABS_CLIENT_CONF_DEFINITIONS[0]); + } // namespace } // namespace dhcp |