summaryrefslogtreecommitdiffstats
path: root/pimd/pim_msdp.c
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@opensourcerouting.org>2021-05-03 17:30:40 +0200
committerRafael Zalamena <rzalamena@opensourcerouting.org>2021-05-03 17:30:40 +0200
commit8c70c9e290211493f0a051f9d7ca84be90391072 (patch)
tree3db8c4307911cce7e652e340c38585992c3ea73d /pimd/pim_msdp.c
parentpimd: reduce code duplication (diff)
downloadfrr-8c70c9e290211493f0a051f9d7ca84be90391072.tar.xz
frr-8c70c9e290211493f0a051f9d7ca84be90391072.zip
pimd: show MSDP configuration
Display the MSDP peer configuration in `show running-config` so it can be saved on configuration write. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'pimd/pim_msdp.c')
-rw-r--r--pimd/pim_msdp.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/pimd/pim_msdp.c b/pimd/pim_msdp.c
index 7336cdfef..9cf73c38c 100644
--- a/pimd/pim_msdp.c
+++ b/pimd/pim_msdp.c
@@ -1562,6 +1562,26 @@ int pim_msdp_config_write(struct pim_instance *pim, struct vty *vty,
return count;
}
+bool pim_msdp_peer_config_write(struct vty *vty, struct pim_instance *pim,
+ const char *spaces)
+{
+ struct pim_msdp_peer *mp;
+ struct listnode *node;
+ bool written = false;
+
+ for (ALL_LIST_ELEMENTS_RO(pim->msdp.peer_list, node, mp)) {
+ /* Non meshed peers have the group name set to 'default'. */
+ if (strcmp(mp->mesh_group_name, "default"))
+ continue;
+
+ vty_out(vty, "%sip msdp peer %pI4 source %pI4\n", spaces,
+ &mp->peer, &mp->local);
+ written = true;
+ }
+
+ return written;
+}
+
/* Enable feature including active/periodic timers etc. on the first peer
* config. Till then MSDP should just stay quiet. */
static void pim_msdp_enable(struct pim_instance *pim)