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 /lib | |
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 'lib')
-rw-r--r-- | lib/cli/qdisc/hfsc.c | 1 | ||||
-rw-r--r-- | lib/netfilter/nfnl.c | 2 | ||||
-rw-r--r-- | lib/route/cls/ematch.c | 1 | ||||
-rw-r--r-- | lib/route/cls/ematch/meta.c | 1 | ||||
-rw-r--r-- | lib/route/cls/ematch/nbyte.c | 1 | ||||
-rw-r--r-- | lib/route/cls/ematch/text.c | 1 | ||||
-rw-r--r-- | lib/route/cls/ematch_grammar.l | 1 | ||||
-rw-r--r-- | lib/route/cls/ematch_syntax.y | 2 | ||||
-rw-r--r-- | lib/route/pktloc_grammar.l | 1 | ||||
-rw-r--r-- | lib/route/route_obj.c | 1 | ||||
-rw-r--r-- | lib/route/rule.c | 1 |
11 files changed, 13 insertions, 0 deletions
diff --git a/lib/cli/qdisc/hfsc.c b/lib/cli/qdisc/hfsc.c index 6a0c960..619befc 100644 --- a/lib/cli/qdisc/hfsc.c +++ b/lib/cli/qdisc/hfsc.c @@ -12,6 +12,7 @@ #include <netlink/cli/utils.h> #include <netlink/cli/tc.h> #include <netlink/route/qdisc/hfsc.h> +#include <linux/pkt_sched.h> static void print_qdisc_usage(void) { diff --git a/lib/netfilter/nfnl.c b/lib/netfilter/nfnl.c index 9b52447..fab7904 100644 --- a/lib/netfilter/nfnl.c +++ b/lib/netfilter/nfnl.c @@ -65,6 +65,8 @@ #include <netlink/netlink.h> #include <netlink/netfilter/nfnl.h> +#include <linux/netfilter/nfnetlink.h> + /** * @name Socket Creating * @{ diff --git a/lib/route/cls/ematch.c b/lib/route/cls/ematch.c index 6cbe274..95f9b3d 100644 --- a/lib/route/cls/ematch.c +++ b/lib/route/cls/ematch.c @@ -22,6 +22,7 @@ #include <netlink/route/classifier.h> #include <netlink/route/cls/ematch.h> #include <netlink/route/cls/ematch/cmp.h> +#include <linux/tc_ematch/tc_em_cmp.h> #include "ematch_syntax.h" #include "ematch_grammar.h" diff --git a/lib/route/cls/ematch/meta.c b/lib/route/cls/ematch/meta.c index e33c405..cf9fdae 100644 --- a/lib/route/cls/ematch/meta.c +++ b/lib/route/cls/ematch/meta.c @@ -21,6 +21,7 @@ #include <netlink/netlink.h> #include <netlink/route/cls/ematch.h> #include <netlink/route/cls/ematch/meta.h> +#include <linux/tc_ematch/tc_em_meta.h> struct rtnl_meta_value { diff --git a/lib/route/cls/ematch/nbyte.c b/lib/route/cls/ematch/nbyte.c index 8852489..e4216d6 100644 --- a/lib/route/cls/ematch/nbyte.c +++ b/lib/route/cls/ematch/nbyte.c @@ -21,6 +21,7 @@ #include <netlink/netlink.h> #include <netlink/route/cls/ematch.h> #include <netlink/route/cls/ematch/nbyte.h> +#include <linux/tc_ematch/tc_em_nbyte.h> struct nbyte_data { diff --git a/lib/route/cls/ematch/text.c b/lib/route/cls/ematch/text.c index e8cdcae..b14c4ab 100644 --- a/lib/route/cls/ematch/text.c +++ b/lib/route/cls/ematch/text.c @@ -21,6 +21,7 @@ #include <netlink/netlink.h> #include <netlink/route/cls/ematch.h> #include <netlink/route/cls/ematch/text.h> +#include <linux/tc_ematch/tc_em_text.h> struct text_data { diff --git a/lib/route/cls/ematch_grammar.l b/lib/route/cls/ematch_grammar.l index c3f02b0..e97f9fe 100644 --- a/lib/route/cls/ematch_grammar.l +++ b/lib/route/cls/ematch_grammar.l @@ -15,6 +15,7 @@ #include <netlink/netlink.h> #include <netlink/route/cls/ematch.h> #include <netlink/route/cls/ematch/cmp.h> + #include <linux/tc_ematch/tc_em_cmp.h> #include "ematch_syntax.h" int ematch_get_column(yyscan_t); diff --git a/lib/route/cls/ematch_syntax.y b/lib/route/cls/ematch_syntax.y index b28eb3c..a0ca4bb 100644 --- a/lib/route/cls/ematch_syntax.y +++ b/lib/route/cls/ematch_syntax.y @@ -20,6 +20,8 @@ #include <netlink/route/cls/ematch/nbyte.h> #include <netlink/route/cls/ematch/text.h> #include <netlink/route/cls/ematch/meta.h> +#include <linux/tc_ematch/tc_em_meta.h> +#include <linux/tc_ematch/tc_em_cmp.h> #define META_ALLOC rtnl_meta_value_alloc_id #define META_ID(name) TCF_META_ID_##name diff --git a/lib/route/pktloc_grammar.l b/lib/route/pktloc_grammar.l index 646ba56..ab592d1 100644 --- a/lib/route/pktloc_grammar.l +++ b/lib/route/pktloc_grammar.l @@ -4,6 +4,7 @@ #include <netlink/netlink.h> #include <netlink/utils.h> #include <netlink/route/pktloc.h> + #include <linux/tc_ematch/tc_em_cmp.h> #include "pktloc_syntax.h" int pktloc_get_column(yyscan_t); diff --git a/lib/route/route_obj.c b/lib/route/route_obj.c index 21b67b1..b8e9f77 100644 --- a/lib/route/route_obj.c +++ b/lib/route/route_obj.c @@ -41,6 +41,7 @@ #include <netlink/route/route.h> #include <netlink/route/link.h> #include <netlink/route/nexthop.h> +#include <linux/in_route.h> /** @cond SKIP */ #define ROUTE_ATTR_FAMILY 0x000001 diff --git a/lib/route/rule.c b/lib/route/rule.c index 883df81..2e40bb1 100644 --- a/lib/route/rule.c +++ b/lib/route/rule.c @@ -22,6 +22,7 @@ #include <netlink/route/rtnl.h> #include <netlink/route/rule.h> #include <inttypes.h> +#include <linux/fib_rules.h> /** @cond SKIP */ #define RULE_ATTR_FAMILY 0x0001 |