From 8f74a383b36052c2f595692d4d201352540d47c0 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 20 Aug 2021 09:14:03 -0400 Subject: [PATCH] zebra: Convert to `struct zebra_lsp` as per our internal standard We do not use typedef's to talk about structures as per our standard. Fixing. Signed-off-by: Donald Sharp --- zebra/dplane_fpm_nl.c | 4 +- zebra/zebra_dplane.c | 17 +++--- zebra/zebra_dplane.h | 10 ++-- zebra/zebra_mpls.c | 125 +++++++++++++++++++++--------------------- zebra/zebra_mpls.h | 19 +++---- zebra/zebra_srte.c | 6 +- zebra/zebra_srte.h | 2 +- 7 files changed, 91 insertions(+), 92 deletions(-) diff --git a/zebra/dplane_fpm_nl.c b/zebra/dplane_fpm_nl.c index d34abbc302..2f39284fb0 100644 --- a/zebra/dplane_fpm_nl.c +++ b/zebra/dplane_fpm_nl.c @@ -874,7 +874,7 @@ struct fpm_lsp_arg { static int fpm_lsp_send_cb(struct hash_bucket *bucket, void *arg) { - zebra_lsp_t *lsp = bucket->data; + struct zebra_lsp *lsp = bucket->data; struct fpm_lsp_arg *fla = arg; /* Skip entries which have already been sent */ @@ -1138,7 +1138,7 @@ static int fpm_nhg_reset(struct thread *t) */ static void fpm_lsp_reset_cb(struct hash_bucket *bucket, void *arg) { - zebra_lsp_t *lsp = bucket->data; + struct zebra_lsp *lsp = bucket->data; UNSET_FLAG(lsp->flags, LSP_FLAG_FPM); } diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index 7f3a64c681..39f865fbfc 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -324,7 +324,7 @@ struct zebra_dplane_ctx { /* Support info for different kinds of updates */ union { struct dplane_route_info rinfo; - zebra_lsp_t lsp; + struct zebra_lsp lsp; struct dplane_pw_info pw; struct dplane_br_port_info br_port; struct dplane_intf_info intf; @@ -515,7 +515,7 @@ static struct zebra_dplane_globals { static int dplane_thread_loop(struct thread *event); static void dplane_info_from_zns(struct zebra_dplane_info *ns_info, struct zebra_ns *zns); -static enum zebra_dplane_result lsp_update_internal(zebra_lsp_t *lsp, +static enum zebra_dplane_result lsp_update_internal(struct zebra_lsp *lsp, enum dplane_op_e op); static enum zebra_dplane_result pw_update_internal(struct zebra_pw *pw, enum dplane_op_e op); @@ -2400,7 +2400,7 @@ done: * Capture information for an LSP update in a dplane context. */ int dplane_ctx_lsp_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op, - zebra_lsp_t *lsp) + struct zebra_lsp *lsp) { int ret = AOK; struct zebra_nhlfe *nhlfe, *new_nhlfe; @@ -3223,7 +3223,7 @@ enum zebra_dplane_result dplane_nexthop_delete(struct nhg_hash_entry *nhe) /* * Enqueue LSP add for the dataplane. */ -enum zebra_dplane_result dplane_lsp_add(zebra_lsp_t *lsp) +enum zebra_dplane_result dplane_lsp_add(struct zebra_lsp *lsp) { enum zebra_dplane_result ret = lsp_update_internal(lsp, DPLANE_OP_LSP_INSTALL); @@ -3234,7 +3234,7 @@ enum zebra_dplane_result dplane_lsp_add(zebra_lsp_t *lsp) /* * Enqueue LSP update for the dataplane. */ -enum zebra_dplane_result dplane_lsp_update(zebra_lsp_t *lsp) +enum zebra_dplane_result dplane_lsp_update(struct zebra_lsp *lsp) { enum zebra_dplane_result ret = lsp_update_internal(lsp, DPLANE_OP_LSP_UPDATE); @@ -3245,7 +3245,7 @@ enum zebra_dplane_result dplane_lsp_update(zebra_lsp_t *lsp) /* * Enqueue LSP delete for the dataplane. */ -enum zebra_dplane_result dplane_lsp_delete(zebra_lsp_t *lsp) +enum zebra_dplane_result dplane_lsp_delete(struct zebra_lsp *lsp) { enum zebra_dplane_result ret = lsp_update_internal(lsp, DPLANE_OP_LSP_DELETE); @@ -3255,8 +3255,7 @@ enum zebra_dplane_result dplane_lsp_delete(zebra_lsp_t *lsp) /* Update or un-install resulting from an async notification */ enum zebra_dplane_result -dplane_lsp_notif_update(zebra_lsp_t *lsp, - enum dplane_op_e op, +dplane_lsp_notif_update(struct zebra_lsp *lsp, enum dplane_op_e op, struct zebra_dplane_ctx *notif_ctx) { enum zebra_dplane_result result = ZEBRA_DPLANE_REQUEST_FAILURE; @@ -3335,7 +3334,7 @@ enum zebra_dplane_result dplane_pw_uninstall(struct zebra_pw *pw) /* * Common internal LSP update utility */ -static enum zebra_dplane_result lsp_update_internal(zebra_lsp_t *lsp, +static enum zebra_dplane_result lsp_update_internal(struct zebra_lsp *lsp, enum dplane_op_e op) { enum zebra_dplane_result result = ZEBRA_DPLANE_REQUEST_FAILURE; diff --git a/zebra/zebra_dplane.h b/zebra/zebra_dplane.h index 06a615e809..3f3ff4de0f 100644 --- a/zebra/zebra_dplane.h +++ b/zebra/zebra_dplane.h @@ -385,7 +385,7 @@ uint8_t dplane_ctx_get_nhe_nh_grp_count(const struct zebra_dplane_ctx *ctx); * context data area. */ int dplane_ctx_lsp_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op, - zebra_lsp_t *lsp); + struct zebra_lsp *lsp); mpls_label_t dplane_ctx_get_in_label(const struct zebra_dplane_ctx *ctx); void dplane_ctx_set_in_label(struct zebra_dplane_ctx *ctx, @@ -593,12 +593,12 @@ enum zebra_dplane_result dplane_nexthop_delete(struct nhg_hash_entry *nhe); /* * Enqueue LSP change operations for the dataplane. */ -enum zebra_dplane_result dplane_lsp_add(zebra_lsp_t *lsp); -enum zebra_dplane_result dplane_lsp_update(zebra_lsp_t *lsp); -enum zebra_dplane_result dplane_lsp_delete(zebra_lsp_t *lsp); +enum zebra_dplane_result dplane_lsp_add(struct zebra_lsp *lsp); +enum zebra_dplane_result dplane_lsp_update(struct zebra_lsp *lsp); +enum zebra_dplane_result dplane_lsp_delete(struct zebra_lsp *lsp); /* Update or un-install resulting from an async notification */ -enum zebra_dplane_result dplane_lsp_notif_update(zebra_lsp_t *lsp, +enum zebra_dplane_result dplane_lsp_notif_update(struct zebra_lsp *lsp, enum dplane_op_e op, struct zebra_dplane_ctx *ctx); diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c index 4823807eb2..e70917c656 100644 --- a/zebra/zebra_mpls.c +++ b/zebra/zebra_mpls.c @@ -83,20 +83,20 @@ static int nhlfe_nexthop_active_ipv6(struct zebra_nhlfe *nhlfe, struct nexthop *nexthop); static int nhlfe_nexthop_active(struct zebra_nhlfe *nhlfe); -static void lsp_select_best_nhlfe(zebra_lsp_t *lsp); +static void lsp_select_best_nhlfe(struct zebra_lsp *lsp); static void lsp_uninstall_from_kernel(struct hash_bucket *bucket, void *ctxt); static void lsp_schedule(struct hash_bucket *bucket, void *ctxt); static wq_item_status lsp_process(struct work_queue *wq, void *data); static void lsp_processq_del(struct work_queue *wq, void *data); static void lsp_processq_complete(struct work_queue *wq); -static int lsp_processq_add(zebra_lsp_t *lsp); +static int lsp_processq_add(struct zebra_lsp *lsp); static void *lsp_alloc(void *p); /* Check whether lsp can be freed - no nhlfes, e.g., and call free api */ -static void lsp_check_free(struct hash *lsp_table, zebra_lsp_t **plsp); +static void lsp_check_free(struct hash *lsp_table, struct zebra_lsp **plsp); /* Free lsp; sets caller's pointer to NULL */ -static void lsp_free(struct hash *lsp_table, zebra_lsp_t **plsp); +static void lsp_free(struct hash *lsp_table, struct zebra_lsp **plsp); static char *nhlfe2str(const struct zebra_nhlfe *nhlfe, char *buf, int size); static char *nhlfe_config_str(const struct zebra_nhlfe *nhlfe, char *buf, @@ -110,7 +110,7 @@ static struct zebra_nhlfe *nhlfe_find(struct nhlfe_list_head *list, const union g_addr *gate, ifindex_t ifindex); static struct zebra_nhlfe * -nhlfe_add(zebra_lsp_t *lsp, enum lsp_types_t lsp_type, +nhlfe_add(struct zebra_lsp *lsp, enum lsp_types_t lsp_type, enum nexthop_types_t gtype, const union g_addr *gate, ifindex_t ifindex, uint8_t num_labels, const mpls_label_t *labels, bool is_backup); @@ -118,19 +118,19 @@ static int nhlfe_del(struct zebra_nhlfe *nhlfe); static void nhlfe_free(struct zebra_nhlfe *nhlfe); static void nhlfe_out_label_update(struct zebra_nhlfe *nhlfe, struct mpls_label_stack *nh_label); -static int mpls_lsp_uninstall_all(struct hash *lsp_table, zebra_lsp_t *lsp, +static int mpls_lsp_uninstall_all(struct hash *lsp_table, struct zebra_lsp *lsp, enum lsp_types_t type); static int mpls_static_lsp_uninstall_all(struct zebra_vrf *zvrf, mpls_label_t in_label); static void nhlfe_print(struct zebra_nhlfe *nhlfe, struct vty *vty, const char *indent); -static void lsp_print(struct vty *vty, zebra_lsp_t *lsp); +static void lsp_print(struct vty *vty, struct zebra_lsp *lsp); static void mpls_lsp_uninstall_all_type(struct hash_bucket *bucket, void *ctxt); static void mpls_ftn_uninstall_all(struct zebra_vrf *zvrf, int afi, enum lsp_types_t lsp_type); -static int lsp_znh_install(zebra_lsp_t *lsp, enum lsp_types_t type, +static int lsp_znh_install(struct zebra_lsp *lsp, enum lsp_types_t type, const struct zapi_nexthop *znh); -static int lsp_backup_znh_install(zebra_lsp_t *lsp, enum lsp_types_t type, +static int lsp_backup_znh_install(struct zebra_lsp *lsp, enum lsp_types_t type, const struct zapi_nexthop *znh); /* Static functions */ @@ -138,7 +138,7 @@ static int lsp_backup_znh_install(zebra_lsp_t *lsp, enum lsp_types_t type, /* * Handle failure in LSP install, clear flags for NHLFE. */ -static void clear_nhlfe_installed(zebra_lsp_t *lsp) +static void clear_nhlfe_installed(struct zebra_lsp *lsp) { struct zebra_nhlfe *nhlfe; struct nexthop *nexthop; @@ -170,7 +170,7 @@ static int lsp_install(struct zebra_vrf *zvrf, mpls_label_t label, { struct hash *lsp_table; struct zebra_ile tmp_ile; - zebra_lsp_t *lsp; + struct zebra_lsp *lsp; struct zebra_nhlfe *nhlfe; struct nexthop *nexthop; enum lsp_types_t lsp_type; @@ -275,7 +275,7 @@ static int lsp_uninstall(struct zebra_vrf *zvrf, mpls_label_t label) { struct hash *lsp_table; struct zebra_ile tmp_ile; - zebra_lsp_t *lsp; + struct zebra_lsp *lsp; struct zebra_nhlfe *nhlfe; char buf[BUFSIZ]; @@ -768,7 +768,7 @@ static int nhlfe_nexthop_active(struct zebra_nhlfe *nhlfe) * marked. This is invoked when an LSP scheduled for processing (due * to some change) is examined. */ -static void lsp_select_best_nhlfe(zebra_lsp_t *lsp) +static void lsp_select_best_nhlfe(struct zebra_lsp *lsp) { struct zebra_nhlfe *nhlfe; struct zebra_nhlfe *best; @@ -860,9 +860,9 @@ static void lsp_select_best_nhlfe(zebra_lsp_t *lsp) */ static void lsp_uninstall_from_kernel(struct hash_bucket *bucket, void *ctxt) { - zebra_lsp_t *lsp; + struct zebra_lsp *lsp; - lsp = (zebra_lsp_t *)bucket->data; + lsp = (struct zebra_lsp *)bucket->data; if (CHECK_FLAG(lsp->flags, LSP_FLAG_INSTALLED)) (void)dplane_lsp_delete(lsp); } @@ -873,9 +873,9 @@ static void lsp_uninstall_from_kernel(struct hash_bucket *bucket, void *ctxt) */ static void lsp_schedule(struct hash_bucket *bucket, void *ctxt) { - zebra_lsp_t *lsp; + struct zebra_lsp *lsp; - lsp = (zebra_lsp_t *)bucket->data; + lsp = (struct zebra_lsp *)bucket->data; /* In the common flow, this is used when external events occur. For * LSPs with backup nhlfes, we'll assume that the forwarding @@ -901,13 +901,13 @@ static void lsp_schedule(struct hash_bucket *bucket, void *ctxt) */ static wq_item_status lsp_process(struct work_queue *wq, void *data) { - zebra_lsp_t *lsp; + struct zebra_lsp *lsp; struct zebra_nhlfe *oldbest, *newbest; char buf[BUFSIZ], buf2[BUFSIZ]; struct zebra_vrf *zvrf = vrf_info_lookup(VRF_DEFAULT); enum zebra_dplane_result res; - lsp = (zebra_lsp_t *)data; + lsp = (struct zebra_lsp *)data; if (!lsp) // unexpected return WQ_SUCCESS; @@ -1034,7 +1034,7 @@ static wq_item_status lsp_process(struct work_queue *wq, void *data) static void lsp_processq_del(struct work_queue *wq, void *data) { struct zebra_vrf *zvrf; - zebra_lsp_t *lsp; + struct zebra_lsp *lsp; struct hash *lsp_table; struct zebra_nhlfe *nhlfe; @@ -1045,7 +1045,7 @@ static void lsp_processq_del(struct work_queue *wq, void *data) if (!lsp_table) // unexpected return; - lsp = (zebra_lsp_t *)data; + lsp = (struct zebra_lsp *)data; if (!lsp) // unexpected return; @@ -1080,7 +1080,7 @@ static void lsp_processq_complete(struct work_queue *wq) /* * Add LSP forwarding entry to queue for subsequent processing. */ -static int lsp_processq_add(zebra_lsp_t *lsp) +static int lsp_processq_add(struct zebra_lsp *lsp) { /* If already scheduled, exit. */ if (CHECK_FLAG(lsp->flags, LSP_FLAG_SCHEDULED)) @@ -1103,9 +1103,9 @@ static int lsp_processq_add(zebra_lsp_t *lsp) static void *lsp_alloc(void *p) { const struct zebra_ile *ile = p; - zebra_lsp_t *lsp; + struct zebra_lsp *lsp; - lsp = XCALLOC(MTYPE_LSP, sizeof(zebra_lsp_t)); + lsp = XCALLOC(MTYPE_LSP, sizeof(struct zebra_lsp)); lsp->ile = *ile; nhlfe_list_init(&lsp->nhlfe_list); nhlfe_list_init(&lsp->backup_nhlfe_list); @@ -1119,9 +1119,9 @@ static void *lsp_alloc(void *p) /* * Check whether lsp can be freed - no nhlfes, e.g., and call free api */ -static void lsp_check_free(struct hash *lsp_table, zebra_lsp_t **plsp) +static void lsp_check_free(struct hash *lsp_table, struct zebra_lsp **plsp) { - zebra_lsp_t *lsp; + struct zebra_lsp *lsp; if (plsp == NULL || *plsp == NULL) return; @@ -1138,9 +1138,9 @@ static void lsp_check_free(struct hash *lsp_table, zebra_lsp_t **plsp) * Dtor for an LSP: remove from ile hash, release any internal allocations, * free LSP object. */ -static void lsp_free(struct hash *lsp_table, zebra_lsp_t **plsp) +static void lsp_free(struct hash *lsp_table, struct zebra_lsp **plsp) { - zebra_lsp_t *lsp; + struct zebra_lsp *lsp; struct zebra_nhlfe *nhlfe; if (plsp == NULL || *plsp == NULL) @@ -1261,7 +1261,7 @@ static struct zebra_nhlfe *nhlfe_find(struct nhlfe_list_head *list, * Allocate and init new NHLFE. */ static struct zebra_nhlfe * -nhlfe_alloc(zebra_lsp_t *lsp, enum lsp_types_t lsp_type, +nhlfe_alloc(struct zebra_lsp *lsp, enum lsp_types_t lsp_type, enum nexthop_types_t gtype, const union g_addr *gate, ifindex_t ifindex, uint8_t num_labels, const mpls_label_t *labels) { @@ -1315,7 +1315,7 @@ nhlfe_alloc(zebra_lsp_t *lsp, enum lsp_types_t lsp_type, * Add primary or backup NHLFE. Base entry must have been created and * duplicate check done. */ -static struct zebra_nhlfe *nhlfe_add(zebra_lsp_t *lsp, +static struct zebra_nhlfe *nhlfe_add(struct zebra_lsp *lsp, enum lsp_types_t lsp_type, enum nexthop_types_t gtype, const union g_addr *gate, @@ -1375,7 +1375,7 @@ static void nhlfe_free(struct zebra_nhlfe *nhlfe) */ static int nhlfe_del(struct zebra_nhlfe *nhlfe) { - zebra_lsp_t *lsp; + struct zebra_lsp *lsp; if (!nhlfe) return -1; @@ -1409,7 +1409,7 @@ static void nhlfe_out_label_update(struct zebra_nhlfe *nhlfe, nhlfe->nexthop->nh_label->label[0] = nh_label->label[0]; } -static int mpls_lsp_uninstall_all(struct hash *lsp_table, zebra_lsp_t *lsp, +static int mpls_lsp_uninstall_all(struct hash *lsp_table, struct zebra_lsp *lsp, enum lsp_types_t type) { struct zebra_nhlfe *nhlfe; @@ -1486,7 +1486,7 @@ static int mpls_static_lsp_uninstall_all(struct zebra_vrf *zvrf, { struct hash *lsp_table; struct zebra_ile tmp_ile; - zebra_lsp_t *lsp; + struct zebra_lsp *lsp; /* Lookup table. */ lsp_table = zvrf->lsp_table; @@ -1634,7 +1634,7 @@ static void nhlfe_print(struct zebra_nhlfe *nhlfe, struct vty *vty, /* * Print an LSP forwarding entry. */ -static void lsp_print(struct vty *vty, zebra_lsp_t *lsp) +static void lsp_print(struct vty *vty, struct zebra_lsp *lsp) { struct zebra_nhlfe *nhlfe, *backup; int i, j; @@ -1673,7 +1673,7 @@ static void lsp_print(struct vty *vty, zebra_lsp_t *lsp) /* * JSON objects for an LSP forwarding entry. */ -static json_object *lsp_json(zebra_lsp_t *lsp) +static json_object *lsp_json(struct zebra_lsp *lsp) { struct zebra_nhlfe *nhlfe = NULL; json_object *json = json_object_new_object(); @@ -1724,7 +1724,7 @@ static struct list *hash_get_sorted_list(struct hash *hash, void *cmp) /* * Compare two LSPs based on their label values. */ -static int lsp_cmp(const zebra_lsp_t *lsp1, const zebra_lsp_t *lsp2) +static int lsp_cmp(const struct zebra_lsp *lsp1, const struct zebra_lsp *lsp2) { if (lsp1->ile.in_label < lsp2->ile.in_label) return -1; @@ -1767,7 +1767,7 @@ void zebra_mpls_lsp_dplane_result(struct zebra_dplane_ctx *ctx) mpls_label_t label; struct zebra_ile tmp_ile; struct hash *lsp_table; - zebra_lsp_t *lsp; + struct zebra_lsp *lsp; struct zebra_nhlfe *nhlfe; struct nexthop *nexthop; enum dplane_op_e op; @@ -2045,7 +2045,7 @@ void zebra_mpls_process_dplane_notify(struct zebra_dplane_ctx *ctx) struct zebra_vrf *zvrf; struct zebra_ile tmp_ile; struct hash *lsp_table; - zebra_lsp_t *lsp; + struct zebra_lsp *lsp; const struct nhlfe_list_head *ctx_list; int start_count = 0, end_count = 0; /* Installed counts */ bool changed_p = false; @@ -2204,7 +2204,7 @@ int zebra_mpls_lsp_uninstall(struct zebra_vrf *zvrf, struct route_node *rn, * the LSP object - nothing is scheduled for processing, for example. */ struct zebra_nhlfe * -zebra_mpls_lsp_add_nhlfe(zebra_lsp_t *lsp, enum lsp_types_t lsp_type, +zebra_mpls_lsp_add_nhlfe(struct zebra_lsp *lsp, enum lsp_types_t lsp_type, enum nexthop_types_t gtype, const union g_addr *gate, ifindex_t ifindex, uint8_t num_labels, const mpls_label_t *out_labels) @@ -2220,9 +2220,9 @@ zebra_mpls_lsp_add_nhlfe(zebra_lsp_t *lsp, enum lsp_types_t lsp_type, * processing, for example. */ struct zebra_nhlfe *zebra_mpls_lsp_add_backup_nhlfe( - zebra_lsp_t *lsp, enum lsp_types_t lsp_type, enum nexthop_types_t gtype, - const union g_addr *gate, ifindex_t ifindex, uint8_t num_labels, - const mpls_label_t *out_labels) + struct zebra_lsp *lsp, enum lsp_types_t lsp_type, + enum nexthop_types_t gtype, const union g_addr *gate, ifindex_t ifindex, + uint8_t num_labels, const mpls_label_t *out_labels) { /* Just a public pass-through to the internal implementation */ return nhlfe_add(lsp, lsp_type, gtype, gate, ifindex, num_labels, @@ -2232,7 +2232,7 @@ struct zebra_nhlfe *zebra_mpls_lsp_add_backup_nhlfe( /* * Add an NHLFE to an LSP based on a nexthop; return the newly-added object */ -struct zebra_nhlfe *zebra_mpls_lsp_add_nh(zebra_lsp_t *lsp, +struct zebra_nhlfe *zebra_mpls_lsp_add_nh(struct zebra_lsp *lsp, enum lsp_types_t lsp_type, const struct nexthop *nh) { @@ -2252,7 +2252,7 @@ struct zebra_nhlfe *zebra_mpls_lsp_add_nh(zebra_lsp_t *lsp, * Add a backup NHLFE to an LSP based on a nexthop; * return the newly-added object. */ -struct zebra_nhlfe *zebra_mpls_lsp_add_backup_nh(zebra_lsp_t *lsp, +struct zebra_nhlfe *zebra_mpls_lsp_add_backup_nh(struct zebra_lsp *lsp, enum lsp_types_t lsp_type, const struct nexthop *nh) { @@ -2901,7 +2901,7 @@ int mpls_zapi_labels_process(bool add_p, struct zebra_vrf *zvrf, const struct prefix *prefix = NULL; struct hash *lsp_table; struct zebra_ile tmp_ile; - zebra_lsp_t *lsp = NULL; + struct zebra_lsp *lsp = NULL; /* Prep LSP for add case */ if (add_p) { @@ -3084,9 +3084,10 @@ znh_done: * the out-label for an existing NHLFE (update case). */ static struct zebra_nhlfe * -lsp_add_nhlfe(zebra_lsp_t *lsp, enum lsp_types_t type, uint8_t num_out_labels, - const mpls_label_t *out_labels, enum nexthop_types_t gtype, - const union g_addr *gate, ifindex_t ifindex, bool is_backup) +lsp_add_nhlfe(struct zebra_lsp *lsp, enum lsp_types_t type, + uint8_t num_out_labels, const mpls_label_t *out_labels, + enum nexthop_types_t gtype, const union g_addr *gate, + ifindex_t ifindex, bool is_backup) { struct zebra_nhlfe *nhlfe; char buf[MPLS_LABEL_STRLEN]; @@ -3180,7 +3181,7 @@ int mpls_lsp_install(struct zebra_vrf *zvrf, enum lsp_types_t type, { struct hash *lsp_table; struct zebra_ile tmp_ile; - zebra_lsp_t *lsp; + struct zebra_lsp *lsp; struct zebra_nhlfe *nhlfe; /* Lookup table. */ @@ -3209,7 +3210,7 @@ int mpls_lsp_install(struct zebra_vrf *zvrf, enum lsp_types_t type, /* * Install or replace NHLFE, using info from zapi nexthop */ -static int lsp_znh_install(zebra_lsp_t *lsp, enum lsp_types_t type, +static int lsp_znh_install(struct zebra_lsp *lsp, enum lsp_types_t type, const struct zapi_nexthop *znh) { struct zebra_nhlfe *nhlfe; @@ -3247,7 +3248,7 @@ static int lsp_znh_install(zebra_lsp_t *lsp, enum lsp_types_t type, /* * Install/update backup NHLFE for an LSP, using info from a zapi message. */ -static int lsp_backup_znh_install(zebra_lsp_t *lsp, enum lsp_types_t type, +static int lsp_backup_znh_install(struct zebra_lsp *lsp, enum lsp_types_t type, const struct zapi_nexthop *znh) { struct zebra_nhlfe *nhlfe; @@ -3269,7 +3270,7 @@ static int lsp_backup_znh_install(zebra_lsp_t *lsp, enum lsp_types_t type, return 0; } -zebra_lsp_t *mpls_lsp_find(struct zebra_vrf *zvrf, mpls_label_t in_label) +struct zebra_lsp *mpls_lsp_find(struct zebra_vrf *zvrf, mpls_label_t in_label) { struct hash *lsp_table; struct zebra_ile tmp_ile; @@ -3295,7 +3296,7 @@ int mpls_lsp_uninstall(struct zebra_vrf *zvrf, enum lsp_types_t type, { struct hash *lsp_table; struct zebra_ile tmp_ile; - zebra_lsp_t *lsp; + struct zebra_lsp *lsp; struct zebra_nhlfe *nhlfe; char buf[NEXTHOP_STRLEN]; bool schedule_lsp = false; @@ -3354,7 +3355,7 @@ int mpls_lsp_uninstall_all_vrf(struct zebra_vrf *zvrf, enum lsp_types_t type, { struct hash *lsp_table; struct zebra_ile tmp_ile; - zebra_lsp_t *lsp; + struct zebra_lsp *lsp; /* Lookup table. */ lsp_table = zvrf->lsp_table; @@ -3377,10 +3378,10 @@ int mpls_lsp_uninstall_all_vrf(struct zebra_vrf *zvrf, enum lsp_types_t type, static void mpls_lsp_uninstall_all_type(struct hash_bucket *bucket, void *ctxt) { struct lsp_uninstall_args *args = ctxt; - zebra_lsp_t *lsp; + struct zebra_lsp *lsp; struct hash *lsp_table; - lsp = (zebra_lsp_t *)bucket->data; + lsp = (struct zebra_lsp *)bucket->data; if (nhlfe_list_first(&lsp->nhlfe_list) == NULL) return; @@ -3474,7 +3475,7 @@ int zebra_mpls_lsp_label_consistent(struct zebra_vrf *zvrf, { struct hash *slsp_table; struct zebra_ile tmp_ile; - zebra_lsp_t *lsp; + struct zebra_lsp *lsp; struct zebra_nhlfe *nhlfe; const struct nexthop *nh; @@ -3542,7 +3543,7 @@ int zebra_mpls_static_lsp_add(struct zebra_vrf *zvrf, mpls_label_t in_label, { struct hash *slsp_table; struct zebra_ile tmp_ile; - zebra_lsp_t *lsp; + struct zebra_lsp *lsp; struct zebra_nhlfe *nhlfe; char buf[BUFSIZ]; @@ -3621,7 +3622,7 @@ int zebra_mpls_static_lsp_del(struct zebra_vrf *zvrf, mpls_label_t in_label, { struct hash *slsp_table; struct zebra_ile tmp_ile; - zebra_lsp_t *lsp; + struct zebra_lsp *lsp; struct zebra_nhlfe *nhlfe; /* Lookup table. */ @@ -3700,7 +3701,7 @@ void zebra_mpls_print_lsp(struct vty *vty, struct zebra_vrf *zvrf, mpls_label_t label, bool use_json) { struct hash *lsp_table; - zebra_lsp_t *lsp; + struct zebra_lsp *lsp; struct zebra_ile tmp_ile; json_object *json = NULL; @@ -3732,7 +3733,7 @@ void zebra_mpls_print_lsp_table(struct vty *vty, struct zebra_vrf *zvrf, { char buf[BUFSIZ]; json_object *json = NULL; - zebra_lsp_t *lsp = NULL; + struct zebra_lsp *lsp = NULL; struct zebra_nhlfe *nhlfe = NULL; struct listnode *node = NULL; struct list *lsp_list = hash_get_sorted_list(zvrf->lsp_table, lsp_cmp); @@ -3866,7 +3867,7 @@ static char *nhlfe_config_str(const struct zebra_nhlfe *nhlfe, char *buf, */ int zebra_mpls_write_lsp_config(struct vty *vty, struct zebra_vrf *zvrf) { - zebra_lsp_t *lsp; + struct zebra_lsp *lsp; struct zebra_nhlfe *nhlfe; struct nexthop *nh; struct listnode *node; diff --git a/zebra/zebra_mpls.h b/zebra/zebra_mpls.h index bffe0b2492..a7e86e14c7 100644 --- a/zebra/zebra_mpls.h +++ b/zebra/zebra_mpls.h @@ -49,7 +49,6 @@ extern "C" { /* Typedefs */ -typedef struct zebra_lsp_t_ zebra_lsp_t; typedef struct zebra_fec_t_ zebra_fec_t; /* Declare LSP nexthop list types */ @@ -66,7 +65,7 @@ struct zebra_nhlfe { struct nexthop *nexthop; /* Backpointer to base entry. */ - zebra_lsp_t *lsp; + struct zebra_lsp *lsp; /* Runtime info - flags, pointers etc. */ uint32_t flags; @@ -93,7 +92,7 @@ struct zebra_ile { /* * Label swap entry (ile -> list of nhlfes) */ -struct zebra_lsp_t_ { +struct zebra_lsp { /* Incoming label */ struct zebra_ile ile; @@ -177,26 +176,26 @@ int zebra_mpls_lsp_uninstall(struct zebra_vrf *zvrf, struct route_node *rn, /* Add an NHLFE to an LSP, return the newly-added object */ struct zebra_nhlfe * -zebra_mpls_lsp_add_nhlfe(zebra_lsp_t *lsp, enum lsp_types_t lsp_type, +zebra_mpls_lsp_add_nhlfe(struct zebra_lsp *lsp, enum lsp_types_t lsp_type, enum nexthop_types_t gtype, const union g_addr *gate, ifindex_t ifindex, uint8_t num_labels, const mpls_label_t *out_labels); /* Add or update a backup NHLFE for an LSP; return the object */ struct zebra_nhlfe *zebra_mpls_lsp_add_backup_nhlfe( - zebra_lsp_t *lsp, enum lsp_types_t lsp_type, enum nexthop_types_t gtype, - const union g_addr *gate, ifindex_t ifindex, uint8_t num_labels, - const mpls_label_t *out_labels); + struct zebra_lsp *lsp, enum lsp_types_t lsp_type, + enum nexthop_types_t gtype, const union g_addr *gate, ifindex_t ifindex, + uint8_t num_labels, const mpls_label_t *out_labels); /* * Add NHLFE or backup NHLFE to an LSP based on a nexthop. These just maintain * the LSP and NHLFE objects; nothing is scheduled for processing. * Return: the newly-added object */ -struct zebra_nhlfe *zebra_mpls_lsp_add_nh(zebra_lsp_t *lsp, +struct zebra_nhlfe *zebra_mpls_lsp_add_nh(struct zebra_lsp *lsp, enum lsp_types_t lsp_type, const struct nexthop *nh); -struct zebra_nhlfe *zebra_mpls_lsp_add_backup_nh(zebra_lsp_t *lsp, +struct zebra_nhlfe *zebra_mpls_lsp_add_backup_nh(struct zebra_lsp *lsp, enum lsp_types_t lsp_type, const struct nexthop *nh); @@ -289,7 +288,7 @@ int mpls_lsp_install(struct zebra_vrf *zvrf, enum lsp_types_t type, /* * Lookup LSP by its input label. */ -zebra_lsp_t *mpls_lsp_find(struct zebra_vrf *zvrf, mpls_label_t in_label); +struct zebra_lsp *mpls_lsp_find(struct zebra_vrf *zvrf, mpls_label_t in_label); /* * Uninstall a particular NHLFE in the forwarding table. If this is diff --git a/zebra/zebra_srte.c b/zebra/zebra_srte.c index 167edf81f7..ba3727371c 100644 --- a/zebra/zebra_srte.c +++ b/zebra/zebra_srte.c @@ -211,7 +211,7 @@ static void zebra_sr_policy_notify_update(struct zebra_sr_policy *policy) } static void zebra_sr_policy_activate(struct zebra_sr_policy *policy, - zebra_lsp_t *lsp) + struct zebra_lsp *lsp) { policy->status = ZEBRA_SR_POLICY_UP; policy->lsp = lsp; @@ -222,7 +222,7 @@ static void zebra_sr_policy_activate(struct zebra_sr_policy *policy, } static void zebra_sr_policy_update(struct zebra_sr_policy *policy, - zebra_lsp_t *lsp, + struct zebra_lsp *lsp, struct zapi_srte_tunnel *old_tunnel) { bool bsid_changed; @@ -267,7 +267,7 @@ int zebra_sr_policy_validate(struct zebra_sr_policy *policy, struct zapi_srte_tunnel *new_tunnel) { struct zapi_srte_tunnel old_tunnel = policy->segment_list; - zebra_lsp_t *lsp; + struct zebra_lsp *lsp; if (new_tunnel) policy->segment_list = *new_tunnel; diff --git a/zebra/zebra_srte.h b/zebra/zebra_srte.h index e5239b7b7b..fe77809446 100644 --- a/zebra/zebra_srte.h +++ b/zebra/zebra_srte.h @@ -43,7 +43,7 @@ struct zebra_sr_policy { char name[SRTE_POLICY_NAME_MAX_LENGTH]; enum zebra_sr_policy_status status; struct zapi_srte_tunnel segment_list; - zebra_lsp_t *lsp; + struct zebra_lsp *lsp; struct zebra_vrf *zvrf; }; RB_HEAD(zebra_sr_policy_instance_head, zebra_sr_policy); -- 2.39.5