freebsd-dev/lib
Alexander V. Chernikov a666325282 Introduce nexthop objects and new routing KPI.
This is the foundational change for the routing subsytem rearchitecture.
 More details and goals are available in https://reviews.freebsd.org/D24141 .

This patch introduces concept of nexthop objects and new nexthop-based
 routing KPI.

Nexthops are objects, containing all necessary information for performing
 the packet output decision. Output interface, mtu, flags, gw address goes
 there. For most of the cases, these objects will serve the same role as
 the struct rtentry is currently serving.
Typically there will be low tens of such objects for the router even with
 multiple BGP full-views, as these objects will be shared between routing
 entries. This allows to store more information in the nexthop.

New KPI:

struct nhop_object *fib4_lookup(uint32_t fibnum, struct in_addr dst,
  uint32_t scopeid, uint32_t flags, uint32_t flowid);
struct nhop_object *fib6_lookup(uint32_t fibnum, const struct in6_addr *dst6,
  uint32_t scopeid, uint32_t flags, uint32_t flowid);

These 2 function are intended to replace all all flavours of
 <in_|in6_>rtalloc[1]<_ign><_fib>, mpath functions  and the previous
 fib[46]-generation functions.

Upon successful lookup, they return nexthop object which is guaranteed to
 exist within current NET_EPOCH. If longer lifetime is desired, one can
 specify NHR_REF as a flag and get a referenced version of the nexthop.
 Reference semantic closely resembles rtentry one, allowing sed-style conversion.

Additionally, another 2 functions are introduced to support uRPF functionality
 inside variety of our firewalls. Their primary goal is to hide the multipath
 implementation details inside the routing subsystem, greatly simplifying
 firewalls implementation:

int fib4_lookup_urpf(uint32_t fibnum, struct in_addr dst, uint32_t scopeid,
  uint32_t flags, const struct ifnet *src_if);
int fib6_lookup_urpf(uint32_t fibnum, const struct in6_addr *dst6, uint32_t scopeid,
  uint32_t flags, const struct ifnet *src_if);

All functions have a separate scopeid argument, paving way to eliminating IPv6 scope
 embedding and allowing to support IPv4 link-locals in the future.

Structure changes:
 * rtentry gets new 'rt_nhop' pointer, slightly growing the overall size.
 * rib_head gets new 'rnh_preadd' callback pointer, slightly growing overall sz.

Old KPI:
During the transition state old and new KPI will coexists. As there are another 4-5
 decent-sized conversion patches, it will probably take a couple of weeks.
To support both KPIs, fields not required by the new KPI (most of rtentry) has to be
 kept, resulting in the temporary size increase.
Once conversion is finished, rtentry will notably shrink.

More details:
* architectural overview: https://reviews.freebsd.org/D24141
* list of the next changes: https://reviews.freebsd.org/D24232

Reviewed by:	ae,glebius(initial version)
Differential Revision:	https://reviews.freebsd.org/D24232
2020-04-12 14:30:00 +00:00
..
atf Update Makefile.depend files 2019-12-11 17:37:53 +00:00
clang llvm: add a build knob for enabling assertions 2020-04-06 01:27:17 +00:00
csu Remove -mlong-calls vhen building arm libraries and llvm. 2020-03-10 06:49:43 +00:00
geom Document geli(8) loader variables conventions 2020-03-19 09:23:26 +00:00
googletest Another round of attempting to squelch -Wdeprecated-declarations, which 2019-09-17 06:07:08 +00:00
kyua Install expected kyua docs. 2020-03-26 17:34:17 +00:00
lib80211 Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libalias Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libarchive MFV r358511,r358532: 2020-03-02 08:44:58 +00:00
libauditd pkgbase: Create a FreeBSD-utilities package and make it the default one 2019-09-05 14:15:47 +00:00
libbe Drop "All Rights Reserved" from all libbe/bectl files 2020-01-24 02:18:09 +00:00
libbearssl Add libbearssl 2019-02-26 05:59:22 +00:00
libbegemot Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libblacklist Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libblocksruntime Move all sources from the llvm project into contrib/llvm-project. 2019-12-20 19:53:05 +00:00
libbluetooth Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libbsdstat Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libbsm Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libbsnmp Merge release 1.14 of bsnmp. 2020-04-01 15:25:16 +00:00
libbz2 Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libc Introduce nexthop objects and new routing KPI. 2020-04-12 14:30:00 +00:00
libc_nonshared
libc++ Remove -mlong-calls vhen building arm libraries and llvm. 2020-03-10 06:49:43 +00:00
libc++experimental Move all sources from the llvm project into contrib/llvm-project. 2019-12-20 19:53:05 +00:00
libcalendar Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libcam Remove unused cam ccb flags 2020-03-10 23:58:41 +00:00
libcapsicum capsicum_helpers: split stream cap bits out of caph_limit_stream() 2020-01-02 23:07:45 +00:00
libcasper libcasper(3): Export functions to C++ 2020-04-07 16:40:41 +00:00
libclang_rt Update build glue for libclang_rt. 2020-01-27 20:46:26 +00:00
libcom_err Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libcompat ftime appeared in 7th Edition Unix to replace gtime. 2018-10-28 02:58:15 +00:00
libcompiler_rt Merge ^/head r357662 through r357854. 2020-02-13 12:52:24 +00:00
libcrypt Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libcuse Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libcxxrt Revert r353140: Re-add ALLOW_MIPS_SHARED_TEXTREL, sprinkle it around 2020-01-14 17:50:13 +00:00
libdevctl Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libdevdctl libdevdctl: g++9 avoid Wdeprecated-copy 2019-12-21 02:44:26 +00:00
libdevinfo Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libdevstat Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libdl Add libdl to clibs package 2018-03-29 19:43:29 +00:00
libdpv Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libdwarf Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libedit Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libefivar Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libelf Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libelftc Update ELF Tool Chain to upstream r3769 2019-12-05 13:20:15 +00:00
libevent Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libexecinfo Move all sources from the llvm project into contrib/llvm-project. 2019-12-20 19:53:05 +00:00
libexpat Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libfetch fetch(3): plug some leaks 2020-02-21 18:21:57 +00:00
libfigpar Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libgcc_eh Revert r353140: Re-add ALLOW_MIPS_SHARED_TEXTREL, sprinkle it around 2020-01-14 17:50:13 +00:00
libgcc_s Fix LLVM libunwnwind _Unwind_Backtrace symbol version for ARM. 2019-12-16 14:08:49 +00:00
libgeom Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libgpio Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libgssapi Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libiconv_modules libiconv: correct undefined behavior. 2018-07-08 23:22:04 +00:00
libifconfig wlandebug: Add include path for libifconfig as it is a internallib 2020-03-25 01:31:26 +00:00
libipsec Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libipt Update Intel Processor Trace decoder library. 2019-10-10 12:46:34 +00:00
libjail libjail: Handle an error from reallocarray() when trimming the buffer. 2020-01-07 21:44:27 +00:00
libkiconv pkgbase: Put a lot of binaries and lib in FreeBSD-runtime 2019-09-05 14:13:08 +00:00
libkvm Remove swblk_t. 2020-02-17 15:11:07 +00:00
libldns Update Makefile.depend files 2019-12-11 17:37:53 +00:00
liblua Add an internal liblua and use it in flua. 2020-03-17 17:28:12 +00:00
liblutok Add liblutok a lightweight C++ API for lua. 2020-03-23 18:26:23 +00:00
liblzma MFV r359197: xz 5.2.5. 2020-03-22 01:27:38 +00:00
libmagic MFV r357712: file 5.38. 2020-02-11 07:02:48 +00:00
libmd ANSIfy and KNF function arg definitions in libmd/md4.c 2020-04-03 20:56:43 +00:00
libmemstat Use per-domain locks for the bucket cache. 2020-02-19 18:48:46 +00:00
libmilter Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libmp Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libmt Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libnetbsd Make timespecadd(3) and friends public 2018-07-30 15:46:40 +00:00
libnetgraph Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libngatm Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libnv Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libomp Update build glue for libomp. 2020-01-27 18:04:28 +00:00
libopenbsd Allow bootstrapping libopenbsd on Linux 2018-12-05 10:58:02 +00:00
libopencsd Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libopie Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libpam pkgbase: Move telnetd and ftpd pam file to the utilities package 2020-03-24 01:08:06 +00:00
libpathconv
libpcap MFV r353141 (by phillip): 2019-12-21 21:01:03 +00:00
libpe
libpjdlog pkgbase: Create a FreeBSD-utilities package and make it the default one 2019-09-05 14:15:47 +00:00
libpmc Update x86 counters 2020-04-03 22:36:22 +00:00
libpmcstat pmc: Add include path for libpmcstat as it is an internallib 2020-03-25 01:32:16 +00:00
libproc Temporarily skip 2 failing tests after llvm10 import 2020-03-11 12:43:54 +00:00
libprocstat fd: use smr for managing struct pwd 2020-03-08 00:23:36 +00:00
libradius libradius: Rip out dubious use of srandomdev(3)+random(3) 2019-12-13 04:55:17 +00:00
libregex Further normalize copyright notices 2019-09-26 16:19:22 +00:00
librpcsec_gss
librpcsvc Update Makefile.depend files 2019-12-11 17:37:53 +00:00
librss Update Makefile.depend files 2019-12-11 17:37:53 +00:00
librt pkgbase: Create a FreeBSD-utilities package and make it the default one 2019-09-05 14:15:47 +00:00
librtld_db Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libsbuf Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libsdp Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libsecureboot Improve interaction of vectx and tftp 2020-04-07 16:56:34 +00:00
libsm
libsmb Move nsmb.conf to lib/libsmb/ 2018-09-20 09:31:27 +00:00
libsmdb
libsmutil
libsqlite3 Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libssp libssp: don't compile with -fstack-protector* 2020-03-14 15:15:27 +00:00
libssp_nonshared Provide libssp based on libc 2020-01-04 20:19:25 +00:00
libstats Make use of the stats(3) framework in the TCP stack. 2019-12-02 20:58:04 +00:00
libstdbuf
libstdthreads Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libsysdecode Retire procfs-based process debugging. 2020-04-01 19:22:09 +00:00
libtacplus libtacplus: Remove bogus srandomdev+random 2019-12-13 05:11:34 +00:00
libtelnet
libthr Remove libthr, csu, libthread_db and testfloat sparc64 specific directories. 2020-02-27 04:44:58 +00:00
libthread_db Remove libthr, csu, libthread_db and testfloat sparc64 specific directories. 2020-02-27 04:44:58 +00:00
libucl Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libufs Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libugidfw Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libulog Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libunbound Unbound's config.h is manually maintained, using a ./configure produced 2020-01-13 06:55:31 +00:00
libusb Fix for building libusb under Linux. 2020-03-10 15:59:20 +00:00
libusbhid Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libutil login.conf(5): split MAIL env var out into a "mail" capability 2020-02-05 04:17:14 +00:00
libveriexec Do not claim libbearssl et al are INTERNALLIB 2020-04-01 05:45:12 +00:00
libvgl Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libvmmapi Forgotten to remove the previous if statement in commit r355838. 2019-12-17 01:37:02 +00:00
libwrap Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libxo Import libxo-1.4.0: 2020-01-25 21:16:45 +00:00
liby liby: rewrite yyerror.h 2018-06-17 18:05:27 +00:00
libypclnt Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libz Update Makefile.depend files 2019-12-11 17:37:53 +00:00
libzstd Update Makefile.depend files 2019-12-11 17:37:53 +00:00
msun Fix typo 2020-04-04 07:43:47 +00:00
ncurses ncurses: bump shlib number to version 9 2020-02-20 09:12:07 +00:00
ofed Update Makefile.depend files 2019-12-11 17:37:53 +00:00
tests
Makefile Import the kyua test framework. 2020-03-23 19:01:23 +00:00
Makefile.inc