freebsd-dev/sys/net/route
Alexander V. Chernikov 0d60e88b41 routing: refactor control cmds #1
This and the follow-up routing-related changes target to remove or
 reduce `struct rt_addrinfo` usage and use recently-landed nhop(9)
 KPI instead.
Traditionally `rt_addrinfo` structure has been used to propagate all necessary
information between the protocol/rtsock and a routing layer. Many
functions inside routing subsystem uses it internally. However, using
this structure became somewhat complicated, as there are too many ways
of specifying a single state and verifying data consistency is hard.
For example, arerouting flgs consistent with mask/gateway sockaddr pointers?
Is mask really a host mask? Are sockaddr "valid" (e.g. properly zeroed, masked,
have proper length)? Are they mutable? Is the suggested interface specified
 by the interface index embedded into the sockadd_dl gateway, or passed
 as RTAX_IFP parameter, or directly provided by rti_ifp or it needs to
 be derived from the ifa?
These (and other similar) questions have to be considered every time when
 a function has `rt_addrinfo` pointer as an argument.

The new approach is to bring more control back to the protocols and
construct the desired routing objects themselves - in the end, it's the
protocol/subsystem who knows the desired outcome.

This specific diff changes the following:
* add explicit basic low-level radix operations:
 add_route() (renamed from add_route_nhop())
 delete_route() (factored from change_route_nhop())
 change_route() (renamed from change_route_nhop)
* remove "info" parameter from change_route_conditional() as a part
 of reducing rt_addrinfo usage in the internal KPIs
* add lookup_prefix_rt() wrapper for doing re-lookups after
 RIB lock/unlock

Differential Revision: https://reviews.freebsd.org/D36070
MFC after:	2 weeks
2022-08-10 18:20:20 +00:00
..
fib_algo.c fib_algo: set vnet when destroying algo instance 2022-08-06 12:51:22 +00:00
fib_algo.h Fib algo: extend KPI by allowing algo to set datapath pointers. 2021-04-18 16:12:12 +01:00
mpath_ctl.c routing: refactor control cmds #1 2022-08-10 18:20:20 +00:00
nhgrp_ctl.c routing: refactor private KPI 2022-08-01 10:02:12 +00:00
nhgrp_var.h Introduce scalable route multipath. 2020-10-03 10:47:17 +00:00
nhgrp.c routing: add nhop(9) kpi. 2022-08-01 08:52:26 +00:00
nhop_ctl.c routing: add nhop(9) kpi. 2022-08-01 08:52:26 +00:00
nhop_utils.c Remove unused nhop_ref_any() function. 2020-09-20 21:32:52 +00:00
nhop_utils.h [multipath][nhops] Fix random crashes with high route churn rate. 2021-08-01 10:07:37 +00:00
nhop_var.h routing: add nhop(9) kpi. 2022-08-01 08:52:26 +00:00
nhop.c routing: remove duplicate error message after 5c23343b8c. 2022-08-04 09:53:58 +00:00
nhop.h routing: add nhop(9) kpi. 2022-08-01 08:52:26 +00:00
route_ctl.c routing: refactor control cmds #1 2022-08-10 18:20:20 +00:00
route_ctl.h routing: refactor private KPI 2022-08-01 10:02:12 +00:00
route_ddb.c ddb: use _FLAGS command macros where appropriate 2022-07-05 11:56:55 -03:00
route_debug.h routing: convert remnants of DPRINTF to FIB_CTL_LOG(). 2022-08-01 08:55:07 +00:00
route_helpers.c route: fix NOIP builds 2022-08-03 21:23:32 +00:00
route_ifaddrs.c Make gcc happy by initializing error in rib_handle_ifaddr_info(). 2021-04-25 08:44:59 +00:00
route_tables.c Introduce and use the NET_EPOCH_DRAIN_CALLBACKS() macro 2022-07-29 21:21:10 +02:00
route_temporal.c routing: move route expiration time to its nexthop 2022-08-01 07:26:53 +00:00
route_var.h routing: refactor control cmds #1 2022-08-10 18:20:20 +00:00