? 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;
struct nexthop *nexthop;
/* Backpointer to base entry. */
- zebra_lsp_t *lsp;
+ struct zebra_lsp *lsp;
/* Runtime info - flags, pointers etc. */
uint32_t flags;
/*
* 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
/*
* FEC to label binding.
*/
-struct zebra_fec_t_ {
+struct zebra_fec {
/* FEC (prefix) */
struct route_node *rn;
};
/* Declare typesafe list apis/macros */
-DECLARE_DLIST(nhlfe_list, struct zebra_nhlfe_t_, list);
+DECLARE_DLIST(nhlfe_list, struct zebra_nhlfe, list);
/* Function declarations. */
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,
* 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.
/*
* 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
*/
void zebra_mpls_vty_init(void);
+/*
+ * When cleaning up a client connection ensure that there are no
+ * vrf labels that need cleaning up too
+ */
+void zebra_mpls_client_cleanup_vrf_label(uint8_t proto);
+
/* Inline functions. */
/*
/* Global variables. */
extern int mpls_enabled;
+extern bool mpls_pw_reach_strict; /* Strict pseudowire reachability checking */
#ifdef __cplusplus
}