rtnl: headers in src/systemd/ may not include internal headers

Hence including "util.h" from sd-rtnl.h is not OK. Let's minimize our
headers we pull in a bit.
This commit is contained in:
Lennart Poettering
2013-11-07 03:39:32 +01:00
parent a2cdd907d1
commit a33dece5f8
7 changed files with 15 additions and 10 deletions
+2
View 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 {
+1
View 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>
+1
View 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"
+7
View File
@@ -23,7 +23,14 @@
#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)
+1
View 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;
+2
View File
@@ -19,12 +19,14 @@
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;
+1 -10
View File
@@ -21,10 +21,7 @@
#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)