]> granicus.if.org Git - libnl/commitdiff
build: fixup headers for C++ inclusion
authorCraig Gallek <kraig@google.com>
Fri, 15 Jul 2016 14:29:06 +0000 (10:29 -0400)
committerThomas Haller <thaller@redhat.com>
Fri, 12 Aug 2016 21:00:18 +0000 (23:00 +0200)
- Fix typos in extern "C" wrappers.
- 'class' is a reserved word, change to cls.
- int -> enum casts are not automatic.
- Static strings must be of type const char*
- Add a few implicit header dependencies explicitly.

http://lists.infradead.org/pipermail/libnl/2016-July/002165.html

Signed-off-by: Craig Gallek <kraig@google.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
include/linux-private/linux/ipv6.h
include/netlink-private/netlink.h
include/netlink-private/types.h
include/netlink/hashtable.h
include/netlink/route/link/ip6tnl.h
include/netlink/route/link/sit.h
include/netlink/route/qdisc/hfsc.h

index f16349df0ceb2c6443d42dc0abc4743d9c3ae1b8..e05e684adac18a374db7cb818c38dca218c63f1e 100644 (file)
@@ -2,6 +2,7 @@
 #define _IPV6_H
 
 #include <asm/byteorder.h>
+#include <linux/in6.h>
 
 /* The latest drafts declared increase in minimal mtu up to 1280. */
 
index befd3014afcb9a34bec57ab620dc3c2cbbd7edf1..dd07c107127c77efa7dbf6b4b31e788c9df5ce3d 100644 (file)
@@ -138,7 +138,7 @@ extern int __str2flags(const char *, const struct trans_tbl *, size_t);
 extern void dump_from_ops(struct nl_object *, struct nl_dump_params *);
 extern struct rtnl_link *link_lookup(struct nl_cache *cache, int ifindex);
 
-static inline int nl_cb_call(struct nl_cb *cb, int type, struct nl_msg *msg)
+static inline int nl_cb_call(struct nl_cb *cb, enum nl_cb_type type, struct nl_msg *msg)
 {
        int ret;
 
@@ -201,7 +201,7 @@ static inline void rtnl_rcopy_ratespec(struct tc_ratespec *dst,
        dst->rate = src->rs_rate;
 }
 
-static inline char *nl_cache_name(struct nl_cache *cache)
+static inline const char *nl_cache_name(struct nl_cache *cache)
 {
        return cache->c_ops ? cache->c_ops->co_name : "unknown";
 }
index 0f67ddda8f4ada31b1698abe9044dab7efb5ec68..e80c8a14ddd5985ef3e1b53ea4b8f76c9228739d 100644 (file)
@@ -20,6 +20,7 @@
 #include <netlink/route/route.h>
 #include <netlink/idiag/idiagnl.h>
 #include <netlink/netfilter/ct.h>
+#include <netlink-private/object-api.h>
 #include <netlink-private/route/tc-api.h>
 #include <linux/tc_act/tc_mirred.h>
 #include <linux/tc_act/tc_skbedit.h>
index d9e6ee45d809c5258722bfe1ed539831192c0276..3b40d86c1376a3fd3d0a76abfee675772de338de 100644 (file)
@@ -12,6 +12,9 @@
 #ifndef NETLINK_HASHTABLE_H_
 #define NETLINK_HASHTABLE_H_
 
+#include <stddef.h>
+#include <stdint.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
index 40213567ee36436344c39e7fa3a63140e4567376..87ab164f50646d505f62ade014cb757330223085 100644 (file)
@@ -51,7 +51,7 @@ extern "C" {
        extern int rtnl_link_ip6_tnl_set_proto(struct rtnl_link *link, uint8_t proto);
        extern uint8_t rtnl_link_ip6_tnl_get_proto(struct rtnl_link *link);
 
-#ifdef _cplusplus
+#ifdef __cplusplus
 }
 #endif
 
index 8f58d0ac23b99e3b2e3bbb2ffbfe2e70b9744d53..62e01edfff5529172169ab42781db45a4952451c 100644 (file)
@@ -58,7 +58,7 @@ extern "C" {
        int rtnl_link_sit_set_ip6rd_relay_prefixlen(struct rtnl_link *link, uint16_t prefix);
        int rtnl_link_sit_get_ip6rd_relay_prefixlen(struct rtnl_link *link, uint16_t *prefix);
 
-#ifdef _cplusplus
+#ifdef __cplusplus
 }
 #endif
 
index 8d34fe55ff7420680a7b81d1de1f2a84ff480815..dd0a2b74fcae1bed6842419b8d84075b6cd59639 100644 (file)
@@ -24,12 +24,12 @@ extern "C" {
 extern uint32_t        rtnl_qdisc_hfsc_get_defcls(const struct rtnl_qdisc *);
 extern int     rtnl_qdisc_hfsc_set_defcls(struct rtnl_qdisc *, uint32_t);
 
-extern int rtnl_class_hfsc_get_rsc(const struct rtnl_class *class, struct tc_service_curve *tsc);
-extern int rtnl_class_hfsc_set_rsc(struct rtnl_class *class, const struct tc_service_curve *tsc);
-extern int rtnl_class_hfsc_get_fsc(const struct rtnl_class *class, struct tc_service_curve *tsc);
-extern int rtnl_class_hfsc_set_fsc(struct rtnl_class *class, const struct tc_service_curve *tsc);
-extern int rtnl_class_hfsc_get_usc(const struct rtnl_class *class, struct tc_service_curve *tsc);
-extern int rtnl_class_hfsc_set_usc(struct rtnl_class *class, const struct tc_service_curve *tsc);
+extern int rtnl_class_hfsc_get_rsc(const struct rtnl_class *cls, struct tc_service_curve *tsc);
+extern int rtnl_class_hfsc_set_rsc(struct rtnl_class *cls, const struct tc_service_curve *tsc);
+extern int rtnl_class_hfsc_get_fsc(const struct rtnl_class *cls, struct tc_service_curve *tsc);
+extern int rtnl_class_hfsc_set_fsc(struct rtnl_class *cls, const struct tc_service_curve *tsc);
+extern int rtnl_class_hfsc_get_usc(const struct rtnl_class *cls, struct tc_service_curve *tsc);
+extern int rtnl_class_hfsc_set_usc(struct rtnl_class *cls, const struct tc_service_curve *tsc);
 #ifdef __cplusplus
 }
 #endif