Commit Graph

487 Commits

Author SHA1 Message Date
David Lamparter
2537f690c3 tools/gcc-plugins: add small test for frr-format
Just enough to check that it works.

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-03-29 10:45:46 +02:00
David Lamparter
7ff9120698 tools/gcc-plugins: frr-format
This provides the first reasonably-working version of the frr-format GCC
plugin.  I've only tested it with gcc 9.3.0.

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-03-29 10:45:46 +02:00
David Lamparter
37f0e5fecc tools/gcc-plugins: cut c-format.c to size
... remove everything we don't need (or can't use because GCC doesn't
export all of its internal classes & stuff.)

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-03-29 10:45:46 +02:00
David Lamparter
891eac5990 tools/gcc-plugins: import c-format from GCC
(and gcc-common.h from the Linux kernel)

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-03-29 10:45:46 +02:00
Donatas Abraitis
09fdbbe98c tools: Convert type int functions to bool where possible
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-03-21 14:58:21 +02:00
Donatas Abraitis
d1fc0cdf06 tools: Move scripts/coccinelle to tools/coccinelle
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-03-10 11:41:09 +02:00
Martin Winter
276c4809d8 tools: Update generate_support_bundle.py to support Python 3
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2020-01-25 00:43:20 +01:00
Don Slice
6024e562c9 tools: improve frr-reload delete performance for some commands
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
2020-01-16 11:57:56 +00:00
David Lamparter
ba7eb55ec6 tools: symalyzer
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-14 12:41:19 +01:00
David Lamparter
3fa139a65b tools/frr-reload.py: remove stderr redirects
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>
2019-12-06 15:13:32 +01:00
David Lamparter
684959068c build: apply DFLT_NAME/profiles in init script
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>
2019-12-06 15:13:32 +01:00
Quentin Young
db6e0503a6 tools: [ [ is not valid test syntax
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-12-05 12:57:45 -05:00
Quentin Young
1d92edb209
Merge pull request #5224 from manuhalo/fix_frr_reload_paths
Fixes and extensions to frr_reload.py
2019-11-19 17:12:38 -05:00
Don Slice
deb2d4019e tools: resolve issue with bfd timer change fix in frr-reload.py
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>
2019-11-19 13:40:23 +00:00
Don Slice
c32ab5cfef tools: stop repeating lines to delete for multiple bfd timer changes
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>
2019-11-13 15:19:36 +00:00
Emanuele Di Pascale
609ac8dd49 tools, vtysh: improved fix for ldpd ifaces
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>
2019-11-12 15:36:15 +01:00
Jafar Al-Gharaibeh
e8e4d6ec03 tools: generate .changes file required for deb pkg upload
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2019-11-01 11:30:26 -05:00
Renato Westphal
f5f0a0e302 tools: update the northbound callbacks generator
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>
2019-10-30 10:32:51 -03:00
Emanuele Di Pascale
ccef6e47a3 tools, vtysh: fix ldpd + frr-reload.py
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>
2019-10-29 10:32:38 +01:00
Emanuele Di Pascale
d9730542a9 tools: frr-reload.py for single daemon
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>
2019-10-29 10:32:38 +01:00
Emanuele Di Pascale
1a11d9cd1e tools: non hardcoded paths in frr-reload
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>
2019-10-29 10:32:38 +01:00
Sri Mohana Singamsetty
8fc80fbd4c tools: Adding new commands to the list of support bundle commands
Signed-off-by: Sri Mohana Singamsetty <msingamsetty@vmware.com>
2019-09-13 10:05:57 -07:00
Sri Mohana Singamsetty
11c83aa48a tools: Modifications to copy support bundle files
This commit is to copy the support bundle scripts to appropriate directories during installation

Signed-off-by: Sri Mohana Singamsetty <msingamsetty@vmware.com>
2019-09-13 10:05:13 -07:00
David Lamparter
0cf6db21ec *: frr_elevate_privs -> frr_with_privs
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-09-03 17:18:35 +02:00
David Lamparter
ba28659f1c tools: extend checkpatch.pl for frr_{with,each}
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>
2019-09-03 17:15:17 +02:00
David Lamparter
00dffa8cde lib: add frr_with_mutex() block-wrapper
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>
2019-09-03 17:15:17 +02:00
David Lamparter
fefa5e0ff5 *: fix ctype (isalpha & co.) casts
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>
2019-08-06 16:54:52 +02:00
Donald Sharp
64f598fd28
Merge pull request #4754 from opensourcerouting/gen-northbound-improvements
tools: improve gen_northbound_callbacks
2019-07-31 14:28:45 -04:00
Rafael Zalamena
c681616f87 tools: generate code that handles all cases
Help developers to start implementing northbound with more complete
callbacks.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-07-30 15:39:34 -03:00
Rafael Zalamena
13080468b0 tools: generate northbound code without warnings
Use the alternate struct instantiation that does not generates warning
on old compilers.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-07-29 19:28:59 -03:00
Rafael Zalamena
88292d6959 tools: allow YANG model path specification
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>
2019-07-29 18:59:20 -03:00
Rafael Zalamena
55c8666a92 frr-reload.py: fix reload with different settings
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>
2019-07-23 18:20:22 -03:00
David Lamparter
b9a0d38d53 tools: add vim snippet
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-12 19:35:43 +02:00
David Lamparter
9c251d376a tools: retain sanity when reloading under systemd
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>
2019-06-10 19:21:43 +02:00
Donald Sharp
9ee2f5741d tools: On shutdown no need to flush from tools/frr.in script
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>
2019-05-31 21:49:17 -04:00
Donald Sharp
610b53283b doc, tools: Update to code to show example MAX_FDS
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>
2019-05-24 08:24:18 -04:00
Quentin Young
1f1896fc6e tools: add vrrpd to frrcommon.sh
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17 16:26:26 +00:00
Quentin Young
f9d31f6f6c tools: fix vrrp autoconfigure reload
Ticket: CM-24375
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17 00:27:08 +00:00
Quentin Young
97b5f22bcd vrrpd: update auto*, init scripts, etc
Add vrrpd to all the usual places daemons need to go

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17 00:27:08 +00:00
Quentin Young
d8b87afe7c lib: hashing functions should take const arguments
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>
2019-05-14 21:23:08 +00:00
Quentin Young
5307949e8f tools: add lints for unsafe functions
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-08 15:55:54 +00:00
Don Slice
ee951352d1 tools: frr-reload.py stop bouncing peers on bfd timer change
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>
2019-04-25 10:54:54 -07:00
Christian Franke
a55578f631 tools/frr.in: Only attempt to load daemons.conf if present
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
2019-03-26 10:33:45 +01:00
Donald Sharp
08d4711684
Merge pull request #3989 from opensourcerouting/redhat-new-init
redhat: switch to new init script
2019-03-25 07:45:04 -04:00
David Lamparter
b7862d93ae tools/frrcommon.sh: ignore 'declare' failures
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>
2019-03-24 15:53:43 +01:00
Donald Sharp
0384e5da0b
Merge pull request #3839 from srimohans/support_bundle
FRR: Python script to generate support bundle for FRR
2019-03-22 04:03:45 -04:00
Ruben Kerkhof
33b397711b tools: fix two typos in daemons file
Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2019-03-21 14:50:53 +01:00
David Lamparter
d3b05897ed
Merge pull request #3869 from qlyoung/cocci-fixes
Assorted Coccinelle fixes
2019-03-06 15:54:44 +01:00
Russ White
3f77bcdbe0
Merge pull request #3872 from dslicenc/frr-reload-vrf-context
tools: keep exit-vrf to change context correctly between vrfs
2019-02-27 11:16:38 -05:00
Quentin Young
25af5f0d79 tools: add coccinelle spatches
Add some Coccinelle semantic patches we can use to automatically
refactor code in the future.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-26 17:40:40 +00:00
Don Slice
06ad470d7c tools: keep exit-vrf to change context correctly between vrfs
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>
2019-02-26 14:23:53 +00:00
Don Slice
348135a5da tools: fix blackhole static changes in frr-reload.py
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>
2019-02-26 14:08:27 +00:00
Donald Sharp
5fa3430885
Merge pull request #3836 from opensourcerouting/debian/master-kill-backports
[master] debian packaging
2019-02-23 18:23:21 -05:00
Sri Mohana Singamsetty
e60eb780e4 FRR: Python script to generate support bundle for FRR
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>
2019-02-20 11:56:22 -08:00
David Lamparter
195f215cfc tools: fix new init script wrt. multi-instance
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>
2019-02-19 21:38:23 +01:00
David Lamparter
3ec9556728 watchfrr: build in defaults for -r/-s/-k
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>
2019-02-19 21:34:31 +01:00
David Lamparter
1bc91be4b8 tools/tarsource.sh: deal with AC_INIT []
configure.ac got cleaned up, now there's [] around the version number.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:34:08 +01:00
David Lamparter
4734c22a4f tools/tarsource.sh: support FRR as a git submodule
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>
2019-02-19 21:34:08 +01:00
David Lamparter
380fe10b16 tools: don't watch nonexistent daemons
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>
2019-02-19 21:34:08 +01:00
David Lamparter
6b37587791 tools/tarsource.sh: keep version info on non-git
extraver won't have any useful value on a non-git run.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:34:06 +01:00
David Lamparter
3e662ed3f1 tools: update build-debian-package.sh
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:34:06 +01:00
David Lamparter
3f406e3f8e tools/tarsource.sh: fix GZIP_ENV
Some older versions of Automake don't escape this properly.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:32:19 +01:00
David Lamparter
74afa5e686 debian: cleanly split off from dist tarball
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>
2019-02-19 21:31:18 +01:00
David Lamparter
081253fcd5 tools/tarsource.sh: create debian changelog
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:31:18 +01:00
David Lamparter
b3c4c164b5 debian: make package "official"
Move us into place in debian/

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-19 21:30:54 +01:00
David Lamparter
e14560a7e6 tools: add new tarsource.sh helper
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>
2019-02-19 21:30:50 +01:00
Mark Stapp
95ce849b58 libs, rip, isis: change northbound operation enum to DESTROY
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>
2019-02-11 15:49:49 -02:00
David Lamparter
0240fee6f4
Merge pull request #3715 from qlyoung/fix-systemd-deps
tools: fix systemd dependency graph
2019-02-11 07:50:16 +01:00
Quentin Young
efbf903d61 tools: fix systemd dependency graph
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>
2019-02-06 19:47:43 +00:00
David Lamparter
fdbd8086b1 build: fix a whole bunch of *FLAGS
- some target_CFLAGS that needed to include AM_CFLAGS didn't do so
- libyang/sysrepo/sqlite3/confd CFLAGS + LIBS weren't used at all
- consistently use $(FOO_CFLAGS) instead of @FOO_CFLAGS@
- 2 dependencies were missing for clippy

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-01-30 19:13:51 +01:00
Ruben Kerkhof
4d762f2607 Treewide: use ANSI function definitions
Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2019-01-24 11:21:59 +01:00
Donald Sharp
38a5232499
Merge pull request #3507 from opensourcerouting/master-init-fixes
[master] minor tools/ fixes
2018-12-18 19:21:39 -05:00
David Lamparter
1515026516 tools/frrcommon.sh: always start staticd
"derp."

Since zebra is always started, the same should hold for staticd.

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-12-18 01:26:12 +01:00
David Lamparter
b7d492f295 tools/frrcommon.sh: actually create /run/frr
tmpfiles.d is nice and all, but we can't rely on it.  Just create
/run/frr if needed.

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-12-18 01:26:12 +01:00
David Lamparter
829d32552b tools/etc: remove cumulus user from vtysh.conf
This is a Cumulus-specific default which we shouldn't have in git.

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-12-18 01:26:12 +01:00
David Lamparter
9210eecc7d tools: add documentation URL on frr.service
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-12-18 01:26:12 +01:00
Don Slice
2a2b64e487 tools: stop frr-reload.py from trying to delete the vrf context
Problem seen when removing last config item under the vrf context,
where frr-reload.py tries instead to delete the vrf context itself.
Since that is not permitted on an active vrf, the command errors
out and nothing is deleted.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-12-14 13:11:05 +00:00
Renato Westphal
225c06b581 tools: update checkpatch to stop suggesting the use of kstrto()
kstrto() is a kernel-specific function so this suggestion doesn't
make sense for FRR.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-12-09 13:59:19 -02:00
David Lamparter
9c830772cd *: get rid of most daemons.conf references
There's a few left over to get compatibility and not break user
installs, but most is gone.

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-12-06 23:05:48 +01:00
David Lamparter
ea4d91bfba debian/tools: new init script
This separates the init script used for the system (and called in the
systemd unit file) from the script that watchfrr uses to control
daemons.  Mixing these two caused the entire thing to become a rather
huge spaghetti mess.

Note that there is a behaviour change in that the new script always
starts zebra regardless of zebra_enable.

Side changes:
- Ubuntu 12.04 removed from backports since it doesn't work anyway
- zebra is always started regardless of zebra_enable.  To disable FRR,
  the entire init script should be disabled through policy.
- no-watchfrr operation is no longer supported by the scripts in the
  Debian packages.  (This is intentional.)

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-12-06 23:05:48 +01:00
David Lamparter
10ea85ee45 tools/frr: get rid of the bash array and "bB"
With a little shell-fu, this can actually be escaped properly.

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-12-06 17:29:27 +01:00
Renato Westphal
1a4bc045de lib, tests: major rework in the operational-data callbacks
The northbound infrastructure for operational data was subpar compared
to the infrastructure for configuration data. This commit addresses most
of the existing problems, making it possible to write operational-data
callbacks for more complex YANG models.

Summary of the changes:
* Add support for nested YANG lists.
* Add support for leaf-lists.
* Add support for leafs of type "empty".
* Introduce the "show yang operational-data XPATH" command, and write an
  unit test for it. The main purpose of this command is to make it
  easier to test the operational-data northbound callbacks.
* Introduce the nb_oper_data_iterate() function, that can be used
  to iterate over operational data. Make the CLI and sysrepo use this
  function.
* Since ConfD has a very peculiar API, it can't reuse the
  nb_oper_data_iterate() like the other northbound clients. In this
  case, adapt the existing ConfD callbacks to support the new features
  (and make some performance improvements in the process).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-11-26 18:28:53 -02:00
Renato Westphal
544ca69a5c lib: add support for YANG lists with mixed config and state data
A YANG list that contains both configuration and state data must have
the following callbacks: create(), delete(), get_next(), get_keys()
and lookup_entry().

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-11-26 17:38:08 -02:00
Renato Westphal
e0ccfad220 lib: rework the yang schema node iteration functions
* Rename yang_snodes_iterate() to yang_snodes_iterate_subtree() and
  expose it in the public API.
* Rename yang_module_snodes_iterate() to yang_snodes_iterate_module().
* Rename yang_all_snodes_iterate() to yang_snodes_iterate_all().
* Make it possible to stop the iteration at any time by returning
  YANG_ITER_STOP in the iteration callbacks.
* Make the iteration callbacks accept only one user argument and not
  two.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-11-26 17:38:08 -02:00
Renato Westphal
db452508bf lib, tools: use CHECK_FLAG/SET_FLAG more often in the northbound code
Cosmetic change to improve code readability a bit. No binary changes.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-11-26 17:35:58 -02:00
Quentin Young
11b5117007 tools: add non-32 bit atomic warning to checkpatch
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-11-19 19:03:45 +00:00
Sri Mohana Singamsetty
179b8a0bde watchfrr: Echo statements are blocking the execution of frr script
1) Certain echo statements present in the script before/after SSD process
restart are causing the FRR script to hang. This is breaking the frr script
functionality for start/stop/restart. Removed such echo statements.

Tests:
1. Multiple start, stop, restart
2. Multiple restarts/kill of same process.

Signed-off-by: Sri Mohana Singamsetty <msingamsetty@vmware.com>
2018-11-06 09:50:40 -08:00
Sri Mohana Singamsetty
eae8bbce91 watchfrr: replace /usr/sbin/service frr with /usr/lib/frr/frr script
Need to use /usr/lib/frr/frr script for start/stop/restart of FRR. /usr/sbin/service frr command is not working as expected.

Signed-off-by: Sri Mohana Singamsetty <msingamsetty@vmware.com>
2018-11-06 09:46:06 -08:00
Renato Westphal
12d35cedf5 tools: update checkpatch to allow indented labels
clang-format always indent labels by default and that can't be changed
with any configuration option. Also, indented labels tend to improve
code readability, especially in long functions.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-10-27 16:16:12 -02:00
Renato Westphal
1c2facd12d lib: introduce new northbound API
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-10-27 16:16:12 -02:00
Lou Berger
75082dafb5
Merge pull request #3235 from opensourcerouting/buildfoo-20181024
build: potpourri
2018-10-27 14:14:35 -04:00
David Lamparter
0437e10517 *: spelchek
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-10-25 20:10:57 +02:00
David Lamparter
67cf020d17 build: make clean and dist consistent
We weren't cleaning up some files (a whole lot of python foobar) and had
some files in the dist tarball that don't quite belong there.

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-10-24 18:35:15 +02:00
Christian Franke
bf8e16b5de debianpkg, tools: Add fabricd to distribution scripts
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-10-24 15:50:56 +02:00
Quentin Young
25e87a8fdc tools: reindent frr
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-10-15 15:45:36 +00:00
Quentin Young
78230371e9
Merge pull request #3098 from opensourcerouting/watchfrr-delay
tools/frr + watchfrr spring cleaning (southern hemisphere)
2018-10-04 15:04:56 -04:00
Martin Winter
ad6707b564
Merge pull request #3108 from dmbaturin/master
Add a script for building a Debian package in one step.
2018-10-02 16:58:12 +02:00
David Lamparter
442fc69786 tools/frr: remove "watchfrr.started" hack
This is no longer neccessary since start-stop-daemon will block until
watchfrr's launch parent has exited.

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-10-02 12:27:51 +02:00
Daniil Baturin
836ad9fb4e tools: add a script for building a Debian package in one step.
The script simplifies the relatively lengthy procedure.
It should be invoked from the top level source directory, for example:
./tools/build-debian-package.sh

Signed-off-by: Daniil Baturin <daniil@baturin.org>
2018-10-01 20:44:01 +02:00
Lou Berger
38893614e5
Merge pull request #3107 from opensourcerouting/fix/tools-gitignore
tools: Update .gitignore
2018-10-01 06:43:58 -04:00
Martin Winter
10f8da2bb4
Merge pull request #3074 from jpmondet/master
frr-reload.py: Python3 compatibility
2018-10-01 12:40:11 +02:00
David Lamparter
cffcc5f75d
Merge pull request #3034 from donaldsharp/LUA
Add initial thoughts on having lua act as a replacement for route-maps
2018-10-01 12:39:51 +02:00
Christian Franke
5b80430c3b tools: Update .gitignore
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-09-28 20:34:29 +02:00
Donald Sharp
1d7c7ace3c bgpd: Add lua match command
Please note this is a Proof of Concept and not actually something
that is ready to commit at this point.  The file tools/lua.scr
contains some documentation on how we expect it to work currently.
Additionally not all bgp values have been hooked up into the
ability to lua script yet.

There is still significant work to be done here:

1) Add the ability to pass in more data and to adjust the return values
as appropriate.

To set it up:

1) copy tools/lua.scr into /etc/frr (or whereever the config
directory is )

2) Create a route-map match command:
!
router bgp 55
 neighbor 10.50.11.116 remote-as external
 !
 address-family ipv4 unicast
  neighbor 10.50.11.116 route-map TEST in
 exit-address-family
!
route-map TEST permit 10
 match command mooey
!

3) In the lua.scr file make sure that you have a function
named 'mooey' ( as the above example does ):

function mooey ()
   zlog_debug(string.format("Family: %d: %s %d ifindex: %d aspath: %s localpref: %d",
                            prefix.family, prefix.route,
			    nexthop.metric, nexthop.ifindex, nexthop.aspath, nexthop.localpref))

   nexthop.metric =  33
   nexthop.localpref = 13
   return 3
end

This example script modifies the metric and localpref currently.  I've also provided
a zlog_debug function in lua to allow some simple debugging.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-26 21:21:23 -04:00
David Lamparter
40da52d8c1 tools/frr: use path settings from ./configure
...so we properly locate config files and daemons whereever the user
decided to put them.

Signed-Off-By: David Lamparter <equinox@diac24.net>
2018-09-27 02:06:14 +02:00
jpmondet
1c64265f86
frr-reload.py: Add python2 & python3 compatibility.
Signed-off-by: jpmondet <jp@mondet.org>
2018-09-26 21:45:33 +02:00
Lou Berger
d127c61aeb
Merge pull request #3010 from opensourcerouting/no-frr-thread-id
lib: frr_pthread minor simplification
2018-09-22 15:02:09 -04:00
Donald Sharp
a10f94506a
Merge pull request #3058 from pacovn/Coverity_1399484_Dereference_null_return_value
tools: null check (Coverity 1399484)
2018-09-20 13:16:30 -04:00
F. Aragon
b0bde9f33d
tools: return check (Coverity 1399196)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-09-20 16:42:31 +02:00
F. Aragon
3b23c6c379
tools: null check (Coverity 1399484)
Fixed using XCALLOC(MTYPE_TMP, ...) instead of calloc(...) because of the
error handling (XCALLOC checks + log + abort through memory_oom())

Signed-off-by: F. Aragon <paco@voltanet.io>
2018-09-20 16:23:52 +02:00
David Lamparter
c5d580fbc7 tools/checkpatch.pl: recognize _Atomic as modifier
checkpatch is slightly confused by _Atomic, causing some spurious
warnings.

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-09-19 22:05:32 +02:00
David Lamparter
ae9eebcaeb *: fix some solaris warnings
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-09-08 21:30:42 +02:00
David Lamparter
b45ac5f5c6 *: fix config.h/zebra.h include order
config.h (or, transitively, zebra.h) must be the first include file
listed for autoconf things like _GNU_SOURCE and _POSIX_C_SOURCE to work
correctly.

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-09-08 21:30:42 +02:00
David Lamparter
e7c25325cc *: cleanup .gitignore files
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-09-08 21:30:42 +02:00
Christian Franke
da82f6b42a zebra: add RTPROT_FABRICD route type 197
Add an iproute2 route type for fabricd

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-09-05 11:38:12 +02:00
David Lamparter
01b9e3fd0d *: use frr_elevate_privs() (1/2: coccinelle)
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-08-14 20:02:05 +00:00
Quentin Young
94cb1f61a4
Merge pull request #2805 from opensourcerouting/malloc-size
lib: track total memory per MTYPE if possible
2018-08-14 11:43:39 -04:00
Donald Sharp
d6853655b5
Merge branch 'master' into bfd-final 2018-08-14 08:16:10 -04:00
David Lamparter
7aea4b8167 tools/checkpatch: fix some bogus macro warnings
checkpatch was throwing an error for "#define FOO , bar"

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-08-10 20:46:35 +02:00
Don Slice
d60f480010 tools: correct frr-reload.py handling of bgp vni/exit-vni config
Problem reported that when a peer-group was added in certain
configurations, it would be rejected because of the order of the
commands put in by nclu. Issued turned out to be how frr-reload.py
was handling the sub-sub-context of the vni under the address-family
and subsequently how it handled the following exit-vni.

Ticket: CM-21996
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-08-10 09:59:24 -07:00
Rafael Zalamena
7134904b1f bfdd: wire to the build process
Add BFD daemon to the build process and packaging instructions.

Currently the bfdd daemon does nothing, this is just to document how the
daemon insertion step occured.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08 18:24:58 -03:00
Martin Winter
09890489cc
Merge pull request #2122 from donaldsharp/zebra_nhs
Create Staticd
2018-08-08 08:07:24 -07:00
Quentin Young
540b2efdf7 tools: improve checkpatch slicing
checkpatch cuts from the diff between the outputs of pre-patch and
post-patch runs of `checkpatch.pl`, but fixed-length greps sometimes
don't cut correctly.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-03 17:25:14 +00:00
Arthur Jones
8b5f787e8e tools/frr: make frr reload error message clearer on missing frr-reload.py
Only frr-reload.py pulls in a python depenedency for frr, we can
reduce the size of the base frr package by a lot if we separate
out frr-pythontools.  When we do this, we get a somewhat cryptic
error message when frr-reload.py is missing on frr reload.

Here, we pull the error message from frr-reload script, which is
much clearer.

Testing done:

frr reload both with and without the frr-reload.py script, see
the frr-reload message when missing and it runs frr-reload.py when
not missing.

Signed-off-by: Arthur Jones <arthur.jones@riverbed.com>
2018-08-01 09:23:55 -07:00
Donald Sharp
7ac1de8ee0 debianpkg, redhat, tools: Fixup startup/build for new daemon
Add code to allow FRR to properly build and handle the staticd
for some of the more common packaging.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-07-29 12:37:25 -04:00
Don Slice
cc27402c4d tools: handle exit-vrf as end of context block
Ticket: CM-21048
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-07-19 18:38:54 +00:00
Quentin Young
7c25948eca
Merge pull request #2505 from pacovn/Coverity_1143220_Argument_cannot_be_negative
tools: return check (2) (Coverity 1143220)
2018-06-21 15:02:31 -04:00
paco
9b606d6c3d
tools: return check (2) (Coverity 1143220)
Previous correction (657f9948ed) was incomplete.

Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-20 21:26:38 +02:00
Donald Sharp
dd52a18493
Merge pull request #2436 from pacovn/Coverity_1143220_Argument_cannot_be_negative
tools: return check (Coverity 1143220)
2018-06-14 10:02:25 -04:00
paco
657f9948ed
tools: return check (Coverity 1143220)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-13 18:07:36 +02:00
paco
e1be9119f8
tools: out-of-bounds access (Coverity 1399290)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-13 16:33:51 +02:00
Quentin Young
e9f272a49e *: disable all sanitizers for clippy build
* Move configure flag propagations out of user flags
* Use AC_SUBST to transfer flag values to Automake
* Set default AM_CFLAGS and AM_CPPFLAGS in common.am and change child
  Makefiles to modify these base variables
* Add flag override to turn off all sanitizers when building clippy
* Remove LSAN suppressions blacklist as it's no longer needed

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-06-08 17:22:13 +00:00
Donald Sharp
d4d71f1133 tools, zebra: Use different protocol value for our statics
The re-use of RTPROT_STATIC has caused too many collisions
where other legitimate route sources are causing us to
believe we are the originator of the route.  Modify
the code so that if another protocol inserts RTPROT_STATIC
we will assume it's a Kernel Route.

Fixes: #2293
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-26 08:46:13 +02:00
Lou Berger
c274a72fb3 *: fix compile with -enable-address-sanitizer configured
Signed-off-by: Lou Berger <lberger@labn.net>
2018-05-14 07:06:36 -04:00
Donald Sharp
31649cb98b redhat, tools: Increase startup time out a bit
We have run across a few cases where the startup timeout is
ocurring on heavily loaded systems.  This is especially true
in simulation environments where the hypervisor load is
extremely high.

Modify the code base to give ourselves more time to startup.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-05-01 23:35:53 -04:00
Donald Sharp
70bf5a07fd tools: Cleanup code to handle sharp and pbr a bit better
The sharp and pbr protocols needed a bit more handling
to be 'right' from a start/stop perspective.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-27 14:59:52 -04:00
Ilya Shipitsin
342d555eb8 tools: more lsan suppressions for clippy
Signed-off-by: Ilya Shipitsin <chipitsine@gmail.com>
2018-04-17 12:30:33 +05:00
Donald Sharp
d4c58fa8f4
Merge pull request #2040 from ajones-rvbd/ajones-issue-2030
alpine packaging: use a more standard packaging format
2018-04-12 10:17:37 -04:00
Lou Berger
0b984829be
Merge pull request #1989 from qlyoung/defpy-hidden
lib, python: DEFPY_ATTR, DEFPY_HIDDEN
2018-04-11 20:12:25 -04:00
Quentin Young
bb7f2da88d
tools: update indent.py for DEFPY_* macros
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-10 12:19:14 -04:00
Arthur Jones
915c81b3ef alpine packaging: use a more standard packaging format
Currently, we just package the frr daemons, but we don't run
them.  This is fine for basic tests, but it is inconvenient to
orchestrate the daemons from downstream test environments.

Here, we follow the redhat and debianpkg formats more closely,
putting the daemons in /usr/lib/frr and including the frr user
and groups in the package.  We also include a docker specific
startup script and a sysvinit link in /etc/init.d/frr for
openrc based alpine installs.

Testing done:

Built packages, built base images, everything seems to work fine.
Uninstalled the package, all the daemons stopped.

Issue: https://github.com/FRRouting/frr/issues/2030
Signed-off-by: Arthur Jones <arthur.jones@riverbed.com>
2018-04-09 15:34:50 -07:00
Donald Sharp
e5c83d9b31 pbrd: Add PBR to FRR
This is an implementation of PBR for FRR.

This implemenation uses a combination of rules and
tables to determine how packets will flow.

PBR introduces a new concept of 'nexthop-groups' to
specify a group of nexthops that will be used for
ecmp.  Nexthop-groups are specified on the cli via:

nexthop-group DONNA
  nexthop 192.168.208.1
  nexthop 192.168.209.1
  nexthop 192.168.210.1
!

PBR sees the nexthop-group and installs these as a default
route with these nexthops starting at table 10000
robot# show pbr nexthop-groups
Nexthop-Group: DONNA Table: 10001 Valid: 1 Installed: 1
	Valid: 1  nexthop 192.168.209.1
	Valid: 1  nexthop 192.168.210.1
	Valid: 1  nexthop 192.168.208.1

I have also introduced the ability to specify a table
in a 'show ip route table XXX' to see the specified tables.

robot# show ip route table 10001
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, P - PIM, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR,
       > - selected route, * - FIB route

F>* 0.0.0.0/0 [0/0] via 192.168.208.1, enp0s8, 00:14:25
  *                 via 192.168.209.1, enp0s9, 00:14:25
  *                 via 192.168.210.1, enp0s10, 00:14:25

PBR tracks PBR-MAPS via the pbr-map command:

!
pbr-map EVA seq 10
  match src-ip 4.3.4.0/24
  set nexthop-group DONNA
!
pbr-map EVA seq 20
  match dst-ip 4.3.5.0/24
  set nexthop-group DONNA
!

pbr-maps can have 'match src-ip <prefix>' and 'match dst-ip <prefix>'
to affect decisions about incoming packets.  Additionally if you
only have one nexthop to use for a pbr-map you do not need
to setup a nexthop-group and can specify 'set nexthop XXXX'.

To apply the pbr-map to an incoming interface you do this:

interface enp0s10
 pbr-policy EVA
!

When a pbr-map is applied to interfaces it can be installed
into the kernel as a rule:

[sharpd@robot frr1]$ ip rule show
0:	from all lookup local
309:	from 4.3.4.0/24 iif enp0s10 lookup 10001
319:	from all to 4.3.5.0/24 iif enp0s10 lookup 10001
1000:	from all lookup [l3mdev-table]
32766:	from all lookup main
32767:	from all lookup default

[sharpd@robot frr1]$ ip route show table 10001
default proto pbr metric 20
	nexthop via 192.168.208.1 dev enp0s8 weight 1
	nexthop via 192.168.209.1 dev enp0s9 weight 1
	nexthop via 192.168.210.1 dev enp0s10 weight 1

The linux kernel now will use the rules and tables to properly
apply these policies.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-06 13:22:43 -04:00
Russ White
5f047032e7
Merge pull request #1984 from donaldsharp/conf_date_master
lib: Remove backwards compatiblity at 1 year
2018-03-30 12:35:53 -04:00
Russ White
a7f38c2512
Merge pull request #1980 from donaldsharp/tools_frr
tools: Cleanup shutdown
2018-03-30 10:36:34 -04:00
Olivier Dugeon
db5bdc694f
Merge pull request #1955 from qlyoung/stylechecker
tools: do not check for kernel macros
2018-03-30 13:21:22 +01:00
Lou Berger
047460795c tools: add fixup-deprecated.py script to replace deprecated quagga/frr mactors/types/etc.
Initial deprecated macros are:
	   #define VNL
	   #define VTYNL
	   #define VTY_NEWLINE
	   #define VTY_GET_INTEGER(desc, v, str)
	   #define VTY_GET_INTEGER_RANGE(desc, v, str, min, max)
	   #define VTY_GET_ULONG(desc, v, str)
	   #define VTY_GET_ULL(desc, v, str)
	   #define VTY_GET_IPV4_ADDRESS(desc, v, str)
	   #define VTY_GET_IPV4_PREFIX(desc, v, str)
	   #define vty_outln(vty, str, ...)

Signed-off-by: Lou Berger <lberger@labn.net>
2018-03-29 18:33:31 -04:00
Donald Sharp
ac654d7b9d tools: Cleanup shutdown
The shutdown code was sometimes taking 1 minute to run because
the ssd program was misbehaving after a make install.

This commit just removes the usage of ssd for shutdown
since we already have a pid file and we know that the
frr script cleans up the pid file as well.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-28 14:52:55 -04:00
Quentin Young
42732e05a9
Merge branch 'master' into stylechecker 2018-03-27 15:21:15 -04:00
Quentin Young
28ac5a0381
tools, doc: update checkpatch for u_int_*
* Checkpatch.pl now checks for nonstandard integral types
* Add shell script to replace all nonstandard types with their standard
  counterparts in C source files
* Document usage of types, mention conversion script

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-27 15:00:23 -04:00
Quentin Young
056d835596
tools: do not check for kernel macros
Certain things checked for by checkpatch.pl are kernel-specific macros
we don't have.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-22 12:11:05 -04:00