summaryrefslogtreecommitdiff
path: root/zebra/zebra_mpls.h
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2020-05-19 14:11:32 -0400
committerMark Stapp <mjs@voltanet.io>2020-06-01 14:46:12 -0400
commitee70f629792b90f92ea7e6becec2450f37bc191b (patch)
treedbefb1900f700707108433bef2158fc8d868e971 /zebra/zebra_mpls.h
parent55add95cd7353adec9b46e61b93172d2030a6faa (diff)
zebra: convert LSP nhlfe lists to use typesafe lists
Convert the embedded lists of nhlfes and snhlfes in zebra LSPs and SLSPs to use typesafe dlists. Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'zebra/zebra_mpls.h')
-rw-r--r--zebra/zebra_mpls.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/zebra/zebra_mpls.h b/zebra/zebra_mpls.h
index e468fb9c1b..9aec9458cb 100644
--- a/zebra/zebra_mpls.h
+++ b/zebra/zebra_mpls.h
@@ -55,6 +55,10 @@ 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(snhlfe_list);
+PREDECL_DLIST(nhlfe_list);
+
/*
* (Outgoing) nexthop label forwarding entry configuration
*/
@@ -71,9 +75,8 @@ struct zebra_snhlfe_t_ {
/* Backpointer to base entry. */
zebra_slsp_t *slsp;
- /* Pointers to more outgoing information for same in-label */
- zebra_snhlfe_t *next;
- zebra_snhlfe_t *prev;
+ /* Linkage for LSPs' lists */
+ struct snhlfe_list_item list;
};
/*
@@ -97,9 +100,10 @@ struct zebra_nhlfe_t_ {
#define NHLFE_FLAG_DELETED (1 << 3)
#define NHLFE_FLAG_INSTALLED (1 << 4)
- zebra_nhlfe_t *next;
- zebra_nhlfe_t *prev;
uint8_t distance;
+
+ /* Linkage for LSPs' lists */
+ struct nhlfe_list_item list;
};
/*
@@ -117,7 +121,7 @@ struct zebra_slsp_t_ {
zebra_ile_t ile;
/* List of outgoing nexthop static configuration */
- zebra_snhlfe_t *snhlfe_list;
+ struct snhlfe_list_head snhlfe_list;
};
/*
@@ -127,8 +131,9 @@ struct zebra_lsp_t_ {
/* Incoming label */
zebra_ile_t ile;
- /* List of NHLFE, pointer to best and num equal-cost. */
- zebra_nhlfe_t *nhlfe_list;
+ /* List of NHLFEs, pointer to best, and num equal-cost. */
+ struct nhlfe_list_head nhlfe_list;
+
zebra_nhlfe_t *best_nhlfe;
uint32_t num_ecmp;
@@ -164,6 +169,9 @@ struct zebra_fec_t_ {
struct list *client_list;
};
+/* Declare typesafe list apis/macros */
+DECLARE_DLIST(nhlfe_list, struct zebra_nhlfe_t_, list);
+
/* Function declarations. */
/*