• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/ap/gpl/zebra/bgpd/

Lines Matching defs:bdi

66 bgp_reuse_list_add (struct bgp_damp_info *bdi)
70 index = bdi->index = bgp_reuse_index (bdi->penalty);
72 bdi->prev = NULL;
73 bdi->next = damp->reuse_list[index];
75 damp->reuse_list[index]->prev = bdi;
76 damp->reuse_list[index] = bdi;
81 bgp_reuse_list_delete (struct bgp_damp_info *bdi)
83 if (bdi->next)
84 bdi->next->prev = bdi->prev;
85 if (bdi->prev)
86 bdi->prev->next = bdi->next;
88 damp->reuse_list[bdi->index] = bdi->next;
114 struct bgp_damp_info *bdi;
132 bdi = damp->reuse_list[damp->reuse_offset];
140 for (; bdi; bdi = next)
142 next = bdi->next;
145 t_diff = t_now - bdi->t_updated;
148 bdi->penalty = bgp_damp_decay (t_diff, bdi->penalty);
151 bdi->t_updated = t_now;
154 if (bdi->penalty < damp->reuse_limit)
157 UNSET_FLAG (bdi->binfo->flags, BGP_INFO_DAMPED);
158 bdi->suppress_time = 0;
160 if (bdi->lastrecord == BGP_RECORD_UPDATE)
162 UNSET_FLAG (bdi->binfo->flags, BGP_INFO_HISTORY);
163 bgp_aggregate_increment (bgp, &bdi->rn->p, bdi->binfo,
164 bdi->afi, bdi->safi);
165 bgp_process (bgp, bdi->rn, bdi->afi, bdi->safi);
168 if (bdi->penalty <= damp->reuse_limit / 2.0)
169 bgp_damp_info_free (bdi, 1);
171 BGP_DAMP_LIST_ADD (damp, bdi);
175 bgp_reuse_list_add (bdi);
187 struct bgp_damp_info *bdi;
193 bdi = binfo->damp_info;
195 if (bdi == NULL)
204 bdi = XCALLOC (MTYPE_BGP_DAMP_INFO, sizeof (struct bgp_damp_info));
205 bdi->binfo = binfo;
206 bdi->rn = rn;
207 bdi->penalty = (attr_change ? DEFAULT_PENALTY / 2 : DEFAULT_PENALTY);
208 bdi->flap = 1;
209 bdi->start_time = t_now;
210 bdi->suppress_time = 0;
211 bdi->index = -1;
212 bdi->afi = afi;
213 bdi->safi = safi;
214 binfo->damp_info = bdi;
215 BGP_DAMP_LIST_ADD (damp, bdi);
219 last_penalty = bdi->penalty;
222 bdi->penalty =
223 (bgp_damp_decay (t_now - bdi->t_updated, bdi->penalty)
226 if (bdi->penalty > damp->ceiling)
227 bdi->penalty = damp->ceiling;
229 bdi->flap++;
232 bdi->lastrecord = BGP_RECORD_WITHDRAW;
233 bdi->t_updated = t_now;
239 if (CHECK_FLAG (bdi->binfo->flags, BGP_INFO_DAMPED))
242 if (bdi->penalty != last_penalty)
244 bgp_reuse_list_delete (bdi);
245 bgp_reuse_list_add (bdi);
252 if (bdi->penalty >= damp->suppress_value)
254 SET_FLAG (bdi->binfo->flags, BGP_INFO_DAMPED);
255 bdi->suppress_time = t_now;
256 BGP_DAMP_LIST_DEL (damp, bdi);
257 bgp_reuse_list_add (bdi);
268 struct bgp_damp_info *bdi;
271 bdi = binfo->damp_info;
272 if (! bdi)
278 bdi->lastrecord = BGP_RECORD_UPDATE;
279 bdi->penalty = bgp_damp_decay (t_now - bdi->t_updated, bdi->penalty);
281 if (! CHECK_FLAG (bdi->binfo->flags, BGP_INFO_DAMPED)
282 && (bdi->penalty < damp->suppress_value))
284 else if (CHECK_FLAG (bdi->binfo->flags, BGP_INFO_DAMPED)
285 && (bdi->penalty < damp->reuse_limit) )
287 UNSET_FLAG (bdi->binfo->flags, BGP_INFO_DAMPED);
288 bgp_reuse_list_delete (bdi);
289 BGP_DAMP_LIST_ADD (damp, bdi);
290 bdi->suppress_time = 0;
296 if (bdi->penalty > damp->reuse_limit / 2.0)
297 bdi->t_updated = t_now;
299 bgp_damp_info_free (bdi, 0);
309 struct bgp_damp_info *bdi;
312 bdi = binfo->damp_info;
316 t_diff = t_now - bdi->suppress_time;
321 bgp_reuse_list_delete (bdi);
322 BGP_DAMP_LIST_ADD (damp, bdi);
323 bdi->penalty = damp->reuse_limit;
324 bdi->suppress_time = 0;
325 bdi->t_updated = t_now;
328 if (bdi->lastrecord == BGP_RECORD_UPDATE)
336 t_diff = t_now - bdi->t_updated;
337 bdi->penalty = bgp_damp_decay (t_diff, bdi->penalty);
339 if (bdi->penalty <= damp->reuse_limit / 2.0)
341 /* release the bdi, bdi->binfo. */
342 bgp_damp_info_free (bdi, 1);
346 bdi->t_updated = t_now;
352 bgp_damp_info_free (struct bgp_damp_info *bdi, int withdraw)
358 if (! bdi)
361 binfo = bdi->binfo;
365 bgp_reuse_list_delete (bdi);
367 BGP_DAMP_LIST_DEL (damp, bdi);
372 if (bdi->lastrecord == BGP_RECORD_WITHDRAW && withdraw)
374 bgp_info_delete (bdi->rn, binfo);
376 bgp_unlock_node (bdi->rn);
378 XFREE (MTYPE_BGP_DAMP_INFO, bdi);
485 struct bgp_damp_info *bdi, *next;
494 for (bdi = damp->reuse_list[i]; bdi; bdi = next)
496 next = bdi->next;
497 bgp_damp_info_free (bdi, 1);
502 for (bdi = damp->no_reuse_list; bdi; bdi = next)
504 next = bdi->next;
505 bgp_damp_info_free (bdi, 1);
598 struct bgp_damp_info *bdi;
604 bdi = binfo->damp_info;
608 if (! damp || ! bdi)
613 t_diff = t_now - bdi->t_updated;
614 penalty = bgp_damp_decay (t_diff, bdi->penalty);
617 penalty, bdi->flap,
618 peer_uptime (bdi->start_time, timebuf, BGP_UPTIME_LEN));
631 struct bgp_damp_info *bdi;
637 bdi = binfo->damp_info;
641 if (! damp || ! bdi)
646 t_diff = t_now - bdi->t_updated;
647 penalty = bgp_damp_decay (t_diff, bdi->penalty);