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.
diff --git a/bgpd/bgp_damp.c b/bgpd/bgp_damp.c
index d70105f..9b7b5da 100644
--- a/bgpd/bgp_damp.c
+++ b/bgpd/bgp_damp.c
@@ -47,7 +47,7 @@
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 @@
int
bgp_damp_decay (time_t tdiff, int penalty)
{
- int i;
+ unsigned int i;
i = (int) ((double) tdiff / DELTA_T);
@@ -380,7 +380,7 @@
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 @@
}
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 @@
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_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 @@
#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;