summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_mpls.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* zebra: dplane FPM LSP table walkDuncan Eastoe2020-11-301-0/+1
| | | | | | | | Add routines to walk the LSP table and generate FPM updates for all entries. A walk of the LSP table is triggered when (re-)connecting to an FPM. Signed-off-by: Duncan Eastoe <duncan.eastoe@att.com>
* zebra: remove 'static' lsp objectsMark Stapp2020-10-081-34/+0
| | | | | | | | Use the same lsp and nexthop/nhlfe objects for 'static' and dynamic LSPs; remove the 'static' objects and their supporting code. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* lib, zebra: Add SR-TE policy infrastructure to zebraSebastien Merle2020-08-071-0/+13
| | | | | | | | | | | | | | | | | | | | For the sake of Segment Routing (SR) and Traffic Engineering (TE) Policies there's a need for additional infrastructure within zebra. The infrastructure in this PR is supposed to manage such policies in terms of installing binding SIDs and LSPs. Also it is capable of managing MPLS labels using the label manager, keeping track of nexthops (for resolving labels) and notifying interested parties about changes of a policy/LSP state. Further it enables a route map mechanism for BGP and SR-TE colors such that learned BGP routes can be mapped onto SR-TE Policies. This PR does not introduce any usable features by now, it is just infrastructure for other upcoming PRs which will introduce 'pathd', a new SR-TE daemon. Co-authored-by: Renato Westphal <renato@opensourcerouting.org> Co-authored-by: GalaxyGorilla <sascha@netdef.org> Signed-off-by: Sebastien Merle <sebastien@netdef.org>
* zebra: collapse some duplicate LSP nhlfe apisMark Stapp2020-07-071-7/+2
| | | | | | | | | Collapse some apis where primary and backup nhlfe code was very similar, generally using a single common api and using a bool to distinguish between primary and backup. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* zebra: add const to mpls and dplane nhlfe apisMark Stapp2020-07-071-2/+2
| | | | | | | Add const to an arg to a couple of the dplane and mpls module apis that add nhlfes to LSPs. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* zebra: backup LSP zapi processingMark Stapp2020-06-011-17/+4
| | | | | | | | Move some processing of zapi label messages so they can be handled more efficiently. Handle zapi delete and replace messages. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* zebra: support backup nhlfes in LSPsMark Stapp2020-06-011-3/+43
| | | | | | | Handle backup nhlfes in LSP zapi messages. Capture backup info with LSPs, capture backup info in the dataplane LSP processing. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* zebra: convert LSP nhlfe lists to use typesafe listsMark Stapp2020-06-011-8/+16
| | | | | | | Convert the embedded lists of nhlfes and snhlfes in zebra LSPs and SLSPs to use typesafe dlists. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* isisd: add support for segment routingRenato Westphal2020-04-301-0/+7
| | | | | | | | | | | | | | | | | | | | | | This is an implementation of the IS-IS SR draft [1] for FRR. The following features are supported: * IPv4 and IPv6 Prefix-SIDs; * IPv4 and IPv6 Adj-SIDs and LAN-Adj-SIDs; * Index and absolute labels; * The no-php and explicit-null Prefix-SID flags; * Full integration with the Label Manager. Known limitations: * No support for Anycast-SIDs; * No support for the SID/Label Binding TLV (required for LDP interop). * No support for persistent Adj-SIDs; * No support for multiple SRGBs. [1] draft-ietf-isis-segment-routing-extensions-25 Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com> Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* zebra,lib: use const in more apisMark Stapp2020-03-271-2/+2
| | | | | | | | Use const with some args to ipaddr, zebra vxlan, mpls lsp, and nexthop apis; add some extra checks to some nexthop-related apis. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* zebra: support LSPs with multiple outgoing labelsRenato Westphal2019-11-291-5/+6
| | | | | | | | | For SR-TE we'll need to create Binding-SIDs which are essentially LSPs that can push multiple outgoing labels. This commit sets the groundwork for that. Luckily the netlink code didn't need to be changed since it already supports pushing label stacks. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* lib, zebra: add new MPLS zapi message with route replace semanticsRenato Westphal2019-09-101-3/+10
| | | | | | | This new message makes it possible to install/reinstall LSPs with multiple nexthops using a single ZAPI message. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* zebra: improve cleanup of MPLS labels when zclient disconnectsRenato Westphal2019-09-071-5/+0
| | | | | | | | | Use the zserv_client_close hook to cleanup all MPLS labels advertised by a zclient when it disconnects. We were doing this cleanup for ldpd only, but now we have other daemons that are MPLS aware, like ospfd (due to the new Segment Routing feature). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* lib, zebra: rename LSP type used for OSPF SRRenato Westphal2019-09-071-4/+8
| | | | | | | | | | SR support for IS-IS is coming so we need to be able to distinguish OSPF and IS-IS LSPs. While here, add missing case statement for LDP on lsp_type_from_re_type(). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* zebra: identify MPLS FTNs by route type and instanceRenato Westphal2019-09-071-2/+2
| | | | | | | | | Use the route type and instance instead of the route distance to identify MPLS FTNs. This is a more robust approach since the routing daemons can modify the distance of their announced routes via configuration, which can cause inconsistencies. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* zebra: mpls lsp async notificationsMark Stapp2019-05-281-0/+3
| | | | | | | Add LSP notification event type; add a handler for LSP notifs; dispatch to that handler. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* zebra: Modify lsp processing to be invoked as neededDonald Sharp2019-03-271-10/+23
| | | | | | | | | | | | | | | | | | LSP processing was a zvrf flag based upon a connected route coming or going. But this did not allow us to know that we should do lsp processing other than after the meta-queue processing was finished. Eventually we moved meta-queue processing of do_nht_processing to after the dataplane sent the main pthread some results. This of course left us with a timing hole where if a connected route came in and we received a data plane response *before* the meta queue was processed we would not do the work as necessary. Move the lsp processing to a flag off of the rib_dest_t. If it is marked then we need to process lsps. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* add cplusplus guards to all zebra headersEmanuele Di Pascale2019-03-251-0/+7
| | | | Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
* *: Rename backet to bucketTim Bray2019-02-251-2/+2
| | | | | | Presume typo from original author Signed-off-by: Tim Bray <tim@kooky.org>
* zebra: move LSP updates into dataplane subsystemMark Stapp2019-01-221-0/+8
| | | | | | | Start performing LSP updates through the async dataplane subsystem. This is plumbed through for linux/netlink. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* zebra: add apis to add and delete NHLFEsMark Stapp2019-01-221-0/+11
| | | | | | | | Add public versions of zebra apis that add NHLFEs to an LSP, and that free NHLFEs. The dataplane code needs to capture/copy NHLFEs in order to do async LSP programming. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* bgpd, zebra: auto assign labels from label pool to regular prefixes in BGP ↵Anton Degtyarev2018-12-201-9/+2
| | | | | | | | | | | | labeled unicast This commit is the last missing piece to complete BGP LU support in bgpd. To this moment, bgpd (and zebra) supported auto label assignment only for prefixes leaked from VRFs to vpn and for MPLS SR prefixes. This adds auto label assignment to other routes types in bgpd. The following enhancements have been made: * bgp_route.c:bgp_process_main_one() now sets implicit-null local_label to all local, aggregate and redistributed routes. * bgp_route.c:bgp_process_main_one() now will request a label from the label pool for any prefix that loses the label for some reason (for example, when the static label assignment config is removed) * bgp_label.c:bgp_reg_dereg_for_label() now requests labels from label pool for routes which have no associated label index * zebra_mpls.c:zebra_mpls_fec_register() now expects both label and label_index from the calling function, one of which must be set to MPLS_INVALID_LABEL or MPLS_INVALID_LABEL_INDEX, based on this it will decide how to register the provided FEC. Signed-off-by: Anton Degtyarev <anton@cumulusnetworks.com>
* bgpd/ospfd: make bgp and ospf json response a bit more consistentDon Slice2018-08-301-2/+2
| | | | | | | | | | | | | | Problem reported that some bgp and ospf json commands did not return any json output at all if the bgp/ospf instance did not exist. Additionally, some bgp and ospf json commands did not return any json output if the instance existed but no neighbors were defined. This fix makes these commands more consistent in returning empty braces for json output and issue a message if not using json output. Additionally, made the flag "use_json" a bool to make it consistent since previously, it had been defined as an int, char, u_char, and bool at various places. Ticket: CM-21040 Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
* zebra: use hooks for client lifecycle callbacksQuentin Young2018-04-231-6/+0
| | | | | | | | | zserv.c was using hardcoded callbacks to clean up various components when a client disconnected. Ergo zserv.c had to know about all these unrelated components that it should not care about. We have hooks now, let's use the proper thing instead. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* lib, zebra: Move label conversion strings to libDonald Sharp2018-04-181-12/+0
| | | | | | | The mpls_label2str and mpls_str2label functions should not be zebra exclusive functions. Move them to lib/mpls.c Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* lib, zebra: Move help string to appropriate headerDonald Sharp2018-04-181-4/+0
| | | | | | | The MPLS_LABEL_HELPSTR belongs in lib/mpls.h in case any other protocol wants to use it. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: use C99 standard fixed-width integer typesQuentin Young2018-03-271-16/+16
| | | | | | | | | | | | | | | | | | | | | | The following types are nonstandard: - u_char - u_short - u_int - u_long - u_int8_t - u_int16_t - u_int32_t Replace them with the C99 standard types: - uint8_t - unsigned short - unsigned int - unsigned long - uint8_t - uint16_t - uint32_t Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* lib, sharpd, zebra: Add new enum for lsp type and pass it through.Donald Sharp2018-02-091-3/+34
| | | | | | | | | | | | | Add the ability to pass the lsp owner type through the zapi and in addition add a new label type for the sharp protocol for testing. Finally modify zebra_mpls.h to not have defaults specified for the enum. That way when we add a new LSP type the compile fails and the person doing the addition knows where he has to touch shit. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge pull request #1654 from mkanjari/evpn-symm-routing-enhancementsPhilippe Guibert2018-02-081-0/+7
|\ | | | | Evpn symmetric routing enhancements
| * *: Handle VRF configuration when VRF gets inactivated and activatedvivek2018-01-241-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A VRF is active only when the corresponding VRF device is present in the kernel. However, when the kernel VRF device is removed, the VRF container in FRR should go away only if there is no user configuration for it. Otherwise, when the VRF device is created again so that the VRF becomes active, FRR cannot take the correct actions. Example configuration for the VRF includes static routes and EVPN L3 VNI. Note that a VRF is currently considered to be "configured" as soon as the operator has issued the "vrf <name>" command in FRR. Such a configured VRF is not deleted upon VRF device removal, it is only made inactive. A VRF that is "configured" can be deleted only upon operator action and only if the VRF has been deactivated i.e., the VRF device removed from the kernel. This is an existing restriction. To implement this change, the VRF disable and delete actions have been modified. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Mitesh Kanjariya <mkanjariya@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com> Ticket: CM-18553, CM-18918, CM-10139 Reviewed By: CCR-7022 Testing Done: 1. vrf and pim-vrf automation tests 2. Multiple VRF delete and readd (ifdown, ifup-with-depends) 3. FRR stop, start, restart 4. Networking restart 5. Configuration delete and readd Some of the above tests run in different sequences (manually).
* | OSPFD: Update Segment Routing following reviewsOlivier Dugeon2018-01-221-1/+1
| | | | | | | | | | | | | | | | | | - Remove OSPD_SR route type - Check that Segment Routing is enable only in default VRF - Add comment for SRGB in lib/mpls.h - Update documentation Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
* | OSPFD: Add Experimental Segment Routing supportOlivier Dugeon2018-01-181-0/+10
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an implementation of draft-ietf-ospf-segment-routing-extensions-24 and RFC7684 for Extended Link & Prefix Opaque LSA. Look to doc/OSPF_SR.rst for implementation details & known limitations. New files: - ospfd/ospf_sr.h: Segment Routing structure definition (SubTLVs + SRDB) - ospfd/ospf_sr.c: Main functions for Segment Routing support - ospfd/ospf_ext.h: TLVs and SubTLVs definition for RFC7684 - ospfd/ospf_ext.c: RFC7684 Extended Link / Prefix implementation - doc/OSPF-SRr.rst: Documentation Modified Files: - doc/ospfd.texi: Add new Segment Routing CLI command definition - lib/command.h: Add new string command for Segment Routing CLI - lib/mpls.h: Add default value for SRGB - lib/route_types.txt: Add new OSPF Segment Routing route type - ospfd/ospf_dump.[c,h]: Add OSPF SR debug - ospfd/ospf_memory.[c,h]: Add new Segment Routing memory type - ospfd/ospf_opaque.[c,h]: Add ospf_sr_init() starting function - ospfd/ospf_ri.c: Add new functions to Set/Get Segment Routing TLVs Add new ospf_router_info_lsa_upadte() to send Opaque LSA to ospf_sr.c() - ospfd/ospf_ri.h: Add new Router Information SR SubTLVs - ospfd/ospf_spf.c: Add new scheduler when running SPF to trigger update of NHLFE - ospfd/ospfd.h: Add new thread for Segment Routing scheduler - ospfd/subdir.am: Add new files - vtysh/Makefile.am: Add new ospf_sr.c file for vtysh - zebra/kernel_netlink.c: Add new OSPF_SR route type - zebra/rt_netlink.[c,h]: Add new OSPF_SR route type - zebra/zebra_mpls.h: Add new OSPF_SR route type Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
* zebra: install MPLS LSPs with appropriate protocol typeRenato Westphal2017-09-211-0/+18
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* zebra: fix administrative distance issuesRenato Westphal2017-09-121-3/+9
| | | | | | | * Reuse route_distance() on rib_add_multipath() and on rib_add(); * Set the admin distance of LDP and BGP MPLS LSPs. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* zapi: add support for routes with multiple labelsRenato Westphal2017-08-231-2/+0
| | | | | | This will be necessary for the Segment Routing feature. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* zebra: increase maximum label stack depthRenato Westphal2017-08-221-1/+1
| | | | | | | | | | | | | | * Bump MPLS_MAX_LABELS from 2 to 16; * Adjust the static_nh_label structure and the mpls_label2str() function; * On OpenBSD, print an error message when trying to push more than one label at once (kernel limitation). While here, add support for MPLSv6 FTNs in OpenBSD. This is not the full package. We still can't pop multiple labels at once, or do things like swap a label and push other ones. We'll address that in the future. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-200/+163
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge pull request #647 from qlyoung/zebra-mpls-error-messagesRenato Westphal2017-06-031-0/+2
|\ | | | | zebra: more informative error messages & help strings for mpls labels
| * zebra: define mpls label helpstrQuentin Young2017-05-311-0/+2
| | | | | | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | zebra: Refactor 'struct rib' to be 'struct route_entry'Donald Sharp2017-06-011-4/+4
|/ | | | | | | | | | The 'struct rib' data structure is missnamed. It really is a 'struct route_entry' as part of the 'struct route_node'. We have 1 'struct route_entry' per route src. As such 1 route node can have multiple route entries if multiple protocols attempt to install the same route. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: make consistent & update GPLv2 file headersDavid Lamparter2017-05-151-4/+3
| | | | | | | | | | | The FSF's address changed, and we had a mixture of comment styles for the GPL file header. (The style with * at the beginning won out with 580 to 141 in existing files.) Note: I've intentionally left intact other "variations" of the copyright header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: lsp_install() failed due to ZEBRA_FLAG_SELECTED checkDaniel Walton2017-05-101-1/+1
| | | | | | | | | | | | | | | ZEBRA_FLAG_SELECTED hasn't been set yet by the time lsp_install is called. The call path is: rib_process -> rib_process_add_fib -> zebra_mpls_lsp_install -> lsp_install but ZEBRA_FLAG_SELECTED is set in rib_process after it calls rib_process_add_fib. I can't think of anything that it would hurt to install the LSP regardless of whether ZEBRA_FLAG_SELECTED is set later. I also cleaned up some UI (json and display the pretty label names instead of their numeric values). Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
* bgpd, lib, zebra: Implement handling of BGP-Prefix-SID label IndexVivek Venkatraman2017-04-061-1/+10
| | | | | | | | | | | | | | | | Implement BGP Prefix-SID IETF draft to be able to signal a labeled-unicast prefix with a label index (segment ID). This makes it easier to deploy global MPLS labels with BGP, even without other aspects of Segment Routing implemented. This patch implements the handling of the BGP-Prefix-SID Label Index attribute. When received from a peer and the index is acceptable, the local label is picked up from the SRGB and is programmed as the incoming label as well as advertised to peers. If the index is not acceptable, no local label is assigned. The outgoing label will always be the one advertised by the downstream neighbor. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
* bgpd, zebra: Implement BGP Prefix-SID IETF draftVivek Venkatraman2017-04-061-0/+19
| | | | | | | | | | | | Implement BGP Prefix-SID IETF draft to be able to signal a labeled-unicast prefix with a label index (segment ID). This makes it easier to deploy global MPLS labels with BGP, even without other aspects of Segment Routing implemented. This patch implements configuration of the global label block (SRGB) and configuration of a label-index for a network in BGP. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
* zebra: labeled unicast handlingDon Slice2017-04-061-6/+23
| | | | | | | | | Support install of labeled-unicast routes by a client. This would be BGP, in order to install routes corresponding to AFI/SAFI 1/4 (IPv4) or 2/4 (IPv6). Convert labeled-unicast routes into label forwarding entries (i.e., transit LSPs) when there is a static label binding. Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
* zebra: fec registerDon Slice2017-04-061-2/+30
| | | | | | | | Implement interface that allows a client to register a FEC for obtaining a label binding (in-label). Update client whenever the label binding is updated and cleanup when client goes away. Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
* zebra: static label bindingDon Slice2017-04-061-0/+63
| | | | | | | | | | Implement static label binding of a label to a prefix (FEC). Note: Currently, only binding to a prefix is supported, the nexthop and/or other parameters are not considered. This was cherry-picked by hand from an earlier mpls branch. Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
* zebra/ldpd: allow MPLS ECMP on unnumbered interfacesRenato Westphal2016-12-141-1/+2
| | | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org> (cherry picked from commit 7144dc12b55e05c9ae3d784dfb75817c9f881eb6)
* zebra: check at startup if the kernel supports MPLSRenato Westphal2016-09-231-0/+9
| | | | | | | | Replace all HAVE_MPLS #ifdef's by a run-time check if MPLS is supported by the kernel or not. This way we don't need to create multiple packages for each OS distribution. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* MPLS: ignore hardware restrictions when --enable-cumulus is not given.Renato Westphal2016-09-231-0/+2
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>