diff options
author | vivek <vivek@cumulusnetworks.com> | 2016-04-16 04:19:37 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-09-23 15:30:56 +0200 |
commit | 40c7bdb0c9ba746d1f1bdfe1cb4d03aa5f407661 (patch) | |
tree | deeff1f385d86818d5f85258074960cdd2827508 /zebra/zebra_mpls.h | |
parent | Quagga: Fix alignment in netlink messages in some cases (diff) | |
download | frr-40c7bdb0c9ba746d1f1bdfe1cb4d03aa5f407661.tar.xz frr-40c7bdb0c9ba746d1f1bdfe1cb4d03aa5f407661.zip |
Quagga: Install label forwarding entries for statically configured LSPs
Install the statically configured LSPs into the FIB (kernel). This is done
using the new attributes and definitions for MPLS in the kernel -
RTA_VIA, RTA_NEWDST and AF_MPLS.
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-4804
Reviewed By: CCR-3088
Testing Done: Manual in SE-1
Diffstat (limited to 'zebra/zebra_mpls.h')
-rw-r--r-- | zebra/zebra_mpls.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/zebra/zebra_mpls.h b/zebra/zebra_mpls.h index b62230ead..5fb481781 100644 --- a/zebra/zebra_mpls.h +++ b/zebra/zebra_mpls.h @@ -190,12 +190,28 @@ zebra_mpls_static_lsp_del (struct zebra_vrf *zvrf, mpls_label_t in_label, char *ifname, ifindex_t ifindex); /* + * Schedule all MPLS label forwarding entries for processing. + * Called upon changes that may affect one or more of them such as + * interface or nexthop state changes. + */ +void +zebra_mpls_lsp_schedule (struct zebra_vrf *zvrf); + +/* * Display MPLS LSP configuration of all static LSPs (VTY command handler). */ int zebra_mpls_write_lsp_config (struct vty *vty, struct zebra_vrf *zvrf); /* + * Called upon process exiting, need to delete LSP forwarding + * entries from the kernel. + * NOTE: Currently supported only for default VRF. + */ +void +zebra_mpls_close_tables (struct zebra_vrf *zvrf); + +/* * Allocate MPLS tables for this VRF. * NOTE: Currently supported only for default VRF. */ @@ -208,4 +224,34 @@ zebra_mpls_init_tables (struct zebra_vrf *zvrf); void zebra_mpls_init (void); +/* Inline functions. */ + +/* + * Distance (priority) definition for LSP NHLFE. + */ +static inline u_char +lsp_distance (enum lsp_types_t type) +{ + if (type == ZEBRA_LSP_STATIC) + return (route_distance (ZEBRA_ROUTE_STATIC)); + + return 150; +} + +/* + * Map RIB type to LSP type. Used when labeled-routes from BGP + * are converted into LSPs. + */ +static inline enum lsp_types_t +lsp_type_from_rib_type (int rib_type) +{ + switch (rib_type) + { + case ZEBRA_ROUTE_STATIC: + return ZEBRA_LSP_STATIC; + default: + return ZEBRA_LSP_INVALID; + } +} + #endif /*_ZEBRA_MPLS_H */ |