1 From 06bd420d4646333bc7ed9964e348f19a942fcfe2 Mon Sep 17 00:00:00 2001
2 From: Balaji <balajig81@gmail.com>
3 Date: Mon, 16 Mar 2015 16:55:29 +0000
4 Subject: [PATCH] bgpd: Display of configured dampening parameters
6 Function to display configured bgp dampening parameters.
8 Signed-off-by: Balaji.G <balajig81@gmail.com>
9 [DL: formatting adjustments]
10 Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 bgpd/bgp_damp.c | 33 +++++++++++++++++++++++++++++++++
13 bgpd/bgp_damp.h | 2 ++
14 2 files changed, 35 insertions(+)
16 diff --git a/bgpd/bgp_damp.c b/bgpd/bgp_damp.c
17 index 0ffafb7..dd6c759 100644
20 @@ -639,3 +639,36 @@ bgp_damp_reuse_time_vty (struct vty *vty, struct bgp_info *binfo,
22 return bgp_get_reuse_time (penalty, timebuf, len);
26 +bgp_show_dampening_parameters (struct vty *vty, afi_t afi, safi_t safi)
29 + bgp = bgp_get_default();
33 + vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
37 + if (CHECK_FLAG (bgp->af_flags[afi][safi], BGP_CONFIG_DAMPENING))
39 + vty_out (vty, "Half-life time: %ld min%s",
40 + damp->half_life / 60, VTY_NEWLINE);
41 + vty_out (vty, "Reuse penalty: %d%s",
42 + damp->reuse_limit, VTY_NEWLINE);
43 + vty_out (vty, "Suppress penalty: %d%s",
44 + damp->suppress_value, VTY_NEWLINE);
45 + vty_out (vty, "Max suppress time: %ld min%s",
46 + damp->max_suppress_time / 60, VTY_NEWLINE);
47 + vty_out (vty, "Max supress penalty: %u%s",
48 + damp->ceiling, VTY_NEWLINE);
49 + vty_out (vty, "%s", VTY_NEWLINE);
52 + vty_out (vty, "dampening not enabled for %s%s",
53 + afi == AFI_IP ? "IPv4" : "IPv6", VTY_NEWLINE);
57 diff --git a/bgpd/bgp_damp.h b/bgpd/bgp_damp.h
58 index e1d319b..16fd367 100644
61 @@ -144,4 +144,6 @@ extern void bgp_damp_info_vty (struct vty *, struct bgp_info *);
62 extern const char * bgp_damp_reuse_time_vty (struct vty *, struct bgp_info *,
65 +extern int bgp_show_dampening_parameters (struct vty *vty, afi_t, safi_t);
67 #endif /* _QUAGGA_BGP_DAMP_H */