]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3907] clean up modules
authorRazvan Becheriu <razvan@isc.org>
Fri, 20 Jun 2025 10:18:40 +0000 (13:18 +0300)
committerRazvan Becheriu <razvan@isc.org>
Fri, 20 Jun 2025 13:29:10 +0000 (13:29 +0000)
src/lib/yang/translator_control_socket.cc
src/share/yang/modules/hashes/kea-ctrl-agent@2025-06-25.hash
src/share/yang/modules/hashes/kea-types@2025-06-25.hash
src/share/yang/modules/kea-ctrl-agent@2025-06-25.yang
src/share/yang/modules/kea-types@2025-06-25.yang

index bd135a216845e97e29b106302a8c14c4f1545e22..cf4c44f3af6ebde09ad59d18c28e211e07fcf4b6 100644 (file)
@@ -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);
index 6e27ce77257e3a09baff2b770a4772c94b5b7bf2..6ce68fab6ddf0aef27785f1a05fd46030c23c7c2 100644 (file)
@@ -1 +1 @@
-02ad468d60aac62d97e60738b4f758da359c00578b145e185c8bdc2cff8a7652
+58fa8cd6ff1e10129668bb54e214d137ba82017a7827e276a656443e7c8249d9
index 94b9d848ead55537acb30b705b4964c1cbffafd4..cec6f2a91ffe1f4fc0a826c6fad5d3bea867a422 100644 (file)
@@ -1 +1 @@
-36a3a9a39d898fc91946241873e060ebbf6e94d282126aa25931b4a41837b061
+2d1041f570386a4b4c81f42c72c3e93ef27729de8224e3522ddf6e98b148e9ca
index 0637d8a489fe85e1f420fd5a3b95c02d60b893d8..40aad5c93e9c178a3988c3ccd0046bcc45b72d9a 100644 (file)
@@ -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 {
index fb06311043c4db6b93749d51c6df94a95a34aabf..b4e319362284e51be7a4b9ba25bf20c0aff4b9bd 100644 (file)
@@ -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 {