diff options
| author | paul <paul> | 2004-10-13 05:06:08 +0000 | 
|---|---|---|
| committer | paul <paul> | 2004-10-13 05:06:08 +0000 | 
| commit | fd79ac918b8feaacebe9719adaac97dffb69137a (patch) | |
| tree | d0665eb68e60da9d6e364414cdb61830f19f33d3 /bgpd/bgp_damp.h | |
| parent | 39db97e4e02eae08a1e18528367b6e9b07eb6a93 (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.h')
| -rw-r--r-- | bgpd/bgp_damp.h | 35 | 
1 files changed, 18 insertions, 17 deletions
diff --git a/bgpd/bgp_damp.h b/bgpd/bgp_damp.h index f3b9bd6dbc..09b953ea93 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 *);  | 
