Commit graph

222 commits

Author SHA1 Message Date
Donald Sharp 1b1fc14ffc lib: Remove in_systm.h it is never used
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-04 14:32:32 -05:00
Donald Sharp 75b3e82dfa *: Remove cost of including netinet/icmp.h everywhere
This file inclusion is only used in 3 places move
the includes to those spots.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-04 14:26:33 -05:00
Donald Sharp ca54540576 lib: Remove inclusion of various MAXINT from zebra.h
All modern systems should have these defined.  Let's stop
paying the cost of this compilation.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-04 14:24:01 -05:00
Donald Sharp fbc31156f0 lib: HAVE_GLIBC_BACKTRACE does not belong in zebra.h
The backtrace functionality has been abstracted over
to zlog_backtrace().  Now that every place uses this
move the inclusion for HAVE_GLIBC_BACKTRACE into
the appropriate files instead of having everyone
pay for this costly include.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-04 14:20:40 -05:00
Donald Sharp 78690deaf2 lib: Move some priviledge headers to file they are used.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-04 14:04:36 -05:00
Donald Sharp 2bf051a577 *: Remove Crypto openSSL define from zebra.h
Only a couple of places use this.  Move these to a better
spot.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-04 14:02:34 -05:00
Donald Sharp 10387101fe lib: Breakout sendmmsg into it's own header
The only 2 places sendmmsg is used is in zlog_5424.c
and zlog_live.c.  Why is the rest of the entire system
paying for this compilation?

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-04 13:56:09 -05:00
Donald Sharp 6de9f7fbf5 *: Move distance related defines into their own header
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-11-07 06:47:51 -05:00
Donald Sharp 42ddcf71e5 *: Remove APPLE #defines from build
We cannot build on apple machines at all due
to our usage of some gcc extensions that will
probably never see the light of day again.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-11-07 06:46:19 -05:00
Donald Sharp 315aa6cde4 *: Remove netlink headers from lib/zebra.h
The headers associated with netlink code
really only belong in those that need it.
Move these headers out of lib/zebra.h and
into more appropriate places.  bgp's usage
of the RT_TABLE_XXX defines are probably not
appropriate and will be cleaned up in future
commits.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-11-07 06:46:19 -05:00
Philippe Guibert a61f49ab36 lib: fix RT_TABLE_LOCAL for bsd builds
The routing table numbers are specific to linux builds, and the
RT_TABLE_xxx are usually defined in linux headers. The bsd builds
do not benefit from this definition: some RT_TABLE_xxx defines
are missing for those builds.

Fix this by appending RT_TABLE_LOCAL define for bsd headers.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-10-20 13:28:52 +02:00
Philippe Guibert 07a459ac25 lib: add support for new redistribute table-direct element
Add a new kind of redistributed route that helps to import entries
that are not copied in the default routing table. Contrary to the
'redistribute table' feature, the entries are directly obtained from
the zebra appropriate routing table.

The 'table-direct' naming expresses the direct redistribution of
the routes, without having to copy the route entries in the default
routing table.

The distance value for this route is 14. Such route entries will
be prioritary compared to 'table' and 'ebgp' route entries type.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-10-20 13:28:52 +02:00
Donald Sharp 0dc12c9003 Revert "lib: register bgp link-state afi/safi"
This reverts commit 1642a68d60.
2023-10-10 16:45:57 -04:00
Louis Scalbert 1642a68d60 lib: register bgp link-state afi/safi
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-09-18 14:22:51 +02:00
Donald Sharp 8383d53e43
Merge pull request #12780 from opensourcerouting/spdx-license-id
*: convert to SPDX License identifiers
2023-02-17 09:43:05 -05:00
David Lamparter a836a6cf8c
Merge pull request #12789 from donaldsharp/version_cleanup 2023-02-14 17:19:07 +01:00
Stephen Worley ee720c5dca lib: make htonll/ntohll compile time and readable
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-13 18:12:05 -05:00
Stephen Worley 04cb115d97 lib: add 64bit versions of htonl/ntohl
Add 64bit version of htonl/ntohl.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2023-02-13 18:12:04 -05:00
Donald Sharp 3d55a4ef29 lib, zebra: Use defines for distance
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-10 09:07:47 -05:00
Donald Sharp 8f4ea1fc5d lib, zebra: Move ZEBRA_ON_RIB_PROCESS_HOOK_CALL
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-10 09:07:47 -05:00
Donald Sharp af01a87b3d lib: Remove include of asm/types.h
We do not use this, nor should we.  So let's remove it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-02-10 09:07:47 -05:00
Donald Sharp 09339809a0 lib: Remove include of linux specific version.h
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-10 09:07:47 -05:00
David Lamparter acddc0ed3c *: auto-convert to SPDX License IDs
Done with a combination of regex'ing and banging my head against a wall.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-09 14:09:11 +01:00
David Lamparter 89cb86aeb0 build, vtysh: extract vtysh commands from .xref
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-10-26 17:12:34 +01:00
Loganaden Velvindron 04b4b595d3 lib/md5,lib/sha256: Use explicit_bzero to clean up sensitive data.
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-05-31 18:00:18 +04:00
David Lamparter d948c317c5 build: check for sendmmsg() and struct mmsghdr
These will be used by the RFC5424 log target.

Signed-off-by: David Lamparter <equinox@diac24.net>
2022-01-17 00:38:56 +01:00
Donatas Abraitis df8d723c5f *: Add FOREACH_AFI_SAFI_NSF(afi, safi) macro to reduce nesting
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>
2022-01-13 14:29:54 +02:00
Donald Lee 1247efcce4 zebra: Add dplane hook point
Signed-off-by: Donald Lee <dlqs@gmx.com>
2021-10-20 00:56:00 +08:00
Christian Hopps deca28a33b tests: add grpc unit test
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-06-06 18:03:17 +00:00
David Lamparter 6a0eb6885b *: drop zassert.h
It's not actually working properly...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-04-23 12:06:35 +02:00
David Lamparter 19083e4f75 build: remove deprecated AC_WORDS_BIGENDIAN
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-04-21 15:42:37 +02:00
David Lamparter 09781197b6 build: make builddir include path consistent
... 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-04-21 15:42:33 +02:00
David Lamparter 15c05f1edf *: require ISO C11 (or C++11)
It's 2021... time to drop some 10yo compat stuff.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17 06:18:17 +01:00
Donald Sharp f18ba3cd18 bgpd, lib, staticd, tests: Convert to using FOREACH_AFI_SAFI
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-11-14 18:53:03 -05:00
Donald Sharp cae8bc967c *: Remove solaris from FRR
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-09-21 10:02:20 -04:00
Quentin Young d35e556c84 lib: add macro to check if value is valid afi
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-01-22 14:12:15 -05:00
Martin Winter beec2cfe57 lib: Fix missing __be16 typedef on CentOS6
Need to include linux/types.h on older Linux

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2020-01-20 15:40:49 +01:00
Mark Stapp 15e84e5abb lib: Remove include of deprecated sysctl.h
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-10-23 09:08:21 -04:00
Michal Ruprich 6252100f88 isisd: Enabling build with openssl
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-09-04 09:39:47 -04:00
Don Slice dc91261567 bgpd: make clear bgp * clear all peers in all afi/safis
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-20 13:50:58 +00:00
Michal Ruprich 0513a27153 ospfd,ripd: Enabling build with openssl
Enabling openssl library for md5 authentication in RIP and OSPF

Signed-off-by: Michal Ruprich <michalruprich@gmail.com>
2019-08-08 16:03:20 +02:00
David Lamparter 0688fd81d0
bgpd, lib: Add iana_afi2str and iana_safi2str for eye pleasing strings (#4439)
bgpd, lib: Add iana_afi2str and iana_safi2str for eye pleasing strings
2019-06-13 22:06:49 +02:00
David Lamparter afb35622ef lib: make "%Ld" work for int64_t
... without compiler plugins.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-12 19:35:43 +02:00
Donald Sharp 03edc41d51 lib: Move zebra_size_t to zclient.h who should own it
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-02 16:07:48 -04:00
Donald Sharp 64cbb7c5b7 lib: Remove unused zebra_command_t type
The zebra_command_t type was never being used, remove from
the system.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-02 16:07:48 -04:00
Donald Sharp 26ee1525e6 lib: Remove unused INT8_MAX and UINT8_MAX values
We are not using these in the system, remove.

Signed-off-by: Donald Sharp <sharpd2cumulusnetworks.com>
2019-06-02 16:07:48 -04:00
Donald Sharp 8ee06b2c46 lib: Move ZEBRA_HEADER_MARKER to header it belongs in
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-02 16:07:48 -04:00
Donald Sharp da01a37a1b lib: Move zclient flags to zclient.h
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-02 16:07:48 -04:00
Donald Sharp 7708357131 lib: Move some log.c functions declarations to log.h
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-02 16:07:48 -04:00
Donald Sharp 17136bf23e lib, bgpd: Create iana_afi.h for storing iana_afi/safi enums
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-02 15:02:07 -04:00