diff options
Diffstat (limited to 'bgpd/bgp_damp.c')
-rw-r--r-- | bgpd/bgp_damp.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/bgpd/bgp_damp.c b/bgpd/bgp_damp.c index ba25f4d1..40edb646 100644 --- a/bgpd/bgp_damp.c +++ b/bgpd/bgp_damp.c @@ -36,7 +36,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA /* Global variable to access damping configuration */ struct bgp_damp_config bgp_damp_cfg; -struct bgp_damp_config *damp = &bgp_damp_cfg; +static struct bgp_damp_config *damp = &bgp_damp_cfg; /* Utility macro to add and delete BGP dampening information to no used list. */ @@ -541,9 +541,7 @@ bgp_config_write_damp (struct vty *vty) VTY_NEWLINE); } -#define BGP_UPTIME_LEN 25 - -char * +static const char * bgp_get_reuse_time (unsigned int penalty, char *buf, size_t len) { time_t reuse_time = 0; @@ -615,12 +613,12 @@ bgp_damp_info_vty (struct vty *vty, struct bgp_info *binfo) vty_out (vty, "%s", VTY_NEWLINE); } -char * -bgp_damp_reuse_time_vty (struct vty *vty, struct bgp_info *binfo) +const char * +bgp_damp_reuse_time_vty (struct vty *vty, struct bgp_info *binfo, + char *timebuf, size_t len) { struct bgp_damp_info *bdi; time_t t_now, t_diff; - char timebuf[BGP_UPTIME_LEN]; int penalty; if (!binfo->extra) @@ -639,5 +637,5 @@ bgp_damp_reuse_time_vty (struct vty *vty, struct bgp_info *binfo) t_diff = t_now - bdi->t_updated; penalty = bgp_damp_decay (t_diff, bdi->penalty); - return bgp_get_reuse_time (penalty, timebuf, BGP_UPTIME_LEN); + return bgp_get_reuse_time (penalty, timebuf, len); } |