]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/zebra_mpls.h
Merge pull request #9345 from mjstapp/fix_lib_zmq_free
[mirror_frr.git] / zebra / zebra_mpls.h
index dd2d2e5658ea1e5b2701baf2852305d57f76c358..a8c4e1a60c60ebe81914c68ef0f49f6d829be26c 100644 (file)
@@ -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
@@ -416,6 +404,12 @@ void zebra_mpls_init(void);
  */
 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. */
 
 /*
@@ -576,6 +570,7 @@ static inline int mpls_should_lsps_be_processed(struct route_node *rn)
 
 /* Global variables. */
 extern int mpls_enabled;
+extern bool mpls_pw_reach_strict; /* Strict pseudowire reachability checking */
 
 #ifdef __cplusplus
 }