summaryrefslogtreecommitdiff
path: root/zebra/zebra_evpn_mh.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zebra_evpn_mh.c')
-rw-r--r--zebra/zebra_evpn_mh.c65
1 files changed, 34 insertions, 31 deletions
diff --git a/zebra/zebra_evpn_mh.c b/zebra/zebra_evpn_mh.c
index c0cc57fc69..e03cf9db06 100644
--- a/zebra/zebra_evpn_mh.c
+++ b/zebra/zebra_evpn_mh.c
@@ -60,7 +60,7 @@ DEFINE_MTYPE_STATIC(ZEBRA, L2_NH, "L2 nexthop");
static void zebra_evpn_es_get_one_base_evpn(void);
static int zebra_evpn_es_evi_send_to_client(struct zebra_evpn_es *es,
- zebra_evpn_t *zevpn, bool add);
+ struct zebra_evpn *zevpn, bool add);
static void zebra_evpn_local_es_del(struct zebra_evpn_es **esp);
static int zebra_evpn_local_es_update(struct zebra_if *zif, esi_t *esi);
static bool zebra_evpn_es_br_port_dplane_update(struct zebra_evpn_es *es,
@@ -76,7 +76,7 @@ esi_t zero_esi_buf, *zero_esi = &zero_esi_buf;
/*****************************************************************************/
/* Ethernet Segment to EVI association -
* 1. The ES-EVI entry is maintained as a RB tree per L2-VNI
- * (zebra_evpn_t.es_evi_rb_tree).
+ * (struct zebra_evpn.es_evi_rb_tree).
* 2. Each local ES-EVI entry is sent to BGP which advertises it as an
* EAD-EVI (Type-1 EVPN) route
* 3. Local ES-EVI setup is re-evaluated on the following triggers -
@@ -103,7 +103,7 @@ RB_GENERATE(zebra_es_evi_rb_head, zebra_evpn_es_evi,
* tables.
*/
static struct zebra_evpn_es_evi *zebra_evpn_es_evi_new(struct zebra_evpn_es *es,
- zebra_evpn_t *zevpn)
+ struct zebra_evpn *zevpn)
{
struct zebra_evpn_es_evi *es_evi;
@@ -169,7 +169,7 @@ static void zebra_evpn_es_evi_re_eval_send_to_client(
static void zebra_evpn_es_evi_free(struct zebra_evpn_es_evi *es_evi)
{
struct zebra_evpn_es *es = es_evi->es;
- zebra_evpn_t *zevpn = es_evi->zevpn;
+ struct zebra_evpn *zevpn = es_evi->zevpn;
if (IS_ZEBRA_DEBUG_EVPN_MH_ES)
zlog_debug("es %s evi %d free",
@@ -186,8 +186,8 @@ static void zebra_evpn_es_evi_free(struct zebra_evpn_es_evi *es_evi)
}
/* find the ES-EVI in the per-L2-VNI RB tree */
-static struct zebra_evpn_es_evi *zebra_evpn_es_evi_find(
- struct zebra_evpn_es *es, zebra_evpn_t *zevpn)
+static struct zebra_evpn_es_evi *
+zebra_evpn_es_evi_find(struct zebra_evpn_es *es, struct zebra_evpn *zevpn)
{
struct zebra_evpn_es_evi es_evi;
@@ -220,7 +220,7 @@ static void zebra_evpn_local_es_evi_do_del(struct zebra_evpn_es_evi *es_evi)
zebra_evpn_es_evi_free(es_evi);
}
static void zebra_evpn_local_es_evi_del(struct zebra_evpn_es *es,
- zebra_evpn_t *zevpn)
+ struct zebra_evpn *zevpn)
{
struct zebra_evpn_es_evi *es_evi;
@@ -231,7 +231,7 @@ static void zebra_evpn_local_es_evi_del(struct zebra_evpn_es *es,
/* Create an ES-EVI if it doesn't already exist and tell BGP */
static void zebra_evpn_local_es_evi_add(struct zebra_evpn_es *es,
- zebra_evpn_t *zevpn)
+ struct zebra_evpn *zevpn)
{
struct zebra_evpn_es_evi *es_evi;
@@ -334,7 +334,7 @@ zebra_evpn_es_evi_show_entry_detail(struct vty *vty,
}
}
-static void zebra_evpn_es_evi_show_one_evpn(zebra_evpn_t *zevpn,
+static void zebra_evpn_es_evi_show_one_evpn(struct zebra_evpn *zevpn,
struct vty *vty,
json_object *json_array, int detail)
{
@@ -358,7 +358,7 @@ struct evpn_mh_show_ctx {
static void zebra_evpn_es_evi_show_one_evpn_hash_cb(struct hash_bucket *bucket,
void *ctxt)
{
- zebra_evpn_t *zevpn = (zebra_evpn_t *)bucket->data;
+ struct zebra_evpn *zevpn = (struct zebra_evpn *)bucket->data;
struct evpn_mh_show_ctx *wctx = (struct evpn_mh_show_ctx *)ctxt;
zebra_evpn_es_evi_show_one_evpn(zevpn, wctx->vty,
@@ -399,7 +399,7 @@ void zebra_evpn_es_evi_show(struct vty *vty, bool uj, int detail)
void zebra_evpn_es_evi_show_vni(struct vty *vty, bool uj, vni_t vni, int detail)
{
json_object *json_array = NULL;
- zebra_evpn_t *zevpn;
+ struct zebra_evpn *zevpn;
zevpn = zebra_evpn_lookup(vni);
if (uj)
@@ -425,7 +425,7 @@ void zebra_evpn_es_evi_show_vni(struct vty *vty, bool uj, vni_t vni, int detail)
}
/* Initialize the ES tables maintained per-L2_VNI */
-void zebra_evpn_es_evi_init(zebra_evpn_t *zevpn)
+void zebra_evpn_es_evi_init(struct zebra_evpn *zevpn)
{
/* Initialize the ES-EVI RB tree */
RB_INIT(zebra_es_evi_rb_head, &zevpn->es_evi_rb_tree);
@@ -438,7 +438,7 @@ void zebra_evpn_es_evi_init(zebra_evpn_t *zevpn)
}
/* Cleanup the ES info maintained per- EVPN */
-void zebra_evpn_es_evi_cleanup(zebra_evpn_t *zevpn)
+void zebra_evpn_es_evi_cleanup(struct zebra_evpn *zevpn)
{
struct zebra_evpn_es_evi *es_evi;
struct zebra_evpn_es_evi *es_evi_next;
@@ -455,7 +455,7 @@ void zebra_evpn_es_evi_cleanup(zebra_evpn_t *zevpn)
/* called when the oper state or bridge membership changes for the
* vxlan device
*/
-void zebra_evpn_update_all_es(zebra_evpn_t *zevpn)
+void zebra_evpn_update_all_es(struct zebra_evpn *zevpn)
{
struct zebra_evpn_es_evi *es_evi;
struct listnode *node;
@@ -664,7 +664,8 @@ void zebra_evpn_acc_bd_svi_mac_add(struct interface *vlan_if)
/* called when a EVPN-L2VNI is set or cleared against a BD */
static void zebra_evpn_acc_bd_evpn_set(struct zebra_evpn_access_bd *acc_bd,
- zebra_evpn_t *zevpn, zebra_evpn_t *old_zevpn)
+ struct zebra_evpn *zevpn,
+ struct zebra_evpn *old_zevpn)
{
struct zebra_if *zif;
struct listnode *node;
@@ -698,7 +699,7 @@ void zebra_evpn_vl_vxl_ref(uint16_t vid, struct zebra_if *vxlan_zif)
{
struct zebra_evpn_access_bd *acc_bd;
struct zebra_if *old_vxlan_zif;
- zebra_evpn_t *old_zevpn;
+ struct zebra_evpn *old_zevpn;
if (!vid)
return;
@@ -760,8 +761,8 @@ void zebra_evpn_vl_vxl_deref(uint16_t vid, struct zebra_if *vxlan_zif)
}
/* handle EVPN add/del */
-void zebra_evpn_vxl_evpn_set(struct zebra_if *zif, zebra_evpn_t *zevpn,
- bool set)
+void zebra_evpn_vxl_evpn_set(struct zebra_if *zif, struct zebra_evpn *zevpn,
+ bool set)
{
struct zebra_l2info_vxlan *vxl;
struct zebra_evpn_access_bd *acc_bd;
@@ -783,7 +784,7 @@ void zebra_evpn_vxl_evpn_set(struct zebra_if *zif, zebra_evpn_t *zevpn,
}
} else {
if (acc_bd->zevpn) {
- zebra_evpn_t *old_zevpn = acc_bd->zevpn;
+ struct zebra_evpn *old_zevpn = acc_bd->zevpn;
acc_bd->zevpn = NULL;
zebra_evpn_acc_bd_evpn_set(acc_bd, NULL, old_zevpn);
}
@@ -1182,7 +1183,7 @@ bool zebra_evpn_nhg_is_local_es(uint32_t nhg_id,
/* update remote macs associated with the ES */
static void zebra_evpn_nhg_mac_update(struct zebra_evpn_es *es)
{
- zebra_mac_t *mac;
+ struct zebra_mac *mac;
struct listnode *node;
bool local_via_nw;
@@ -1994,7 +1995,8 @@ static void zebra_evpn_es_setup_evis(struct zebra_evpn_es *es)
}
}
-static void zebra_evpn_flush_local_mac(zebra_mac_t *mac, struct interface *ifp)
+static void zebra_evpn_flush_local_mac(struct zebra_mac *mac,
+ struct interface *ifp)
{
struct zebra_if *zif;
struct interface *br_ifp;
@@ -2021,7 +2023,7 @@ static void zebra_evpn_flush_local_mac(zebra_mac_t *mac, struct interface *ifp)
static void zebra_evpn_es_flush_local_macs(struct zebra_evpn_es *es,
struct interface *ifp, bool add)
{
- zebra_mac_t *mac;
+ struct zebra_mac *mac;
struct listnode *node;
struct listnode *nnode;
@@ -2507,7 +2509,7 @@ stream_failure:
return;
}
-void zebra_evpn_es_mac_deref_entry(zebra_mac_t *mac)
+void zebra_evpn_es_mac_deref_entry(struct zebra_mac *mac)
{
struct zebra_evpn_es *es = mac->es;
@@ -2523,7 +2525,8 @@ void zebra_evpn_es_mac_deref_entry(zebra_mac_t *mac)
/* Associate a MAC entry with a local or remote ES. Returns false if there
* was no ES change.
*/
-bool zebra_evpn_es_mac_ref_entry(zebra_mac_t *mac, struct zebra_evpn_es *es)
+bool zebra_evpn_es_mac_ref_entry(struct zebra_mac *mac,
+ struct zebra_evpn_es *es)
{
if (mac->es == es)
return false;
@@ -2541,7 +2544,7 @@ bool zebra_evpn_es_mac_ref_entry(zebra_mac_t *mac, struct zebra_evpn_es *es)
return true;
}
-bool zebra_evpn_es_mac_ref(zebra_mac_t *mac, const esi_t *esi)
+bool zebra_evpn_es_mac_ref(struct zebra_mac *mac, const esi_t *esi)
{
struct zebra_evpn_es *es;
@@ -2561,7 +2564,7 @@ bool zebra_evpn_es_mac_ref(zebra_mac_t *mac, const esi_t *esi)
/* Inform BGP about local ES-EVI add or del */
static int zebra_evpn_es_evi_send_to_client(struct zebra_evpn_es *es,
- zebra_evpn_t *zevpn, bool add)
+ struct zebra_evpn *zevpn, bool add)
{
struct zserv *client;
struct stream *s;
@@ -2680,7 +2683,7 @@ static void zebra_evpn_es_df_pref_update(struct zebra_if *zif, uint16_t df_pref)
static void zebra_evpn_es_bypass_update_macs(struct zebra_evpn_es *es,
struct interface *ifp, bool bypass)
{
- zebra_mac_t *mac;
+ struct zebra_mac *mac;
struct listnode *node;
struct listnode *nnode;
struct zebra_if *zif;
@@ -2855,7 +2858,7 @@ void zebra_evpn_if_es_print(struct vty *vty, json_object *json,
static void zebra_evpn_local_mac_oper_state_change(struct zebra_evpn_es *es)
{
- zebra_mac_t *mac;
+ struct zebra_mac *mac;
struct listnode *node;
/* If fast-failover is supported by the dataplane via the use
@@ -3511,7 +3514,7 @@ void zebra_evpn_mh_print(struct vty *vty)
* necessary
*/
/* called when a new vni is added or becomes oper up or becomes a bridge port */
-void zebra_evpn_es_set_base_evpn(zebra_evpn_t *zevpn)
+void zebra_evpn_es_set_base_evpn(struct zebra_evpn *zevpn)
{
struct listnode *node;
struct zebra_evpn_es *es;
@@ -3560,7 +3563,7 @@ void zebra_evpn_es_set_base_evpn(zebra_evpn_t *zevpn)
/* called when a vni is removed or becomes oper down or is removed from a
* bridge
*/
-void zebra_evpn_es_clear_base_evpn(zebra_evpn_t *zevpn)
+void zebra_evpn_es_clear_base_evpn(struct zebra_evpn *zevpn)
{
struct listnode *node;
struct zebra_evpn_es *es;
@@ -3589,7 +3592,7 @@ void zebra_evpn_es_clear_base_evpn(zebra_evpn_t *zevpn)
/* Locate an "eligible" L2-VNI to follow */
static int zebra_evpn_es_get_one_base_evpn_cb(struct hash_bucket *b, void *data)
{
- zebra_evpn_t *zevpn = b->data;
+ struct zebra_evpn *zevpn = b->data;
zebra_evpn_es_set_base_evpn(zevpn);