]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: constify yang_resolve_snode_xpath results
authorChristian Hopps <chopps@labn.net>
Sat, 27 Jul 2024 05:07:57 +0000 (01:07 -0400)
committerChristian Hopps <chopps@labn.net>
Tue, 17 Sep 2024 07:04:59 +0000 (03:04 -0400)
Signed-off-by: Christian Hopps <chopps@labn.net>
ang

lib/northbound.c
lib/yang.c
lib/yang.h
mgmtd/mgmt_fe_adapter.c

index 0bc79d02774094ea74dd4cb61b05e9f16edf1a3b..63062ee3369ec2526291e06387fd3e0041d24445 100644 (file)
@@ -178,7 +178,7 @@ struct nb_node *nb_node_find(const char *path)
 
 struct nb_node **nb_nodes_find(const char *xpath)
 {
-       struct lysc_node **snodes = NULL;
+       const struct lysc_node **snodes = NULL;
        struct nb_node **nb_nodes = NULL;
        bool simple;
        LY_ERR err;
index 6c1aed00cc7b89d1aa61900d0bbec23d9e0f6cb2..14d5b118c652a2044c23bf17ed3cd66bd5d0094e 100644 (file)
@@ -286,7 +286,7 @@ void yang_snode_get_path(const struct lysc_node *snode,
 }
 
 LY_ERR yang_resolve_snode_xpath(struct ly_ctx *ly_ctx, const char *xpath,
-                               struct lysc_node ***snodes, bool *simple)
+                               const struct lysc_node ***snodes, bool *simple)
 {
        struct lysc_node *snode;
        struct ly_set *set;
index 57131f478bacdad61cccb5ea6cc4aff769e3a3e5..c4fc78b8aed7f0153954fd99cac8212521896eb7 100644 (file)
@@ -827,7 +827,8 @@ extern int yang_xpath_pop_node(char *xpath);
  * Return: a libyang error or LY_SUCCESS.
  */
 extern LY_ERR yang_resolve_snode_xpath(struct ly_ctx *ly_ctx, const char *xpath,
-                                      struct lysc_node ***snodes, bool *simple);
+                                      const struct lysc_node ***snodes,
+                                      bool *simple);
 
 /*
  * Libyang future functions
index 09d1910cee612e46ebf797b6457973ef85f254e3..fc35e74610ec3f7bc7f76a78b7dc1a42cd6c68ed 100644 (file)
@@ -1282,8 +1282,7 @@ static void fe_adapter_handle_get_data(struct mgmt_fe_session_ctx *session,
                                       void *__msg, size_t msg_len)
 {
        struct mgmt_msg_get_data *msg = __msg;
-       struct lysc_node **snodes = NULL;
-       char *xpath_resolved = NULL;
+       const struct lysc_node **snodes = NULL;
        uint64_t req_id = msg->req_id;
        Mgmtd__DatastoreId ds_id;
        uint64_t clients;
@@ -1395,7 +1394,6 @@ static void fe_adapter_handle_get_data(struct mgmt_fe_session_ctx *session,
        }
 done:
        darr_free(snodes);
-       darr_free(xpath_resolved);
 }
 
 static void fe_adapter_handle_edit(struct mgmt_fe_session_ctx *session,