summaryrefslogtreecommitdiff
path: root/ripd
AgeCommit message (Collapse)Author
2023-04-19ripd: support BFD integrationRenato Westphal
Implement RIP peer monitoring with BFD. RFC 5882 Generic Application of Bidirectional Forwarding Detection (BFD), Section 10.3 Interactions with RIP. Co-authored-by: Renato Westphal <renato@opensourcerouting.org> Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2023-04-18ripd: Align show ip rip status output for sourcesDonatas Abraitis
Before: ``` Routing Protocol is "rip" Sending updates every 5 seconds with +/-50%, next due in 0 seconds Timeout after 15 seconds, garbage collect after 10 seconds Outgoing update filter list for all interface is not set Incoming update filter list for all interface is not set Default redistribution metric is 1 Redistributing: Default version control: send version 2, receive any version Interface Send Recv Key-chain r1-eth0 2 1 2 Routing for Networks: 192.168.1.0/24 Routing Information Sources: Gateway BadPackets BadRoutes Distance Last Update 192.168.1.2 0 0 120 00:00:05 192.168.1.3 0 0 120 00:00:04 Distance: (default is 120) ``` After: ``` Routing Protocol is "rip" Sending updates every 5 seconds with +/-50%, next due in 4 seconds Timeout after 15 seconds, garbage collect after 10 seconds Outgoing update filter list for all interface is not set Incoming update filter list for all interface is not set Default redistribution metric is 1 Redistributing: Default version control: send version 2, receive any version Interface Send Recv Key-chain r1-eth0 2 1 2 Routing for Networks: 192.168.1.0/24 Routing Information Sources: Gateway BadPackets BadRoutes Distance Last Update 192.168.1.2 0 0 120 00:00:00 192.168.1.3 0 0 120 00:00:04 Distance: (default is 120) ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-04-18ripd: Create non default passive interface if defined soDonatas Abraitis
Without this patch, it's never get non-passive and even listed under status: Configuration: ``` router rip network 192.168.1.0/24 network 10.10.10.1/32 passive-interface default no passive-interface r2-eth0 timers basic 5 15 10 exit ``` ``` r2# do sh ip rip status Routing Protocol is "rip" Sending updates every 5 seconds with +/-50%, next due in 4 seconds Timeout after 15 seconds, garbage collect after 10 seconds Outgoing update filter list for all interface is not set Incoming update filter list for all interface is not set Default redistribution metric is 1 Redistributing: Default version control: send version 2, receive any version Interface Send Recv Key-chain lo 2 1 2 r2-eth0 2 1 2 Routing for Networks: 10.10.10.1/32 192.168.1.0/24 Passive Interface(s): lo r2-eth0 Routing Information Sources: Gateway BadPackets BadRoutes Distance Last Update 192.168.1.3 0 0 120 00:00:04 Distance: (default is 120) r2# ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-04-12lib: convert if_rmap config output to northboundIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2023-04-11ripd: adapt to new YANG NB if_rmap conversionChristian Hopps
- uses YANG grouping and calls if_rmap library code to implement. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-11Merge pull request #13245 from anlancs/cleanup/ripd-1Donatas Abraitis
ripd: Cosmetic changes for ripd
2023-04-10ripd: Simplify code for distanceanlan_cs
Simplify the code for `rip_distance_apply()`. Signed-off-by: anlan_cs <vic.lan@pica8.com>
2023-04-10ripd: Correct one debug loganlan_cs
Correct one debug log, which wrongly mixed address and port. Before: ``` ripd[469497]: [NDAGH-Z85V7] rip_send_packet 3.3.3.4 > 224.0.0.9 (enp1s0) ripd[469497]: [VEJY5-67P5X] SEND to 224.0.0.9520 ``` After: ``` ripd[471330]: [NDAGH-Z85V7] rip_send_packet 3.3.3.4 > 224.0.0.9 (enp1s0) ripd[471330]: [T8DFR-P09JH] SEND to 224.0.0.9 port 520 ``` Signed-off-by: anlan_cs <vic.lan@pica8.com>
2023-04-07ripd: implement new YANG operational stateChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-07ripd: yang: extend nexthops functionality in YANG model - skeletonChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-03-24*: Fixup formatting issues due to reorderingDonald Sharp
All the event changes exposed a bunch of places where we were not properly following our standards. Just clean them up in one big fell swoop. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert event.h to frrevent.hDonald Sharp
We should probably prevent any type of namespace collision with something else. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert `struct event_master` to `struct event_loop`Donald Sharp
Let's find a better name for it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert THREAD_XXX macros to EVENT_XXX macrosDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert struct thread_master to struct event_master and it's ilkDonald Sharp
Convert the `struct thread_master` to `struct event_master` across the code base. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert thread_timer_remain_XXX to event_timer_remain_XXXDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert thread_add_XXX functions to event_add_XXXDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename `struct thread` to `struct event`Donald Sharp
Effectively a massive search and replace of `struct thread` to `struct event`. Using the term `thread` gives people the thought that this event system is a pthread when it is not Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename thread.[ch] to event.[ch]Donald Sharp
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-02-09*: auto-convert to SPDX License IDsDavid Lamparter
Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-01-31ripd: Add missin enum's to switch statementDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-10-26build, vtysh: extract vtysh commands from .xrefDavid Lamparter
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-12ripd: Cleanup memory allocations on shutdownDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-10-07*: Create and use infrastructure to show debugs in libDonald Sharp
There are lib debugs being set but never show up in `show debug` commands because there was no way to show that they were being used. Add a bit of infrastructure to allow this and then use it for `debug route-map` Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-09-04Merge pull request #11898 from sri-mohan1/sri-rip-dbg1Donatas Abraitis
ripd: changes for code maintainability
2022-09-03ripd: changes for code maintainabilitysri-mohan1
these changes are for improving the code maintainability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2022-08-24ripd: Use a sequence number instead of timeDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-21ripd: Convert thread_cancel to THREAD_OFFDonald Sharp
Just convert all uses of thread_cancel to THREAD_OFF Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-21ripd: Remove various macros that overlap THREAD_OFFDonald Sharp
Let's just use THREAD_OFF consistently in the code base instead of each daemon having a special macro that needs to be looked at and remembered what it does. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-13*: Use autocomplete for route-maps under commands that require itDonatas Abraitis
For example: ``` donatas-laptop# show bgp ipv4 unicast neighbors 127.0.0.2 advertised-routes route-map ? RMAP_NAME Name of the route map testas2 testas donatas-laptop(config)# router bgp donatas-laptop(config-router)# address-family ipv4 donatas-laptop(config-router-af)# redistribute connected route-map ? RMAP_NAME Pointer to route-map entries testas2 testas donatas-laptop(config-router-af)# network 192.168.0.0/23 route-map ? RMAP_NAME Name of the route map testas2 testas ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-05-11*: Properly use memset() when zeroingDonatas Abraitis
Wrong: memset(&a, 0, sizeof(struct ...)); Good: memset(&a, 0, sizeof(a)); Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-05-11ripd: Use correct usage of memcpy() when zeroing structDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-04-19*: Fix spelling of modifedDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-19*: Fix spelling of strucutreDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-02*: Fix spelling of IntefaceDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-02*: Fix spelling of ojbectDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-02*: Fix spelling of wetherDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-23*: Change thread->func to return void instead of intDonald Sharp
The int return value is never used. Modify the code base to just return a void instead. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-22Merge pull request #10593 from donaldsharp/rip_cleanupRuss White
ripd: Cleanup ripd.c indentation levels and comments
2022-02-16ripd: Cleanup ripd.c indentation levels and commentsDonald Sharp
The entirety of this file is heavily indented. Work some coding structure to make it easier to read and understand and not be so heavily indented. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-02-15ripd: Fix packet send for non primary addressesDonald Sharp
When rip is configured to work on secondary addresses on an interface, rip was not properly sending out the packets on secondary addresses because the source of the packet was never properly being setup and rip would send the packet out multiple times for the primary address not once for each address on the interface that is setup to work. tcpdump + rip debugs output with fix: 2022/02/15 19:59:50 RIP: [ZG173-BHW0K] turn on virbr0 2022/02/15 19:59:51 RIP: [PYB7S-80D89] multicast join at virbr0 2022/02/15 19:59:51 RIP: [GZR24-FCQGG] multicast request on virbr0 2022/02/15 19:59:51 RIP: [JTNCV-XD8S1] rip_send_packet 192.168.122.1 > 224.0.0.9 (virbr0) 2022/02/15 19:59:51 RIP: [VEJY5-67P5X] SEND to 224.0.0.9520 2022/02/15 19:59:51 RIP: [JTNCV-XD8S1] rip_send_packet 73.3.3.8 > 224.0.0.9 (virbr0) 2022/02/15 19:59:51 RIP: [VEJY5-67P5X] SEND to 224.0.0.9520 19:59:51.831128 IP 192.168.122.1.route > rip2-routers.mcast.net.route: RIPv2, Request, length: 24 19:59:51.831161 IP c-73-3-3-8.hsd1.mo.comcast.net.route > rip2-routers.mcast.net.route: RIPv2, Request, length: 24 Fixes: #10588 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-12-21*: rework renaming the default VRFIgor Ryzhov
Currently, it is possible to rename the default VRF either by passing `-o` option to zebra or by creating a file in `/var/run/netns` and binding it to `/proc/self/ns/net`. In both cases, only zebra knows about the rename and other daemons learn about it only after they connect to zebra. This is a problem, because daemons may read their config before they connect to zebra. To handle this rename after the config is read, we have some special code in every single daemon, which is not very bad but not desirable in my opinion. But things are getting worse when we need to handle this in northbound layer as we have to manually rewrite the config nodes. This approach is already hacky, but still works as every daemon handles its own NB structures. But it is completely incompatible with the central management daemon architecture we are aiming for, as mgmtd doesn't even have a connection with zebra to learn from it. And it shouldn't have it, because operational state changes should never affect configuration. To solve the problem and simplify the code, I propose to expand the `-o` option to all daemons. By using the startup option, we let daemons know about the rename before they read their configs so we don't need any special code to deal with it. There's an easy way to pass the option to all daemons by using `frr_global_options` variable. Unfortunately, the second way of renaming by creating a file in `/var/run/netns` is incompatible with the new mgmtd architecture. Theoretically, we could force daemons to read their configs only after they connect to zebra, but it means adding even more code to handle a very specific use-case. And anyway this won't work for mgmtd as it doesn't have a connection with zebra. So I had to remove this option. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-11-22*: cleanup ifp->vrf_idIgor Ryzhov
Since f60a1188 we store a pointer to the VRF in the interface structure. There's no need anymore to store a separate vrf_id field. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-11-17*: clean up ifp-by-local-address function(s)David Lamparter
Most users of if_lookup_address_exact only cared about whether the address is any local address. Split that off into a separate function. For the users that actually need the ifp - which I'm about to add a few of - change it to prefer returning interfaces that are UP. (Function name changed due to slight change in behavior re. UP state, to avoid possible bugs from this change.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-13Merge pull request #10032 from opensourcerouting/build-fix-20211111Donald Sharp
build: assorted build system improvements, 2021-11 edition
2021-11-11*: Convert quagga_signal_X to frr_signal_XDonald Sharp
Naming functions/data structures more appropriately for the project we are actually in. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-11-11build: remove some useless intermediate librariesDavid Lamparter
These really serve no purpose other than slowing our build down. If there's a benefit to any of these, they can be readded. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-10-31lib: Add autocomplete for access-listsDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-10-26Merge pull request #9820 from idryzhov/if-nb-configMark Stapp
*: fix interface config write in NB-converted daemons
2021-10-26Merge pull request #9854 from opensourcerouting/zapi-call-tableRuss White
*: convert zclient callbacks to table