summaryrefslogtreecommitdiff
path: root/bgpd/bgp_damp.h
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/bgp_damp.h')
-rw-r--r--bgpd/bgp_damp.h35
1 files changed, 18 insertions, 17 deletions
diff --git a/bgpd/bgp_damp.h b/bgpd/bgp_damp.h
index f3b9bd6d..09b953ea 100644
--- a/bgpd/bgp_damp.h
+++ b/bgpd/bgp_damp.h
@@ -27,10 +27,10 @@ struct bgp_damp_info
struct bgp_damp_info *prev;
/* Figure-of-merit. */
- int penalty;
+ unsigned int penalty;
/* Number of flapping. */
- int flap;
+ unsigned int flap;
/* First flap time */
time_t start_time;
@@ -52,8 +52,8 @@ struct bgp_damp_info
/* Last time message type. */
u_char lastrecord;
-#define BGP_RECORD_UPDATE 1
-#define BGP_RECORD_WITHDRAW 2
+#define BGP_RECORD_UPDATE 1U
+#define BGP_RECORD_WITHDRAW 2U
afi_t afi;
safi_t safi;
@@ -63,32 +63,32 @@ struct bgp_damp_info
struct bgp_damp_config
{
/* Value over which routes suppressed. */
- int suppress_value;
+ unsigned int suppress_value;
/* Value below which suppressed routes reused. */
- int reuse_limit;
+ unsigned int reuse_limit;
/* Max time a route can be suppressed. */
- int max_suppress_time;
+ time_t max_suppress_time;
/* Time during which accumulated penalty reduces by half. */
- int half_life;
+ time_t half_life;
/* Non-configurable parameters but fixed at implementation time.
* To change this values, init_bgp_damp() should be modified.
*/
- int tmax; /* Max time previous instability retained */
- int reuse_list_size; /* Number of reuse lists */
- int reuse_index_size; /* Size of reuse index array */
+ time_t tmax; /* Max time previous instability retained */
+ unsigned int reuse_list_size; /* Number of reuse lists */
+ unsigned int reuse_index_size; /* Size of reuse index array */
/* Non-configurable parameters. Most of these are calculated from
* the configurable parameters above.
*/
- unsigned int ceiling; /* Max value a penalty can attain */
- int decay_rate_per_tick; /* Calculated from half-life */
- int decay_array_size; /* Calculated using config parameters */
+ unsigned int ceiling; /* Max value a penalty can attain */
+ unsigned int decay_rate_per_tick; /* Calculated from half-life */
+ unsigned int decay_array_size; /* Calculated using config parameters */
double scale_factor;
- int reuse_scale_factor;
+ unsigned int reuse_scale_factor;
/* Decay array per-set based. */
double *decay_array;
@@ -126,7 +126,8 @@ struct bgp_damp_config
#define REUSE_LIST_SIZE 256
#define REUSE_ARRAY_SIZE 1024
-int bgp_damp_enable (struct bgp *, afi_t, safi_t, int, int, int, int);
+int bgp_damp_enable (struct bgp *, afi_t, safi_t, time_t, unsigned int,
+ unsigned int, time_t);
int bgp_damp_disable (struct bgp *, afi_t, safi_t);
int bgp_damp_withdraw (struct bgp_info *, struct bgp_node *,
afi_t, safi_t, int);
@@ -134,7 +135,7 @@ int bgp_damp_update (struct bgp_info *, struct bgp_node *, afi_t, safi_t);
int bgp_damp_scan (struct bgp_info *, afi_t, safi_t);
void bgp_damp_info_free (struct bgp_damp_info *, int);
void bgp_damp_info_clean ();
-char * bgp_get_reuse_time (int, char*, size_t);
+char * bgp_get_reuse_time (unsigned int, char*, size_t);
int bgp_damp_decay (time_t, int);
int bgp_config_write_damp (struct vty *);
void bgp_damp_info_vty (struct vty *, struct bgp_info *);