From 90fef831c93b031b980ee27d32fb654ec565a4d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateo=20Cindri=C4=87?= Date: Fri, 11 Feb 2022 11:41:51 +0100 Subject: [PATCH] routing-plugin: fix operational data XPath issues --- .gitignore | 1 + src/routing/routing.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 64992f08..22819ac6 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ build/ .vscode/ .clangd/ .test/ +.cache/ compile_commands.json \ No newline at end of file diff --git a/src/routing/routing.c b/src/routing/routing.c index 98a39d32..a2d5f72f 100644 --- a/src/routing/routing.c +++ b/src/routing/routing.c @@ -146,14 +146,14 @@ int sr_plugin_init_cb(sr_session_ctx_t *session, void **private_data) SRPLG_LOG_INF(PLUGIN_NAME, "subscribing to interfaces operational data"); // interface leaf-list oper data - error = sr_oper_get_subscribe(session, BASE_YANG_MODEL, ROUTING_INTERFACES_CONTAINER_YANG_PATH "/*", routing_oper_get_interfaces_cb, NULL, 0, &subscription); + error = sr_oper_get_subscribe(session, BASE_YANG_MODEL, ROUTING_INTERFACES_CONTAINER_YANG_PATH, routing_oper_get_interfaces_cb, NULL, 0, &subscription); if (error) { SRPLG_LOG_ERR(PLUGIN_NAME, "sr_oper_get_items_subscribe error (%d): %s", error, sr_strerror(error)); goto error_out; } // RIB oper data - error = sr_oper_get_subscribe(session, BASE_YANG_MODEL, ROUTING_RIB_LIST_YANG_PATH "/*", routing_oper_get_rib_routes_cb, NULL, 1, &subscription); + error = sr_oper_get_subscribe(session, BASE_YANG_MODEL, ROUTING_RIB_LIST_YANG_PATH, routing_oper_get_rib_routes_cb, NULL, 1, &subscription); if (error) { SRPLG_LOG_ERR(PLUGIN_NAME, "sr_oper_get_items_subscribe error (%d): %s", error, sr_strerror(error)); goto error_out; @@ -1020,12 +1020,12 @@ static int routing_oper_get_rib_routes_cb(sr_session_ctx_t *session, uint32_t su break; } case route_next_hop_kind_special: - SRPLG_LOG_DBG(PLUGIN_NAME, "special-next-hop = %s", NEXTHOP->special.value); - ly_err = lyd_new_path(nh_node, ly_ctx, "special-next-hop", (void *) NEXTHOP->special.value, false, NULL); - if (ly_err != LY_SUCCESS) { - SRPLG_LOG_ERR(PLUGIN_NAME, "unable to create new special-next-hop node"); - goto error_out; - } + // SRPLG_LOG_DBG(PLUGIN_NAME, "special-next-hop = %s", NEXTHOP->special.value); + // ly_err = lyd_new_path(nh_node, ly_ctx, "special-next-hop", NEXTHOP->special.value, false, NULL); + // if (ly_err != LY_SUCCESS) { + // SRPLG_LOG_ERR(PLUGIN_NAME, "unable to create new special-next-hop node"); + // goto error_out; + // } break; case route_next_hop_kind_list: { const struct route_next_hop_list *NEXTHOP_LIST = &ROUTE->next_hop.value.list;