From: Razvan Becheriu Date: Fri, 20 Jun 2025 10:18:40 +0000 (+0300) Subject: [#3907] clean up modules X-Git-Tag: Kea-3.0.0~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b9a1ab5d8a8aaaf029e11708def6e905d52de517;p=thirdparty%2Fkea.git [#3907] clean up modules --- diff --git a/src/lib/yang/translator_control_socket.cc b/src/lib/yang/translator_control_socket.cc index bd135a2168..cf4c44f3af 100644 --- a/src/lib/yang/translator_control_socket.cc +++ b/src/lib/yang/translator_control_socket.cc @@ -214,26 +214,27 @@ TranslatorControlSocket::setControlSocketKea(string const& xpath, ConstElementPt } checkAndSetLeaf(elem, xpath, "socket-name", LeafBaseType::String); - - checkAndSetLeaf(elem, xpath, "socket-address", LeafBaseType::String); - checkAndSetLeaf(elem, xpath, "socket-port", LeafBaseType::Uint32); - checkAndSetLeaf(elem, xpath, "trust-anchor", LeafBaseType::String); - checkAndSetLeaf(elem, xpath, "cert-file", LeafBaseType::String); - checkAndSetLeaf(elem, xpath, "key-file", LeafBaseType::String); - checkAndSetLeaf(elem, xpath, "cert-required", LeafBaseType::Bool); - ConstElementPtr authentication = elem->get("authentication"); - if (authentication && !authentication->empty()) { - setMandatoryDivergingLeaf(authentication, xpath , "type", "auth-type", LeafBaseType::String); - checkAndSetLeaf(authentication, xpath + "/authentication", "realm", LeafBaseType::String); - checkAndSetLeaf(authentication, xpath + "/authentication", "directory", LeafBaseType::String); - ConstElementPtr clients = authentication->get("clients"); - setControlSocketAuthenticationClients(xpath + "/authentication/clients", clients); - } - ConstElementPtr http_headers = elem->get("http-headers"); - if (http_headers && !http_headers->empty()) { - for (size_t i = 0; i < http_headers->size(); ++i) { - ElementPtr header = elem->getNonConst(i); - // setHeader + if (model_ != KEA_CTRL_AGENT) { + checkAndSetLeaf(elem, xpath, "socket-address", LeafBaseType::String); + checkAndSetLeaf(elem, xpath, "socket-port", LeafBaseType::Uint32); + checkAndSetLeaf(elem, xpath, "trust-anchor", LeafBaseType::String); + checkAndSetLeaf(elem, xpath, "cert-file", LeafBaseType::String); + checkAndSetLeaf(elem, xpath, "key-file", LeafBaseType::String); + checkAndSetLeaf(elem, xpath, "cert-required", LeafBaseType::Bool); + ConstElementPtr authentication = elem->get("authentication"); + if (authentication && !authentication->empty()) { + setMandatoryDivergingLeaf(authentication, xpath , "type", "auth-type", LeafBaseType::String); + checkAndSetLeaf(authentication, xpath + "/authentication", "realm", LeafBaseType::String); + checkAndSetLeaf(authentication, xpath + "/authentication", "directory", LeafBaseType::String); + ConstElementPtr clients = authentication->get("clients"); + setControlSocketAuthenticationClients(xpath + "/authentication/clients", clients); + } + ConstElementPtr http_headers = elem->get("http-headers"); + if (http_headers && !http_headers->empty()) { + for (size_t i = 0; i < http_headers->size(); ++i) { + ElementPtr header = elem->getNonConst(i); + // setHeader + } } } setMandatoryLeaf(elem, xpath, "socket-type", LeafBaseType::Enum); @@ -304,6 +305,8 @@ TranslatorControlSocket::setControlSocketHttpHeaders(const std::string& xpath, void TranslatorControlSocket::setControlSocketHttpHeader(const std::string& xpath, isc::data::ConstElementPtr elem) { + setItem(xpath, ElementPtr(), LeafBaseType::Unknown); + checkAndSetLeaf(elem, xpath, "value", LeafBaseType::String); checkAndSetUserContext(elem, xpath); setMandatoryLeaf(elem, xpath, "name", LeafBaseType::Enum); diff --git a/src/share/yang/modules/hashes/kea-ctrl-agent@2025-06-25.hash b/src/share/yang/modules/hashes/kea-ctrl-agent@2025-06-25.hash index 6e27ce7725..6ce68fab6d 100644 --- a/src/share/yang/modules/hashes/kea-ctrl-agent@2025-06-25.hash +++ b/src/share/yang/modules/hashes/kea-ctrl-agent@2025-06-25.hash @@ -1 +1 @@ -02ad468d60aac62d97e60738b4f758da359c00578b145e185c8bdc2cff8a7652 +58fa8cd6ff1e10129668bb54e214d137ba82017a7827e276a656443e7c8249d9 diff --git a/src/share/yang/modules/hashes/kea-types@2025-06-25.hash b/src/share/yang/modules/hashes/kea-types@2025-06-25.hash index 94b9d848ea..cec6f2a91f 100644 --- a/src/share/yang/modules/hashes/kea-types@2025-06-25.hash +++ b/src/share/yang/modules/hashes/kea-types@2025-06-25.hash @@ -1 +1 @@ -36a3a9a39d898fc91946241873e060ebbf6e94d282126aa25931b4a41837b061 +2d1041f570386a4b4c81f42c72c3e93ef27729de8224e3522ddf6e98b148e9ca diff --git a/src/share/yang/modules/kea-ctrl-agent@2025-06-25.yang b/src/share/yang/modules/kea-ctrl-agent@2025-06-25.yang index 0637d8a489..40aad5c93e 100644 --- a/src/share/yang/modules/kea-ctrl-agent@2025-06-25.yang +++ b/src/share/yang/modules/kea-ctrl-agent@2025-06-25.yang @@ -47,7 +47,7 @@ module kea-ctrl-agent { container control-sockets { description "Control sockets."; - list socket { + list control-sockets { key server-type; description "List of server control socket."; leaf server-type { diff --git a/src/share/yang/modules/kea-types@2025-06-25.yang b/src/share/yang/modules/kea-types@2025-06-25.yang index fb06311043..b4e3193622 100644 --- a/src/share/yang/modules/kea-types@2025-06-25.yang +++ b/src/share/yang/modules/kea-types@2025-06-25.yang @@ -35,15 +35,6 @@ module kea-types { } } - grouping control-sockets { - description "Control sockets grouping."; - list control-sockets { - key socket-type; - description "List of control sockets."; - uses control-socket-data; - } - } - grouping control-socket-tls { description "Control socket TLS parameters."; leaf trust-anchor {