summaryrefslogtreecommitdiffstats
path: root/lib/northbound_sysrepo.c
diff options
context:
space:
mode:
authorChristian Hopps <chopps@gmail.com>2021-05-04 16:41:58 +0200
committerChristian Hopps <chopps@labn.net>2021-05-13 22:24:48 +0200
commit3bb513c399c2e7c8dd597b7399dd7c0f064842d0 (patch)
tree14f3e677c49fce272946788f8a8b8f3f8a3e26b5 /lib/northbound_sysrepo.c
parentMerge pull request #8629 from donaldsharp/parse_rtattr (diff)
downloadfrr-3bb513c399c2e7c8dd597b7399dd7c0f064842d0.tar.xz
frr-3bb513c399c2e7c8dd597b7399dd7c0f064842d0.zip
lib: adapt to version 2 of libyang
Compile with v2.0.0 tag of `libyang2` branch of: https://github.com/CESNET/libyang staticd init load time of 10k routes now 6s vs ly1 time of 150s Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'lib/northbound_sysrepo.c')
-rw-r--r--lib/northbound_sysrepo.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/northbound_sysrepo.c b/lib/northbound_sysrepo.c
index 63fd40f8d..7c463dd61 100644
--- a/lib/northbound_sysrepo.c
+++ b/lib/northbound_sysrepo.c
@@ -48,10 +48,10 @@ static int frr_sr_finish(void);
static int yang_data_frr2sr(struct yang_data *frr_data, sr_val_t *sr_data)
{
struct nb_node *nb_node;
- const struct lys_node *snode;
- struct lys_node_container *scontainer;
- struct lys_node_leaf *sleaf;
- struct lys_node_leaflist *sleaflist;
+ const struct lysc_node *snode;
+ struct lysc_node_container *scontainer;
+ struct lysc_node_leaf *sleaf;
+ struct lysc_node_leaflist *sleaflist;
LY_DATA_TYPE type;
sr_val_set_xpath(sr_data, frr_data->xpath);
@@ -67,8 +67,8 @@ static int yang_data_frr2sr(struct yang_data *frr_data, sr_val_t *sr_data)
snode = nb_node->snode;
switch (snode->nodetype) {
case LYS_CONTAINER:
- scontainer = (struct lys_node_container *)snode;
- if (!scontainer->presence)
+ scontainer = (struct lysc_node_container *)snode;
+ if (!CHECK_FLAG(scontainer->flags, LYS_PRESENCE))
return -1;
sr_data->type = SR_CONTAINER_PRESENCE_T;
return 0;
@@ -76,11 +76,11 @@ static int yang_data_frr2sr(struct yang_data *frr_data, sr_val_t *sr_data)
sr_data->type = SR_LIST_T;
return 0;
case LYS_LEAF:
- sleaf = (struct lys_node_leaf *)snode;
+ sleaf = (struct lysc_node_leaf *)snode;
type = sleaf->type.base;
break;
case LYS_LEAFLIST:
- sleaflist = (struct lys_node_leaflist *)snode;
+ sleaflist = (struct lysc_node_leaflist *)snode;
type = sleaflist->type.base;
break;
default:
@@ -359,7 +359,7 @@ static int frr_sr_config_change_cb(sr_session_ctx_t *session,
}
}
-static int frr_sr_state_data_iter_cb(const struct lys_node *snode,
+static int frr_sr_state_data_iter_cb(const struct lysc_node *snode,
struct yang_translator *translator,
struct yang_data *data, void *arg)
{
@@ -562,7 +562,7 @@ static void frr_sr_subscribe_config(struct yang_module *module)
sr_strerror(ret));
}
-static int frr_sr_subscribe_state(const struct lys_node *snode, void *arg)
+static int frr_sr_subscribe_state(const struct lysc_node *snode, void *arg)
{
struct yang_module *module = arg;
struct nb_node *nb_node;
@@ -591,7 +591,7 @@ static int frr_sr_subscribe_state(const struct lys_node *snode, void *arg)
return YANG_ITER_CONTINUE;
}
-static int frr_sr_subscribe_rpc(const struct lys_node *snode, void *arg)
+static int frr_sr_subscribe_rpc(const struct lysc_node *snode, void *arg)
{
struct yang_module *module = arg;
struct nb_node *nb_node;