]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: remove 'enum rnh_type' from system
authorDonald Sharp <sharpd@nvidia.com>
Fri, 24 Sep 2021 15:04:03 +0000 (11:04 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Mon, 27 Sep 2021 16:38:08 +0000 (12:38 -0400)
This code is now dead code since there are not two
nexthop resolution types.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra/rib.h
zebra/zapi_msg.c
zebra/zebra_rib.c
zebra/zebra_rnh.c
zebra/zebra_rnh.h
zebra/zebra_routemap.c
zebra/zebra_srte.c
zebra/zebra_vty.c

index 648399176109d98d671b9de5cd9d00e698f2ec9f..92e1b3635d690fb263ab4ffd8430093b4d485e95 100644 (file)
@@ -46,8 +46,6 @@ DECLARE_MGROUP(ZEBRA);
 
 DECLARE_MTYPE(RE);
 
-enum rnh_type { RNH_NEXTHOP_TYPE };
-
 PREDECL_LIST(rnh_list);
 
 /* Nexthop structure. */
@@ -64,8 +62,6 @@ struct rnh {
 
        afi_t afi;
 
-       enum rnh_type type;
-
        uint32_t seqno;
 
        struct route_entry *state;
index 640b119d035d43f04179415c9758c22ecee28a4a..adf9dfa00022bc99d14fc7777ed59129afc65a33 100644 (file)
@@ -1164,11 +1164,6 @@ int zsend_zebra_srv6_locator_delete(struct zserv *client,
 
 /* Inbound message handling ------------------------------------------------ */
 
-const int cmd2type[] = {
-       [ZEBRA_NEXTHOP_REGISTER] = RNH_NEXTHOP_TYPE,
-       [ZEBRA_NEXTHOP_UNREGISTER] = RNH_NEXTHOP_TYPE,
-};
-
 /* Nexthop register */
 static void zread_rnh_register(ZAPI_HANDLER_ARGS)
 {
@@ -1178,16 +1173,14 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS)
        unsigned short l = 0;
        uint8_t flags = 0;
        uint8_t resolve_via_default;
-       uint16_t type = cmd2type[hdr->command];
        bool exist;
        bool flag_changed = false;
        uint8_t orig_flags;
 
        if (IS_ZEBRA_DEBUG_NHT)
                zlog_debug(
-                       "rnh_register msg from client %s: hdr->length=%d, type=%s vrf=%u",
+                       "rnh_register msg from client %s: hdr->length=%d vrf=%u",
                        zebra_route_string(client->proto), hdr->length,
-                       (type == RNH_NEXTHOP_TYPE) ? "nexthop" : "route",
                        zvrf->vrf->vrf_id);
 
        s = msg;
@@ -1228,19 +1221,15 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS)
                                p.family);
                        return;
                }
-               rnh = zebra_add_rnh(&p, zvrf_id(zvrf), type, &exist);
+               rnh = zebra_add_rnh(&p, zvrf_id(zvrf), &exist);
                if (!rnh)
                        return;
 
                orig_flags = rnh->flags;
-               if (type == RNH_NEXTHOP_TYPE) {
-                       if (flags
-                           && !CHECK_FLAG(rnh->flags, ZEBRA_NHT_CONNECTED))
-                               SET_FLAG(rnh->flags, ZEBRA_NHT_CONNECTED);
-                       else if (!flags
-                                && CHECK_FLAG(rnh->flags, ZEBRA_NHT_CONNECTED))
-                               UNSET_FLAG(rnh->flags, ZEBRA_NHT_CONNECTED);
-               }
+               if (flags && !CHECK_FLAG(rnh->flags, ZEBRA_NHT_CONNECTED))
+                       SET_FLAG(rnh->flags, ZEBRA_NHT_CONNECTED);
+               else if (!flags && CHECK_FLAG(rnh->flags, ZEBRA_NHT_CONNECTED))
+                       UNSET_FLAG(rnh->flags, ZEBRA_NHT_CONNECTED);
 
                if (resolve_via_default)
                        SET_FLAG(rnh->flags, ZEBRA_NHT_RESOLVE_VIA_DEFAULT);
@@ -1250,10 +1239,9 @@ static void zread_rnh_register(ZAPI_HANDLER_ARGS)
 
                /* Anything not AF_INET/INET6 has been filtered out above */
                if (!exist || flag_changed)
-                       zebra_evaluate_rnh(zvrf, family2afi(p.family), 1, type,
-                                          &p);
+                       zebra_evaluate_rnh(zvrf, family2afi(p.family), 1, &p);
 
-               zebra_add_rnh_client(rnh, client, type, zvrf_id(zvrf));
+               zebra_add_rnh_client(rnh, client, zvrf_id(zvrf));
        }
 
 stream_failure:
@@ -1267,7 +1255,6 @@ static void zread_rnh_unregister(ZAPI_HANDLER_ARGS)
        struct stream *s;
        struct prefix p;
        unsigned short l = 0;
-       uint16_t type = cmd2type[hdr->command];
 
        if (IS_ZEBRA_DEBUG_NHT)
                zlog_debug(
@@ -1317,10 +1304,10 @@ static void zread_rnh_unregister(ZAPI_HANDLER_ARGS)
                                p.family);
                        return;
                }
-               rnh = zebra_lookup_rnh(&p, zvrf_id(zvrf), type);
+               rnh = zebra_lookup_rnh(&p, zvrf_id(zvrf));
                if (rnh) {
                        client->nh_dereg_time = monotime(NULL);
-                       zebra_remove_rnh_client(rnh, client, type);
+                       zebra_remove_rnh_client(rnh, client);
                }
        }
 stream_failure:
index 24c51e485ff5c8ef8e64922298f04722cfd9c1e0..5230f0a4d157134c0eed6e845943aa875a354a05 100644 (file)
@@ -730,10 +730,9 @@ void zebra_rib_evaluate_rn_nexthops(struct route_node *rn, uint32_t seq)
 
                        if (IS_ZEBRA_DEBUG_NHT_DETAILED)
                                zlog_debug(
-                                       "%s(%u):%pRN has Nexthop(%pFX) Type: %s depending on it, evaluating %u:%u",
-                                       zvrf_name(zvrf), zvrf_id(zvrf),
-                                       rn, p, rnh_type2str(rnh->type), seq,
-                                       rnh->seqno);
+                                       "%s(%u):%pRN has Nexthop(%pFX) depending on it, evaluating %u:%u",
+                                       zvrf_name(zvrf), zvrf_id(zvrf), rn, p,
+                                       seq, rnh->seqno);
 
                        /*
                         * If we have evaluated this node on this pass
@@ -755,8 +754,7 @@ void zebra_rib_evaluate_rn_nexthops(struct route_node *rn, uint32_t seq)
                        }
 
                        rnh->seqno = seq;
-                       zebra_evaluate_rnh(zvrf, family2afi(p->family), 0,
-                                          rnh->type, p);
+                       zebra_evaluate_rnh(zvrf, family2afi(p->family), 0, p);
                }
 
                rn = rn->parent;
index 422f2c92c1f7739f7dc06ea8e465e21800e3b599..c58debb6affb465d20af5569d2f074399ce200d0 100644 (file)
@@ -70,19 +70,14 @@ void zebra_rnh_init(void)
        hook_register(zserv_client_close, zebra_client_cleanup_rnh);
 }
 
-static inline struct route_table *get_rnh_table(vrf_id_t vrfid, afi_t afi,
-                                               enum rnh_type type)
+static inline struct route_table *get_rnh_table(vrf_id_t vrfid, afi_t afi)
 {
        struct zebra_vrf *zvrf;
        struct route_table *t = NULL;
 
        zvrf = zebra_vrf_lookup_by_id(vrfid);
        if (zvrf)
-               switch (type) {
-               case RNH_NEXTHOP_TYPE:
-                       t = zvrf->rnh_table[afi];
-                       break;
-               }
+               t = zvrf->rnh_table[afi];
 
        return t;
 }
@@ -132,8 +127,7 @@ static void zebra_rnh_store_in_routing_table(struct rnh *rnh)
        route_unlock_node(rn);
 }
 
-struct rnh *zebra_add_rnh(struct prefix *p, vrf_id_t vrfid, enum rnh_type type,
-                         bool *exists)
+struct rnh *zebra_add_rnh(struct prefix *p, vrf_id_t vrfid, bool *exists)
 {
        struct route_table *table;
        struct route_node *rn;
@@ -143,16 +137,15 @@ struct rnh *zebra_add_rnh(struct prefix *p, vrf_id_t vrfid, enum rnh_type type,
        if (IS_ZEBRA_DEBUG_NHT) {
                struct vrf *vrf = vrf_lookup_by_id(vrfid);
 
-               zlog_debug("%s(%u): Add RNH %pFX type %s", VRF_LOGNAME(vrf),
-                          vrfid, p, rnh_type2str(type));
+               zlog_debug("%s(%u): Add RNH %pFX", VRF_LOGNAME(vrf), vrfid, p);
        }
-       table = get_rnh_table(vrfid, afi, type);
+       table = get_rnh_table(vrfid, afi);
        if (!table) {
                struct vrf *vrf = vrf_lookup_by_id(vrfid);
 
                flog_warn(EC_ZEBRA_RNH_NO_TABLE,
-                         "%s(%u): Add RNH %pFX type %s - table not found",
-                         VRF_LOGNAME(vrf), vrfid, p, rnh_type2str(type));
+                         "%s(%u): Add RNH %pFX - table not found",
+                         VRF_LOGNAME(vrf), vrfid, p);
                *exists = false;
                return NULL;
        }
@@ -175,7 +168,6 @@ struct rnh *zebra_add_rnh(struct prefix *p, vrf_id_t vrfid, enum rnh_type type,
                rnh->resolved_route.family = p->family;
                rnh->client_list = list_new();
                rnh->vrf_id = vrfid;
-               rnh->type = type;
                rnh->seqno = 0;
                rnh->afi = afi;
                rnh->zebra_pseudowire_list = list_new();
@@ -192,13 +184,12 @@ struct rnh *zebra_add_rnh(struct prefix *p, vrf_id_t vrfid, enum rnh_type type,
        return (rn->info);
 }
 
-struct rnh *zebra_lookup_rnh(struct prefix *p, vrf_id_t vrfid,
-                            enum rnh_type type)
+struct rnh *zebra_lookup_rnh(struct prefix *p, vrf_id_t vrfid)
 {
        struct route_table *table;
        struct route_node *rn;
 
-       table = get_rnh_table(vrfid, family2afi(PREFIX_FAMILY(p)), type);
+       table = get_rnh_table(vrfid, family2afi(PREFIX_FAMILY(p)));
        if (!table)
                return NULL;
 
@@ -244,7 +235,7 @@ void zebra_free_rnh(struct rnh *rnh)
        XFREE(MTYPE_RNH, rnh);
 }
 
-static void zebra_delete_rnh(struct rnh *rnh, enum rnh_type type)
+static void zebra_delete_rnh(struct rnh *rnh)
 {
        struct route_node *rn;
 
@@ -258,8 +249,8 @@ static void zebra_delete_rnh(struct rnh *rnh, enum rnh_type type)
        if (IS_ZEBRA_DEBUG_NHT) {
                struct vrf *vrf = vrf_lookup_by_id(rnh->vrf_id);
 
-               zlog_debug("%s(%u): Del RNH %pRN type %s", VRF_LOGNAME(vrf),
-                          rnh->vrf_id, rnh->node, rnh_type2str(type));
+               zlog_debug("%s(%u): Del RNH %pRN", VRF_LOGNAME(vrf),
+                          rnh->vrf_id, rnh->node);
        }
 
        zebra_free_rnh(rnh);
@@ -276,15 +267,14 @@ static void zebra_delete_rnh(struct rnh *rnh, enum rnh_type type)
  * and as such it will have a resolved rnh.
  */
 void zebra_add_rnh_client(struct rnh *rnh, struct zserv *client,
-                         enum rnh_type type, vrf_id_t vrf_id)
+                         vrf_id_t vrf_id)
 {
        if (IS_ZEBRA_DEBUG_NHT) {
                struct vrf *vrf = vrf_lookup_by_id(vrf_id);
 
-               zlog_debug("%s(%u): Client %s registers for RNH %pRN type %s",
+               zlog_debug("%s(%u): Client %s registers for RNH %pRN",
                           VRF_LOGNAME(vrf), vrf_id,
-                          zebra_route_string(client->proto), rnh->node,
-                          rnh_type2str(type));
+                          zebra_route_string(client->proto), rnh->node);
        }
        if (!listnode_lookup(rnh->client_list, client))
                listnode_add(rnh->client_list, client);
@@ -293,21 +283,20 @@ void zebra_add_rnh_client(struct rnh *rnh, struct zserv *client,
         * We always need to respond with known information,
         * currently multiple daemons expect this behavior
         */
-       zebra_send_rnh_update(rnh, client, type, vrf_id, 0);
+       zebra_send_rnh_update(rnh, client, vrf_id, 0);
 }
 
-void zebra_remove_rnh_client(struct rnh *rnh, struct zserv *client,
-                            enum rnh_type type)
+void zebra_remove_rnh_client(struct rnh *rnh, struct zserv *client)
 {
        if (IS_ZEBRA_DEBUG_NHT) {
                struct vrf *vrf = vrf_lookup_by_id(rnh->vrf_id);
 
-               zlog_debug("Client %s unregisters for RNH %s(%u)%pRN type %s",
+               zlog_debug("Client %s unregisters for RNH %s(%u)%pRN",
                           zebra_route_string(client->proto), VRF_LOGNAME(vrf),
-                          vrf->vrf_id, rnh->node, rnh_type2str(type));
+                          vrf->vrf_id, rnh->node);
        }
        listnode_delete(rnh->client_list, client);
-       zebra_delete_rnh(rnh, type);
+       zebra_delete_rnh(rnh);
 }
 
 /* XXX move this utility function elsewhere? */
@@ -347,15 +336,14 @@ void zebra_register_rnh_pseudowire(vrf_id_t vrf_id, struct zebra_pw *pw,
                return;
 
        addr2hostprefix(pw->af, &pw->nexthop, &nh);
-       rnh = zebra_add_rnh(&nh, vrf_id, RNH_NEXTHOP_TYPE, &exists);
+       rnh = zebra_add_rnh(&nh, vrf_id, &exists);
        if (!rnh)
                return;
 
        if (!listnode_lookup(rnh->zebra_pseudowire_list, pw)) {
                listnode_add(rnh->zebra_pseudowire_list, pw);
                pw->rnh = rnh;
-               zebra_evaluate_rnh(zvrf, family2afi(pw->af), 1,
-                                  RNH_NEXTHOP_TYPE, &nh);
+               zebra_evaluate_rnh(zvrf, family2afi(pw->af), 1, &nh);
        } else
                *nht_exists = true;
 }
@@ -371,7 +359,7 @@ void zebra_deregister_rnh_pseudowire(vrf_id_t vrf_id, struct zebra_pw *pw)
        listnode_delete(rnh->zebra_pseudowire_list, pw);
        pw->rnh = NULL;
 
-       zebra_delete_rnh(rnh, RNH_NEXTHOP_TYPE);
+       zebra_delete_rnh(rnh);
 }
 
 /* Clear the NEXTHOP_FLAG_RNH_FILTERED flags on all nexthops
@@ -472,8 +460,7 @@ static void zebra_rnh_notify_protocol_clients(struct zebra_vrf *zvrf, afi_t afi,
                                        zebra_route_string(client->proto));
                }
 
-               zebra_send_rnh_update(rnh, client, RNH_NEXTHOP_TYPE,
-                                     zvrf->vrf->vrf_id, 0);
+               zebra_send_rnh_update(rnh, client, zvrf->vrf->vrf_id, 0);
        }
 
        if (re)
@@ -719,17 +706,16 @@ static void zebra_rnh_eval_nexthop_entry(struct zebra_vrf *zvrf, afi_t afi,
 
 /* Evaluate one tracked entry */
 static void zebra_rnh_evaluate_entry(struct zebra_vrf *zvrf, afi_t afi,
-                                    int force, enum rnh_type type,
-                                    struct route_node *nrn)
+                                    int force, struct route_node *nrn)
 {
        struct rnh *rnh;
        struct route_entry *re;
        struct route_node *prn;
 
        if (IS_ZEBRA_DEBUG_NHT) {
-               zlog_debug("%s(%u):%pRN: Evaluate RNH, type %s %s",
+               zlog_debug("%s(%u):%pRN: Evaluate RNH, %s",
                           VRF_LOGNAME(zvrf->vrf), zvrf->vrf->vrf_id, nrn,
-                          rnh_type2str(type), force ? "(force)" : "");
+                          force ? "(force)" : "");
        }
 
        rnh = nrn->info;
@@ -757,7 +743,7 @@ static void zebra_rnh_evaluate_entry(struct zebra_vrf *zvrf, afi_t afi,
  * covers multiple nexthops we are interested in.
  */
 static void zebra_rnh_clear_nhc_flag(struct zebra_vrf *zvrf, afi_t afi,
-                                    enum rnh_type type, struct route_node *nrn)
+                                    struct route_node *nrn)
 {
        struct rnh *rnh;
        struct route_entry *re;
@@ -776,12 +762,12 @@ static void zebra_rnh_clear_nhc_flag(struct zebra_vrf *zvrf, afi_t afi,
  * of a particular VRF and address-family or a specific prefix.
  */
 void zebra_evaluate_rnh(struct zebra_vrf *zvrf, afi_t afi, int force,
-                       enum rnh_type type, struct prefix *p)
+                       struct prefix *p)
 {
        struct route_table *rnh_table;
        struct route_node *nrn;
 
-       rnh_table = get_rnh_table(zvrf->vrf->vrf_id, afi, type);
+       rnh_table = get_rnh_table(zvrf->vrf->vrf_id, afi);
        if (!rnh_table) // unexpected
                return;
 
@@ -789,7 +775,7 @@ void zebra_evaluate_rnh(struct zebra_vrf *zvrf, afi_t afi, int force,
                /* Evaluating a specific entry, make sure it exists. */
                nrn = route_node_lookup(rnh_table, p);
                if (nrn && nrn->info)
-                       zebra_rnh_evaluate_entry(zvrf, afi, force, type, nrn);
+                       zebra_rnh_evaluate_entry(zvrf, afi, force, nrn);
 
                if (nrn)
                        route_unlock_node(nrn);
@@ -798,26 +784,25 @@ void zebra_evaluate_rnh(struct zebra_vrf *zvrf, afi_t afi, int force,
                nrn = route_top(rnh_table);
                while (nrn) {
                        if (nrn->info)
-                               zebra_rnh_evaluate_entry(zvrf, afi, force, type,
-                                                        nrn);
+                               zebra_rnh_evaluate_entry(zvrf, afi, force, nrn);
                        nrn = route_next(nrn); /* this will also unlock nrn */
                }
                nrn = route_top(rnh_table);
                while (nrn) {
                        if (nrn->info)
-                               zebra_rnh_clear_nhc_flag(zvrf, afi, type, nrn);
+                               zebra_rnh_clear_nhc_flag(zvrf, afi, nrn);
                        nrn = route_next(nrn); /* this will also unlock nrn */
                }
        }
 }
 
 void zebra_print_rnh_table(vrf_id_t vrfid, afi_t afi, struct vty *vty,
-                          enum rnh_type type, struct prefix *p)
+                          struct prefix *p)
 {
        struct route_table *table;
        struct route_node *rn;
 
-       table = get_rnh_table(vrfid, afi, type);
+       table = get_rnh_table(vrfid, afi);
        if (!table) {
                if (IS_ZEBRA_DEBUG_NHT)
                        zlog_debug("print_rnhs: rnh table not found");
@@ -1154,8 +1139,7 @@ static bool compare_state(struct route_entry *r1,
 }
 
 int zebra_send_rnh_update(struct rnh *rnh, struct zserv *client,
-                         enum rnh_type type, vrf_id_t vrf_id,
-                         uint32_t srte_color)
+                         vrf_id_t vrf_id, uint32_t srte_color)
 {
        struct stream *s = NULL;
        struct route_entry *re;
@@ -1325,7 +1309,7 @@ static void print_rnh(struct route_node *rn, struct vty *vty)
 }
 
 static int zebra_cleanup_rnh_client(vrf_id_t vrf_id, afi_t afi,
-                                   struct zserv *client, enum rnh_type type)
+                                   struct zserv *client)
 {
        struct route_table *ntable;
        struct route_node *nrn;
@@ -1334,14 +1318,12 @@ static int zebra_cleanup_rnh_client(vrf_id_t vrf_id, afi_t afi,
        if (IS_ZEBRA_DEBUG_NHT) {
                struct vrf *vrf = vrf_lookup_by_id(vrf_id);
 
-               zlog_debug(
-                       "%s(%u): Client %s RNH cleanup for family %s type %s",
-                       VRF_LOGNAME(vrf), vrf_id,
-                       zebra_route_string(client->proto), afi2str(afi),
-                       rnh_type2str(type));
+               zlog_debug("%s(%u): Client %s RNH cleanup for family %s",
+                          VRF_LOGNAME(vrf), vrf_id,
+                          zebra_route_string(client->proto), afi2str(afi));
        }
 
-       ntable = get_rnh_table(vrf_id, afi, type);
+       ntable = get_rnh_table(vrf_id, afi);
        if (!ntable) {
                zlog_debug("cleanup_rnh_client: rnh table not found");
                return -1;
@@ -1352,7 +1334,7 @@ static int zebra_cleanup_rnh_client(vrf_id_t vrf_id, afi_t afi,
                        continue;
 
                rnh = nrn->info;
-               zebra_remove_rnh_client(rnh, client, type);
+               zebra_remove_rnh_client(rnh, client);
        }
        return 1;
 }
@@ -1366,10 +1348,9 @@ static int zebra_client_cleanup_rnh(struct zserv *client)
        RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) {
                zvrf = vrf->info;
                if (zvrf) {
-                       zebra_cleanup_rnh_client(zvrf_id(zvrf), AFI_IP, client,
-                                                RNH_NEXTHOP_TYPE);
-                       zebra_cleanup_rnh_client(zvrf_id(zvrf), AFI_IP6, client,
-                                                RNH_NEXTHOP_TYPE);
+                       zebra_cleanup_rnh_client(zvrf_id(zvrf), AFI_IP, client);
+                       zebra_cleanup_rnh_client(zvrf_id(zvrf), AFI_IP6,
+                                                client);
                }
        }
 
index 6a225d43a9d18ec7fd3f039ee3eb3af351aa15c6..01ad7215b80261a3195443913010cda2fb7ff338 100644 (file)
@@ -31,34 +31,21 @@ extern "C" {
 
 extern void zebra_rnh_init(void);
 
-static inline const char *rnh_type2str(enum rnh_type type)
-{
-       switch (type) {
-       case RNH_NEXTHOP_TYPE:
-               return "Nexthop";
-       }
-
-       return "ERROR";
-}
-
 extern struct rnh *zebra_add_rnh(struct prefix *p, vrf_id_t vrfid,
-                                enum rnh_type type, bool *exists);
-extern struct rnh *zebra_lookup_rnh(struct prefix *p, vrf_id_t vrfid,
-                                   enum rnh_type type);
+                                bool *exists);
+extern struct rnh *zebra_lookup_rnh(struct prefix *p, vrf_id_t vrfid);
 extern void zebra_free_rnh(struct rnh *rnh);
 extern void zebra_add_rnh_client(struct rnh *rnh, struct zserv *client,
-                                enum rnh_type type, vrf_id_t vrfid);
+                                vrf_id_t vrfid);
 extern int zebra_send_rnh_update(struct rnh *rnh, struct zserv *client,
-                                enum rnh_type type, vrf_id_t vrf_id,
-                                uint32_t srte_color);
+                                vrf_id_t vrf_id, uint32_t srte_color);
 extern void zebra_register_rnh_pseudowire(vrf_id_t, struct zebra_pw *, bool *);
 extern void zebra_deregister_rnh_pseudowire(vrf_id_t, struct zebra_pw *);
-extern void zebra_remove_rnh_client(struct rnh *rnh, struct zserv *client,
-                                   enum rnh_type type);
+extern void zebra_remove_rnh_client(struct rnh *rnh, struct zserv *client);
 extern void zebra_evaluate_rnh(struct zebra_vrf *zvrf, afi_t afi, int force,
-                              enum rnh_type type, struct prefix *p);
+                              struct prefix *p);
 extern void zebra_print_rnh_table(vrf_id_t vrfid, afi_t afi, struct vty *vty,
-                                 enum rnh_type type, struct prefix *p);
+                                 struct prefix *p);
 
 extern int rnh_resolve_via_default(struct zebra_vrf *zvrf, int family);
 
index d07a49fb6e3726a81dd3b1aaf78f10076cb4de73..0887ce1f0a72de6ffce4be823f6059ea679c266c 100644 (file)
@@ -319,7 +319,7 @@ static int ip_nht_rm_add(struct zebra_vrf *zvrf, const char *rmap, int rtype,
        route_map_counter_increment(NHT_RM_MAP(zvrf, afi, rtype));
 
        if (NHT_RM_MAP(zvrf, afi, rtype))
-               zebra_evaluate_rnh(zvrf, AFI_IP, 1, RNH_NEXTHOP_TYPE, NULL);
+               zebra_evaluate_rnh(zvrf, AFI_IP, 1, NULL);
 
        return CMD_SUCCESS;
 }
@@ -340,8 +340,7 @@ static int ip_nht_rm_del(struct zebra_vrf *zvrf, const char *rmap, int rtype,
                                        zvrf->vrf->vrf_id, rtype);
                        NHT_RM_MAP(zvrf, afi, rtype) = NULL;
 
-                       zebra_evaluate_rnh(zvrf, AFI_IP, 1, RNH_NEXTHOP_TYPE,
-                                          NULL);
+                       zebra_evaluate_rnh(zvrf, AFI_IP, 1, NULL);
                }
                XFREE(MTYPE_ROUTE_MAP_NAME, NHT_RM_NAME(zvrf, afi, rtype));
        }
@@ -1588,9 +1587,8 @@ static void zebra_nht_rm_update(const char *rmap)
 
                                                afi_ip = 1;
 
-                                               zebra_evaluate_rnh(
-                                                       zvrf, AFI_IP, 1,
-                                                       RNH_NEXTHOP_TYPE, NULL);
+                                               zebra_evaluate_rnh(zvrf, AFI_IP,
+                                                                  1, NULL);
                                        }
                                }
                        }
@@ -1619,9 +1617,8 @@ static void zebra_nht_rm_update(const char *rmap)
 
                                                afi_ipv6 = 1;
 
-                                               zebra_evaluate_rnh(
-                                                       zvrf, AFI_IP, 1,
-                                                       RNH_NEXTHOP_TYPE, NULL);
+                                               zebra_evaluate_rnh(zvrf, AFI_IP,
+                                                                  1, NULL);
                                        }
                                }
                        }
index ba3727371cb6a6e3420669c50ae242a2f93d21a1..0fa054105e02ee6d3d6c7b67e9d5ac3259136546 100644 (file)
@@ -196,7 +196,7 @@ static void zebra_sr_policy_notify_update(struct zebra_sr_policy *policy)
                exit(1);
        }
 
-       rnh = zebra_lookup_rnh(&p, zvrf_id(zvrf), RNH_NEXTHOP_TYPE);
+       rnh = zebra_lookup_rnh(&p, zvrf_id(zvrf));
        if (!rnh)
                return;
 
@@ -205,8 +205,8 @@ static void zebra_sr_policy_notify_update(struct zebra_sr_policy *policy)
                        zebra_sr_policy_notify_update_client(policy, client);
                else
                        /* Fallback to the IGP shortest path. */
-                       zebra_send_rnh_update(rnh, client, RNH_NEXTHOP_TYPE,
-                                             zvrf_id(zvrf), policy->color);
+                       zebra_send_rnh_update(rnh, client, zvrf_id(zvrf),
+                                             policy->color);
        }
 }
 
index 848926400e5534d19700bb2bcc4842b3c24a420b..779996a80661ceb3825bf4022391c047b8d0ab0b 100644 (file)
@@ -1330,10 +1330,6 @@ DEFPY (show_ip_nht,
        afi_t afi = ipv4 ? AFI_IP : AFI_IP6;
        vrf_id_t vrf_id = VRF_DEFAULT;
        struct prefix prefix, *p = NULL;
-       enum rnh_type rtype;
-
-       if (strcmp(type, "nht") == 0)
-               rtype = RNH_NEXTHOP_TYPE;
 
        if (vrf_all) {
                struct vrf *vrf;
@@ -1343,7 +1339,7 @@ DEFPY (show_ip_nht,
                        if ((zvrf = vrf->info) != NULL) {
                                vty_out(vty, "\nVRF %s:\n", zvrf_name(zvrf));
                                zebra_print_rnh_table(zvrf_id(zvrf), afi, vty,
-                                                     rtype, NULL);
+                                                     NULL);
                        }
                return CMD_SUCCESS;
        }
@@ -1357,7 +1353,7 @@ DEFPY (show_ip_nht,
                        return CMD_WARNING;
        }
 
-       zebra_print_rnh_table(vrf_id, afi, vty, rtype, p);
+       zebra_print_rnh_table(vrf_id, afi, vty, p);
        return CMD_SUCCESS;
 }
 
@@ -1378,7 +1374,7 @@ DEFUN (ip_nht_default_route,
 
        zvrf->zebra_rnh_ip_default_route = true;
 
-       zebra_evaluate_rnh(zvrf, AFI_IP, 0, RNH_NEXTHOP_TYPE, NULL);
+       zebra_evaluate_rnh(zvrf, AFI_IP, 0, NULL);
        return CMD_SUCCESS;
 }
 
@@ -1716,7 +1712,7 @@ DEFUN (no_ip_nht_default_route,
                return CMD_SUCCESS;
 
        zvrf->zebra_rnh_ip_default_route = false;
-       zebra_evaluate_rnh(zvrf, AFI_IP, 0, RNH_NEXTHOP_TYPE, NULL);
+       zebra_evaluate_rnh(zvrf, AFI_IP, 0, NULL);
        return CMD_SUCCESS;
 }
 
@@ -1736,7 +1732,7 @@ DEFUN (ipv6_nht_default_route,
                return CMD_SUCCESS;
 
        zvrf->zebra_rnh_ipv6_default_route = true;
-       zebra_evaluate_rnh(zvrf, AFI_IP6, 0, RNH_NEXTHOP_TYPE, NULL);
+       zebra_evaluate_rnh(zvrf, AFI_IP6, 0, NULL);
        return CMD_SUCCESS;
 }
 
@@ -1757,7 +1753,7 @@ DEFUN (no_ipv6_nht_default_route,
                return CMD_SUCCESS;
 
        zvrf->zebra_rnh_ipv6_default_route = false;
-       zebra_evaluate_rnh(zvrf, AFI_IP6, 0, RNH_NEXTHOP_TYPE, NULL);
+       zebra_evaluate_rnh(zvrf, AFI_IP6, 0, NULL);
        return CMD_SUCCESS;
 }