Commit graph

73 commits

Author SHA1 Message Date
Mark Stapp e49a2f9a53 eigrpd: clean up variable-shadow warnings
Clean up various warnings from -Wshadow in eigrp.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2025-04-08 14:41:27 -04:00
Donald Sharp 694fb7f48f eigrpd: Fix possible use after free in nbr deletion
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>
2025-03-27 11:28:58 -04:00
Donald Sharp cb34559d7f eigrpd: Convert the eiflist to a typesafe hash
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>
2025-03-24 11:36:13 -04:00
Donald Sharp 8249c046d7 eigrpd: Convert the nbrs list to a typesafe hash
Convert the ei->nbrs list to a typesafe hash to
facilitate quick lookups.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-03-24 11:36:13 -04:00
Donald Sharp 24a58196dd *: Convert event.h to frrevent.h
We should probably prevent any type of namespace collision
with something else.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24 08:32:17 -04:00
Donald Sharp cb37cb336a *: Rename thread.[ch] to event.[ch]
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>
2023-03-24 08:32:16 -04:00
David Lamparter acddc0ed3c *: auto-convert to SPDX License IDs
Done with a combination of regex'ing and banging my head against a wall.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-09 14:09:11 +01:00
David Lamparter 89cb86aeb0 build, vtysh: extract vtysh commands from .xref
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>
2022-10-26 17:12:34 +01:00
Donald Sharp 6fd04fda31 eigrpd: vrf variable name hides a parameter of the same name
vrf is a char * being passed in.  Rename the vrf to be something
else.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-16 16:31:35 -04:00
Donnie Savage dc4accdd53 eigrpd: Rename nexthop_entry and prefix_entry to better names
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>
2021-01-12 07:45:48 -05:00
Donald Sharp 37b4b3cc34 eigrpd: Replace inet_ntoa with %pI4
Search and destroy the inet_ntoa usage in eigrp

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-10-21 18:55:09 -04:00
Donald Sharp fb41c4f32d eigrpd: make show ip eigrp vrf all neighbor work correctly
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-08-31 14:42:09 -04:00
Donald Sharp b1d26a4003 eigrpd: Make show ip eigrp vrf all interfaces work correctly
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-08-31 14:41:32 -04:00
Donald Sharp 10b3a32521 eigrpd: Fix show ip eigrp vrf all topology to actually work
Fix multiple forms of this command to behave appropriately
when `vrf all` is specified.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-08-31 08:46:17 -04:00
Donald Sharp cae06ae04a eigrpd: Convert cli to be able to use [vrf NAME]
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>
2019-08-06 22:47:03 -03:00
Donald Sharp e944996140 eigrpd: Add router eigrp AS [vrf NAME] and various stuff
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>
2019-08-06 22:41:05 -03:00
Donald Sharp daa64bdf49 eigrpd: Use the eigrp->vrf_id where we can immediately transform
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>
2019-08-06 21:26:23 -03:00
Rafael Zalamena f25c244b75 eigrpd: migrate old CLI to northbound
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>
2019-08-03 14:52:45 -03:00
Rafael Zalamena 5b768c945e yang/eigrp: change active-time timer to seconds
Based on feedback.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-07-09 10:16:24 -03:00
Igor Ryzhov db68438337 eigrpd: fix invalid command definitions
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2019-06-07 16:21:17 +03:00
Quentin Young 9f2d035447 *: remove useless return variables
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-25 23:00:16 +00:00
Donald Sharp 051da24eef eigrpd: Correctly handle the ref-count in a couple of spots
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>
2019-02-11 07:19:14 -05:00
Donald Sharp 1313365236 eigrpd: Allow A.B.C.D and A.B.C.D/M for topology specification
Allow eigrp to display interesting topo information to the
end user.

Fixes: #3705
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-03 17:45:08 -05:00
Donald Sharp b0534a8920 eigrpd: Abstract display of an individual entry
Abstract the individual display of a entry in the eigrp
topology table.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-03 17:45:08 -05:00
Donald Sharp 95fc2ae791 eigrpd: Modify from int to boolean for display
Track based upon boolean instead of an int

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-03 17:45:08 -05:00
Renato Westphal d52fa66f0e
Merge pull request #3543 from donaldsharp/eigrp_router_id_is_the_bee
Eigrp router id cleanup
2019-01-01 22:39:03 -02:00
Donald Sharp aa0af4243b eigrpd: Allow eigrp to set/unset the router-id as a value.
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>
2018-12-30 19:59:52 -05:00
Donald Sharp 900e2d42cf eigrpd: eigrp usage of uint32_t to struct in_addr for router_id data
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>
2018-12-30 19:55:50 -05:00
Donald Sharp e7c0d8c234 eigrpd: Write eigrp config even if no network statements yet
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>
2018-12-30 19:44:27 -05:00
Philippe Guibert 03a38493f8 lib, rip, ripng, babel, eigrp: add ctx pointer to distribute api
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>
2018-12-28 18:18:40 +01:00
Donald Sharp 984e5e52c7 eigrpd: Fix bandwidth command to actually read input properly
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>
2018-10-24 19:58:14 -04:00
Donald Sharp 085fc3446d eigrpd: Convert keychain authentication to DEFPY
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>
2018-10-24 19:54:04 -04:00
dturlupov 1a5cad2e9a eigrp: opnional metric in 'no redistribute'
Signed-off-by: Dmitrii Turlupov <dturlupov@factor-rs.ru>
2018-09-06 06:14:51 -04:00
Quentin Young d7c0a89a3a
*: use C99 standard fixed-width integer types
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>
2018-03-27 15:13:34 -04:00
Lou Berger 996c93142d *: conform with COMMUNITY.md formatting rules, via 'make indent'
Signed-off-by: Lou Berger <lberger@labn.net>
2018-03-06 14:04:32 -05:00
Renato Westphal cbb65f5ef5 *: fix coverity warnings - error handling issues
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>
2017-10-24 19:30:30 -02:00
Renato Westphal efd7904eab *: add missing \n in some help strings
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-24 19:30:30 -02:00
Donald Sharp 9ca66cc76d eigrpd: Convert topology list to a table
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>
2017-10-24 08:36:15 -04:00
Renato Westphal 451fda4f9a *: use the FOR_ALL_INTERFACES abstraction from babeld
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>
2017-10-10 09:05:46 -03:00
Renato Westphal f4e14fdba7 *: use rb-trees to store interfaces instead of sorted linked-lists
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>
2017-10-10 09:05:02 -03:00
Donald Sharp b748db674a eigrpd: Remove ei mapping to connected routes
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>
2017-10-02 21:24:59 -04:00
David Lamparter 8972cae0fd Merge pull request #1051 from donaldsharp/plists
Refactor Access and Prefix Lists application
2017-09-05 04:41:17 +02:00
Renato Westphal 8941a38520 Merge pull request #1078 from dwalton76/ospfd-network-cmd-warning
*: return CMD_WARNING if command was already configured
2017-08-31 13:23:25 -03:00
Jafar Al-Gharaibeh 959768e8d0 Merge pull request #1044 from donaldsharp/combination
Coverity Cleanup of Stuff
2017-08-31 10:25:55 -05:00
Daniel Walton 851fcbaebe *: return CMD_WARNING if command was already configured
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
2017-08-31 15:14:01 +00:00
David Lamparter a8b828f3c3 *: remove empty "interface XYZ" config blocks
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>
2017-08-29 08:36:03 +02:00
Donald Sharp 255ab9408f eigrpd: eigrp_neighbor_entry to eigrp_nexthop_entry
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>
2017-08-26 19:32:06 -04:00
Donald Sharp cc9b06ad5e eigrpd, ospfd: Cleanup inet_aton return code checking
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-24 20:34:24 -04:00
Donald Sharp cd6c066eb3 eigrpd: Refactor eigrp_network_[un]set to use prefix
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-08-24 08:09:03 -04:00
Renato Westphal 493c8ac787 eigrpd: minor fix in the redistribute command
Commands like "redistribute stati" and "redistribute osp" were being
silently ignored.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-07-26 11:51:00 -03:00