diff options
Diffstat (limited to 'zebra/zebra_mpls.h')
| -rw-r--r-- | zebra/zebra_mpls.h | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/zebra/zebra_mpls.h b/zebra/zebra_mpls.h index 39f084ad2f..3a131e1aaf 100644 --- a/zebra/zebra_mpls.h +++ b/zebra/zebra_mpls.h @@ -34,6 +34,9 @@ #include "zebra/zserv.h" #include "zebra/zebra_vrf.h" +#ifdef __cplusplus +extern "C" { +#endif /* Definitions and macros. */ @@ -507,31 +510,48 @@ static inline const char *nhlfe_type2str(enum lsp_types_t lsp_type) return "Unknown"; } -static inline void mpls_mark_lsps_for_processing(struct zebra_vrf *zvrf) +static inline void mpls_mark_lsps_for_processing(struct zebra_vrf *zvrf, + struct prefix *p) { + struct route_table *table; + struct route_node *rn; + rib_dest_t *dest; + if (!zvrf) return; - zvrf->mpls_flags |= MPLS_FLAG_SCHEDULE_LSPS; + table = zvrf->table[family2afi(p->family)][SAFI_UNICAST]; + if (!table) + return; + + rn = route_node_match(table, p); + if (!rn) + return; + + + dest = rib_dest_from_rnode(rn); + SET_FLAG(dest->flags, RIB_DEST_UPDATE_LSPS); } -static inline void mpls_unmark_lsps_for_processing(struct zebra_vrf *zvrf) +static inline void mpls_unmark_lsps_for_processing(struct route_node *rn) { - if (!zvrf) - return; + rib_dest_t *dest = rib_dest_from_rnode(rn); - zvrf->mpls_flags &= ~MPLS_FLAG_SCHEDULE_LSPS; + UNSET_FLAG(dest->flags, RIB_DEST_UPDATE_LSPS); } -static inline int mpls_should_lsps_be_processed(struct zebra_vrf *zvrf) +static inline int mpls_should_lsps_be_processed(struct route_node *rn) { - if (!zvrf) - return 0; + rib_dest_t *dest = rib_dest_from_rnode(rn); - return ((zvrf->mpls_flags & MPLS_FLAG_SCHEDULE_LSPS) ? 1 : 0); + return !!CHECK_FLAG(dest->flags, RIB_DEST_UPDATE_LSPS); } /* Global variables. */ extern int mpls_enabled; +#ifdef __cplusplus +} +#endif + #endif /*_ZEBRA_MPLS_H */ |
