summaryrefslogtreecommitdiff
path: root/zebra/zebra_mpls_vty.c
AgeCommit message (Collapse)Author
2024-05-16zebra: fix mpls commandanlan_cs
Configured with "mpls label bind 1.1.1.1/32 explicit-null", the running configuration is: ``` ! mpls label bind 1.1.1.1/32 IPv4 Explicit Null ! ``` After this commit, the running configuration is: ``` ! mpls label bind 1.1.1.1/32 explicit-null ! ``` And add the support for the "no" form: ``` anlan(config)# mpls label bind 1.1.1.1/32 explicit-null anlan(config)# no mpls label bind 1.1.1.1/32 explicit-null ``` Signed-off-by: anlan_cs <anlan_cs@tom.com>
2024-04-06zebra: fix wrong check for mpls labelanlan_cs
Add a parameter for `zebra_mpls_fec_for_label()`, as before if it is `NULL`, otherwise exclude what this parameter represents. Before: ``` anlan(config)# mpls label bind 1.1.1.2/32 88 anlan(config)# mpls label bind 1.1.1.2/32 88 % Label already bound to a FEC anlan(config)# mpls label bind 1.1.1.3/32 88 % Label already bound to a FEC ``` After: ``` anlan(config)# mpls label bind 1.1.1.2/32 88 anlan(config)# mpls label bind 1.1.1.2/32 88 anlan(config)# mpls label bind 1.1.1.3/32 88 % Label already bound to a FEC ``` Signed-off-by: anlan_cs <anlan_cs@tom.com>
2023-10-18zebra: add 'mpls label dynamic-block' commandPhilippe Guibert
Hardset label values (eg. ISIS Segment-routing label blocks, hardset BGP L3VPN service label) may conflict with label chunks dynamically allocated by zebra. Add an optional 'mpls label dynamic-block' command to let the user define a range that is not in conflict with the hardset values. Restarting control planes is recommended when dynamic label chunks are already allocated. Command is aborted when any hardset label chunks conflict with the dynamic block. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-07-12zebra: remove unnecessary check for default vrfanlan_cs
The default vrf is generally non-NULL, except when shutdown. So, most of the time it is not necessary to check if it is NULL, we should remove the useless checks for it. Searched them with exact match: ``` grep -rI "zebra_vrf_lookup_by_id(VRF_DEFAULT)" | wc -l 31 ``` Signed-off-by: anlan_cs <vic.lan@pica8.com>
2023-03-28zebra: Use zebra_vrf_lookup_by_id when we canDonald Sharp
Let's make this as consistent as is possible. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-02-09*: auto-convert to SPDX License IDsDavid Lamparter
Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-05-11*: Properly use memset() when zeroingDonatas Abraitis
Wrong: memset(&a, 0, sizeof(struct ...)); Good: memset(&a, 0, sizeof(a)); Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2021-08-18zebra: fix wrong check of mpls commandanlan_cs
Maybe with empty nexthop to call zebra_mpls_transit_lsp(): "no mpls lsp (16-1048575)". So just remove this "gate_str" check. If without "gate" in command, "gtype" is set to NEXTHOP_TYPE_BLACKHOLE for subsequent processing. Signed-off-by: anlan_cs <anlan_cs@tom.com>
2021-08-12zebra: mpls validation and static lsp fixesMark Stapp
Handle TYPE_IFINDEX nexthops more consistently in a few places; be more specific about a few integer return values that were being treated as booleans. Signed-off-by: Mark Stapp <mjs.ietf@gmail.com>
2020-04-16*: move CLI node names to cmd_node->nameDavid Lamparter
And again for the name. Why on earth would we centralize this, just so people can forget to update it? Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: remove second parameter on install_node()David Lamparter
There is really no reason to not put this in the cmd_node. And while we're add it, rename from pointless ".func" to ".config_write". [v2: fix forgotten ldpd config_write] Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: remove cmd_node->vtyshDavid Lamparter
The only nodes that have this as 0 don't have a "->func" anyway, so the entire thing is really just pointless. Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16*: clean up cmd_node initializersDavid Lamparter
... and use named assignments everywhere (so I can change the struct.) Signed-off-by: David Lamparter <equinox@diac24.net>
2018-09-04bgpd, ospfd, pimd, zebra: Convert more use_json locations to boolDon Slice
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-07-29zebra: Remove zebra_static.c and .hDonald Sharp
These are no longer needed so remove. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-27*: use C99 standard fixed-width integer typesQuentin Young
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>
2018-02-08*: Make code use a consisten definition of labelsDonald Sharp
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>
2017-07-27zebra: remove redundant DEFUNs for labeled static routesRenato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-07-17*: reindentreindent-master-afterwhitespace / reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-14Merge remote-tracking branch 'frr/master' into newline-reduxDavid Lamparter
Lots of conflicts from CMD_WARNING_CONFIG_FAILED... Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-13vtysh: return non-zero for configuration failuresDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> This allows frr-reload.py (or anything else that scripts via vtysh) to know if the vtysh command worked or hit an error.
2017-07-13*: ditch vty_outln(), part 1 of 2David Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-06-29*: use vty_outlnQuentin Young
Saves 400 lines Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-05-31zebra: define mpls label helpstrQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-05-15*: make consistent & update GPLv2 file headersDavid Lamparter
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>
2017-04-15zebra: Fix whitespace issue with if statementDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-04-15zebra: Allow explicit-null as a label optionDonald Sharp
When entering 'mpls label bind ...' command allow the explicit-null as an option. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-04-06bgpd, zebra: Implement BGP Prefix-SID IETF draftVivek Venkatraman
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>
2017-04-06zebra: labeled unicast handlingDon Slice
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>
2017-04-06zebra: static label bindingDon Slice
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>
2017-02-10*: fix ambiguous commandsDavid Lamparter
Some "show [ip] bgp ipv4 encap ..." commands remaining ambiguous. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-01-30zebra: support static srcdest routesChristian Franke
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2016-12-08zebra: fix segfault on "show mpls table"Renato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-11-29all: Replace "JavaScript Object Notation\n" with JSON_STRQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2016-10-25Merge branch 'cmaster-next' into vtysh-grammarQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com> Conflicts: ospfd/ospf_ri.c zebra/zebra_vty.c
2016-10-25zebra: Disable mpls slightly differentDonald Sharp
When mpls is not turned on in the kernel, we are not installing the mpls commands into the cli. This results in vtysh attempting to run the command and receiving a 'WTF is this command' back from zebra. Modify the mpls code to install commands and to check to see if the command should be accepted based upon mpls working or not. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-10-19*: Fix duplicate commands from view/enable node consolidationPaul Jakma
2016-10-17Merge branch 'cmaster-next' into vtysh-grammarQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com> Conflicts: bgpd/bgp_route.c bgpd/bgp_routemap.c bgpd/bgp_vty.c isisd/isis_redist.c isisd/isis_routemap.c isisd/isis_vty.c isisd/isisd.c lib/command.c lib/distribute.c lib/if.c lib/keychain.c lib/routemap.c lib/routemap.h ospf6d/ospf6_asbr.c ospf6d/ospf6_interface.c ospf6d/ospf6_neighbor.c ospf6d/ospf6_top.c ospf6d/ospf6_zebra.c ospf6d/ospf6d.c ospfd/ospf_routemap.c ospfd/ospf_vty.c ripd/rip_routemap.c ripngd/ripng_routemap.c vtysh/extract.pl.in vtysh/vtysh.c zebra/interface.c zebra/irdp_interface.c zebra/rt_netlink.c zebra/rtadv.c zebra/test_main.c zebra/zebra_routemap.c zebra/zebra_vty.c
2016-10-07*: Consistently support 32-bit route tagsChristian Franke
This patch improves zebra,ripd,ripngd,ospfd and bgpd so that they can make use of 32-bit route tags in the case of zebra,ospf,bgp or 16-bit route-tags in the case of ripd,ripngd. It is based on the following patch: commit d25764028829a3a30cdbabe85f32408a63cccadf Author: Paul Jakma <paul.jakma@hpe.com> Date: Fri Jul 1 14:23:45 2016 +0100 *: Widen width of Zserv routing tag field. But also contains the changes which make this actually useful for all the daemons. Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2016-09-23zebra: check at startup if the kernel supports MPLSRenato Westphal
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>
2016-09-23zebra: add explicit-null option for static MPLS LSPsRenato Westphal
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2016-09-23zebra: install MPLS CLI commands only if MPLS is enabled.Renato Westphal
To keep things simple, zebra's code should be the same whether MPLS is enabled or not. Then, when MPLS is not enabled, we just disable all MPLS CLI commands. This way we don't need to add a lot of #ifdef cruft in zebra's core, improving code readability. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>