diff options
| author | Christian Hopps <chopps@labn.net> | 2021-09-14 16:45:28 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-14 16:45:28 -0400 |
| commit | 2e69e3852f76bd55a31cd39f95494bc8f7c936cf (patch) | |
| tree | ab20180c9cb84c9bdd2b70e478909def0e863e2c /staticd/static_vrf.c | |
| parent | 2a8ded2b97b578a98ce4805d2d57e785f2acd0ac (diff) | |
| parent | 6cc73dad918984fc940369523a5a3c61538f0fdf (diff) | |
Merge pull request #9410 from idryzhov/static-show-run-nb
staticd: output config using NB callbacks instead of operational data
Diffstat (limited to 'staticd/static_vrf.c')
| -rw-r--r-- | staticd/static_vrf.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/staticd/static_vrf.c b/staticd/static_vrf.c index 740d904690..4bea3075c9 100644 --- a/staticd/static_vrf.c +++ b/staticd/static_vrf.c @@ -23,11 +23,11 @@ #include "nexthop.h" #include "table.h" #include "srcdest_table.h" +#include "northbound_cli.h" #include "static_vrf.h" #include "static_routes.h" #include "static_zebra.h" -#include "static_vty.h" DEFINE_MTYPE_STATIC(STATIC, STATIC_RTABLE_INFO, "Static Route Table Info"); @@ -150,24 +150,16 @@ struct static_vrf *static_vrf_lookup_by_name(const char *name) static int static_vrf_config_write(struct vty *vty) { - struct vrf *vrf; - - RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) { - if (vrf->vrf_id != VRF_DEFAULT) - vty_frame(vty, "vrf %s\n", vrf->name); + struct lyd_node *dnode; + int written = 0; - static_config(vty, vrf->info, AFI_IP, - SAFI_UNICAST, "ip route"); - static_config(vty, vrf->info, AFI_IP, - SAFI_MULTICAST, "ip mroute"); - static_config(vty, vrf->info, AFI_IP6, - SAFI_UNICAST, "ipv6 route"); - - if (vrf->vrf_id != VRF_DEFAULT) - vty_endframe(vty, "exit-vrf\n!\n"); + dnode = yang_dnode_get(running_config->dnode, "/frr-routing:routing"); + if (dnode) { + nb_cli_show_dnode_cmds(vty, dnode, false); + written = 1; } - return 0; + return written; } void static_vrf_init(void) |
