#endif
#include <errno.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <linux/if.h>
-#include <linux/netlink.h>
-#include <linux/rtnetlink.h>
+#include <net/if.h>
+
+#ifndef IFF_LOWER_UP
+#define IFF_LOWER_UP 0x10000
+#endif
#include <glib.h>
#define CONNMAN_API_SUBJECT_TO_CHANGE
#include <connman/plugin.h>
#include <connman/device.h>
+#include <connman/inet.h>
#include <connman/rtnl.h>
#include <connman/log.h>
-#include "inet.h"
-
struct ethernet_data {
int index;
unsigned flags;
struct connman_device *device = user_data;
struct ethernet_data *ethernet = connman_device_get_data(device);
- DBG("index %d flags %ld change %ld", ethernet->index, flags, change);
+ DBG("index %d flags %d change %d", ethernet->index, flags, change);
if ((ethernet->flags & IFF_UP) != (flags & IFF_UP)) {
if (flags & IFF_UP) {
DBG("device %p", device);
- return inet_ifup(ethernet->index);
+ return connman_inet_ifup(ethernet->index);
}
static int ethernet_disable(struct connman_device *device)
DBG("device %p", device);
- return inet_ifdown(ethernet->index);
+ return connman_inet_ifdown(ethernet->index);
}
static struct connman_device_driver ethernet_driver = {
}
CONNMAN_PLUGIN_DEFINE(ethernet, "Ethernet interface plugin", VERSION,
- ethernet_init, ethernet_exit)
+ CONNMAN_PLUGIN_PRIORITY_DEFAULT, ethernet_init, ethernet_exit)