summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2021-01-20tools: fix frr-reload BFD profile supportRafael Zalamena
Fix the handling of multiple BFD profiles by adding the appropriated code to push/pop contexts inside BFD configuration node. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-01-13tools: ignore missing seq nums in prefix and access lists in frr-reload.pyDon Slice
If frr.conf contains a prefix-list or access-list without a seq number, frr-reload needs to be aware that it should not delete/add if the running config contains a seq number. Ticket: CM-32623 Signed-off-by: Don Slice <dslice@nvidia.com>
2021-01-13tools: apply black formatting changes to frr-reload.pyDon Slice
Since new workflow instructions state to run black against python change and it found formatting changes required that were not part of my change set, committing those changes separately. Signed-off-by: Don Slice <dslice@nvidia.com>
2021-01-09tools: fix pce-config removalEmanuele Di Pascale
make sure that the order in which the pcep-related commands are removed by frr-reload.py is the correct one, i.e., pce followed by pce-config followed by pcc. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2021-01-09pathd, tools: fix peer preference configEmanuele Di Pascale
on one hand, the default value for a peer preference was always being displayed, and on the other there was some code in frr-reload.py which was attempting to add a default value to match this behavior, and which was incorrectly overriding a specified preference. Fix this by removing this code and making pathd behave like other daemons in this respect, i.e. not displaying the default value. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2021-01-09tools: add bfdd to frr-reload.py daemons listEmanuele Di Pascale
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2021-01-08tools: Cleanup some zebra section of the support bundleDonald Sharp
a) Add some useful commands b) Remove `show error all` this just dumps the error codes. If we know the version we don't need this. Additionally this is rather large. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-08tools: Cleanup bgp commands in the support bundleDonald Sharp
Add some missing commands ( I am sure that there are more useful ones to ) Cleanup to use the modern non-deprecated syntax in case anyone runs across this. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-12-22Merge pull request #7472 from opensourcerouting/fpm-fixesMark Stapp
fpm: frr-reload, IPv6 and an improvement
2020-12-18pathd: Add optional support for PCEP to pathdSebastien Merle
This new dynamic module makes pathd behave as a PCC for dynamic candidate path using the external library pcpelib https://github.com/volta-networks/pceplib . The candidate paths defined as dynamic will trigger computation requests to the configured PCE, and the PCE response will be used to update the policy. It supports multiple PCE. The one with smaller precedence will be elected as the master PCE, and only if the connection repeatedly fails, the PCC will switch to another PCE. Example of configuration: segment-routing traffic-eng pcep pce-config CONF source-address ip 10.10.10.10 sr-draft07 ! pce PCE1 config CONF address ip 1.1.1.1 ! pce PCE2 config CONF address ip 2.2.2.2 ! pcc peer PCE1 precedence 10 peer PCE2 precedence 20 ! ! ! ! Co-authored-by: Brady Johnson <brady@voltanet.io> Co-authored-by: Emanuele Di Pascale <emanuele@voltanet.io> Co-authored-by: GalaxyGorilla <sascha@netdef.org> Co-authored-by: Javier Garcia <javier.garcia@voltanet.io> Co-authored-by: Renato Westphal <renato@opensourcerouting.org> Co-authored-by: Sebastien Merle <sebastien@netdef.org> Signed-off-by: Sebastien Merle <sebastien@netdef.org>
2020-12-18pathd: New SR-TE policy management daemonSebastien Merle
This new daemon manages Segment-Routing Traffic-Engineering (SR-TE) Policies and installs them into zebra. It provides the usual yang support and vtysh commands to define or change SR-TE Policies. In a nutshell SR-TE Policies provide the possibility to steer traffic through a (possibly dynamic) list of Segment Routing segments to the endpoint of the policy. This list of segments is part of a Candidate Path which again belongs to the SR-TE Policy. SR-TE Policies are uniquely identified by their color and endpoint. The color can be used to e.g. match BGP communities on incoming traffic. There can be multiple Candidate Paths for a single policy, the active Candidate Path is chosen according to certain conditions of which the most important is its preference. Candidate Paths can be explicit (fixed list of segments) or dynamic (list of segment comes from e.g. PCEP, see below). Configuration example: segment-routing traffic-eng segment-list SL index 10 mpls label 1111 index 20 mpls label 2222 ! policy color 4 endpoint 10.10.10.4 name POL4 binding-sid 104 candidate-path preference 100 name exp explicit segment-list SL candidate-path preference 200 name dyn dynamic ! ! ! There is an important connection between dynamic Candidate Paths and the overall topic of Path Computation. Later on for pathd a dynamic module will be introduced that is capable of communicating via the PCEP protocol with a PCE (Path Computation Element) which again is capable of calculating paths according to its local TED (Traffic Engineering Database). This dynamic module will be able to inject the mentioned dynamic Candidate Paths into pathd based on calculated paths from a PCE. https://tools.ietf.org/html/draft-ietf-spring-segment-routing-policy-06 Co-authored-by: Sebastien Merle <sebastien@netdef.org> Co-authored-by: Renato Westphal <renato@opensourcerouting.org> Co-authored-by: GalaxyGorilla <sascha@netdef.org> Co-authored-by: Emanuele Di Pascale <emanuele@voltanet.io> Signed-off-by: Sebastien Merle <sebastien@netdef.org>
2020-12-07Merge pull request #7582 from AnuradhaKaruppiah/frr-reload-cleanupRuss White
frr reload fixes for mac and ip normalization
2020-12-03tools: make frr-reload handle fpm commandsRafael Zalamena
Instruct `frr-reload.py` to not use `fpm` commands as configuration node. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-12-01tools: Fix run folder permissionsJavier Garcia
In the case of some linux distros the /var/run dir is mounted with tmpfs so in every reboot it's removed. Then the frrcommon.sh will recreate it without 'x' perm So no pid file cannot be created in /var/run/frr Signed-off-by: Javier Garcia <rampxxxx@gmail.com>
2020-11-21frr-reload: ignore-case in the es-id and es-sys-mac config comparisonsAnuradha Karuppiah
MAC address can be configured as lower/upper hex characters but is always rendered as lower case in "show run". Avoid incorrect "change detection" by ignoring case. Ticket: CM-32235 Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
2020-11-21frr-reload: fixup ipv6 address normalizationAnuradha Karuppiah
The condition to normalize ipv6 addresses was accidentally broken via - [ e238920df07be0b61e483f0a58e0b99ab3d2e0ea tools: Fix reload with 'ipv6 address...' in interface ] The condition was supposed to be skipped only if "ipv6 add" was present in the line. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-11-19Revert "debian: Adjust tarsource.sh to use native debian/changelog"Quentin Young
This reverts commit 4ffb9a4c9ddd0ef3f770c0bc2674c4818331780d.
2020-11-19Revert "debian: Update tools/build-debian-package.sh to use git-buildpackage"Quentin Young
This reverts commit 63c0c8ed89e1564294ff174b819e520d5977f499.
2020-11-19Revert "debian: Remove the changelog-auto automation in favor of dch"Quentin Young
This reverts commit cace1d9bf178d447599fe7caa5ccad9a89babe03.
2020-11-19Revert "debian: Remove now obsolete tarsource.sh script"Quentin Young
This reverts commit bc304e08ea48523b4c70d1d330eaefba3b6b7a6c.
2020-11-19Revert "debian: Update the tools/build-debian-package.sh to be example build ↵Quentin Young
script" This reverts commit c950a7f214cd713652da1b6b78eca9278c33b448.
2020-11-19debian: Update the tools/build-debian-package.sh to be example build scriptOndřej Surý
Signed-off-by: Ondřej Surý <ondrej@sury.org>
2020-11-19debian: Remove now obsolete tarsource.sh scriptOndřej Surý
2020-11-19debian: Remove the changelog-auto automation in favor of dchOndřej Surý
Signed-off-by: Ondřej Surý <ondrej@sury.org>
2020-11-19debian: Update tools/build-debian-package.sh to use git-buildpackageOndřej Surý
Signed-off-by: Ondřej Surý <ondrej@sury.org>
2020-11-19debian: Adjust tarsource.sh to use native debian/changelogOndřej Surý
Signed-off-by: Ondřej Surý <ondrej@sury.org>
2020-11-18tools: fix frr-reload l2vpn deleteEmanuele Di Pascale
when deleting a whole l2vpn context in ldpd which also had pseudowires in it, we were first deleting the l2vpn with a 'no l2vpn XXX' command, and then adding it again by running 'l2vpn XXX\n no member pseudowire YYY' which obviously was not needed. As a result the l2vpn would be reinstated. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2020-11-03tools/gcc-frr-format: fix ICE in gcc-10David Lamparter
gcc-10 has a more strict internal assert for type checks so the plugin currently causes an Internal Compiler Error. Fix. Signed-off-by: David Lamparter <equinox@diac24.net>
2020-10-27Merge pull request #7370 from eololab/add-missing-daemon-in-watchfrr-conf-fileDonald Sharp
tools: add staticd line in daemon config file
2020-10-26tools: add comment on staticd in daemon config fileEmanuele Bovisio
staticd is always started, so no need to specify it explicitly Signed-off-by: Emanuele Bovisio <emanuele.bovisio@eolo.it>
2020-10-23lib: combine two YANG schema iteration functions into oneRenato Westphal
Combine yang_snodes_iterate_module() and yang_snodes_iterate_all() into an unified yang_snodes_iterate() function, where the first "module" parameter is optional. There's no point in having two separate YANG schema iteration functions anymore now that they are too similar. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-10-23tools: add cocci patch for thread cancel api changesMark Stapp
Add Quentin's cocci patch to align code with the changes to the event cancel api. Also added a README to explain what this collection of cocci patches is for. Signed-off-by: Quentin Young <qlyoung@nvidia.com> Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-10-13tools: use function chownfrrEmanuele Bovisio
chownfrr applies correct owner and group Signed-off-by: Emanuele Bovisio <emanuele.bovisio@eolo.it>
2020-10-07*: reformat python fileswhitespace
We are now using black. Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-09-17tools: fix vtysh failure error handlingQuentin Young
Based on the current code, I think the intent was to gracefully handle vtysh failures and print a useful error message. Barriers in the way of that: - Despite reading the results of subprocess.communicate(), there won't be anything there, because we aren't passing subprocess.PIPE as stdin and stderr when calling subprocess.Popen() - Despite catching subprocess.TimeoutExpired, if we were to actually hit this case frr-reload.py would just crash because it's calling .communicate() on an unbound process variable, probably a copy-paste error - Aside from that, building a kwargs dict to pass to a function that contains something if something else is not None and nothing if it is, is pointless when we could just pass the thing itself Net result is that if vtysh fails to read an frr.conf due to syntax errors, instead of crashing with a traceback, we actually handle the error condition, log the problem and vtysh's output, and exit. Actually we were printing the failed line just by chance because stderr wasn't captured from the subprocess and I guess showed up as part of systemd's error capturing or something, but the traceback did a good job of obscuring that with useless noise. Old: frrinit.sh[32183]: * Started watchfrr frrinit.sh[32183]: line 20: % Unknown command: eee frrinit.sh[32183]: Traceback (most recent call last): frrinit.sh[32183]: File "/usr/lib/frr/frr-reload.py", line 1316, in <module> frrinit.sh[32183]: newconf.load_from_file(args.filename) frrinit.sh[32183]: File "/usr/lib/frr/frr-reload.py", line 231, in load_from_file frrinit.sh[32183]: file_output = self.vtysh.mark_file(filename) frrinit.sh[32183]: File "/usr/lib/frr/frr-reload.py", line 146, in mark_file frrinit.sh[32183]: % (child.returncode, stderr)) frrinit.sh[32183]: __main__.VtyshException: vtysh (mark file) exited with status 2: frrinit.sh[32183]: None New: frrinit.sh[30090]: * Started watchfrr frrinit.sh[30090]: vtysh failed to process new configuration: vtysh (mark file) exited with status 2: frrinit.sh[30090]: line 20: % Unknown command: eee Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-08-24lib, tools: fix reloading of key sub-context in key chainsAlexander Chernavin
When you add a key chain in the RIP configuration file and reload the configurations via the frr-reload.py script, the script will fail and the key chain will not appear in the running configuration. The reason is that frr-reload.py doesn't recognize key as a sub-context. Before this change, keys were generated this way: key chain test key 2 key-string 123 key 3 key-string 456 With this change, keys will be generated this way: key chain test key 2 key-string 123 exit key 3 key-string 456 exit This will allow frr-reload.py to see the key sub-context and correctly reload them. Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2020-08-20Merge pull request #6738 from deastoe/frr-reload-log-levelRafael Zalamena
tools: frr-reload: more detailed log level control
2020-08-12Merge pull request #6909 from donaldsharp/weird_dump_commandsSri Mohana Singamsetty
tools: Remove zebra commands that have never existed
2020-08-12tools: Remove zebra commands that have never existedDonald Sharp
The support bundle feature(tm) asks for some data from zebra in the form of a command that has never existed in FRR. Looks like some cruft snuck in remove. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-08-11tools: nb generate callback script to use attrChirag Shah
northbound genrate callback script to use attr->event in case passed in generated callbacks.. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2020-07-29Merge pull request #6732 from opensourcerouting/printfrr-prepQuentin Young
*: preparations for printfrr coccinelle run
2020-07-23tools: do not silently ignore errors when loading config during startupTore Anderson
Drop the `-n` (`--noerror`) flag from the `vtysh -b` invocation called by the init script responsible for starting FRR. This ensures that errors in the configuration file is propagated to the administrator, and prevents a node from entering a production network while running an essentially undefined configuration (a behaviour that I can personally attest to has the potential to cause disastrous network outages - documented in more detail in Cumulus Networks CS#12791). Silently ignoring errors also leads to the rather odd behaviour that starting FRR will ostensibly succeed, while reloading it immediately after - without changing the configuration - will fail. This is due to the fact that the `-n` flag is not used while reloading. The use of the `-n` flag appears to have been introduced without any explanation in commit 858aa29c6862ed2390baee53b6fc9f54e65246e2 by @donaldsharp. Looking at the commit message, I suspect that it was not an intentional change. It seems more likely to me that it was just meant to be used during testing and development, but ended up being committed to master by accident. Ticket:CM-28003 Signed-off-by: Tore Anderson <tore@fud.no>
2020-07-22Merge pull request #6343 from opensourcerouting/watchfrr-n-20200505Quentin Young
watchfrr: add `-N` and `--netns` options
2020-07-22tools: add frr@.serviceDavid Lamparter
... for starting an FRR instance. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-07-22tools/frr-reload.py: support -N pathspaceDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-07-22watchfrr: add (network) namespace supportDavid Lamparter
This adds -N and --netns options to watchfrr, allowing it to start daemons with -N and switching network namespaces respectively. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-07-17tools: fix more frr-reload vrf static errorsDon Slice
Reported that in certain config changes, a static intended for the default table would be duplicated into a vrf context. Determined that we still weren't keeping or adding the exit-vrf command when necessary to keep the contexts straight. Added logic to look for the failing circumstances and add or remove the delete of the exit-vrf command as needed. Signed-off-by: Don Slice <dslice@nvidia.com>
2020-07-17tools/gcc-frr-format: update READMEDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2020-07-17tools/gcc-frr-format: update debian bitsDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2020-07-17tools/gcc-frr-format: improve testDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>