]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3907] Add TranslatorControlSocket::getControlSocketHttpHeaders
authorAndrei Pavel <andrei@isc.org>
Fri, 20 Jun 2025 09:14:55 +0000 (12:14 +0300)
committerRazvan Becheriu <razvan@isc.org>
Fri, 20 Jun 2025 13:29:10 +0000 (13:29 +0000)
src/lib/yang/translator_control_socket.cc

index 5e664f6c157b7fb43ad1447435bd7c5f0312e2b2..d50c36176596989b4dbfd37b946b6be3ef1c22e5 100644 (file)
@@ -19,8 +19,7 @@ using namespace sysrepo;
 namespace isc {
 namespace yang {
 
-TranslatorControlSocket::TranslatorControlSocket(Session session,
-                                                 const string& model)
+TranslatorControlSocket::TranslatorControlSocket(Session session, const string& model)
     : Translator(session, model) {
 }
 
@@ -105,6 +104,15 @@ TranslatorControlSocket::getControlSocketKea(DataNode const& data_node) {
     return (result->empty() ? ElementPtr() : result);
 }
 
+ElementPtr
+TranslatorControlSocket::getControlSocketHttpHeaders(DataNode const& data_node) {
+    ElementPtr result(Element::createMap());
+    checkAndGetLeaf(result, data_node, "name");
+    checkAndGetLeaf(result, data_node, "value");
+    checkAndGetLeaf(result, data_node, "user-context");
+    return (result->empty() ? ElementPtr() : result);
+}
+
 ElementPtr
 TranslatorControlSocket::getControlSocketAuthenticationClients(DataNode const& data_node) {
     return getList(data_node, "clients", *this,