Coverity is complaining about use after free's in
clearing eigrp neighbors. Clean the code
up to not have the problem.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
The eigrp->eiflist is a linked list and should just
be a hash instead. The full conversion to a hash
like functionality is goingto wait until the connected
eigrp data structure is created.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This is a first in a series of commits, whose goal is to rename
the thread system in FRR to an event system. There is a continual
problem where people are confusing `struct thread` with a true
pthread. In reality, our entire thread.c is an event system.
In this commit rename the thread.[ch] files to event.[ch].
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Rather than running selected source files through the preprocessor and a
bunch of perl regex'ing to get the list of all DEFUNs, use the data
collected in frr.xref.
This not only eliminates issues we've been having with preprocessor
failures due to nonexistent header files, but is also much faster.
Where extract.pl would take 5s, this now finishes in 0.2s. And since
this is a non-parallelizable build step towards the end of the build
(dependent on a lot of other things being done already), the speedup is
actually noticeable.
Also files containing CLI no longer need to be listed in `vtysh_scan`
since the .xref data covers everything. `#ifndef VTYSH_EXTRACT_PL`
checks are equally obsolete.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Rename struct eigrp_nexthop_entry to struct eigrp_route_descriptor
Rename struct eigrp_prefix_entry to struct eigrp_prefix_descriptor
Fix all the associated function names as well.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: Donnie SAvage <diivious@hotmail.com>
Modify the cli to allow us to specify the [vrf NAME]
and also get rid of the usages of VRF_DEFAULT that we can.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Add the ability to parse `router eigrp AS [vrf NAME]` and
modify eigrp_lookup to actually handle a vrf_id for us.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
For those places where we can immediately transform the usage
of VRF_DEFAULT to eigrp->vrf_id do so.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Move all configuration commands to the new CLI code (`eigrp_cli.c`),
implement the northbound and do all the necessary wiring to get it
working.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
The ref count for the eigrp topology table was incorrect in a couple
of spots. Let's clean it up.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This code addition allows eigrp to set/unset the router-id
value. At this point I am not 100% sure that we do all the necessary
rework when a router-id changes. But on startup if read in before
a network statement we should be ok.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
In eigrp we were using a uint32_t to hold the `struct in_addr` data
for the router id values. This caused us to do unnecessary conversions
pre and post for in/out. Let's just use the standard `struct in_addr`
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Let's write the eigrp config even if we have no network statements
as that the other functions return safely if nothing to do here.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
a distribute_ctx context pointer is returned after initialisation to the
calling daemon. this context pointer will be further used to do
discussion with distribute service. Today, there is no specific problem
with old api, since the pointer is the same in all the memory process.
but the pointer will be different if we have multiple instances. Right
now, this is not the case, but if that happens, that work will be used
for that.
distribute-list initialisation is split in two. the vty initialisation
is done at global level, while the context initialisation is done for
each routing daemon instance.
babel daemon is being equipped with a routing returning the main babel
instance.
also, a delete routine is available when the daemon routing instance is
suppressed.
a list of contexts is used inside distribute_list. This will permit
distribute_list utility to handle in the same daemon to handle more than
one context. This will be very useful in the vrf context.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
The bandwidth command was not properly reading cli input
and would do weird stuff with the input.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The keychain authentication code under eigrp was
using the wrong argv numbers for keychain lookup. Convert
to DEFPY.
I do not actually know if this allows eigrp authentication to
work. But this connects up a bit more of the pieces if it does.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The following types are nonstandard:
- u_char
- u_short
- u_int
- u_long
- u_int8_t
- u_int16_t
- u_int32_t
Replace them with the C99 standard types:
- uint8_t
- unsigned short
- unsigned int
- unsigned long
- uint8_t
- uint16_t
- uint32_t
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Ignore the return value of some functions in the places we know they
can't fail, and other small fixes.
Regarding the change in bgpd/rfapi/rfapi_rib.c, asserting that
rfapiRaddr2Qprefix() didn't fail is the common idiom inside the rfapi
code.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
The EIGRP topology list is an extremely inefficient
way to store data about the known routes. Convert
to using a table.
Signed-off-by: Donald Sharp <sharpd@cumulusnetorks.com>
This improves code readability and also future-proofs our codebase
against new changes in the data structure used to store interfaces.
The FOR_ALL_INTERFACES_ADDRESSES macro was also moved to lib/ but
for now only babeld is using it.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
This is an important optimization for users running FRR on systems with
a large number of interfaces (e.g. thousands of tunnels). Red-black
trees scale much better than sorted linked-lists and also store the
elements in an ordered way (contrary to hash tables).
This is a big patch but the interesting bits are all in lib/if.[ch].
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
We need one struct eigrp_interface per ifp structure
not a ifp->info structure with a ei per connected.
Some minor code cleanup as well with macros and
their weird usage.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
If the user configures some command that is already in the config we
should return CMD_WARNING instead of CMD_WARNING_CONFIG_FAILED
Using the previously-added vty_frame() support, this gets rid of all the
pointless empty "interface XYZ" blocks that get added for any interface
that shows up in the system (e.g. dummys, tunnels, etc.)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
The struct 'eigrp_neighbor_entry' really represents
a nexthop for a prefix. Rename the structure to
better represent what we are representing.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>