]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/zebra_rnh.c
Merge pull request #6048 from sarav511/joinsup
[mirror_frr.git] / zebra / zebra_rnh.c
index 6cfc68eb74721c4d54c69a6d1c197707bb67691f..ad2e00b1ecb5e9e3882df08d2e69adb64b29f6e5 100644 (file)
@@ -57,8 +57,8 @@ static void free_state(vrf_id_t vrf_id, struct route_entry *re,
 static void copy_state(struct rnh *rnh, const struct route_entry *re,
                       struct route_node *rn);
 static int compare_state(struct route_entry *r1, struct route_entry *r2);
-static int send_client(struct rnh *rnh, struct zserv *client, rnh_type_t type,
-                      vrf_id_t vrf_id);
+static int send_client(struct rnh *rnh, struct zserv *client,
+                      enum rnh_type type, vrf_id_t vrf_id);
 static void print_rnh(struct route_node *rn, struct vty *vty);
 static int zebra_client_cleanup_rnh(struct zserv *client);
 
@@ -68,7 +68,7 @@ void zebra_rnh_init(void)
 }
 
 static inline struct route_table *get_rnh_table(vrf_id_t vrfid, afi_t afi,
-                                               rnh_type_t type)
+                                               enum rnh_type type)
 {
        struct zebra_vrf *zvrf;
        struct route_table *t = NULL;
@@ -148,7 +148,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, rnh_type_t type,
+struct rnh *zebra_add_rnh(struct prefix *p, vrf_id_t vrfid, enum rnh_type type,
                          bool *exists)
 {
        struct route_table *table;
@@ -207,7 +207,8 @@ struct rnh *zebra_add_rnh(struct prefix *p, vrf_id_t vrfid, rnh_type_t type,
        return (rn->info);
 }
 
-struct rnh *zebra_lookup_rnh(struct prefix *p, vrf_id_t vrfid, rnh_type_t type)
+struct rnh *zebra_lookup_rnh(struct prefix *p, vrf_id_t vrfid,
+                            enum rnh_type type)
 {
        struct route_table *table;
        struct route_node *rn;
@@ -258,7 +259,7 @@ void zebra_free_rnh(struct rnh *rnh)
        XFREE(MTYPE_RNH, rnh);
 }
 
-static void zebra_delete_rnh(struct rnh *rnh, rnh_type_t type)
+static void zebra_delete_rnh(struct rnh *rnh, enum rnh_type type)
 {
        struct route_node *rn;
 
@@ -289,7 +290,7 @@ static void zebra_delete_rnh(struct rnh *rnh, rnh_type_t type)
  * and as such it will have a resolved rnh.
  */
 void zebra_add_rnh_client(struct rnh *rnh, struct zserv *client,
-                         rnh_type_t type, vrf_id_t vrf_id)
+                         enum rnh_type type, vrf_id_t vrf_id)
 {
        if (IS_ZEBRA_DEBUG_NHT) {
                char buf[PREFIX2STR_BUFFER];
@@ -308,7 +309,7 @@ void zebra_add_rnh_client(struct rnh *rnh, struct zserv *client,
 }
 
 void zebra_remove_rnh_client(struct rnh *rnh, struct zserv *client,
-                            rnh_type_t type)
+                            enum rnh_type type)
 {
        if (IS_ZEBRA_DEBUG_NHT) {
                char buf[PREFIX2STR_BUFFER];
@@ -471,7 +472,7 @@ zebra_rnh_resolve_import_entry(struct zebra_vrf *zvrf, afi_t afi,
                *prn = rn;
 
        if (!re && IS_ZEBRA_DEBUG_NHT_DETAILED)
-               zlog_debug("\tRejected due to removed or is a bgp route");
+               zlog_debug("        Rejected due to removed or is a bgp route");
 
        return re;
 }
@@ -656,7 +657,7 @@ zebra_rnh_resolve_nexthop_entry(struct zebra_vrf *zvrf, afi_t afi,
                    && !rnh_resolve_via_default(zvrf, rn->p.family)) {
                        if (IS_ZEBRA_DEBUG_NHT_DETAILED)
                                zlog_debug(
-                                       "\tNot allowed to resolve through default prefix");
+                                       "        Not allowed to resolve through default prefix");
                        return NULL;
                }
 
@@ -665,7 +666,7 @@ zebra_rnh_resolve_nexthop_entry(struct zebra_vrf *zvrf, afi_t afi,
                        if (CHECK_FLAG(re->status, ROUTE_ENTRY_REMOVED)) {
                                if (IS_ZEBRA_DEBUG_NHT_DETAILED)
                                        zlog_debug(
-                                               "\tRoute Entry %s removed",
+                                               "        Route Entry %s removed",
                                                zebra_route_string(re->type));
                                continue;
                        }
@@ -673,7 +674,7 @@ zebra_rnh_resolve_nexthop_entry(struct zebra_vrf *zvrf, afi_t afi,
                            !CHECK_FLAG(re->flags, ZEBRA_FLAG_FIB_OVERRIDE)) {
                                if (IS_ZEBRA_DEBUG_NHT_DETAILED)
                                        zlog_debug(
-                                               "\tRoute Entry %s !selected",
+                                               "        Route Entry %s !selected",
                                                zebra_route_string(re->type));
                                continue;
                        }
@@ -681,7 +682,7 @@ zebra_rnh_resolve_nexthop_entry(struct zebra_vrf *zvrf, afi_t afi,
                        if (CHECK_FLAG(re->status, ROUTE_ENTRY_QUEUED)) {
                                if (IS_ZEBRA_DEBUG_NHT_DETAILED)
                                        zlog_debug(
-                                               "\tRoute Entry %s queued",
+                                               "        Route Entry %s queued",
                                                zebra_route_string(re->type));
                                continue;
                        }
@@ -697,7 +698,7 @@ zebra_rnh_resolve_nexthop_entry(struct zebra_vrf *zvrf, afi_t afi,
                        if (nexthop == NULL) {
                                if (IS_ZEBRA_DEBUG_NHT_DETAILED)
                                        zlog_debug(
-                                               "\tRoute Entry %s no nexthops",
+                                               "        Route Entry %s no nexthops",
                                                zebra_route_string(re->type));
                                continue;
                        }
@@ -732,7 +733,7 @@ zebra_rnh_resolve_nexthop_entry(struct zebra_vrf *zvrf, afi_t afi,
                else {
                        if (IS_ZEBRA_DEBUG_NHT_DETAILED)
                                zlog_debug(
-                                       "\tNexthop must be connected, cannot recurse up");
+                                       "        Nexthop must be connected, cannot recurse up");
                        return NULL;
                }
        }
@@ -804,7 +805,7 @@ 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, rnh_type_t type,
+                                    int force, enum rnh_type type,
                                     struct route_node *nrn)
 {
        struct rnh *rnh;
@@ -851,7 +852,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,
-                                    rnh_type_t type, struct route_node *nrn)
+                                    enum rnh_type type, struct route_node *nrn)
 {
        struct rnh *rnh;
        struct route_entry *re;
@@ -875,7 +876,7 @@ 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,
-                       rnh_type_t type, struct prefix *p)
+                       enum rnh_type type, struct prefix *p)
 {
        struct route_table *rnh_table;
        struct route_node *nrn;
@@ -911,7 +912,7 @@ void zebra_evaluate_rnh(struct zebra_vrf *zvrf, afi_t afi, int force,
 }
 
 void zebra_print_rnh_table(vrf_id_t vrfid, afi_t afi, struct vty *vty,
-                          rnh_type_t type, struct prefix *p)
+                          enum rnh_type type, struct prefix *p)
 {
        struct route_table *table;
        struct route_node *rn;
@@ -997,8 +998,8 @@ static int compare_state(struct route_entry *r1, struct route_entry *r2)
        return 0;
 }
 
-static int send_client(struct rnh *rnh, struct zserv *client, rnh_type_t type,
-                      vrf_id_t vrf_id)
+static int send_client(struct rnh *rnh, struct zserv *client,
+                      enum rnh_type type, vrf_id_t vrf_id)
 {
        struct stream *s;
        struct route_entry *re;
@@ -1030,7 +1031,7 @@ static int send_client(struct rnh *rnh, struct zserv *client, rnh_type_t type,
        default:
                flog_err(EC_ZEBRA_RNH_UNKNOWN_FAMILY,
                         "%s: Unknown family (%d) notification attempted\n",
-                        __FUNCTION__, rn->p.family);
+                        __func__, rn->p.family);
                break;
        }
        if (re) {
@@ -1134,7 +1135,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, rnh_type_t type)
+                                   struct zserv *client, enum rnh_type type)
 {
        struct route_table *ntable;
        struct route_node *nrn;