summaryrefslogtreecommitdiffstats
path: root/tools (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 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>
| * | tools/tarsource.sh: deal with AC_INIT []David Lamparter2019-02-191-0/+2
| | | | | | | | | | | | | | | | | | configure.ac got cleaned up, now there's [] around the version number. Signed-off-by: David Lamparter <equinox@diac24.net>
| * | tools/tarsource.sh: support FRR as a git submoduleDavid Lamparter2019-02-191-1/+1
| | | | | | | | | | | | | | | | | | | | | a git submodule will have .git as a file instead of a directory... which breaks tarsource.sh. Signed-off-by: David Lamparter <equinox@diac24.net>
| * | tools: don't watch nonexistent daemonsDavid Lamparter2019-02-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | If we try to monitor a nonexisting daemon in watchfrr, it will (currently) forever wait at startup since the vty connection will never come up. Just drop the daemon from the daemon list in such a case. Signed-off-by: David Lamparter <equinox@diac24.net>
| * | tools/tarsource.sh: keep version info on non-gitDavid Lamparter2019-02-191-0/+3
| | | | | | | | | | | | | | | | | | extraver won't have any useful value on a non-git run. Signed-off-by: David Lamparter <equinox@diac24.net>
| * | tools: update build-debian-package.shDavid Lamparter2019-02-191-28/+15
| | | | | | | | | | | | Signed-off-by: David Lamparter <equinox@diac24.net>
| * | tools/tarsource.sh: fix GZIP_ENVDavid Lamparter2019-02-191-1/+1
| | | | | | | | | | | | | | | | | | Some older versions of Automake don't escape this properly. Signed-off-by: David Lamparter <equinox@diac24.net>
| * | debian: cleanly split off from dist tarballDavid Lamparter2019-02-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The debian/ directory is distributed separately for tarballs in 3.0 (quilt) format. Including it in the dist tarball causes problems with automake when the separately distributed debian directory is unpacked on top of the dist tarball; the clean and correct thing to do here is to not include the debian/ directory in dist tarballs. Users have two choices for building FRR Debian packages: - build straight off git - build from a "frr.tar" + "frr-debian.tar" The tarsource.sh tool does the right thing when invoked with the -D ("Debian") option. Signed-off-by: David Lamparter <equinox@diac24.net>
| * | tools/tarsource.sh: create debian changelogDavid Lamparter2019-02-191-0/+3
| | | | | | | | | | | | Signed-off-by: David Lamparter <equinox@diac24.net>
| * | debian: make package "official"David Lamparter2019-02-191-13/+12
| | | | | | | | | | | | | | | | | | Move us into place in debian/ Signed-off-by: David Lamparter <equinox@diac24.net>
| * | tools: add new tarsource.sh helperDavid Lamparter2019-02-191-0/+324
| |/ | | | | | | | | | | | | | | | | | | | | It cleans your house and cooks dinner. Or maybe it creates a clean dist tarball for you, plus a Debian .dsc if you have dpkg installed - and GPG-signs the result appropriately if requested. In any case the resulting tarball should be distributed for our releases. Signed-off-by: David Lamparter <equinox@diac24.net>
* / tools: fix new init script wrt. multi-instanceDavid Lamparter2019-02-191-5/+8
|/ | | | | | | | | | | | TBH when I looked at watchfrr I didn't see any MI support and hence assumed this just didn't work to begin with. However, it actually does (transparently to watchfrr, by just using "ospfd-1" as daemon name.) So, fix this up and make it work again. (Also remove 2 extraneous \n in messages.) Signed-off-by: David Lamparter <equinox@diac24.net>
* libs, rip, isis: change northbound operation enum to DESTROYMark Stapp2019-02-111-1/+1
| | | | | | | | Change the northbound lib operation from DELETE to DESTROY; make the required changes in the users of the northbound, in the cli, rip, ripng, and isis. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* Merge pull request #3715 from qlyoung/fix-systemd-depsDavid Lamparter2019-02-111-2/+4
|\ | | | | tools: fix systemd dependency graph
| * tools: fix systemd dependency graphQuentin Young2019-02-061-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently our systemd dependencies look something like this (example from vanilla Debian 9): $ systemctl list-dependencies frr frr.service ● ├─system.slice ● └─sysinit.target ... $ systemctl list-dependencies --reverse frr frr.service ● └─network-online.target ● └─apt-daily.service Note that sysinit.target does not depend on any network* service or target. In other words, unless there is a service that requires network-online.service, even if FRR is enabled it will not be started. Therefore network-online.target is the wrong unit to have in WantedBy=, as it is not always started. This patch updates our service file so that it is properly started by the system when enabled, delayed until networking is up, and if possible delayed until after NetworkManager, systemd-networkd or any other networking configuration manager has finished performing its tasks - i.e. after network-online.target. After these changes our new dependency graph looks like this: $ systemctl list-dependencies frr frr.service ● ├─system.slice ● │ └─networking.service ● ├─network.target ● └─sysinit.target ... $ systemctl list-dependencies --reverse frr frr.service ● └─multi-user.target ● └─graphical.target This way, FRR will be started by multi-user.target (just like most applications), but delayed until after networking has been configured. In the same stroke, this should also fix issues on systems that do not provide "networking.service" (such as CentOS 7). Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com> Signed-off-by: David Lamparter <equinox@diac24.net>