]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: rename update_type enum values 11788/head
authorQuentin Young <qlyoung@nvidia.com>
Fri, 11 Jun 2021 23:00:15 +0000 (19:00 -0400)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Thu, 11 Aug 2022 19:35:50 +0000 (22:35 +0300)
These values were named WITHDRAW and UPDATE. Yeah, you guessed it, those
are already #define's elsewhere (bgp_debug.h). Hilarity ensues.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
bgpd/bgp_conditional_adv.c
bgpd/bgp_vty.c
bgpd/bgpd.c
bgpd/bgpd.h

index a0af8a48a76201ee2defda4e6e3fcb0c8c1d56c9..90a2e5c286ba37835857e904c1354e708ecfc7cb 100644 (file)
@@ -100,7 +100,8 @@ static void bgp_conditional_adv_routes(struct peer *peer, afi_t afi,
 
        if (BGP_DEBUG(update, UPDATE_OUT))
                zlog_debug("%s: %s routes to/from %s for %s", __func__,
-                          update_type == ADVERTISE ? "Advertise" : "Withdraw",
+                          update_type == UPDATE_TYPE_ADVERTISE ? "Advertise"
+                                                               : "Withdraw",
                           peer->host, get_afi_safi_str(afi, safi, false));
 
        addpath_capable = bgp_addpath_encode_tx(peer, afi, safi);
@@ -133,7 +134,7 @@ static void bgp_conditional_adv_routes(struct peer *peer, afi_t afi,
                         * on same peer, routes in advertise-map may not
                         * be advertised as expected.
                         */
-                       if (update_type == ADVERTISE &&
+                       if (update_type == UPDATE_TYPE_ADVERTISE &&
                            subgroup_announce_check(dest, pi, subgrp, dest_p,
                                                    &attr, &advmap_attr)) {
                                bgp_adj_out_set_subgroup(dest, subgrp, &attr,
@@ -248,12 +249,14 @@ static void bgp_conditional_adv_timer(struct thread *t)
                         */
                        if (filter->advmap.condition == CONDITION_EXIST)
                                filter->advmap.update_type =
-                                       (ret == RMAP_PERMITMATCH) ? ADVERTISE
-                                                                 : WITHDRAW;
+                                       (ret == RMAP_PERMITMATCH)
+                                               ? UPDATE_TYPE_ADVERTISE
+                                               : UPDATE_TYPE_WITHDRAW;
                        else
                                filter->advmap.update_type =
-                                       (ret == RMAP_PERMITMATCH) ? WITHDRAW
-                                                                 : ADVERTISE;
+                                       (ret == RMAP_PERMITMATCH)
+                                               ? UPDATE_TYPE_WITHDRAW
+                                               : UPDATE_TYPE_ADVERTISE;
 
                        /*
                         * Update condadv update type so
index 0a4083e5f62a5d8dfb4869e3c9ec88db646d975b..e3c2dcff42d38b610279849779d01a0ad4687202 100644 (file)
@@ -12014,11 +12014,12 @@ static void bgp_show_peer_afi(struct vty *vty, struct peer *p, afi_t afi,
                                               filter->advmap.cname);
                        json_object_string_add(json_advmap, "advertiseMap",
                                               filter->advmap.aname);
-                       json_object_string_add(json_advmap, "advertiseStatus",
-                                              filter->advmap.update_type
-                                                              == ADVERTISE
-                                                      ? "Advertise"
-                                                      : "Withdraw");
+                       json_object_string_add(
+                               json_advmap, "advertiseStatus",
+                               filter->advmap.update_type ==
+                                               UPDATE_TYPE_ADVERTISE
+                                       ? "Advertise"
+                                       : "Withdraw");
                        json_object_object_add(json_addr, "advertiseMap",
                                               json_advmap);
                }
@@ -12328,7 +12329,8 @@ static void bgp_show_peer_afi(struct vty *vty, struct peer *p, afi_t afi,
                                filter->advmap.cname,
                                filter->advmap.amap ? "*" : "",
                                filter->advmap.aname,
-                               filter->advmap.update_type == ADVERTISE
+                               filter->advmap.update_type ==
+                                               UPDATE_TYPE_ADVERTISE
                                        ? "Advertise"
                                        : "Withdraw");
 
index 7d284f28b38b22c248db2076759a0c7e0fdc8c88..69ce52b0aa315e46618cbc6c024af4399d273f58 100644 (file)
@@ -7089,7 +7089,7 @@ static void peer_advertise_map_filter_update(struct peer *peer, afi_t afi,
 
        /* Increment condition_filter_count and/or create timer. */
        if (!filter_exists) {
-               filter->advmap.update_type = ADVERTISE;
+               filter->advmap.update_type = UPDATE_TYPE_ADVERTISE;
                bgp_conditional_adv_enable(peer, afi, safi);
        }
 }
index bf26bdc5b03ff99c13206d360cb9fa3b1148b658..1eb1dcc89e2a9aa92e945a28bef79e4010716202 100644 (file)
@@ -857,7 +857,7 @@ struct bgp_nexthop {
 #define CONDITION_NON_EXIST    false
 #define CONDITION_EXIST                true
 
-enum update_type { WITHDRAW, ADVERTISE };
+enum update_type { UPDATE_TYPE_WITHDRAW, UPDATE_TYPE_ADVERTISE };
 
 #include "filter.h"