summaryrefslogtreecommitdiff
path: root/lib/zebra.h
AgeCommit message (Collapse)Author
2023-10-11Revert "lib: register bgp link-state afi/safi"Donald Sharp
This reverts commit 1642a68d60cfade4b2fce72aaef58dea700c65c3. (cherry picked from commit 0dc12c9003a865c7ee829543d40e8c285863abe8)
2023-09-18lib: register bgp link-state afi/safiLouis Scalbert
Register BGP Link-State AFI/SAFI values from RFC7752. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com> Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2023-02-17Merge pull request #12780 from opensourcerouting/spdx-license-idDonald Sharp
*: convert to SPDX License identifiers
2023-02-14Merge pull request #12789 from donaldsharp/version_cleanupDavid Lamparter
2023-02-13lib: make htonll/ntohll compile time and readableStephen Worley
Make the htonll/ntohll functions compile time determined since we have MACROS to determine endianess and bonus points it makes it more readable. Signed-off-by: Stephen Worley <sworley@nvidia.com>
2023-02-13lib: add 64bit versions of htonl/ntohlStephen Worley
Add 64bit version of htonl/ntohl. Signed-off-by: Stephen Worley <sworley@nvidia.com>
2023-02-10lib, zebra: Use defines for distanceDonald Sharp
Use the defines for distance that are in zebra.h. We could easily have a cluster where we don't agree with ourselves. So let's convert zebra to use the defines in zebra.h Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-02-10lib, zebra: Move ZEBRA_ON_RIB_PROCESS_HOOK_CALLDonald Sharp
The define of ZEBRA_ON_RIB_PROCESS_HOOK_CALL was in zebra.h which exposes it to everyone, except zebra is the only daemon to use this define. This does not beling in zebra.h Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-02-10lib: Remove include of asm/types.hDonald Sharp
We do not use this, nor should we. So let's remove it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-02-10lib: Remove include of linux specific version.hDonald Sharp
We apparently do not use it and looking at what this file actually includes, we should not be including this at all. 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>
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-05-31lib/md5,lib/sha256: Use explicit_bzero to clean up sensitive data.Loganaden Velvindron
explicit_bzero() is available as an API to clean up sensitive data and avoid compiler optimizations that remove calls to memset() or bzero(). Signed-off-by: Loganaden Velvindron <logan@cyberstorm.mu>
2022-01-17build: check for sendmmsg() and struct mmsghdrDavid Lamparter
These will be used by the RFC5424 log target. Signed-off-by: David Lamparter <equinox@diac24.net>
2022-01-13*: Add FOREACH_AFI_SAFI_NSF(afi, safi) macro to reduce nestingDonatas Abraitis
Used for graceful-restart mostly. Especially for bgp_show_neighbor_graceful_restart_capability_per_afi_safi() Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-10-20zebra: Add dplane hook pointDonald Lee
Signed-off-by: Donald Lee <dlqs@gmx.com>
2021-06-06tests: add grpc unit testChristian Hopps
Test uses staticd which required some C++ header protections. Additionally, the test also runs in the ubuntu20 docker container as grpc is supported there by the packaging system. Signed-off-by: Christian Hopps <chopps@labn.net>
2021-04-23*: drop zassert.hDavid Lamparter
It's not actually working properly... Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-04-21build: remove deprecated AC_WORDS_BIGENDIANDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-04-21build: make builddir include path consistentDavid Lamparter
... by referencing all autogenerated headers relative to the root directory. (90% of the changes here is `version.h`.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-03-17*: require ISO C11 (or C++11)David Lamparter
It's 2021... time to drop some 10yo compat stuff. Signed-off-by: David Lamparter <equinox@diac24.net>
2020-11-14bgpd, lib, staticd, tests: Convert to using FOREACH_AFI_SAFIDonald Sharp
Move the FOREACH_AFI_SAFI macro from bgpd.h to zebra.h( GLOBAL's YOUALL ) Then convert all the places that have the two level for loop to iterate over all afi/safis Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-09-21*: Remove solaris from FRRDonald Sharp
The Solaris code has gone through a deprecation cycle. No-one has said anything to us and worse of all we don't have any test systems running Solaris to know if we are making changes that are breaking on Solaris. Remove it from the system so we can clean up a bit. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-01-22lib: add macro to check if value is valid afiQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-01-20lib: Fix missing __be16 typedef on CentOS6Martin Winter
Need to include linux/types.h on older Linux Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2019-10-23lib: Remove include of deprecated sysctl.hMark Stapp
Stop including deprecated header file; appears to be unused and it has been deprecated in recent linux. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-09-04isisd: Enabling build with opensslMichal Ruprich
Similar to PR #4677, I am enabling the openssl library for md5 authentication in IS-IS Signed-off-by: Michal Ruprich <michalruprich@gmail.com>
2019-08-20bgpd: make clear bgp * clear all peers in all afi/safisDon Slice
Problem reported that "clear bgp *" only cleared ipv6 peers. Changed the logic to clear all afi/safis of all peers in that case. Also improved the operation of clearing individual afi/safi using soft/in/out to do the right thing. Ticket: CM-25887 Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2019-08-08ospfd,ripd: Enabling build with opensslMichal Ruprich
Enabling openssl library for md5 authentication in RIP and OSPF Signed-off-by: Michal Ruprich <michalruprich@gmail.com>
2019-06-13bgpd, lib: Add iana_afi2str and iana_safi2str for eye pleasing strings (#4439)David Lamparter
bgpd, lib: Add iana_afi2str and iana_safi2str for eye pleasing strings
2019-06-12lib: make "%Ld" work for int64_tDavid Lamparter
... without compiler plugins. Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-02lib: Move zebra_size_t to zclient.h who should own itDonald Sharp
The zebra_size_t type needs to be owned by zclient.h since it is part of the zapi protocol. Move it to where the structure belongs. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-02lib: Remove unused zebra_command_t typeDonald Sharp
The zebra_command_t type was never being used, remove from the system. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-02lib: Remove unused INT8_MAX and UINT8_MAX valuesDonald Sharp
We are not using these in the system, remove. Signed-off-by: Donald Sharp <sharpd2cumulusnetworks.com>
2019-06-02lib: Move ZEBRA_HEADER_MARKER to header it belongs inDonald Sharp
The ZEBRA_HEADER_MARKER is part of the zapi protocol Move it to the zclient.h header. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-02lib: Move zclient flags to zclient.hDonald Sharp
zebra.h had some defined flags that were being used as part of the route encode/decode functionality. These belong in the zclient.h code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-02lib: Move some log.c functions declarations to log.hDonald Sharp
We have some functions that are owned by log.c, so move their declarations from zebra.h to log.h Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-02lib, bgpd: Create iana_afi.h for storing iana_afi/safi enumsDonald Sharp
The iana_afi_t and iana_safi_t were being created in zebra.h and zebra.h is a bit of a dumping ground. When the iana_afi2str and iana_safi2str functions were created, it was correctly pointed out that we should just use the internal afi_t and safi_t 2str functions but to do that we would need to include prefix.h in zebra.h. Which really is not the right thing to do. This tells us that we need to break out this code into it's own header. Move to iana_afi.h the enums and specific functions and remove from zebra. Convert to using the afi2str and safi2str functions. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-02bgpd, lib: Add iana_afi2str and iana_safi2str for eye pleasing stringsDonald Sharp
Modify the code such that we can auto turn the iana values of afi and safi to pleasant to read strings. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-02lib: Remove some iana_afi_t values that are not really afi'sDonald Sharp
The IPMR and IP6MR values have no actual legal representation and we do not sue them at all. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-05-14lib,bgpd,pbrd: Add AFI_UNSPEC to AFI enumStephen Worley
Add an upspecified option to the AFI enum and update switch statements using it in bgpd and pbrd. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-04-18lib: ZEBRA_NUM_OF -> array_sizeDavid Lamparter
The latter is widely used, e.g. in the Linux kernel. Signed-off-by: David Lamparter <equinox@diac24.net>
2019-04-18lib: move/redo some macrosDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-11lib: add macro that performs explicit static casts when using a C++ compilerRenato Westphal
C++ doesn't support implicit casts from void pointers like C does. And the libfrr headers have some bits of code that rely on implicit casts in order to work. To solve this problem, add a new "static_cast" macro that performs explicit static casts when a C++ compiler is being used, or do nothing otherwise. NOTE: since macros are only evaluated when they are used, there might be other macros from libfrr that will need to use "static_cast" as well. If a header is successfully compiled using a C++ compiler, there's no guarantee that its macros are compatible with C++. We'll only know about such macros when they are used by C++ code, then we'll need to adapt them one by one in the future. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-01-26*: The onlink attribute should be owned by the nexthop not the route.Donald Sharp
The onlink attribute was being passed from upper level protocols as an attribute of the route *not* the individual nexthop. When we pass this data to the kernel, we treat the onlink as a attribute of the nexthop. This commit modifies the code base to allow us to pass the ONLINK attribute as an attribute of the nexthop. This commit also fixes static routes that have multiple nexthops some onlink and some not. ip route 4.5.6.7/32 192.168.41.1 eveth1 onlink ip route 4.5.6.7/32 192.168.42.2 S>* 4.5.6.7/32 [1/0] via 192.168.41.1, eveth1 onlink, 00:03:04 * via 192.168.42.2, eveth2, 00:03:04 sharpd@robot ~/frr2> sudo ip netns exec EVA ip route show 4.5.6.7 proto 196 metric 20 nexthop via 192.168.41.1 dev eveth1 weight 1 onlink nexthop via 192.168.42.2 dev eveth2 weight 1 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-12-20bgpd, zebra: auto assign labels from label pool to regular prefixes in BGP ↵Anton Degtyarev
labeled unicast This commit is the last missing piece to complete BGP LU support in bgpd. To this moment, bgpd (and zebra) supported auto label assignment only for prefixes leaked from VRFs to vpn and for MPLS SR prefixes. This adds auto label assignment to other routes types in bgpd. The following enhancements have been made: * bgp_route.c:bgp_process_main_one() now sets implicit-null local_label to all local, aggregate and redistributed routes. * bgp_route.c:bgp_process_main_one() now will request a label from the label pool for any prefix that loses the label for some reason (for example, when the static label assignment config is removed) * bgp_label.c:bgp_reg_dereg_for_label() now requests labels from label pool for routes which have no associated label index * zebra_mpls.c:zebra_mpls_fec_register() now expects both label and label_index from the calling function, one of which must be set to MPLS_INVALID_LABEL or MPLS_INVALID_LABEL_INDEX, based on this it will decide how to register the provided FEC. Signed-off-by: Anton Degtyarev <anton@cumulusnetworks.com>
2018-12-12lib: Reorder Zebra message flags and documentDonald Sharp
Reorder the numbering of the Zebra message flags and document what each flag is supposed to do. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-12-12lib: Remove unused ZEBRA_FLAG_SCOPE_LINKDonald Sharp
The ZEBRA_FLAG_SCOPE_LINK #define was never used, remove it Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-12-12lib, zebra: Remove ZEBRA_FLAG_STATICDonald Sharp
We never used this information and it was merely stored. Additionally this is not something that is a flag, it's a status. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-03lib: Include compiler.h as early as is possible in the buildDonald Sharp
The compiler.h header provides us with some useful macro's that we are using in the system. We do not know exactly where the CPP_NOTICE and CPP_WARN macros are used but they can move around. Place this header early in the build then. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>