diff options
Diffstat (limited to 'zebra/zebra_mpls.h')
| -rw-r--r-- | zebra/zebra_mpls.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/zebra/zebra_mpls.h b/zebra/zebra_mpls.h index 51279798a4..22c771c348 100644 --- a/zebra/zebra_mpls.h +++ b/zebra/zebra_mpls.h @@ -436,6 +436,24 @@ static inline enum lsp_types_t lsp_type_from_re_type(int re_type) } } +/* + * Map LSP type to RIB type. + */ +static inline int re_type_from_lsp_type(enum lsp_types_t lsp_type) +{ + switch (lsp_type) { + case ZEBRA_LSP_STATIC: + return ZEBRA_ROUTE_STATIC; + case ZEBRA_LSP_LDP: + return ZEBRA_ROUTE_LDP; + case ZEBRA_LSP_BGP: + return ZEBRA_ROUTE_BGP; + case ZEBRA_LSP_NONE: + default: + return ZEBRA_ROUTE_KERNEL; + } +} + /* NHLFE type as printable string. */ static inline const char *nhlfe_type2str(enum lsp_types_t lsp_type) { |
