#ifdef HAVE_UDEV
int __connman_udev_init(void);
void __connman_udev_cleanup(void);
+char *__connman_udev_get_devtype(const char *ifname);
#else
static inline int __connman_udev_init(void)
{
static inline void __connman_udev_cleanup(void)
{
}
+
+static inline char *__connman_udev_get_devtype(const char *ifname)
+{
+ return NULL;
+}
#endif
#include <connman/device.h>
if (devname == NULL)
return NULL;
+ __connman_udev_get_devtype(devname);
+
if (type == ARPHRD_ETHER) {
char bridge_path[PATH_MAX], wimax_path[PATH_MAX];
struct stat st;
#include <config.h>
#endif
+#include <stdio.h>
#include <sys/types.h>
#define LIBUDEV_I_KNOW_THE_API_IS_SUBJECT_TO_CHANGE
static struct udev_monitor *udev_mon;
static guint udev_watch = 0;
+char *__connman_udev_get_devtype(const char *ifname)
+{
+ struct udev_device *device;
+ const char *devtype;
+ char syspath[128];
+
+ snprintf(syspath, sizeof(syspath) - 1, "/sys/class/net/%s", ifname);
+
+ device = udev_device_new_from_syspath(udev_ctx, syspath);
+ if (device == NULL)
+ return NULL;
+
+ devtype = udev_device_get_devtype(device);
+ if (devtype == NULL)
+ goto done;
+
+ connman_info("%s ==> %s", ifname, devtype);
+
+done:
+ udev_device_unref(device);
+
+ return NULL;
+}
+
int __connman_udev_init(void)
{
GIOChannel *channel;