diff options
author | Thomas Haller <thaller@redhat.com> | 2017-03-01 21:00:14 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-03-02 00:33:25 (GMT) |
commit | 45cbfb9d11c23d5f64a795fb05205ced48db1c7c (patch) | |
tree | cec9fcb3513f60bd017d1c3eda94b593438fe8fc /src | |
parent | 3b2071e970995a9a22d46457e60a762161b46231 (diff) | |
download | libnl-45cbfb9d11c23d5f64a795fb05205ced48db1c7c.zip libnl-45cbfb9d11c23d5f64a795fb05205ced48db1c7c.tar.gz libnl-45cbfb9d11c23d5f64a795fb05205ced48db1c7c.tar.bz2 |
include: don't include kernel headers in public libnl3 headers
It would be desirable not to include kernel headers in our public
libnl3 headers. As a test, remove all those includes, and fix
compilation by explicitly including the kernel headers where needed.
In some cases, that requires forward declaration for kernel
structures, as we use them as part of our own headers.
Realistically, we cannot drop those includes as it probalby breaks
compilation for users that expect to get a certain kernel header
when including a libnl3 header. So, this will not be done and the
includes will be restored in the next commit.
Do this step to show how it would be and to verify that we could
build with such a change. The reason not to do this is backward
compatibility (at compile-time).
Diffstat (limited to 'src')
42 files changed, 86 insertions, 2 deletions
diff --git a/src/genl-ctrl-list.c b/src/genl-ctrl-list.c index 078c30c..e6d09c3 100644 --- a/src/genl-ctrl-list.c +++ b/src/genl-ctrl-list.c @@ -11,6 +11,8 @@ #include <netlink/cli/utils.h> +#include <linux/genetlink.h> + static struct nl_cache *alloc_genl_family_cache(struct nl_sock *sk) { return nl_cli_alloc_cache(sk, "generic netlink family", diff --git a/src/nf-ct-add.c b/src/nf-ct-add.c index 8ad4c53..fa988ac 100644 --- a/src/nf-ct-add.c +++ b/src/nf-ct-add.c @@ -14,6 +14,8 @@ #include <netlink/cli/utils.h> #include <netlink/cli/ct.h> +#include <linux/rtnetlink.h> + static int quiet = 0; static void print_usage(void) diff --git a/src/nf-ct-list.c b/src/nf-ct-list.c index bc6a337..6355d10 100644 --- a/src/nf-ct-list.c +++ b/src/nf-ct-list.c @@ -14,6 +14,8 @@ #include <netlink/cli/utils.h> #include <netlink/cli/ct.h> +#include <linux/netlink.h> + static void print_usage(void) { printf( diff --git a/src/nf-exp-add.c b/src/nf-exp-add.c index a81147e..68e2ec6 100644 --- a/src/nf-exp-add.c +++ b/src/nf-exp-add.c @@ -16,6 +16,8 @@ #include <netlink/cli/utils.h> #include <netlink/cli/exp.h> +#include <linux/netlink.h> + static int quiet = 0; static void print_usage(void) diff --git a/src/nf-exp-delete.c b/src/nf-exp-delete.c index 0965e90..43493d5 100644 --- a/src/nf-exp-delete.c +++ b/src/nf-exp-delete.c @@ -15,6 +15,8 @@ #include <netlink/cli/utils.h> #include <netlink/cli/exp.h> +#include <linux/rtnetlink.h> + static int quiet = 0; static void print_usage(void) diff --git a/src/nf-exp-list.c b/src/nf-exp-list.c index 7f5624d..d14b1fa 100644 --- a/src/nf-exp-list.c +++ b/src/nf-exp-list.c @@ -15,6 +15,8 @@ #include <netlink/cli/utils.h> #include <netlink/cli/exp.h> +#include <linux/netlink.h> + static void print_usage(void) { printf( diff --git a/src/nf-log.c b/src/nf-log.c index 1e2c1e4..c0fd978 100644 --- a/src/nf-log.c +++ b/src/nf-log.c @@ -13,10 +13,12 @@ #include <netlink/cli/utils.h> #include <netlink/cli/link.h> -#include <linux/netfilter/nfnetlink_log.h> #include <netlink/netfilter/nfnl.h> #include <netlink/netfilter/log.h> +#include <linux/netfilter/nfnetlink_log.h> +#include <linux/netlink.h> + static struct nfnl_log *alloc_log(void) { struct nfnl_log *log; diff --git a/src/nf-monitor.c b/src/nf-monitor.c index fe99af4..0b74473 100644 --- a/src/nf-monitor.c +++ b/src/nf-monitor.c @@ -14,6 +14,9 @@ #include <netlink/cli/utils.h> #include <netlink/netfilter/nfnl.h> +#include <linux/netlink.h> +#include <linux/netfilter/nfnetlink.h> + static void obj_input(struct nl_object *obj, void *arg) { struct nl_dump_params dp = { diff --git a/src/nf-queue.c b/src/nf-queue.c index b043c80..de069b0 100644 --- a/src/nf-queue.c +++ b/src/nf-queue.c @@ -20,6 +20,8 @@ #include <netlink/netfilter/queue.h> #include <netlink/netfilter/queue_msg.h> +#include <linux/netlink.h> + static struct nl_sock *nf_sock; static struct nfnl_queue *alloc_queue(void) diff --git a/src/nl-addr-add.c b/src/nl-addr-add.c index 19d07b3..0467f67 100644 --- a/src/nl-addr-add.c +++ b/src/nl-addr-add.c @@ -12,6 +12,8 @@ #include <netlink/cli/addr.h> #include <netlink/cli/link.h> +#include <linux/netlink.h> + static int quiet = 0; static void print_usage(void) diff --git a/src/nl-addr-delete.c b/src/nl-addr-delete.c index 981930f..0f3ae2f 100644 --- a/src/nl-addr-delete.c +++ b/src/nl-addr-delete.c @@ -12,6 +12,8 @@ #include <netlink/cli/addr.h> #include <netlink/cli/link.h> +#include <linux/netlink.h> + static struct nl_sock *sock; static int interactive = 0, default_yes = 0, quiet = 0; static int deleted = 0; diff --git a/src/nl-addr-list.c b/src/nl-addr-list.c index 20995a8..f9e4080 100644 --- a/src/nl-addr-list.c +++ b/src/nl-addr-list.c @@ -12,6 +12,8 @@ #include <netlink/cli/addr.h> #include <netlink/cli/link.h> +#include <linux/netlink.h> + static void print_usage(void) { printf( diff --git a/src/nl-class-add.c b/src/nl-class-add.c index 4593471..bbba619 100644 --- a/src/nl-class-add.c +++ b/src/nl-class-add.c @@ -17,6 +17,8 @@ #include <netlink-private/route/tc-api.h> +#include <linux/netlink.h> + static int quiet = 0; static void print_usage(void) diff --git a/src/nl-class-delete.c b/src/nl-class-delete.c index e4be2c0..4570258 100644 --- a/src/nl-class-delete.c +++ b/src/nl-class-delete.c @@ -13,6 +13,8 @@ #include <netlink/cli/class.h> #include <netlink/cli/link.h> +#include <linux/netlink.h> + static int quiet = 0, default_yes = 0, deleted = 0, interactive = 0; static struct nl_sock *sock; diff --git a/src/nl-class-list.c b/src/nl-class-list.c index e8cc71a..4cace9a 100644 --- a/src/nl-class-list.c +++ b/src/nl-class-list.c @@ -14,6 +14,8 @@ #include <netlink/cli/class.h> #include <netlink/cli/link.h> +#include <linux/netlink.h> + static struct nl_sock *sock; static struct nl_dump_params params = { diff --git a/src/nl-classid-lookup.c b/src/nl-classid-lookup.c index 1493ebf..b633ab6 100644 --- a/src/nl-classid-lookup.c +++ b/src/nl-classid-lookup.c @@ -10,6 +10,7 @@ */ #include <netlink/cli/utils.h> +#include <linux/pkt_sched.h> static void print_usage(void) { diff --git a/src/nl-cls-add.c b/src/nl-cls-add.c index 6ac8590..e4a080a 100644 --- a/src/nl-cls-add.c +++ b/src/nl-cls-add.c @@ -15,6 +15,8 @@ #include <netlink-private/route/tc-api.h> +#include <linux/netlink.h> + static int quiet = 0; static void print_usage(void) diff --git a/src/nl-cls-delete.c b/src/nl-cls-delete.c index 78b93ec..3297992 100644 --- a/src/nl-cls-delete.c +++ b/src/nl-cls-delete.c @@ -13,6 +13,8 @@ #include <netlink/cli/cls.h> #include <netlink/cli/link.h> +#include <linux/netlink.h> + static int quiet = 0, default_yes = 0, deleted = 0, interactive = 0; static struct nl_sock *sock; diff --git a/src/nl-cls-list.c b/src/nl-cls-list.c index 08956e0..2ab3d12 100644 --- a/src/nl-cls-list.c +++ b/src/nl-cls-list.c @@ -14,6 +14,8 @@ #include <netlink/cli/cls.h> #include <netlink/cli/link.h> +#include <linux/netlink.h> + static struct nl_sock *sock; static struct nl_dump_params params = { diff --git a/src/nl-fib-lookup.c b/src/nl-fib-lookup.c index 705cf32..95e6acd 100644 --- a/src/nl-fib-lookup.c +++ b/src/nl-fib-lookup.c @@ -11,6 +11,8 @@ #include <netlink/cli/utils.h> +#include <linux/rtnetlink.h> + static void print_usage(void) { printf( diff --git a/src/nl-link-enslave.c b/src/nl-link-enslave.c index 2b5d47d..1a75939 100644 --- a/src/nl-link-enslave.c +++ b/src/nl-link-enslave.c @@ -13,6 +13,8 @@ #include <netlink/cli/link.h> #include <netlink/route/link/bonding.h> +#include <linux/netlink.h> + int main(int argc, char *argv[]) { struct nl_sock *sock; diff --git a/src/nl-link-ifindex2name.c b/src/nl-link-ifindex2name.c index 68e5158..c4ed827 100644 --- a/src/nl-link-ifindex2name.c +++ b/src/nl-link-ifindex2name.c @@ -12,6 +12,8 @@ #include <netlink/cli/utils.h> #include <netlink/cli/link.h> +#include <linux/netlink.h> + static void print_usage(void) { printf("Usage: nl-link-ifindex2name <ifindex>\n"); diff --git a/src/nl-link-list.c b/src/nl-link-list.c index b5c98b4..47d5c06 100644 --- a/src/nl-link-list.c +++ b/src/nl-link-list.c @@ -12,6 +12,8 @@ #include <netlink/cli/utils.h> #include <netlink/cli/link.h> +#include <linux/netlink.h> + static void print_usage(void) { printf( diff --git a/src/nl-link-name2ifindex.c b/src/nl-link-name2ifindex.c index b8ae4bc..1be1d18 100644 --- a/src/nl-link-name2ifindex.c +++ b/src/nl-link-name2ifindex.c @@ -12,6 +12,8 @@ #include <netlink/cli/utils.h> #include <netlink/cli/link.h> +#include <linux/netlink.h> + static void print_usage(void) { printf("Usage: nl-link-name2ifindex <name>\n"); diff --git a/src/nl-link-release.c b/src/nl-link-release.c index 4c9f15a..6f9de0e 100644 --- a/src/nl-link-release.c +++ b/src/nl-link-release.c @@ -13,6 +13,8 @@ #include <netlink/cli/link.h> #include <netlink/route/link/bonding.h> +#include <linux/netlink.h> + int main(int argc, char *argv[]) { struct nl_sock *sock; diff --git a/src/nl-link-set.c b/src/nl-link-set.c index 6a6bac8..a3ff8a1 100644 --- a/src/nl-link-set.c +++ b/src/nl-link-set.c @@ -9,10 +9,12 @@ * Copyright (c) 2003-2010 Thomas Graf <tgraf@suug.ch> */ -#include <linux/if.h> #include <netlink/cli/utils.h> #include <netlink/cli/link.h> +#include <linux/if.h> +#include <linux/netlink.h> + static struct nl_sock *sock; static int quiet = 0; diff --git a/src/nl-link-stats.c b/src/nl-link-stats.c index 9bb11c8..82132f8 100644 --- a/src/nl-link-stats.c +++ b/src/nl-link-stats.c @@ -12,6 +12,8 @@ #include <netlink/cli/utils.h> #include <netlink/cli/link.h> +#include <linux/netlink.h> + static void print_usage(void) { printf( diff --git a/src/nl-monitor.c b/src/nl-monitor.c index 16ecac0..754f8dc 100644 --- a/src/nl-monitor.c +++ b/src/nl-monitor.c @@ -12,6 +12,8 @@ #include <netlink/cli/utils.h> #include <netlink/cli/link.h> +#include <linux/rtnetlink.h> + static void obj_input(struct nl_object *obj, void *arg) { struct nl_dump_params dp = { diff --git a/src/nl-neigh-add.c b/src/nl-neigh-add.c index 09cef9a..d98330b 100644 --- a/src/nl-neigh-add.c +++ b/src/nl-neigh-add.c @@ -13,6 +13,8 @@ #include <netlink/cli/neigh.h> #include <netlink/cli/link.h> +#include <linux/netlink.h> + static int quiet = 0; static void print_usage(void) diff --git a/src/nl-neigh-delete.c b/src/nl-neigh-delete.c index b6be44c..2d3be37 100644 --- a/src/nl-neigh-delete.c +++ b/src/nl-neigh-delete.c @@ -13,6 +13,8 @@ #include <netlink/cli/neigh.h> #include <netlink/cli/link.h> +#include <linux/netlink.h> + static int quiet = 0, default_yes = 0, deleted = 0, interactive = 0; static struct nl_sock *sock; diff --git a/src/nl-neigh-list.c b/src/nl-neigh-list.c index c99d237..ba4ade8 100644 --- a/src/nl-neigh-list.c +++ b/src/nl-neigh-list.c @@ -13,6 +13,8 @@ #include <netlink/cli/neigh.h> #include <netlink/cli/link.h> +#include <linux/netlink.h> + static void print_usage(void) { printf( diff --git a/src/nl-neightbl-list.c b/src/nl-neightbl-list.c index 2380e01..5c28e91 100644 --- a/src/nl-neightbl-list.c +++ b/src/nl-neightbl-list.c @@ -12,6 +12,8 @@ #include <netlink/cli/utils.h> #include <netlink/cli/link.h> +#include <linux/netlink.h> + static void print_usage(void) { printf( diff --git a/src/nl-pktloc-lookup.c b/src/nl-pktloc-lookup.c index 7d24402..68dbdf9 100644 --- a/src/nl-pktloc-lookup.c +++ b/src/nl-pktloc-lookup.c @@ -11,6 +11,7 @@ #include <netlink/cli/utils.h> #include <netlink/route/pktloc.h> +#include <linux/tc_ematch/tc_em_cmp.h> static void print_usage(void) { diff --git a/src/nl-qdisc-add.c b/src/nl-qdisc-add.c index d8a1f73..dc0b4f1 100644 --- a/src/nl-qdisc-add.c +++ b/src/nl-qdisc-add.c @@ -16,6 +16,8 @@ #include <netlink-private/route/tc-api.h> +#include <linux/netlink.h> + static int quiet = 0; static void print_usage(void) diff --git a/src/nl-qdisc-delete.c b/src/nl-qdisc-delete.c index c4acbfe..4a63a7e 100644 --- a/src/nl-qdisc-delete.c +++ b/src/nl-qdisc-delete.c @@ -14,6 +14,8 @@ #include <netlink/cli/qdisc.h> #include <netlink/cli/link.h> +#include <linux/netlink.h> + static int quiet = 0, default_yes = 0, deleted = 0, interactive = 0; static struct nl_sock *sock; diff --git a/src/nl-qdisc-list.c b/src/nl-qdisc-list.c index b8110f1..eb73e5f 100644 --- a/src/nl-qdisc-list.c +++ b/src/nl-qdisc-list.c @@ -16,6 +16,9 @@ #include <netlink/cli/cls.h> #include <netlink/cli/link.h> +#include <linux/pkt_sched.h> +#include <linux/netlink.h> + #define NUM_INDENT 4 static struct nl_sock *sock; diff --git a/src/nl-route-add.c b/src/nl-route-add.c index d4aa767..3a2dd61 100644 --- a/src/nl-route-add.c +++ b/src/nl-route-add.c @@ -13,6 +13,8 @@ #include <netlink/cli/route.h> #include <netlink/cli/link.h> +#include <linux/netlink.h> + static int quiet = 0; static struct nl_cache *link_cache, *route_cache; diff --git a/src/nl-route-delete.c b/src/nl-route-delete.c index 884fd7f..56d52eb 100644 --- a/src/nl-route-delete.c +++ b/src/nl-route-delete.c @@ -13,6 +13,8 @@ #include <netlink/cli/route.h> #include <netlink/cli/link.h> +#include <linux/netlink.h> + static int interactive = 0, default_yes = 0, quiet = 0; static int deleted = 0; static struct nl_sock *sock; diff --git a/src/nl-route-get.c b/src/nl-route-get.c index 1ee47e4..b031ae4 100644 --- a/src/nl-route-get.c +++ b/src/nl-route-get.c @@ -13,6 +13,8 @@ #include <netlink/cli/route.h> #include <netlink/cli/link.h> +#include <linux/rtnetlink.h> + static void print_usage(void) { printf("Usage: nl-route-get <addr>\n"); diff --git a/src/nl-route-list.c b/src/nl-route-list.c index e0e57be..06ef01a 100644 --- a/src/nl-route-list.c +++ b/src/nl-route-list.c @@ -13,6 +13,8 @@ #include <netlink/cli/route.h> #include <netlink/cli/link.h> +#include <linux/netlink.h> + static void print_usage(void) { printf( diff --git a/src/nl-rule-list.c b/src/nl-rule-list.c index 7c450e2..ec73aca 100644 --- a/src/nl-rule-list.c +++ b/src/nl-rule-list.c @@ -13,6 +13,8 @@ #include <netlink/cli/rule.h> #include <netlink/cli/link.h> +#include <linux/netlink.h> + static void print_usage(void) { printf( diff --git a/src/nl-tctree-list.c b/src/nl-tctree-list.c index d90cb28..7c3b7e6 100644 --- a/src/nl-tctree-list.c +++ b/src/nl-tctree-list.c @@ -13,6 +13,8 @@ #include <netlink/cli/link.h> #include <netlink/cli/qdisc.h> #include <netlink/cli/class.h> + +#include <linux/netlink.h> #include <linux/pkt_sched.h> static struct nl_sock *sock; |