From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1921) id 0DD1A385414D; Mon, 11 Jul 2022 11:51:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0DD1A385414D Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Sebastian Huber To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Introduce nexthop objects and new routing KPI. X-Act-Checkin: newlib-cygwin X-Git-Author: Alexander V. Chernikov X-Git-Refname: refs/heads/master X-Git-Oldrev: f3303cf1d5c9fe8236a576fc994052bc7718759a X-Git-Newrev: 86484e84d7be074b540c8e11650bed025692d71f Message-Id: <20220711115134.0DD1A385414D@sourceware.org> Date: Mon, 11 Jul 2022 11:51:34 +0000 (GMT) X-BeenThere: newlib-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib GIT logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2022 11:51:34 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D86484e84d7b= e074b540c8e11650bed025692d71f commit 86484e84d7be074b540c8e11650bed025692d71f Author: Alexander V. Chernikov Date: Sun Apr 12 14:30:00 2020 +0000 Introduce nexthop objects and new routing KPI. =20 This is the foundational change for the routing subsytem rearchitecture. More details and goals are available in https://reviews.freebsd.org/D2= 4141 . =20 This patch introduces concept of nexthop objects and new nexthop-based routing KPI. =20 Nexthops are objects, containing all necessary information for performi= ng the packet output decision. Output interface, mtu, flags, gw address g= oes 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 wi= th multiple BGP full-views, as these objects will be shared between routi= ng entries. This allows to store more information in the nexthop. =20 New KPI: =20 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); =20 These 2 function are intended to replace all all flavours of rtalloc[1]<_ign><_fib>, mpath functions and the previous fib[46]-generation functions. =20 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 c= onversion. =20 Additionally, another 2 functions are introduced to support uRPF functi= onality inside variety of our firewalls. Their primary goal is to hide the mul= tipath implementation details inside the routing subsystem, greatly simplifyi= ng firewalls implementation: =20 int fib4_lookup_urpf(uint32_t fibnum, struct in_addr dst, uint32_t scop= eid, uint32_t flags, const struct ifnet *src_if); int fib6_lookup_urpf(uint32_t fibnum, const struct in6_addr *dst6, uint= 32_t scopeid, uint32_t flags, const struct ifnet *src_if); =20 All functions have a separate scopeid argument, paving way to eliminati= ng IPv6 scope embedding and allowing to support IPv4 link-locals in the future. =20 Structure changes: * rtentry gets new 'rt_nhop' pointer, slightly growing the overall siz= e. * rib_head gets new 'rnh_preadd' callback pointer, slightly growing ov= erall sz. =20 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 wee= ks. To support both KPIs, fields not required by the new KPI (most of rtent= ry) has to be kept, resulting in the temporary size increase. Once conversion is finished, rtentry will notably shrink. =20 More details: * architectural overview: https://reviews.freebsd.org/D24141 * list of the next changes: https://reviews.freebsd.org/D24232 =20 Reviewed by: ae,glebius(initial version) Differential Revision: https://reviews.freebsd.org/D24232 Diff: --- newlib/libc/sys/rtems/include/sys/socket.h | 1 + 1 file changed, 1 insertion(+) diff --git a/newlib/libc/sys/rtems/include/sys/socket.h b/newlib/libc/sys/r= tems/include/sys/socket.h index 30c606389..3431947cf 100644 --- a/newlib/libc/sys/rtems/include/sys/socket.h +++ b/newlib/libc/sys/rtems/include/sys/socket.h @@ -408,6 +408,7 @@ struct sockproto { #define NET_RT_IFMALIST 4 /* return multicast address list */ #define NET_RT_IFLISTL 5 /* Survey interface list, using 'l'en * versions of msghdr structs. */ +#define NET_RT_NHOP 6 /* dump routing nexthops */ #endif /* __BSD_VISIBLE */ =20 /*