diff options
Diffstat (limited to 'zebra/zebra_mpls.h')
| -rw-r--r-- | zebra/zebra_mpls.h | 66 |
1 files changed, 27 insertions, 39 deletions
diff --git a/zebra/zebra_mpls.h b/zebra/zebra_mpls.h index 5195b2f14f..a8c4e1a60c 100644 --- a/zebra/zebra_mpls.h +++ b/zebra/zebra_mpls.h @@ -47,20 +47,13 @@ extern "C" { ? AF_INET6 \ : AF_INET) -/* Typedefs */ - -typedef struct zebra_ile_t_ zebra_ile_t; -typedef struct zebra_nhlfe_t_ zebra_nhlfe_t; -typedef struct zebra_lsp_t_ zebra_lsp_t; -typedef struct zebra_fec_t_ zebra_fec_t; - /* Declare LSP nexthop list types */ PREDECL_DLIST(nhlfe_list); /* * (Outgoing) nexthop label forwarding entry */ -struct zebra_nhlfe_t_ { +struct zebra_nhlfe { /* Type of entry - static etc. */ enum lsp_types_t type; @@ -68,7 +61,7 @@ struct zebra_nhlfe_t_ { struct nexthop *nexthop; /* Backpointer to base entry. */ - zebra_lsp_t *lsp; + struct zebra_lsp *lsp; /* Runtime info - flags, pointers etc. */ uint32_t flags; @@ -88,21 +81,21 @@ struct zebra_nhlfe_t_ { /* * Incoming label entry */ -struct zebra_ile_t_ { +struct zebra_ile { mpls_label_t in_label; }; /* * Label swap entry (ile -> list of nhlfes) */ -struct zebra_lsp_t_ { +struct zebra_lsp { /* Incoming label */ - zebra_ile_t ile; + struct zebra_ile ile; /* List of NHLFEs, pointer to best, and num equal-cost. */ struct nhlfe_list_head nhlfe_list; - zebra_nhlfe_t *best_nhlfe; + struct zebra_nhlfe *best_nhlfe; uint32_t num_ecmp; /* Backup nhlfes, if present. The nexthop in a primary/active nhlfe @@ -126,7 +119,7 @@ struct zebra_lsp_t_ { /* * FEC to label binding. */ -struct zebra_fec_t_ { +struct zebra_fec { /* FEC (prefix) */ struct route_node *rn; @@ -145,7 +138,7 @@ struct zebra_fec_t_ { }; /* Declare typesafe list apis/macros */ -DECLARE_DLIST(nhlfe_list, struct zebra_nhlfe_t_, list); +DECLARE_DLIST(nhlfe_list, struct zebra_nhlfe, list); /* Function declarations. */ @@ -178,37 +171,32 @@ int zebra_mpls_lsp_uninstall(struct zebra_vrf *zvrf, struct route_node *rn, struct route_entry *re); /* Add an NHLFE to an LSP, return the newly-added object */ -zebra_nhlfe_t *zebra_mpls_lsp_add_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_nhlfe * +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 */ -zebra_nhlfe_t *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_nhlfe *zebra_mpls_lsp_add_backup_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 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 */ -zebra_nhlfe_t *zebra_mpls_lsp_add_nh(zebra_lsp_t *lsp, - enum lsp_types_t lsp_type, - const struct nexthop *nh); -zebra_nhlfe_t *zebra_mpls_lsp_add_backup_nh(zebra_lsp_t *lsp, - enum lsp_types_t lsp_type, - const struct nexthop *nh); +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(struct zebra_lsp *lsp, + enum lsp_types_t lsp_type, + const struct nexthop *nh); /* Free an allocated NHLFE */ -void zebra_mpls_nhlfe_free(zebra_nhlfe_t *nhlfe); +void zebra_mpls_nhlfe_free(struct zebra_nhlfe *nhlfe); int zebra_mpls_fec_register(struct zebra_vrf *zvrf, struct prefix *p, uint32_t label, uint32_t label_index, @@ -229,8 +217,8 @@ int zebra_mpls_fec_unregister(struct zebra_vrf *zvrf, struct prefix *p, * TODO: Currently walks entire table, can optimize later with another * hash.. */ -zebra_fec_t *zebra_mpls_fec_for_label(struct zebra_vrf *zvrf, - mpls_label_t label); +struct zebra_fec *zebra_mpls_fec_for_label(struct zebra_vrf *zvrf, + mpls_label_t label); /* * Inform if specified label is currently bound to a FEC or not. @@ -296,7 +284,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 |
