]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_damp.c
bgpd: Convert all bgp_info_XXX functions to bgp_path_XXX functions
[mirror_frr.git] / bgpd / bgp_damp.c
index fd7192a6f906940ab60fbca36cacaaaa03502635..32ba6002b6d68e4a640aa48a3ece21b0fe752bce 100644 (file)
@@ -145,13 +145,13 @@ static int bgp_reuse_timer(struct thread *t)
                /* if (figure-of-merit < reuse).  */
                if (bdi->penalty < damp->reuse_limit) {
                        /* Reuse the route.  */
-                       bgp_info_unset_flag(bdi->rn, bdi->binfo,
-                                           BGP_PATH_DAMPED);
+                       bgp_path_info_unset_flag(bdi->rn, bdi->binfo,
+                                                BGP_PATH_DAMPED);
                        bdi->suppress_time = 0;
 
                        if (bdi->lastrecord == BGP_RECORD_UPDATE) {
-                               bgp_info_unset_flag(bdi->rn, bdi->binfo,
-                                                   BGP_PATH_HISTORY);
+                               bgp_path_info_unset_flag(bdi->rn, bdi->binfo,
+                                                        BGP_PATH_HISTORY);
                                bgp_aggregate_increment(bgp, &bdi->rn->p,
                                                        bdi->binfo, bdi->afi,
                                                        bdi->safi);
@@ -205,7 +205,7 @@ int bgp_damp_withdraw(struct bgp_path_info *binfo, struct bgp_node *rn,
                bdi->index = -1;
                bdi->afi = afi;
                bdi->safi = safi;
-               (bgp_info_extra_get(binfo))->damp_info = bdi;
+               (bgp_path_info_extra_get(binfo))->damp_info = bdi;
                BGP_DAMP_LIST_ADD(damp, bdi);
        } else {
                last_penalty = bdi->penalty;
@@ -228,7 +228,7 @@ int bgp_damp_withdraw(struct bgp_path_info *binfo, struct bgp_node *rn,
        bdi->t_updated = t_now;
 
        /* Make this route as historical status.  */
-       bgp_info_set_flag(rn, binfo, BGP_PATH_HISTORY);
+       bgp_path_info_set_flag(rn, binfo, BGP_PATH_HISTORY);
 
        /* Remove the route from a reuse list if it is on one.  */
        if (CHECK_FLAG(bdi->binfo->flags, BGP_PATH_DAMPED)) {
@@ -243,7 +243,7 @@ int bgp_damp_withdraw(struct bgp_path_info *binfo, struct bgp_node *rn,
        /* If not suppressed before, do annonunce this withdraw and
           insert into reuse_list.  */
        if (bdi->penalty >= damp->suppress_value) {
-               bgp_info_set_flag(rn, binfo, BGP_PATH_DAMPED);
+               bgp_path_info_set_flag(rn, binfo, BGP_PATH_DAMPED);
                bdi->suppress_time = t_now;
                BGP_DAMP_LIST_DEL(damp, bdi);
                bgp_reuse_list_add(bdi);
@@ -263,7 +263,7 @@ int bgp_damp_update(struct bgp_path_info *binfo, struct bgp_node *rn, afi_t afi,
                return BGP_DAMP_USED;
 
        t_now = bgp_clock();
-       bgp_info_unset_flag(rn, binfo, BGP_PATH_HISTORY);
+       bgp_path_info_unset_flag(rn, binfo, BGP_PATH_HISTORY);
 
        bdi->lastrecord = BGP_RECORD_UPDATE;
        bdi->penalty = bgp_damp_decay(t_now - bdi->t_updated, bdi->penalty);
@@ -273,7 +273,7 @@ int bgp_damp_update(struct bgp_path_info *binfo, struct bgp_node *rn, afi_t afi,
                status = BGP_DAMP_USED;
        else if (CHECK_FLAG(bdi->binfo->flags, BGP_PATH_DAMPED)
                 && (bdi->penalty < damp->reuse_limit)) {
-               bgp_info_unset_flag(rn, binfo, BGP_PATH_DAMPED);
+               bgp_path_info_unset_flag(rn, binfo, BGP_PATH_DAMPED);
                bgp_reuse_list_delete(bdi);
                BGP_DAMP_LIST_ADD(damp, bdi);
                bdi->suppress_time = 0;
@@ -304,7 +304,8 @@ int bgp_damp_scan(struct bgp_path_info *binfo, afi_t afi, safi_t safi)
                t_diff = t_now - bdi->suppress_time;
 
                if (t_diff >= damp->max_suppress_time) {
-                       bgp_info_unset_flag(bdi->rn, binfo, BGP_PATH_DAMPED);
+                       bgp_path_info_unset_flag(bdi->rn, binfo,
+                                                BGP_PATH_DAMPED);
                        bgp_reuse_list_delete(bdi);
                        BGP_DAMP_LIST_ADD(damp, bdi);
                        bdi->penalty = damp->reuse_limit;
@@ -347,10 +348,11 @@ void bgp_damp_info_free(struct bgp_damp_info *bdi, int withdraw)
        else
                BGP_DAMP_LIST_DEL(damp, bdi);
 
-       bgp_info_unset_flag(bdi->rn, binfo, BGP_PATH_HISTORY | BGP_PATH_DAMPED);
+       bgp_path_info_unset_flag(bdi->rn, binfo,
+                                BGP_PATH_HISTORY | BGP_PATH_DAMPED);
 
        if (bdi->lastrecord == BGP_RECORD_WITHDRAW && withdraw)
-               bgp_info_delete(bdi->rn, binfo);
+               bgp_path_info_delete(bdi->rn, binfo);
 
        XFREE(MTYPE_BGP_DAMP_INFO, bdi);
 }