summaryrefslogtreecommitdiffstats
path: root/lib/mpls.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #12780 from opensourcerouting/spdx-license-idDonald Sharp2023-02-171-16/+1
|\ | | | | *: convert to SPDX License identifiers
| * *: auto-convert to SPDX License IDsDavid Lamparter2023-02-091-16/+1
| | | | | | | | | | | | Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | lib: remove unneeded parans on labl2str returnStephen Worley2023-02-141-1/+1
| | | | | | | | | | | | Remove unneeded parans on labl2str return. Signed-off-by: Stephen Worley <sworley@nvidia.com>
* | lib: add asserts to appease the SAStephen Worley2023-02-141-0/+4
| | | | | | | | | | | | | | | | I don't believe label can be NULL in any calling path but SA thinks so so let's just assert here to be safe anyway and make it happy. Signed-off-by: Stephen Worley <sworley@nvidia.com>
* | lib,zebra,bgpd,staticd: use label code to store VNI infoStephen Worley2023-02-141-2/+31
|/ | | | | | | | | | | | | Use the already existing mpls label code to store VNI info for vxlan. VNI's are defined as labels just like mpls, we should be using the same code for both. This patch is the first part of that. Next we will need to abstract the label code to not be so mpls specific. Currently in this, we are just treating VXLAN as a label type and storing it that way. Signed-off-by: Stephen Worley <sworley@nvidia.com>
* ldpd: Fix issue when starting up LDP with no configuration.lynne2020-09-041-2/+1
| | | | | | | | LDP would mark all routes as learned on a non-ldp interface. Then when LDP was configured the labels were not updated correctly. This commit fixes issues 6841 and 6842. Signed-off-by: Lynne Morrison <lynne@voltanet.io>
* lib, zebra: Add SR-TE policy infrastructure to zebraSebastien Merle2020-08-071-0/+1
| | | | | | | | | | | | | | | | | | | | 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>
* isisd: add support for segment routingRenato Westphal2020-04-301-1/+2
| | | | | | | | | | | | | | | | | | | | | | 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-1/+4
| | | | | | | | 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>
* isisd: Update TLVs processing for TE, RI & SROlivier Dugeon2019-09-171-0/+1
| | | | | | | | | | | | | | | | | | | | | In preparation to Segment Routing: - Update the management of Traffic Engineering subTLVs to the new tlvs parser - Add Router Capability TLV 242 as per RFC 4971 & 7981 - Add Segment Routing subTLVs as per draft-isis-segment-routing-extension-25 Modified files: - isis_tlvs.h: add new structure to manage TE subTLVs, TLV 242 & SR subTLVs - isis_tlvs.c: add new functions (pack, copy, free, unpack & print) to process TE subTLVs, Router Capability TLV and SR subTLVs - isis_circuit.[c,h] & isis_lsp.[c,h]: update to new subTLVs & TLV processing - isis_te.[c,h]: remove all old TE structures and managment functions, and add hook call to set local and remote IP addresses as wellas update TE parameters - isis_zebra.[c,h]: add hook call when new interface is up - isis_mt.[c,h], isis_pdu.c & isis_northbound.c: adjust to new TE subTLVs - tests/isisd/test_fuzz_isis_tlv_tests.h.gz: adapte fuuz tests to new parser Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
* lib, zebra: rename LSP type used for OSPF SRRenato Westphal2019-09-071-1/+1
| | | | | | | | | | 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>
* lib, zebra: support label chunk requests for SRGBEmanuele Di Pascale2019-07-101-0/+1
| | | | | | | | | | | | | | | | For SRGB, we need to support chunk requests starting at a specific point in the label space, rather than just asking for any sufficiently large chunk. To this purpose, we extend the label manager api to request a chunk with a base value; if the base is set to 0, the label manager will behave as it currently does, i.e. fetching the first free chunk big enough to satisfy the request. update all the existing calls to get chunks from the label manager so that they use MPLS_LABEL_BASE_ANY as the base for the requested chunk Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
* lib: add extern "C" {} blocks to all libfrr headersRenato Westphal2019-02-121-0/+8
| | | | | | | These are necessary to use functions defined in these headers from C++. Signed-off-by: David Lamparter <equinox@diac24.net> Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: spelchekDavid Lamparter2018-10-251-1/+1
| | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* zebra, lib: error references for zebraQuentin Young2018-08-141-0/+1
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* lib, zebra: Move label conversion strings to libDonald Sharp2018-04-181-0/+11
| | | | | | | 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-0/+4
| | | | | | | 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-4/+3
| | | | | | | | | | | | | | | | | | | | | | 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>
* bgpd, lib, sharpd, zebra: Use MPLS_LABEL_NONEDonald Sharp2018-02-091-1/+1
| | | | | | | | | | Modify mpls.h to rename MPLS_LABEL_ILLEGAL to be MPLS_LABEL_NONE. Fix all pre-existing code that used MPLS_LABEL_ILLEGAL. Modify the zapi vrf label message to use MPLS_LABEL_NONE as the signal to remove label associated with a vrf. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* lib, sharpd, zebra: Add new enum for lsp type and pass it through.Donald Sharp2018-02-091-1/+2
| | | | | | | | | | | | | 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>
* *: Make code use a consisten definition of labelsDonald Sharp2018-02-091-31/+29
| | | | | | | | | | Turns out we had 3 different ways to define labels all of them overlapping with the same meanings. Consolidate to 1. This one choosen is consistent naming wise with what the *bsd and linux kernels use. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge remote-tracking 'frr/master' into SR-RoutingOlivier Dugeon2018-01-301-0/+6
|\
| * lib, zebra: Rename and place appropriately the label stackDonald Sharp2018-01-221-0/+6
| | | | | | | | | | | | Fix and rename the label stack to be better named. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | OSPFD: Update Segment Routing following reviewsOlivier Dugeon2018-01-221-1/+7
| | | | | | | | | | | | | | | | | | - 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-3/+6
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* zapi: add support for routes with multiple labelsRenato Westphal2017-08-231-0/+3
| | | | | | This will be necessary for the Segment Routing feature. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* Revert "*: reindent pt. 2"David Lamparter2017-07-221-1/+1
| | | | | | | | | This reverts commit c14777c6bfd0a446c85243d3a9835054a259c276. clang 5 is not widely available enough for people to indent with. This is particularly problematic when rebasing/adjusting branches. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: reindent pt. 2whitespace / reindent2017-07-171-1/+1
| | | | | | | | w/ clang 5 * reflow comments * struct members go 1 per line * binpack algo was adjusted
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-72/+65
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge branch 'master' into bgpd-ipv4-plus-label-misc3Daniel Walton2017-06-211-0/+4
|\
| * zebra: define default segment routing global block valuesDon Slice2017-06-081-0/+4
| | | | | | | | | | | | | | | | | | Standard define the default SRGB range from 16000 to 23999. This commit defines these default values for frr. Ticket: CM-16737 Signed-off-by: Don Slice <dslice@cumulusnetworks.com> Reviewed-by: CCR-6347
* | bgpd: Install SAFI_LABELED_UNICAST routes in SAFI_UNICAST tableDaniel Walton2017-06-161-2/+7
|/ | | | | | | | | | | | | | | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> - All ipv4 labeled-unicast routes are now installed in the ipv4 unicast table. This allows us to do things like take routes from an ipv4 unicast peer, allocate a label for them and TX them to a ipv4 labeled-unicast peer. We can do the opposite where we take routes from a labeled-unicast peer, remove the label and advertise them to an ipv4 unicast peer. - Multipath over a labeled route and non-labeled route is not allowed. - You cannot activate a peer for both 'ipv4 unicast' and 'ipv4 labeled-unicast' - The 'tag' variable was overloaded for zebra's route tag feature as well as the mpls label. I added a 'mpls_label_t mpls' variable to avoid this. This is much cleaner but resulted in touching a lot of code.
* *: 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>
* bgpd, lib, zebra: Implement handling of BGP-Prefix-SID label IndexVivek Venkatraman2017-04-061-0/+5
| | | | | | | | | | | | | | | | 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>
* zebra: labeled unicast handlingDon Slice2017-04-061-1/+2
| | | | | | | | | 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>
* Implement generic label managerßingen2017-03-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Label Manager allows to share MPLS label space among different daemons. Each daemon can request a chunk of consecutive labels and release it if it doesn't need them anymore. Label Manager stores the daemon protocol and instance to identify the owner client. It uses them to perform garbage collection, releasing all label chunks from a client when it gets disconnected or reconnected. Additionally, every client can request that the chunk is never garbage collected. In that case client has the responsibility to release non-used labels. Zebra can host the label manager itself (if no -l param is provided) or connect to an external one using zserv/zclient (providing its address with -l param). Client code is in lib/zclient.c, but currently only LDP is using it. TODO: Allow for custom ranges requests, i.e., specify the start label besides the chunk. TODO: Release labels from LDP. Signed-off-by: Bingen Eguzkitza <bingen@voltanet.io>
* lib: fix remaining coverity issuesDavid Lamparter2017-02-101-32/+13
| | | | | Reported-by: Coverity Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* mpls: add support for LDP LSPsRenato Westphal2016-09-231-0/+9
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* ldpd: adapt the code for QuaggaRenato Westphal2016-09-231-0/+9
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* Quagga: Basic definitions for MPLSvivek2016-09-231-0/+172
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Ticket: CM-4804, ... Reviewed By: CCR-3083 Testing Done: Not relevant