summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBalaji <balajig81@gmail.com>2015-03-16 16:55:29 +0000
committerDavid Lamparter <equinox@opensourcerouting.org>2015-04-14 12:31:42 +0200
commit06bd420d4646333bc7ed9964e348f19a942fcfe2 (patch)
treed7d2ee186e7ed8e856da3b6d39bef86839d5040f
parentaa7dbb1067b7d02e1354fe1e5664ccb7d259d649 (diff)
downloadquagga-06bd420d4646333bc7ed9964e348f19a942fcfe2.tar.bz2
quagga-06bd420d4646333bc7ed9964e348f19a942fcfe2.tar.xz
bgpd: Display of configured dampening parameters
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>
-rw-r--r--bgpd/bgp_damp.c33
-rw-r--r--bgpd/bgp_damp.h2
2 files changed, 35 insertions, 0 deletions
diff --git a/bgpd/bgp_damp.c b/bgpd/bgp_damp.c
index 0ffafb7a..dd6c759f 100644
--- a/bgpd/bgp_damp.c
+++ b/bgpd/bgp_damp.c
@@ -639,3 +639,36 @@ bgp_damp_reuse_time_vty (struct vty *vty, struct bgp_info *binfo,
return bgp_get_reuse_time (penalty, timebuf, len);
}
+
+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;
+}
diff --git a/bgpd/bgp_damp.h b/bgpd/bgp_damp.h
index e1d319b5..16fd3671 100644
--- a/bgpd/bgp_damp.h
+++ b/bgpd/bgp_damp.h
@@ -144,4 +144,6 @@ extern void bgp_damp_info_vty (struct vty *, struct bgp_info *);
extern const char * bgp_damp_reuse_time_vty (struct vty *, struct bgp_info *,
char *, size_t);
+extern int bgp_show_dampening_parameters (struct vty *vty, afi_t, safi_t);
+
#endif /* _QUAGGA_BGP_DAMP_H */