From: Sergey Matveev Date: Wed, 18 Sep 2024 16:36:21 +0000 (+0300) Subject: Netlinked BIRD skel X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=05728eba1eef1acaefae57f15f1bdb871f44470fc831060d167d498463ec12c6;p=bass.git Netlinked BIRD skel --- diff --git a/build/distfiles/.gitignore b/build/distfiles/.gitignore index 3c535ef..4ae8a8d 100644 --- a/build/distfiles/.gitignore +++ b/build/distfiles/.gitignore @@ -16,6 +16,8 @@ /bash-5.2.21.tar.gz /bfs-3.1.3.tar.zst /bfs.git/ +/bird-2.15.1.tar.gz +/bird-doc-2.15.1.tar.gz /BLAKE2.git/ /boost_1_74_0.tar.bz2 /boost_1_86_0.tar.bz2 diff --git a/build/distfiles/bird-2.15.1.tar.gz.meta4 b/build/distfiles/bird-2.15.1.tar.gz.meta4 new file mode 100644 index 0000000..0a61fb7 --- /dev/null +++ b/build/distfiles/bird-2.15.1.tar.gz.meta4 @@ -0,0 +1,18 @@ + + + + b9d872e117c1916964460fe6c5f2bc743f64baa44c59bdfa6d428a1261288969 + c3fe95ae2b8a3dca036278c8014f3ce2d1fd224c65c10abcc77b2cc1dbdfaa1b5766e8643b873a12ac33f00cd5e866aa7ce853ead78150ec4314b53457ad554a + 3798bae7ebdeae97cc8b5ebd2b85d6b57bcf3b10f3291c61e3b959049774c5b1 + c60a5573e353b7918412b6ddc2701eac82a188c522dbfe95c98d34ac1b3ffe8dd6692ecb58c851877113176d81c4c1d6d68ca933107e02f3d268a17925461874 + b27663682f11a9b9aab364abe4f4b1ae99da13da2f36b46ec80f92028d1806ca + 0222f9e747f02a8d8ebc0bb4412f103b16a8e3ae030a84ba564fe37503eab589bca2ea43fd0a887fcbf627a0321b2f3850a0a6ff8d5fdb7b2da905ef1b7bc965 + 75828ae7c3e574097ba6d7e38dd275ada3b078e215454478f2ed9898f7f8447b149e9ba4f47de05a2b8f4e4959b5ee8d46bee0ef58c79b9cb908a44e12df2842 + 48e85c622de164756c132ea77ad1a8a95cc9fd0137ffd0d882746589ce75c75d + c468ac024354738b65e70ffc971f87ff1a3ca27a716632eaf82e03add2bdd7188326ec05b44b5e9b50f7055d57f56db28d1be2e9f6b723ec18a34504b8d83d7f + a078d78c0d25c6adb4c6a986988295d03a6913ad6f3805bd8059d79d782e7eaf + be59c651eb87e563a9aeae3dcccc81bf + 1409653 + https://bird.network.cz/download/bird-2.15.1.tar.gz + + diff --git a/build/distfiles/bird-doc-2.15.1.tar.gz.meta4 b/build/distfiles/bird-doc-2.15.1.tar.gz.meta4 new file mode 100644 index 0000000..311fb66 --- /dev/null +++ b/build/distfiles/bird-doc-2.15.1.tar.gz.meta4 @@ -0,0 +1,18 @@ + + + + 4c6ae42184a351d76b823d02034bcc69262b29356dbfe5af6560aac80d953e6d + 464623b244cfde5d43dd3fd47364920bb48004466172cf79a5ab0b8a053b580148e113104f4217030f6e0e900919affa8240db93b2ad8ccfc02a7a1d3e0121a6 + f85fb102cc71b39cb29006b7de63ed7f1065e9dac9aafd24d19418705dc640a5 + f01e2c5c3a7c9e8ff7c577859d2273ed709f479cbca21f0f56f1c2cf38290bd3156362039235ef53f892312e0a829be174b71b674fc31fcc262ea4a0b294e5b9 + b44b44343ebd448def849d8801aee1bbd17f5db7801d82fcdcba198f1f99a2d7 + 2e39727dc72716830290e53fdafa04017ab4aff73f7fb9ed1629f003d0c3ab3056ee069186bdfe81b074df14cb1ca4532ad9a2b6bf90d59b22eb9dbd23739a58 + e2496166e20ba020d8a2027e5ca3ca4f51fcd0823a275421b77ae1a6cd16e8e50ae903c7714757397530f9371a20e3c5ab25cde3677548b5be98e21975727d3f + d4cfb6e509b0e3f35220a095d1f7f34137543de4d2fcc9fd793d4f821536dee6 + eef0b1a22518f9c5bed3a0f2fc97d3e7b9f1e9eebfa36c151e8f5a5256f1de4f4aae36b364d54091829aeef24fd65682790837983c2532e8c0224b06ccb0a6ed + 3fae463caa7eb043b556c409d8f3313b66caf2fcca4cf2adc17e92b7058683c1 + 0d82cef48af2d57682bd4c58a53fa450 + 986111 + https://bird.network.cz/download/bird-doc-2.15.1.tar.gz + + diff --git a/build/skel/net/bird-2.15.1.do b/build/skel/net/bird-2.15.1.do new file mode 100644 index 0000000..d9152f7 --- /dev/null +++ b/build/skel/net/bird-2.15.1.do @@ -0,0 +1,27 @@ +[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../../.. +sname=$1.do . "$BASS_ROOT"/lib/rc +. "$BASS_ROOT"/build/skel/common.rc + +bdeps="rc-paths stow archivers/zstd devel/pkgconf-2.1.1 devel/gmake-4.4.1" +ver=${NAME#curl-with-tls-} +redo-ifchange $bdeps "$DISTFILES"/$NAME.tar.gz +hsh=$("$BASS_ROOT"/build/bin/cksum $BASS_REV $SPATH) +. "$BASS_ROOT"/build/lib/create-tmp-for-build.rc +"$BASS_ROOT"/build/bin/pkg-inst $bdeps +. ./rc +$TAR xf "$DISTFILES"/$NAME.tar.gz +"$BASS_ROOT"/bin/rm-r "$SKELBINS"/$ARCH/$NAME-$hsh + +cd $NAME +patch <"$BASS_ROOT"/build/skel/net/bird-bsd-netlink-sys.h.patch >&2 +patch <"$BASS_ROOT"/build/skel/net/bird-bsd-netlink-route.h.patch >&2 +./configure --prefix="$SKELBINS"/$ARCH/$NAME-$hsh \ + --with-sysconfig=bsd-netlink \ + --with-protocols="aggregator bfd babel bgp l3vpn mrt ospf perf pipe radv static" \ + >&2 +gmake -j$MAKE_JOBS >&2 +mkdir -p "$SKELBINS"/$ARCH/$NAME-$hsh/bin +mv bird birdc "$SKELBINS"/$ARCH/$NAME-$hsh/bin + +cd "$SKELBINS"/$ARCH +"$BASS_ROOT"/build/lib/mk-pkg $NAME-$hsh diff --git a/build/skel/net/bird-bsd-netlink-route.h.patch b/build/skel/net/bird-bsd-netlink-route.h.patch new file mode 100644 index 0000000..0e40951 --- /dev/null +++ b/build/skel/net/bird-bsd-netlink-route.h.patch @@ -0,0 +1,370 @@ +--- /dev/null 2024-03-22 15:39:07.538356000 +0100 ++++ sysdep/bsd-netlink/netlink-route.h 2024-03-22 15:39:02.226088000 +0100 +@@ -0,0 +1,367 @@ ++/*- ++ * SPDX-License-Identifier: BSD-2-Clause ++ * ++ * Copyright (c) 2022 Alexander V. Chernikov ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ */ ++ ++/* ++ * Route-related (RTM_ROUTE) message header and attributes. ++ */ ++ ++#ifndef _NETLINK_ROUTE_ROUTE_H_ ++#define _NETLINK_ROUTE_ROUTE_H_ ++ ++/* Base header for all of the relevant messages */ ++struct rtmsg { ++ unsigned char rtm_family; /* address family */ ++ unsigned char rtm_dst_len; /* Prefix length */ ++ unsigned char rtm_src_len; /* Source prefix length (not used) */ ++ unsigned char rtm_tos; /* Type of service (not used) */ ++ unsigned char rtm_table; /* rtable id */ ++ unsigned char rtm_protocol; /* Routing protocol id (RTPROT_) */ ++ unsigned char rtm_scope; /* Route distance (RT_SCOPE_) */ ++ unsigned char rtm_type; /* Route type (RTN_) */ ++ unsigned rtm_flags; /* Route flags (RTM_F_) */ ++}; ++ ++/* ++ * RFC 3549, 3.1.1, route type (rtm_type field). ++ */ ++enum { ++ RTN_UNSPEC, ++ RTN_UNICAST, /* Unicast route */ ++ RTN_LOCAL, /* Accept locally (not supported) */ ++ RTN_BROADCAST, /* Accept locally as broadcast, send as broadcast */ ++ RTN_ANYCAST, /* Accept locally as broadcast, but send as unicast */ ++ RTN_MULTICAST, /* Multicast route */ ++ RTN_BLACKHOLE, /* Drop traffic towards destination */ ++ RTN_UNREACHABLE, /* Destination is unreachable */ ++ RTN_PROHIBIT, /* Administratively prohibited */ ++ RTN_THROW, /* Not in this table (not supported) */ ++ RTN_NAT, /* Translate this address (not supported) */ ++ RTN_XRESOLVE, /* Use external resolver (not supported) */ ++ __RTN_MAX, ++}; ++#define RTN_MAX (__RTN_MAX - 1) ++ ++/* ++ * RFC 3549, 3.1.1, protocol (Identifies what/who added the route). ++ * Values larger than RTPROT_STATIC(4) are not interpreted by the ++ * kernel, they are just for user information. ++ */ ++#define RTPROT_UNSPEC 0 ++#define RTPROT_REDIRECT 1 /* Route installed by ICMP redirect */ ++#define RTPROT_KERNEL 2 /* Route installed by kernel */ ++#define RTPROT_BOOT 3 /* Route installed during boot */ ++#define RTPROT_STATIC 4 /* Route installed by administrator */ ++ ++#define RTPROT_GATED 8 ++#define RTPROT_RA 9 ++#define RTPROT_MRT 1 ++#define RTPROT_ZEBRA 11 ++#define RTPROT_BIRD 12 ++#define RTPROT_DNROUTED 13 ++#define RTPROT_XORP 14 ++#define RTPROT_NTK 15 ++#define RTPROT_DHCP 16 ++#define RTPROT_MROUTED 17 ++#define RTPROT_KEEPALIVED 18 ++#define RTPROT_BABEL 42 ++#define RTPROT_OPENR 99 ++#define RTPROT_BGP 186 ++#define RTPROT_ISIS 187 ++#define RTPROT_OSPF 188 ++#define RTPROT_RIP 189 ++#define RTPROT_EIGRP 192 ++ ++/* ++ * RFC 3549 3.1.1 Route scope (valid distance to destination). ++ * ++ * The values between RT_SCOPE_UNIVERSE(0) and RT_SCOPE_SITE(200) ++ * are available to the user. ++ */ ++enum rt_scope_t { ++ RT_SCOPE_UNIVERSE = 0, ++ /* User defined values */ ++ RT_SCOPE_SITE = 200, ++ RT_SCOPE_LINK = 253, ++ RT_SCOPE_HOST = 254, ++ RT_SCOPE_NOWHERE = 255 ++}; ++ ++/* ++ * RFC 3549 3.1.1 Route flags (rtm_flags). ++ * Is a composition of RTNH_F flags (0x1..0x40 range), RTM_F flags (below) ++ * and per-protocol (IPv4/IPv6) flags. ++ */ ++#define RTM_F_NOTIFY 0x00000100 /* not supported */ ++#define RTM_F_CLONED 0x00000200 /* not supported */ ++#define RTM_F_EQUALIZE 0x00000400 /* not supported */ ++#define RTM_F_PREFIX 0x00000800 /* not supported */ ++#define RTM_F_LOOKUP_TABLE 0x00001000 /* not supported */ ++#define RTM_F_FIB_MATCH 0x00002000 /* not supported */ ++#define RTM_F_OFFLOAD 0x00004000 /* not supported */ ++#define RTM_F_TRAP 0x00008000 /* not supported */ ++#define RTM_F_OFFLOAD_FAILED 0x20000000 /* not supported */ ++ ++/* Compatibility handling helpers */ ++#ifndef _KERNEL ++#define NL_RTM_HDRLEN ((int)sizeof(struct rtmsg)) ++#define RTM_RTA(_rtm) ((struct rtattr *)((char *)(_rtm) + NL_RTM_HDRLEN)) ++#define RTM_PAYLOAD(_hdr) NLMSG_PAYLOAD((_hdr), NL_RTM_HDRLEN) ++#endif ++ ++/* ++ * Routing table identifiers. ++ * FreeBSD route table numbering starts from 0, where 0 is a valid default routing table. ++ * Indicating "all tables" via netlink can be done by not including RTA_TABLE attribute ++ * and keeping rtm_table=0 (compatibility) or setting RTA_TABLE value to RT_TABLE_UNSPEC. ++ */ ++#define RT_TABLE_MAIN 0 /* RT_DEFAULT_FIB */ ++#define RT_TABLE_UNSPEC 0xFFFFFFFF /* RT_ALL_FIBS */ ++ ++enum rtattr_type_t { ++ NL_RTA_UNSPEC, ++ NL_RTA_DST = 1, /* binary, IPv4/IPv6 destination */ ++ NL_RTA_SRC = 2, /* binary, preferred source address */ ++ NL_RTA_IIF = 3, /* not supported */ ++ NL_RTA_OIF = 4, /* u32, transmit ifindex */ ++ NL_RTA_GATEWAY = 5, /* binary: IPv4/IPv6 gateway */ ++ NL_RTA_PRIORITY = 6, /* not supported */ ++ NL_RTA_PREFSRC = 7, /* not supported */ ++ NL_RTA_METRICS = 8, /* nested, list of NL_RTAX* attrs */ ++ NL_RTA_MULTIPATH = 9, /* binary, array of struct rtnexthop */ ++ NL_RTA_PROTOINFO = 10, /* not supported / deprecated */ ++ NL_RTA_KNH_ID = 10, /* u32, FreeBSD specific, kernel nexthop index */ ++ NL_RTA_FLOW = 11, /* not supported */ ++ NL_RTA_CACHEINFO = 12, /* not supported */ ++ NL_RTA_SESSION = 13, /* not supported / deprecated */ ++ NL_RTA_WEIGHT = 13, /* u32, FreeBSD specific, path weight */ ++ NL_RTA_MP_ALGO = 14, /* not supported / deprecated */ ++ NL_RTA_RTFLAGS = 14, /* u32, FreeBSD specific, path flags (RTF_)*/ ++ NL_RTA_TABLE = 15, /* u32, fibnum */ ++ NL_RTA_MARK = 16, /* not supported */ ++ NL_RTA_MFC_STATS = 17, /* not supported */ ++ NL_RTA_VIA = 18, /* binary, struct rtvia */ ++ NL_RTA_NEWDST = 19, /* not supported */ ++ NL_RTA_PREF = 20, /* not supported */ ++ NL_RTA_ENCAP_TYPE = 21, /* not supported */ ++ NL_RTA_ENCAP = 22, /* not supported */ ++ NL_RTA_EXPIRES = 23, /* u32, seconds till expiration */ ++ NL_RTA_PAD = 24, /* not supported */ ++ NL_RTA_UID = 25, /* not supported */ ++ NL_RTA_TTL_PROPAGATE = 26, /* not supported */ ++ NL_RTA_IP_PROTO = 27, /* not supported */ ++ NL_RTA_SPORT = 28, /* not supported */ ++ NL_RTA_DPORT = 29, /* not supported */ ++ NL_RTA_NH_ID = 30, /* u32, nexthop/nexthop group index */ ++ __RTA_MAX ++}; ++#define NL_RTA_MAX (__RTA_MAX - 1) ++ ++/* ++ * Attributes that can be used as filters: ++ * ++ */ ++ ++#ifndef _KERNEL ++/* ++ * RTA_* space has clashes with rtsock namespace. ++ * Use NL_RTA_ prefix in the kernel and map to ++ * RTA_ for userland. ++ */ ++#define RTA_UNSPEC NL_RTA_UNSPEC ++#define RTA_DST NL_RTA_DST ++#define RTA_SRC NL_RTA_SRC ++#define RTA_IIF NL_RTA_IIF ++#define RTA_OIF NL_RTA_OIF ++#define RTA_GATEWAY NL_RTA_GATEWAY ++#define RTA_PRIORITY NL_RTA_PRIORITY ++#define RTA_PREFSRC NL_RTA_PREFSRC ++#define RTA_METRICS NL_RTA_METRICS ++#define RTA_MULTIPATH NL_RTA_MULTIPATH ++#define RTA_PROTOINFO NL_RTA_PROTOINFO ++#define RTA_KNH_ID NL_RTA_KNH_ID ++#define RTA_FLOW NL_RTA_FLOW ++#define RTA_CACHEINFO NL_RTA_CACHEINFO ++#define RTA_SESSION NL_RTA_SESSION ++#define RTA_MP_ALGO NL_RTA_MP_ALGO ++#define RTA_TABLE NL_RTA_TABLE ++#define RTA_MARK NL_RTA_MARK ++#define RTA_MFC_STATS NL_RTA_MFC_STATS ++#define RTA_VIA NL_RTA_VIA ++#define RTA_NEWDST NL_RTA_NEWDST ++#define RTA_PREF NL_RTA_PREF ++#define RTA_ENCAP_TYPE NL_RTA_ENCAP_TYPE ++#define RTA_ENCAP NL_RTA_ENCAP ++#define RTA_EXPIRES NL_RTA_EXPIRES ++#define RTA_PAD NL_RTA_PAD ++#define RTA_UID NL_RTA_UID ++#define RTA_TTL_PROPAGATE NL_RTA_TTL_PROPAGATE ++#define RTA_IP_PROTO NL_RTA_IP_PROTO ++#define RTA_SPORT NL_RTA_SPORT ++#define RTA_DPORT NL_RTA_DPORT ++#define RTA_NH_ID NL_RTA_NH_ID ++#define RTA_MAX NL_RTA_MAX ++#endif ++ ++/* route attribute header */ ++struct rtattr { ++ unsigned short rta_len; ++ unsigned short rta_type; ++}; ++ ++#define NL_RTA_ALIGN_SIZE NL_ITEM_ALIGN_SIZE ++#define NL_RTA_ALIGN NL_ITEM_ALIGN ++#define NL_RTA_HDRLEN ((int)sizeof(struct rtattr)) ++#define NL_RTA_DATA_LEN(_rta) ((int)((_rta)->rta_len - NL_RTA_HDRLEN)) ++#define NL_RTA_DATA(_rta) NL_ITEM_DATA(_rta, NL_RTA_HDRLEN) ++#define NL_RTA_DATA_CONST(_rta) NL_ITEM_DATA_CONST(_rta, NL_RTA_HDRLEN) ++ ++/* Compatibility attribute handling helpers */ ++#ifndef _KERNEL ++#define RTA_ALIGNTO NL_RTA_ALIGN_SIZE ++#define RTA_ALIGN(_len) NL_RTA_ALIGN(_len) ++#define _RTA_LEN(_rta) ((int)(_rta)->rta_len) ++#define _RTA_ALIGNED_LEN(_rta) RTA_ALIGN(_RTA_LEN(_rta)) ++#define RTA_OK(_rta, _len) NL_ITEM_OK(_rta, _len, NL_RTA_HDRLEN, _RTA_LEN) ++#define RTA_NEXT(_rta, _len) NL_ITEM_ITER(_rta, _len, _RTA_ALIGNED_LEN) ++#define RTA_LENGTH(_len) (NL_RTA_HDRLEN + (_len)) ++#define RTA_SPACE(_len) RTA_ALIGN(RTA_LENGTH(_len)) ++#define RTA_DATA(_rta) NL_RTA_DATA(_rta) ++#define RTA_PAYLOAD(_rta) ((int)(_RTA_LEN(_rta) - NL_RTA_HDRLEN)) ++#endif ++ ++/* RTA attribute headers */ ++ ++/* RTA_VIA */ ++struct rtvia { ++ sa_family_t rtvia_family; ++ uint8_t rtvia_addr[0]; ++}; ++ ++/* ++ * RTA_METRICS is a nested attribute, consisting of a list of ++ * TLVs with types defined below. ++ */ ++ enum { ++ NL_RTAX_UNSPEC, ++ NL_RTAX_LOCK = 1, /* not supported */ ++ NL_RTAX_MTU = 2, /* desired path MTU */ ++ NL_RTAX_WINDOW = 3, /* not supported */ ++ NL_RTAX_RTT = 4, /* not supported */ ++ NL_RTAX_RTTVAR = 5, /* not supported */ ++ NL_RTAX_SSTHRESH = 6, /* not supported */ ++ NL_RTAX_CWND = 7, /* not supported */ ++ NL_RTAX_ADVMSS = 8, /* not supported */ ++ NL_RTAX_REORDERING = 9, /* not supported */ ++ NL_RTAX_HOPLIMIT = 10, /* not supported */ ++ NL_RTAX_INITCWND = 11, /* not supporrted */ ++ NL_RTAX_FEATURES = 12, /* not supported */ ++ NL_RTAX_RTO_MIN = 13, /* not supported */ ++ NL_RTAX_INITRWND = 14, /* not supported */ ++ NL_RTAX_QUICKACK = 15, /* not supported */ ++ NL_RTAX_CC_ALGO = 16, /* not supported */ ++ NL_RTAX_FASTOPEN_NO_COOKIE = 17, /* not supported */ ++ __NL_RTAX_MAX ++}; ++#define NL_RTAX_MAX (__NL_RTAX_MAX - 1) ++ ++#define RTAX_FEATURE_ECN (1 << 0) ++#define RTAX_FEATURE_SACK (1 << 1) ++#define RTAX_FEATURE_TIMESTAMP (1 << 2) ++#define RTAX_FEATURE_ALLFRAG (1 << 3) ++ ++#define RTAX_FEATURE_MASK \ ++ (RTAX_FEATURE_ECN | RTAX_FEATURE_SACK | RTAX_FEATURE_TIMESTAMP | \ ++ RTAX_FEATURE_ALLFRAG) ++ ++#ifndef _KERNEL ++ ++/* ++ * RTAX_* space clashes with rtsock namespace. ++ * Use NL_RTAX_ prefix in the kernel and map to ++ * RTAX_ for userland. ++ */ ++#define RTAX_UNSPEC NL_RTAX_UNSPEC ++#define RTAX_LOCK NL_RTAX_LOCK ++#define RTAX_MTU NL_RTAX_MTU ++#define RTAX_WINDOW NL_RTAX_WINDOW ++#define RTAX_RTT NL_RTAX_RTT ++#define RTAX_RTTVAR NL_RTAX_RTTVAR ++#define RTAX_SSTHRESH NL_RTAX_SSTHRESH ++#define RTAX_CWND NL_RTAX_CWND ++#define RTAX_ADVMSS NL_RTAX_ADVMSS ++#define RTAX_REORDERING NL_RTAX_REORDERING ++#define RTAX_HOPLIMIT NL_RTAX_HOPLIMIT ++#define RTAX_INITCWND NL_RTAX_INITCWND ++#define RTAX_FEATURES NL_RTAX_FEATURES ++#define RTAX_RTO_MIN NL_RTAX_RTO_MIN ++#define RTAX_INITRWND NL_RTAX_INITRWND ++#define RTAX_QUICKACK NL_RTAX_QUICKACK ++#define RTAX_CC_ALGO NL_RTAX_CC_ALGO ++#define RTAX_FASTOPEN_NO_COOKIE NL_RTAX_FASTOPEN_NO_COOKIE ++#endif ++ ++/* ++ * RTA_MULTIPATH consists of an array of rtnexthop structures. ++ * Each rtnexthop structure contains RTA_GATEWAY or RTA_VIA ++ * attribute following the header. ++ */ ++struct rtnexthop { ++ unsigned short rtnh_len; ++ unsigned char rtnh_flags; ++ unsigned char rtnh_hops; /* nexthop weight */ ++ int rtnh_ifindex; ++}; ++ ++/* rtnh_flags */ ++#define RTNH_F_DEAD 0x01 /* not supported */ ++#define RTNH_F_PERVASIVE 0x02 /* not supported */ ++#define RTNH_F_ONLINK 0x04 /* not supported */ ++#define RTNH_F_OFFLOAD 0x08 /* not supported */ ++#define RTNH_F_LINKDOWN 0x10 /* not supported */ ++#define RTNH_F_UNRESOLVED 0x20 /* not supported */ ++#define RTNH_F_TRAP 0x40 /* not supported */ ++ ++#define RTNH_COMPARE_MASK (RTNH_F_DEAD | RTNH_F_LINKDOWN | \ ++ RTNH_F_OFFLOAD | RTNH_F_TRAP) ++ ++/* Macros to handle hexthops */ ++#define RTNH_ALIGNTO NL_ITEM_ALIGN_SIZE ++#define RTNH_ALIGN(_len) NL_ITEM_ALIGN(_len) ++#define RTNH_HDRLEN ((int)sizeof(struct rtnexthop)) ++#define _RTNH_LEN(_nh) ((int)(_nh)->rtnh_len) ++#define _RTNH_ALIGNED_LEN(_nh) RTNH_ALIGN(_RTNH_LEN(_nh)) ++#define RTNH_OK(_nh, _len) NL_ITEM_OK(_nh, _len, RTNH_HDRLEN, _RTNH_LEN) ++#define RTNH_NEXT(_nh) ((struct rtnexthop *)((char *)(_nh) + _RTNH_ALIGNED_LEN(_nh))) ++#define RTNH_LENGTH(_len) (RTNH_HDRLEN + (_len)) ++#define RTNH_SPACE(_len) RTNH_ALIGN(RTNH_LENGTH(_len)) ++#define RTNH_DATA(_nh) ((struct rtattr *)NL_ITEM_DATA(_nh, RTNH_HDRLEN)) ++ ++struct rtgenmsg { ++ unsigned char rtgen_family; ++}; ++ ++#endif diff --git a/build/skel/net/bird-bsd-netlink-sys.h.patch b/build/skel/net/bird-bsd-netlink-sys.h.patch new file mode 100644 index 0000000..8c3583d --- /dev/null +++ b/build/skel/net/bird-bsd-netlink-sys.h.patch @@ -0,0 +1,10 @@ +--- sysdep/bsd-netlink/netlink-sys.h.orig 2024-03-22 14:19:18 UTC ++++ sysdep/bsd-netlink/netlink-sys.h +@@ -9,6 +9,7 @@ + #ifndef _BIRD_NETLINK_SYS_H_ + #define _BIRD_NETLINK_SYS_H_ + ++#include "netlink-route.h" + #include + #include +