]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Display of configured dampening parameters
authorBalaji <balajig81@gmail.com>
Mon, 16 Mar 2015 16:55:29 +0000 (16:55 +0000)
committerDaniel Walton <dwalton@cumulusnetworks.com>
Thu, 26 May 2016 15:26:05 +0000 (15:26 +0000)
Function to display configured bgp dampening parameters.

Signed-off-by: Balaji.G <balajig81@gmail.com>
[DL: formatting adjustments]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 06bd420d4646333bc7ed9964e348f19a942fcfe2)

bgpd/bgp_damp.c
bgpd/bgp_damp.h

index a4ce5ae3f9c3088c59dc5bce4c92722052dfbda7..c1ab04407b05796e30eea6a59813b60f7911ece2 100644 (file)
@@ -684,3 +684,36 @@ bgp_damp_reuse_time_vty (struct vty *vty, struct bgp_info *binfo,
 
   return  bgp_get_reuse_time (penalty, timebuf, len, use_json, json);
 }
+
+int
+bgp_show_dampening_parameters (struct vty *vty, afi_t afi, safi_t safi)
+{
+  struct bgp *bgp;
+  bgp = bgp_get_default();
+
+  if (bgp == NULL)
+    {
+      vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
+  if (CHECK_FLAG (bgp->af_flags[afi][safi], BGP_CONFIG_DAMPENING))
+    {
+      vty_out (vty, "Half-life time: %ld min%s",
+                    damp->half_life / 60, VTY_NEWLINE);
+      vty_out (vty, "Reuse penalty: %d%s",
+                    damp->reuse_limit, VTY_NEWLINE);
+      vty_out (vty, "Suppress penalty: %d%s",
+                    damp->suppress_value, VTY_NEWLINE);
+      vty_out (vty, "Max suppress time: %ld min%s",
+                    damp->max_suppress_time / 60, VTY_NEWLINE);
+      vty_out (vty, "Max supress penalty: %u%s",
+                    damp->ceiling, VTY_NEWLINE);
+      vty_out (vty, "%s", VTY_NEWLINE);
+    }
+  else
+    vty_out (vty, "dampening not enabled for %s%s",
+                  afi == AFI_IP ? "IPv4" : "IPv6", VTY_NEWLINE);
+
+  return CMD_SUCCESS;
+}
index 6853696378163a87a5f38d754e6d393e9faf2e11..030a621974640be885ef06b0c36f5a1f1634e145 100644 (file)
@@ -143,5 +143,6 @@ extern void bgp_config_write_damp (struct vty *);
 extern void bgp_damp_info_vty (struct vty *, struct bgp_info *, json_object *json_path);
 extern const char * bgp_damp_reuse_time_vty (struct vty *, struct bgp_info *,
                                              char *, size_t, u_char, json_object *);
+extern int bgp_show_dampening_parameters (struct vty *vty, afi_t, safi_t);
 
 #endif /* _QUAGGA_BGP_DAMP_H */