]> git.puffer.fish Git - matthieu/frr.git/commitdiff
mgmtd: add empty notif xpath map for completeness
authorChristian Hopps <chopps@labn.net>
Thu, 6 Jun 2024 18:08:00 +0000 (14:08 -0400)
committerChristian Hopps <chopps@labn.net>
Fri, 7 Jun 2024 09:50:10 +0000 (05:50 -0400)
New back-end clients may need to add notification static allocations so
we should have it available for those users, rather than requiring the
new user delve into the mgmtd infra and modify it themselves.

Signed-off-by: Christian Hopps <chopps@labn.net>
mgmtd/mgmt_be_adapter.c

index 81574d1a56cfc6fd6644928bfee62a5fb2a794b3..c7f4fb9d844d4f35df4c9d47e6e681b38fa7966b 100644 (file)
@@ -155,6 +155,9 @@ static const char *const *be_client_oper_xpaths[MGMTD_BE_CLIENT_ID_MAX] = {
        [MGMTD_BE_CLIENT_ID_ZEBRA] = zebra_oper_xpaths,
 };
 
+static const char *const *be_client_notif_xpaths[MGMTD_BE_CLIENT_ID_MAX] = {
+};
+
 static const char *const *be_client_rpc_xpaths[MGMTD_BE_CLIENT_ID_MAX] = {
 #ifdef HAVE_RIPD
        [MGMTD_BE_CLIENT_ID_RIPD] = ripd_rpc_xpaths,
@@ -298,6 +301,13 @@ static void mgmt_be_xpath_map_init(void)
                                                   MGMT_BE_XPATH_SUBSCR_TYPE_OPER);
                }
 
+               /* Initialize the common NOTIF init map */
+               for (init = be_client_notif_xpaths[id]; init && *init; init++) {
+                       __dbg(" - NOTIF XPATH: '%s'", *init);
+                       mgmt_register_client_xpath(id, *init,
+                                                  MGMT_BE_XPATH_SUBSCR_TYPE_NOTIF);
+               }
+
                /* Initialize the common RPC init map */
                for (init = be_client_rpc_xpaths[id]; init && *init; init++) {
                        __dbg(" - RPC XPATH: '%s'", *init);
@@ -308,6 +318,7 @@ static void mgmt_be_xpath_map_init(void)
 
        __dbg("Total Cfg XPath Maps: %u", darr_len(be_cfg_xpath_map));
        __dbg("Total Oper XPath Maps: %u", darr_len(be_oper_xpath_map));
+       __dbg("Total Noitf XPath Maps: %u", darr_len(be_notif_xpath_map));
        __dbg("Total RPC XPath Maps: %u", darr_len(be_rpc_xpath_map));
 }