chiark / gitweb /
rtnl: headers in src/systemd/ may not include internal headers
authorLennart Poettering <lennart@poettering.net>
Thu, 7 Nov 2013 02:39:32 +0000 (03:39 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 7 Nov 2013 02:39:32 +0000 (03:39 +0100)
Hence including "util.h" from sd-rtnl.h is not OK. Let's minimize our
headers we pull in a bit.

src/libsystemd-rtnl/rtnl-internal.h
src/libsystemd-rtnl/rtnl-message.c
src/libsystemd-rtnl/rtnl-util.c
src/libsystemd-rtnl/rtnl-util.h
src/libsystemd-rtnl/sd-rtnl.c
src/libsystemd-rtnl/test-rtnl.c
src/systemd/sd-rtnl.h

index b34e7ea126f63345074462456f3f04e11090dba7..b05290fd89ee7ad5ab9a69c08c01e5eb62402b8d 100644 (file)
@@ -21,6 +21,8 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <linux/netlink.h>
+
 #include "refcnt.h"
 
 struct sd_rtnl {
index 9a40a75a9f761d3c41adf4e62f7910248eabd463..85cf55a3cdcc2df8cad09e0d5445512078f82b89 100644 (file)
@@ -19,6 +19,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <linux/rtnetlink.h>
 #include <netinet/in.h>
 #include <netinet/ether.h>
 #include <stdbool.h>
index 93804bb74429ec6af002ba2f9521e45af97473c1..9707aa04a661496bf5386f0d378439e1392661f3 100644 (file)
@@ -19,6 +19,7 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <linux/rtnetlink.h>
 #include <netinet/ether.h>
 
 #include "sd-rtnl.h"
index 902ff646cf078bb25d90596e9bbff90d24885357..ba0f71f944c2d39b10aee568814a956059523d2e 100644 (file)
 
 #include <netinet/ether.h>
 
+#include "util.h"
 #include "sd-rtnl.h"
 
 int rtnl_set_link_name(sd_rtnl *rtnl, int ifindex, const char *name);
 int rtnl_set_link_properties(sd_rtnl *rtnl, int ifindex, const struct ether_addr *mac, unsigned mtu);
+
+DEFINE_TRIVIAL_CLEANUP_FUNC(sd_rtnl*, sd_rtnl_unref);
+DEFINE_TRIVIAL_CLEANUP_FUNC(sd_rtnl_message*, sd_rtnl_message_unref);
+
+#define _cleanup_sd_rtnl_unref_ _cleanup_(sd_rtnl_unrefp)
+#define _cleanup_sd_rtnl_message_unref_ _cleanup_(sd_rtnl_message_unrefp)
index ed145b9ab313230a27c4e2a3f83aaa548a7983f3..8ea11df808d2981dda7c59cedd141e3ed542b035 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "sd-rtnl.h"
 #include "rtnl-internal.h"
+#include "rtnl-util.h"
 
 static int sd_rtnl_new(sd_rtnl **ret) {
         sd_rtnl *rtnl;
index 2d2b2373b6a6b5f18f8fdefa52a19167cc36a945..39a83f353207cb7c6f924b158a2b03aacf469123 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <linux/rtnetlink.h>
 #include <netinet/ether.h>
 
 #include "util.h"
 #include "macro.h"
 #include "sd-rtnl.h"
 #include "socket-util.h"
+#include "rtnl-util.h"
 
 static void test_link_configure(sd_rtnl *rtnl, int ifindex) {
         _cleanup_sd_rtnl_message_unref_ sd_rtnl_message *message;
index 5c964a39b2ce9d45cc0900b47b6db31107447db8..289f96b5b9123ae50d2e8ad460c725248229831e 100644 (file)
 
 #pragma once
 
-#include <linux/rtnetlink.h>
-#include <linux/netlink.h>
-#include <stdint.h>
-#include <util.h>
+#include <inttypes.h>
 
 typedef struct sd_rtnl sd_rtnl;
 typedef struct sd_rtnl_message sd_rtnl_message;
@@ -54,9 +51,3 @@ sd_rtnl_message *sd_rtnl_message_unref(sd_rtnl_message *m);
 int sd_rtnl_message_get_type(sd_rtnl_message *m, uint16_t *type);
 int sd_rtnl_message_append(sd_rtnl_message *m, unsigned short type, const void *data);
 int sd_rtnl_message_read(sd_rtnl_message *m, unsigned short *type, void **data);
-
-DEFINE_TRIVIAL_CLEANUP_FUNC(sd_rtnl*, sd_rtnl_unref);
-DEFINE_TRIVIAL_CLEANUP_FUNC(sd_rtnl_message*, sd_rtnl_message_unref);
-
-#define _cleanup_sd_rtnl_unref_ _cleanup_(sd_rtnl_unrefp)
-#define _cleanup_sd_rtnl_message_unref_ _cleanup_(sd_rtnl_message_unrefp)