summaryrefslogtreecommitdiff
path: root/bgpd/bgp_damp.c
diff options
context:
space:
mode:
authorpaul <paul>2004-10-13 05:06:08 +0000
committerpaul <paul>2004-10-13 05:06:08 +0000
commitfd79ac918b8feaacebe9719adaac97dffb69137a (patch)
treed0665eb68e60da9d6e364414cdb61830f19f33d3 /bgpd/bgp_damp.c
parent39db97e4e02eae08a1e18528367b6e9b07eb6a93 (diff)
2004-10-13 Paul Jakma <paul@dishone.st>
* (global) more const'ification and fixups of types to clean up code. * bgp_mplsvpn.{c,h}: (str2tag) fix abuse. Still not perfect, should use something like the VTY_GET_INTEGER macro, but without the vty_out bits.. * bgp_routemap.c: (set_aggregator_as) use VTY_GET_INTEGER_RANGE (no_set_aggregator_as) ditto. * bgpd.c: (peer_uptime) fix unlikely bug, where no buffer is returned, add comments about troublesome return value.
Diffstat (limited to 'bgpd/bgp_damp.c')
-rw-r--r--bgpd/bgp_damp.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/bgpd/bgp_damp.c b/bgpd/bgp_damp.c
index d70105f5..9b7b5dae 100644
--- a/bgpd/bgp_damp.c
+++ b/bgpd/bgp_damp.c
@@ -47,7 +47,7 @@ struct bgp_damp_config *damp = &bgp_damp_cfg;
static int
bgp_reuse_index (int penalty)
{
- int i;
+ unsigned int i;
int index;
i = (int)(((double) penalty / damp->reuse_limit - 1.0) * damp->scale_factor);
@@ -91,7 +91,7 @@ bgp_reuse_list_delete (struct bgp_damp_info *bdi)
int
bgp_damp_decay (time_t tdiff, int penalty)
{
- int i;
+ unsigned int i;
i = (int) ((double) tdiff / DELTA_T);
@@ -380,7 +380,7 @@ void
bgp_damp_parameter_set (int hlife, int reuse, int sup, int maxsup)
{
double reuse_max_ratio;
- int i;
+ unsigned int i;
double j;
damp->suppress_value = sup;
@@ -438,8 +438,8 @@ bgp_damp_parameter_set (int hlife, int reuse, int sup, int maxsup)
}
int
-bgp_damp_enable (struct bgp *bgp, afi_t afi, safi_t safi, int half,
- int reuse, int suppress, int max)
+bgp_damp_enable (struct bgp *bgp, afi_t afi, safi_t safi, time_t half,
+ unsigned int reuse, unsigned int suppress, time_t max)
{
if (CHECK_FLAG (bgp->af_flags[afi][safi], BGP_CONFIG_DAMPENING))
{
@@ -479,7 +479,7 @@ bgp_damp_config_clean (struct bgp_damp_config *damp)
void
bgp_damp_info_clean ()
{
- int i;
+ unsigned int i;
struct bgp_damp_info *bdi, *next;
damp->reuse_offset = 0;
@@ -537,11 +537,11 @@ bgp_config_write_damp (struct vty *vty)
&& bgp_damp_cfg.reuse_limit == DEFAULT_REUSE
&& bgp_damp_cfg.suppress_value == DEFAULT_SUPPRESS
&& bgp_damp_cfg.max_suppress_time == bgp_damp_cfg.half_life*4)
- vty_out (vty, " bgp dampening %d%s",
+ vty_out (vty, " bgp dampening %ld%s",
bgp_damp_cfg.half_life/60,
VTY_NEWLINE);
else
- vty_out (vty, " bgp dampening %d %d %d %d%s",
+ vty_out (vty, " bgp dampening %ld %d %d %ld%s",
bgp_damp_cfg.half_life/60,
bgp_damp_cfg.reuse_limit,
bgp_damp_cfg.suppress_value,
@@ -555,7 +555,7 @@ bgp_config_write_damp (struct vty *vty)
#define BGP_UPTIME_LEN 25
char *
-bgp_get_reuse_time (int penalty, char *buf, size_t len)
+bgp_get_reuse_time (unsigned int penalty, char *buf, size_t len)
{
time_t reuse_time = 0;
struct tm *tm = NULL;