diff options
author | Donald Sharp <sharpd@nvidia.com> | 2023-11-04 09:15:54 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2023-11-07 12:46:19 +0100 |
commit | 315aa6cde48bbe5af08f61778d70f72aa0f9648a (patch) | |
tree | 0cf61da735151e7fbd2d9760bb8dae77af747576 | |
parent | Merge pull request #14729 from donaldsharp/v6_rr_semantics_zrouter (diff) | |
download | frr-315aa6cde48bbe5af08f61778d70f72aa0f9648a.tar.xz frr-315aa6cde48bbe5af08f61778d70f72aa0f9648a.zip |
*: 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>
-rw-r--r-- | bfdd/bfd_packet.c | 4 | ||||
-rw-r--r-- | bgpd/bgp_vty.c | 4 | ||||
-rw-r--r-- | lib/zebra.h | 6 | ||||
-rw-r--r-- | nhrpd/netlink_arp.c | 4 | ||||
-rw-r--r-- | nhrpd/nhrp_multicast.c | 4 | ||||
-rw-r--r-- | zebra/dplane_fpm_nl.c | 3 | ||||
-rw-r--r-- | zebra/if_netlink.c | 2 | ||||
-rw-r--r-- | zebra/kernel_netlink.c | 3 | ||||
-rw-r--r-- | zebra/main.c | 4 | ||||
-rw-r--r-- | zebra/netconf_netlink.c | 2 | ||||
-rw-r--r-- | zebra/rule_netlink.c | 3 | ||||
-rw-r--r-- | zebra/tc_netlink.c | 1 | ||||
-rw-r--r-- | zebra/zebra_evpn_neigh.c | 4 | ||||
-rw-r--r-- | zebra/zebra_fpm.c | 4 | ||||
-rw-r--r-- | zebra/zebra_fpm_dt.c | 4 | ||||
-rw-r--r-- | zebra/zebra_fpm_netlink.c | 3 | ||||
-rw-r--r-- | zebra/zebra_mpls_netlink.c | 3 | ||||
-rw-r--r-- | zebra/zebra_netns_id.c | 4 | ||||
-rw-r--r-- | zebra/zebra_ns.h | 2 | ||||
-rw-r--r-- | zebra/zebra_rib.c | 4 |
20 files changed, 63 insertions, 5 deletions
diff --git a/bfdd/bfd_packet.c b/bfdd/bfd_packet.c index 5d8bf47fc..f2596dfc3 100644 --- a/bfdd/bfd_packet.c +++ b/bfdd/bfd_packet.c @@ -13,6 +13,10 @@ #include <zebra.h> +#ifdef GNU_LINUX +#include <linux/filter.h> +#endif + #ifdef BFD_LINUX #include <linux/if_packet.h> #endif /* BFD_LINUX */ diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 36e216cb1..c9d21b674 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -5,6 +5,10 @@ #include <zebra.h> +#ifdef GNU_LINUX +#include <linux/rtnetlink.h> //RT_TABLE_XXX +#endif + #include "command.h" #include "lib/json.h" #include "lib/sockopt.h" diff --git a/lib/zebra.h b/lib/zebra.h index b742e7184..3fe61c801 100644 --- a/lib/zebra.h +++ b/lib/zebra.h @@ -115,11 +115,7 @@ #include <net/route.h> -#ifdef HAVE_NETLINK -#include <linux/netlink.h> -#include <linux/rtnetlink.h> -#include <linux/filter.h> -#else +#ifndef HAVE_NETLINK #define RT_TABLE_MAIN 0 #define RT_TABLE_LOCAL RT_TABLE_MAIN #endif /* HAVE_NETLINK */ diff --git a/nhrpd/netlink_arp.c b/nhrpd/netlink_arp.c index 2e22f8e24..bcecf9fc0 100644 --- a/nhrpd/netlink_arp.c +++ b/nhrpd/netlink_arp.c @@ -7,6 +7,10 @@ #include "config.h" #endif +#ifdef GNU_LINUX +#include <linux/rtnetlink.h> +#endif + #include <fcntl.h> #include <net/if.h> #include <netinet/if_ether.h> diff --git a/nhrpd/nhrp_multicast.c b/nhrpd/nhrp_multicast.c index fdc1a31f2..aead98284 100644 --- a/nhrpd/nhrp_multicast.c +++ b/nhrpd/nhrp_multicast.c @@ -7,6 +7,10 @@ #include "config.h" #endif +#ifdef GNU_LINUX +#include <linux/rtnetlink.h> +#endif + #include <fcntl.h> #include <net/if.h> #include <net/ethernet.h> diff --git a/zebra/dplane_fpm_nl.c b/zebra/dplane_fpm_nl.c index 70bcfe449..c98655fdb 100644 --- a/zebra/dplane_fpm_nl.c +++ b/zebra/dplane_fpm_nl.c @@ -19,6 +19,9 @@ #include <string.h> #include "lib/zebra.h" + +#include <linux/rtnetlink.h> + #include "lib/json.h" #include "lib/libfrr.h" #include "lib/frratomic.h" diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c index ed2e0a224..6dad69396 100644 --- a/zebra/if_netlink.c +++ b/zebra/if_netlink.c @@ -17,6 +17,8 @@ #define _LINUX_IF_H #define _LINUX_IP_H +#include <linux/netlink.h> +#include <linux/rtnetlink.h> #include <netinet/if_ether.h> #include <linux/if_bridge.h> #include <linux/if_link.h> diff --git a/zebra/kernel_netlink.c b/zebra/kernel_netlink.c index 3f4a03192..8b59ecd87 100644 --- a/zebra/kernel_netlink.c +++ b/zebra/kernel_netlink.c @@ -6,6 +6,9 @@ #include <zebra.h> #ifdef HAVE_NETLINK +#include <linux/netlink.h> +#include <linux/rtnetlink.h> +#include <linux/filter.h> #include "linklist.h" #include "if.h" diff --git a/zebra/main.c b/zebra/main.c index 158d1b8c4..aea30daa3 100644 --- a/zebra/main.c +++ b/zebra/main.c @@ -5,6 +5,10 @@ #include <zebra.h> +#ifdef GNU_LINUX +#include <linux/rtnetlink.h> +#endif + #include <lib/version.h> #include "getopt.h" #include "command.h" diff --git a/zebra/netconf_netlink.c b/zebra/netconf_netlink.c index 7352dfb2e..9a0b3c5d0 100644 --- a/zebra/netconf_netlink.c +++ b/zebra/netconf_netlink.c @@ -11,6 +11,8 @@ #include <ns.h> +#include <linux/netlink.h> +#include <linux/rtnetlink.h> #include "linux/netconf.h" #include "lib/lib_errors.h" diff --git a/zebra/rule_netlink.c b/zebra/rule_netlink.c index f00aef52c..05282793d 100644 --- a/zebra/rule_netlink.c +++ b/zebra/rule_netlink.c @@ -9,6 +9,9 @@ #ifdef HAVE_NETLINK +#include <linux/netlink.h> +#include <linux/rtnetlink.h> + #include "if.h" #include "prefix.h" #include "vrf.h" diff --git a/zebra/tc_netlink.c b/zebra/tc_netlink.c index d633c0777..19667e66a 100644 --- a/zebra/tc_netlink.c +++ b/zebra/tc_netlink.c @@ -9,6 +9,7 @@ #ifdef HAVE_NETLINK +#include <linux/rtnetlink.h> #include <linux/pkt_cls.h> #include <linux/pkt_sched.h> #include <netinet/if_ether.h> diff --git a/zebra/zebra_evpn_neigh.c b/zebra/zebra_evpn_neigh.c index a00d8c969..81705d4e8 100644 --- a/zebra/zebra_evpn_neigh.c +++ b/zebra/zebra_evpn_neigh.c @@ -6,6 +6,10 @@ #include <zebra.h> +#ifdef GNU_LINUX +#include <linux/neighbour.h> +#endif + #include "hash.h" #include "interface.h" #include "jhash.h" diff --git a/zebra/zebra_fpm.c b/zebra/zebra_fpm.c index 699f3ed11..92dc591d4 100644 --- a/zebra/zebra_fpm.c +++ b/zebra/zebra_fpm.c @@ -8,6 +8,10 @@ #include <zebra.h> +#ifdef GNU_LINUX +#include <linux/rtnetlink.h> +#endif + #include "log.h" #include "libfrr.h" #include "stream.h" diff --git a/zebra/zebra_fpm_dt.c b/zebra/zebra_fpm_dt.c index 94308a961..ce5eb6fe1 100644 --- a/zebra/zebra_fpm_dt.c +++ b/zebra/zebra_fpm_dt.c @@ -22,6 +22,10 @@ */ #include <zebra.h> + +#ifdef GNU_LINUX +#include <linux/rtnetlink.h> +#endif #include "log.h" #include "vrf.h" diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c index 127976223..1dd96347f 100644 --- a/zebra/zebra_fpm_netlink.c +++ b/zebra/zebra_fpm_netlink.c @@ -11,6 +11,9 @@ #ifdef HAVE_NETLINK +#include <linux/rtnetlink.h> +#include <linux/neighbour.h> + #include "log.h" #include "rib.h" #include "vty.h" diff --git a/zebra/zebra_mpls_netlink.c b/zebra/zebra_mpls_netlink.c index 4bc676f39..b76640743 100644 --- a/zebra/zebra_mpls_netlink.c +++ b/zebra/zebra_mpls_netlink.c @@ -7,6 +7,9 @@ #ifdef HAVE_NETLINK +#include <linux/netlink.h> +#include <linux/rtnetlink.h> + #include "zebra/debug.h" #include "zebra/rt.h" #include "zebra/rt_netlink.h" diff --git a/zebra/zebra_netns_id.c b/zebra/zebra_netns_id.c index 0531ab959..ae8f9d9a8 100644 --- a/zebra/zebra_netns_id.c +++ b/zebra/zebra_netns_id.c @@ -6,6 +6,10 @@ #include <zebra.h> +#ifdef GNU_LINUX +#include <linux/if_link.h> +#endif + #include "ns.h" #include "vrf.h" #include "log.h" diff --git a/zebra/zebra_ns.h b/zebra/zebra_ns.h index edf261197..cda8bada0 100644 --- a/zebra/zebra_ns.h +++ b/zebra/zebra_ns.h @@ -18,6 +18,8 @@ extern "C" { #endif #ifdef HAVE_NETLINK +#include <linux/netlink.h> + /* Socket interface to kernel */ struct nlsock { int sock; diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 37c042c04..a4af3a43f 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -5,6 +5,10 @@ #include <zebra.h> +#ifdef GNU_LINUX +#include <linux/rtnetlink.h> +#endif + #include "command.h" #include "if.h" #include "linklist.h" |