; /* Accept this LSA for quick LSDB resynchronization. */
}
else if (tv_cmp (tv_sub (recent_relative_time (), current->tv_recv),
- intms2tv (ospf->min_ls_arrival)) < 0)
+ msec2tv (ospf->min_ls_arrival)) < 0)
{
if (IS_DEBUG_OSPF_EVENT)
zlog_debug ("LSA[Flooding]: LSA is received recently.");
}
struct timeval
-intms2tv (int a)
+int2tv (int a)
{
struct timeval ret;
- ret.tv_sec = a/1000;
- ret.tv_usec = (a%1000)*1000;
+ ret.tv_sec = a;
+ ret.tv_usec = 0;
return ret;
}
struct timeval
-int2tv (int a)
+msec2tv (int a)
{
struct timeval ret;
- ret.tv_sec = a;
- ret.tv_usec = 0;
+ ret.tv_sec = a/1000;
+ ret.tv_usec = (a%1000) * 1000;
- return ret;
+ return tv_adjust (ret);
}
struct timeval
quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
delta = tv_sub (now, lsa->tv_orig);
- if (tv_cmp (delta, intms2tv (OSPF_MIN_LS_INTERVAL)) < 0)
+ if (tv_cmp (delta, msec2tv (OSPF_MIN_LS_INTERVAL)) < 0)
{
- delay = tv_ceil (tv_sub (intms2tv (OSPF_MIN_LS_INTERVAL), delta));
+ delay = tv_ceil (tv_sub (msec2tv (OSPF_MIN_LS_INTERVAL), delta));
if (IS_DEBUG_OSPF (lsa, LSA_GENERATE))
zlog_debug ("LSA[Type%d:%s]: Refresh timer delay %d seconds",
extern struct timeval tv_adjust (struct timeval);
extern int tv_ceil (struct timeval);
extern int tv_floor (struct timeval);
-extern struct timeval intms2tv (int);
extern struct timeval int2tv (int);
+extern struct timeval msec2tv (int);
extern struct timeval tv_add (struct timeval, struct timeval);
extern struct timeval tv_sub (struct timeval, struct timeval);
extern int tv_cmp (struct timeval, struct timeval);
quagga_gettime (QUAGGA_CLK_MONOTONIC, &now);
if (tv_cmp (tv_sub (now, current->tv_orig),
- intms2tv (oi->ospf->min_ls_arrival)) >= 0)
+ msec2tv (ospf->min_ls_arrival)) >= 0)
/* Trap NSSA type later.*/
ospf_ls_upd_send_lsa (nbr, current, OSPF_SEND_PACKET_DIRECT);
DISCARD_LSA (lsa, 8);
new->default_metric = -1;
new->ref_bandwidth = OSPF_DEFAULT_REF_BANDWIDTH;
+ /* LSA timers */
+ new->min_ls_interval = OSPF_MIN_LS_INTERVAL;
+ new->min_ls_arrival = OSPF_MIN_LS_ARRIVAL;
+
/* SPF timer value init. */
new->spf_delay = OSPF_SPF_DELAY_DEFAULT;
new->spf_holdtime = OSPF_SPF_HOLDTIME_DEFAULT;
new->spf_max_holdtime = OSPF_SPF_MAX_HOLDTIME_DEFAULT;
new->spf_hold_multiplier = 1;
- /* LSA timers value init */
- new->min_ls_interval = OSPF_MIN_LS_INTERVAL;
- new->min_ls_arrival = OSPF_MIN_LS_ARRIVAL;
-
/* MaxAge init. */
new->maxage_delay = OSPF_LSA_MAXAGE_REMOVE_DELAY_DEFAULT;
new->maxage_lsa = route_table_init();
#define OSPF_STUB_MAX_METRIC_SUMMARY_COST 0x00ff0000
+ /* LSA timers */
+ unsigned int min_ls_interval; /* minimum delay between LSAs (in msec) */
+ unsigned int min_ls_arrival; /* minimum interarrival time between LSAs (in msec) */
+
/* SPF parameters */
unsigned int spf_delay; /* SPF delay time. */
unsigned int spf_holdtime; /* SPF hold time. */
unsigned int spf_max_holdtime; /* SPF maximum-holdtime */
unsigned int spf_hold_multiplier; /* Adaptive multiplier for hold time */
- /* LSA timer parameters */
- unsigned int min_ls_interval; /* mininum delay between LSAs (in msec) */
- unsigned int min_ls_arrival; /* LSA minimum arrival in milliseconds. */
-
int default_originate; /* Default information originate. */
#define DEFAULT_ORIGINATE_NONE 0
#define DEFAULT_ORIGINATE_ZEBRA 1