diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2017-09-16 02:25:32 +0200 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2017-09-21 18:27:50 +0200 |
commit | 805444ce721c814f44d4e7a7fb5cdc95fc11333a (patch) | |
tree | cff3a6b5821967a126fd24ff7741851001a10de6 /zebra/zebra_mpls.h | |
parent | zebra: pay attention to metric from kernel (ECMP version) (diff) | |
download | frr-805444ce721c814f44d4e7a7fb5cdc95fc11333a.tar.xz frr-805444ce721c814f44d4e7a7fb5cdc95fc11333a.zip |
zebra: install MPLS LSPs with appropriate protocol type
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
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 51279798a..22c771c34 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) { |