Add hex-encoded character string getter to AtChat
[connman] / plugins / ethernet.c
index 1e797c0..3013271 100644 (file)
 #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;
@@ -53,7 +50,7 @@ static void ethernet_newlink(unsigned flags, unsigned change, void *user_data)
        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) {
@@ -120,7 +117,7 @@ static int ethernet_enable(struct connman_device *device)
 
        DBG("device %p", device);
 
-       return inet_ifup(ethernet->index);
+       return connman_inet_ifup(ethernet->index);
 }
 
 static int ethernet_disable(struct connman_device *device)
@@ -129,7 +126,7 @@ 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 = {
@@ -152,4 +149,4 @@ static void ethernet_exit(void)
 }
 
 CONNMAN_PLUGIN_DEFINE(ethernet, "Ethernet interface plugin", VERSION,
-                                               ethernet_init, ethernet_exit)
+               CONNMAN_PLUGIN_PRIORITY_DEFAULT, ethernet_init, ethernet_exit)