summaryrefslogtreecommitdiffstats
path: root/tools (follow)
Commit message (Collapse)AuthorAgeFilesLines
* tools: Move scripts/coccinelle to tools/coccinelleDonatas Abraitis2020-03-1011-0/+157
| | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* tools: Update generate_support_bundle.py to support Python 3Martin Winter2020-01-251-13/+13
| | | | Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
* tools: improve frr-reload delete performance for some commandsDon Slice2020-01-161-0/+28
| | | | | | | | | | | | Problem seen when deleting many static routes or access-lists due to frr-reload.py issuing individual vtysh -c commands for every line. On slow switches, this can take long enough for systemd to time out the reload process and restart frr. This fix uses add logic for static routes, prefix-lists, and access-lists to gang the changes together. Signed-off-by: Don Slice <dslice@cumulusnetworks.com> Ticket: CM-27856
* tools: symalyzerDavid Lamparter2019-12-142-0/+730
| | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* tools/frr-reload.py: remove stderr redirectsDavid Lamparter2019-12-061-4/+4
| | | | | | | | | | | These make no sense. stderr=subprocess.STDOUT means that vtysh's stdout and stderr are combined and returned by check_output. We don't expect errors in that, and we certainly don't log them. Leaving vtysh's stderr as stderr is perfectly fine, it'll be captured for logging just like stderr output from frr-reload.py. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* build: apply DFLT_NAME/profiles in init scriptDavid Lamparter2019-12-063-5/+36
| | | | | | | | | | | | | Hopefully at some point we can get rid of the --enable-datacenter switch and just have the init script do magic. Should already work for Cumulus as it is. NB: the profile name can't be baked into the package. The whole point is to make the package profile-agnostic; in theory at some point the exact same package files should work on both, say, a Cumulus switch and a Linux software BGP DFZ router. Signed-off-by: David Lamparter <equinox@diac24.net>
* tools: [ [ is not valid test syntaxQuentin Young2019-12-051-1/+1
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* Merge pull request #5224 from manuhalo/fix_frr_reload_pathsQuentin Young2019-11-191-26/+74
|\ | | | | Fixes and extensions to frr_reload.py
| * tools, vtysh: improved fix for ldpd ifacesEmanuele Di Pascale2019-11-121-1/+13
| | | | | | | | | | | | | | | | | | instead of suppressing the 'exit' markers at the end of each 'interface XXX' clause in the mpls ldp configuration, mark those with a special marker 'exit-ldp-if' and teach the reload script to correctly recognize the new sub-subcontext Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
| * tools, vtysh: fix ldpd + frr-reload.pyEmanuele Di Pascale2019-10-291-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | frr-reload.py has many special case rules that did not consider ldpd at all. Specifically: 1. The bulk of ldp configuration comes in a big 'mpls ldp' context, which was previously considered a single-line context as it started with 'mpls'. This rule should only apply to labels and lsps. 2. ldp has a 'router-id' config line that fell into the same rule as the above one. It should not be considered a single-line context as more ldp configuration can follow. 3. enabled interfaces should not end their context. A better fix would actually require popping a new context for each interface in case there is any interface-specific config, but at least this fix will address the most common use case. 4. when declaring pseudowires, any line with 'member pseudowire XXX' should be considered a sub-context of the 'l2vpn YYY type ZZZ' context. Without this fix, changes in the first psuedowire declared would not correctly be processed (e.g. removing a 'control-word exclude' line would not be picked up). Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
| * tools: frr-reload.py for single daemonEmanuele Di Pascale2019-10-291-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | allow frr-reload.py to be invoked with a --daemon option to specify an individual daemon for which the configuration diff should be computed. This is useful when integrated config is not used and we want to apply a patch to a single daemon config file. No attempt to integrate this with 'service frr reload' has been done. Making watchfrr work with per-daemon config is outside the scope of this simple patch. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
| * tools: non hardcoded paths in frr-reloadEmanuele Di Pascale2019-10-291-19/+38
| | | | | | | | | | | | | | | | | | allow command line parameters to specify different folder for the vtysh binary, config file location and temporary file. Keep the old hardcoded paths as default values for those options to preserve current functionality. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
* | tools: resolve issue with bfd timer change fix in frr-reload.pyDon Slice2019-11-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | Found that while the previous fix solved the traceback and created the correct configuration, it was doing a delete/add process rather than just an add. This was due to an incorrectly created search string. This commit fixes that search string and testing verifies that the correct thing is now being done. Ticket: CM-27233 Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
* | tools: stop repeating lines to delete for multiple bfd timer changesDon Slice2019-11-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Problem reported with tracebacks seen when making multiple bfd timer changes in frr.conf and applying via frr-reload.py. Found that when multiple bfd timer changes are made, the same line can be added for deletion more than once, causing the traceback when the deletion is performed. This fix verifies the correct line is being appended for deletion. Ticket: CM-27233 Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
* | tools: generate .changes file required for deb pkg uploadJafar Al-Gharaibeh2019-11-011-2/+7
| | | | | | | | Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
* | tools: update the northbound callbacks generatorRenato Westphal2019-10-301-3/+52
|/ | | | | | | | | | | | | | | | | Add a new '-s' option which controls whether the generated northbound callbacks are declared with the 'static' specifier or not. If not (the default), a prototype is generated for each callback before their declarations. It's suggested that daemons shouldn't use the '-s' option so that their northbound callbacks can be implemented in different files according to their class (config, state, rpc or notification). libfrr commands, on the other hand, can use the '-s' option when their associated YANG module is too small and putting all callbacks in the same file is desirable. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* tools: Adding new commands to the list of support bundle commandsSri Mohana Singamsetty2019-09-131-3/+7
| | | | Signed-off-by: Sri Mohana Singamsetty <msingamsetty@vmware.com>
* tools: Modifications to copy support bundle filesSri Mohana Singamsetty2019-09-132-0/+4
| | | | | | This commit is to copy the support bundle scripts to appropriate directories during installation Signed-off-by: Sri Mohana Singamsetty <msingamsetty@vmware.com>
* *: frr_elevate_privs -> frr_with_privsDavid Lamparter2019-09-031-6/+6
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* tools: extend checkpatch.pl for frr_{with,each}David Lamparter2019-09-031-2/+27
| | | | | | | For frr_each, just fix some existing warnings; for frr_with_* add a warning indicating that braces should always be used. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib: add frr_with_mutex() block-wrapperDavid Lamparter2019-09-031-0/+23
| | | | | | | | | frr_with_mutex(...) { ... } locks and automatically unlocks the listed mutex(es) when the block is exited. This adds a bit of safety against forgetting the unlock in error paths & co. and makes the code a slight bit more readable. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: fix ctype (isalpha & co.) castsDavid Lamparter2019-08-062-1/+12
| | | | | | | | | The correct cast for these is (unsigned char), because "char" could be signed and thus have some negative value. isalpha & co. expect an int arg that is positive, i.e. 0-255. So we need to cast to (unsigned char) when calling any of these. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge pull request #4754 from opensourcerouting/gen-northbound-improvementsDonald Sharp2019-07-311-13/+60
|\ | | | | tools: improve gen_northbound_callbacks
| * tools: generate code that handles all casesRafael Zalamena2019-07-301-8/+31
| | | | | | | | | | | | | | Help developers to start implementing northbound with more complete callbacks. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
| * tools: generate northbound code without warningsRafael Zalamena2019-07-301-3/+6
| | | | | | | | | | | | | | Use the alternate struct instantiation that does not generates warning on old compilers. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
| * tools: allow YANG model path specificationRafael Zalamena2019-07-291-2/+23
| | | | | | | | | | | | | | This allows developer to set a temporary YANG model directory path for generating northbound for models not yet installed. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* | frr-reload.py: fix reload with different settingsRafael Zalamena2019-07-231-0/+2
|/ | | | | | | | Add `allow-external-route-update` and `domainname` to the one line context list, otherwise reload will fail when those commands show up in the running configuration. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* tools: add vim snippetDavid Lamparter2019-06-121-0/+36
| | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* tools: retain sanity when reloading under systemdDavid Lamparter2019-06-101-0/+25
| | | | | | | | | Without this, we end up restarting watchfrr with the systemd watchdog non-functional & tripped a bit later. Also, if watchfrr is in the "control" cgroup, systemd 232 will kill it. (241 apparently doesn't. Can't find anything about this in systemd's ChangeLog though.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* tools: On shutdown no need to flush from tools/frr.in scriptDonald Sharp2019-06-011-24/+1
| | | | | | | | | | | Zebra already flushes routes on proper shutdown if you are not using the -K option. If you are using the -K option then you do not want the tools/frr script to flush routes. If zebra crashes and we restart then load up will either delete the routes or leave them depending on the -K option. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* doc, tools: Update to code to show example MAX_FDSDonald Sharp2019-05-241-0/+8
| | | | | | | Place in the code the ability for end operators to know how to modify MAX_FDS so that they can run large scale operations. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* tools: add vrrpd to frrcommon.shQuentin Young2019-05-171-1/+1
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* tools: fix vrrp autoconfigure reloadQuentin Young2019-05-171-1/+2
| | | | | Ticket: CM-24375 Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* vrrpd: update auto*, init scripts, etcQuentin Young2019-05-173-1/+5
| | | | | | Add vrrpd to all the usual places daemons need to go Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* lib: hashing functions should take const argumentsQuentin Young2019-05-141-0/+76
| | | | | | | | | | It doesn't make much sense for a hash function to modify its argument, so const the hash input. BGP does it in a couple places, those cast away the const. Not great but not any worse than it was. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* tools: add lints for unsafe functionsQuentin Young2019-05-081-0/+29
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* tools: frr-reload.py stop bouncing peers on bfd timer changeDon Slice2019-04-251-0/+21
| | | | | | | | | | | Problem reported that if a bgp neighbor had a bfd timer change made in frr.conf and systemctl reload frr performed, the neighbor with the timer changed bounced. If the change is made in vtysh by just adding the new timer values, no peer bounce occurs. This fix skips the delete part of the delete/add process in frr-reload so the peers stay up. Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
* tools/frr.in: Only attempt to load daemons.conf if presentChristian Franke2019-03-261-1/+3
| | | | | | | | | Apparently, the default changed to use `/etc/frr/daemons` instead of `/etc/frr/daemons.conf`. Therefore, we should ignore absence of the latter file, because its absence is not an actuall error but will cause a confusing error message like this: /etc/init.d/frr: line 507: /etc/frr/daemons.conf: No such file or directory
* Merge pull request #3989 from opensourcerouting/redhat-new-initDonald Sharp2019-03-251-1/+1
|\ | | | | redhat: switch to new init script
| * tools/frrcommon.sh: ignore 'declare' failuresDavid Lamparter2019-03-241-1/+1
| | | | | | | | | | | | | | The "declare -p watchfrr_options" call is just to support backwards compatibility. If it fails, silently ignore that. Signed-off-by: David Lamparter <equinox@diac24.net>
* | Merge pull request #3839 from srimohans/support_bundleDonald Sharp2019-03-222-0/+193
|\ \ | | | | | | FRR: Python script to generate support bundle for FRR
| * | FRR: Python script to generate support bundle for FRRSri Mohana Singamsetty2019-02-202-0/+193
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This has a python script that helps in collecting various CLI show command outputs in an automated way. This commit has two files. 1.Text Configuration file: support_bundle_commands.conf - This file has list of CLI show commands to be executed. This file will be in tools/etc/frr/ directory. On executing command "sudo install -m 644 tools/etc/frr/ support_bundle_commands.conf /etc/frr/support_bundle_commands.conf", as part of FRR installation, this file will be copied into /etc/frr directory. 2.Python script file: generate_support_bundle.py - This file has the python code that has the below functionality. * It reads the support_bundle_commands.conf file. For each process present in the conf file, it creates a support_bundle file. For example, it creates bgp_support_bundle.log file for BGP and zebra_support_bundle.log file for Zebra. These files will be created in /var/log/frr/ directory. This is where regular FRR log files are also stored currently. * The script reads the CLI command specified between CLI_START and CLI_END key words for each process. It will execute the commands one by one. * For each such command, the script also appends the current time stamp at which the CLI command is executed. * In case of successful execution of the CLI command, it will copy the CLI output into the above support bundle file. * In case of CLI command failure, it will capture the error thrown and the error is also written into the same file. * A small snippet of the output file is as below. >>[2019-01-02 13:55:23.318987]show bgp summary IPv4 Unicast Summary: BGP router identifier 203.0.113.1, local AS number 65000 vrf-id 0 BGP table version 4 RIB entries 7, using 1176 bytes of memory Peers 1, using 21 KiB of memory Peer groups 1, using 64 bytes of memory Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd 203.0.113.2 4 65001 34 34 0 0 0 00:29:47 2 Total number of neighbors 1 >>[2019-01-02 13:55:23.619953]show ip bgp BGP table version is 4, local router ID is 203.0.113.1, vrf id 0 Status codes: s suppressed, d damped, h history, * valid, > best, = multipath, i internal, r RIB-failure, S Stale, R Removed Signed-off-by: Sri Mohana Singamsetty <msingamsetty@vmware.com>
* | | tools: fix two typos in daemons fileRuben Kerkhof2019-03-211-1/+1
| |/ |/| | | | | Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
* | Merge pull request #3869 from qlyoung/cocci-fixesDavid Lamparter2019-03-0630-0/+2283
|\ \ | | | | | | Assorted Coccinelle fixes
| * | tools: add coccinelle spatchesQuentin Young2019-02-2630-0/+2283
| | | | | | | | | | | | | | | | | | | | | Add some Coccinelle semantic patches we can use to automatically refactor code in the future. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | | Merge pull request #3872 from dslicenc/frr-reload-vrf-contextRuss White2019-02-271-1/+12
|\ \ \ | | | | | | | | tools: keep exit-vrf to change context correctly between vrfs
| * | | tools: keep exit-vrf to change context correctly between vrfsDon Slice2019-02-261-1/+12
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Discovered in testing that if a static route in the default table was entered immediately after a vrf static block, the static route intended for the default table was put in the vrf instead. This fix retains the "exit-vrf" statement which causes the following static routes to appear in the default table correctly. Ticket: CM-23985 Signed-off-by: Don Slice <dslice@cumulusnetwork.com>
* / / tools: fix blackhole static changes in frr-reload.pyDon Slice2019-02-261-4/+2
|/ / | | | | | | | | | | | | | | | | | | Problem caused when nclu is used to create "ip route 1.1.1.0/24 blackhole" because frr-reload.py changed the line to Null0 instead of blackhole. If nclu tries to delete it using the same line as entered, the commit fails since it doesn't match. Ticket: CM-23986 Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
* | Merge pull request #3836 from opensourcerouting/debian/master-kill-backportsDonald Sharp2019-02-246-32/+360
|\ \ | | | | | | [master] debian packaging
| * | watchfrr: build in defaults for -r/-s/-kDavid Lamparter2019-02-194-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | There's no good reason to not have these options default to the installation path of tools/watchfrr.sh. Doing so allows us to ditch watchfrr_options from daemons/daemons.conf completely. Fixes: #3652 Signed-off-by: David Lamparter <equinox@diac24.net>