diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2019-09-19 16:37:14 +0200 |
|---|---|---|
| committer | Louis Scalbert <louis.scalbert@6wind.com> | 2024-01-18 13:23:36 +0100 |
| commit | a42d490ac2eac007a5730b19118f34f18a68e439 (patch) | |
| tree | f350122ab0cfc99e86ebe54e332ea6e3e7ad6ba5 /bgpd/bgp_main.c | |
| parent | 1420189c11e52f8ff306de5d3d0e6a81293e54a9 (diff) | |
bgpd: show per vrf rpki configuration in show run
Show per VRF RPKI configuration in "show run".
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Diffstat (limited to 'bgpd/bgp_main.c')
| -rw-r--r-- | bgpd/bgp_main.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/bgpd/bgp_main.c b/bgpd/bgp_main.c index 739fab7ddd..1666d654c5 100644 --- a/bgpd/bgp_main.c +++ b/bgpd/bgp_main.c @@ -51,6 +51,9 @@ #include "bgpd/bgp_routemap_nb.h" #include "bgpd/bgp_community_alias.h" +DEFINE_HOOK(bgp_hook_config_write_vrf, (struct vty *vty, struct vrf *vrf), + (vty, vrf)); + #ifdef ENABLE_BGP_VNC #include "bgpd/rfapi/rfapi_backend.h" #endif @@ -344,9 +347,29 @@ static int bgp_vrf_disable(struct vrf *vrf) return 0; } +static int bgp_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_out(vty, "!\n"); + continue; + } + vty_out(vty, "vrf %s\n", vrf->name); + + hook_call(bgp_hook_config_write_vrf, vty, vrf); + + vty_out(vty, "exit-vrf\n!\n"); + } + + return 0; +} + static void bgp_vrf_init(void) { vrf_init(bgp_vrf_new, bgp_vrf_enable, bgp_vrf_disable, bgp_vrf_delete); + vrf_cmd_init(bgp_vrf_config_write); } static void bgp_vrf_terminate(void) |
