gboolean __connman_connection_update_gateway(void);
int __connman_udev_init(void);
+void __connman_udev_start(void);
void __connman_udev_cleanup(void);
char *__connman_udev_get_devtype(const char *ifname);
char *__connman_udev_get_mbm_devnode(const char *ifname);
#include <connman/rtnl.h>
int __connman_rtnl_init(void);
+void __connman_rtnl_start(void);
void __connman_rtnl_cleanup(void);
int __connman_rtnl_send(const void *buf, size_t len);
started = TRUE;
- __connman_rtnl_init();
- __connman_udev_init();
+ __connman_rtnl_start();
+ __connman_udev_start();
__connman_connection_init();
__connman_ipv4_init();
__connman_profile_init(conn);
__connman_resolver_init();
+ __connman_rtnl_init();
+ __connman_udev_init();
__connman_plugin_init(option_plugin, option_noplugin);
return 0;
}
+void __connman_rtnl_start(void)
+{
+ DBG("");
+}
+
void __connman_rtnl_cleanup(void)
{
GSList *list;
int __connman_udev_init(void)
{
- int err;
-
DBG("");
- err = connman_rtnl_register(&detect_rtnl);
- if (err < 0)
- return err;
+ return connman_rtnl_register(&detect_rtnl);
+}
- connman_rtnl_send_getlink();
+void __connman_udev_start(void)
+{
+ DBG("");
- return 0;
+ connman_rtnl_send_getlink();
}
void __connman_udev_cleanup(void)
#include "connman.h"
#ifdef NEED_UDEV_MONITOR_FILTER
-#if 0
static int udev_monitor_filter_add_match_subsystem_devtype(struct udev_monitor *udev_monitor,
const char *subsystem, const char *devtype)
{
return -EINVAL;
}
#endif
-#endif
static GSList *device_list = NULL;
int __connman_udev_init(void)
{
- GIOChannel *channel;
- int fd;
-
DBG("");
udev_ctx = udev_new();
return -1;
}
+ udev_monitor_filter_add_match_subsystem_devtype(udev_mon,
+ "net", NULL);
+ udev_monitor_filter_add_match_subsystem_devtype(udev_mon,
+ "rfkill", NULL);
+
+ udev_monitor_filter_update(udev_mon);
+
+ return 0;
+}
+
+void __connman_udev_start(void)
+{
+ GIOChannel *channel;
+ int fd;
+
+ DBG("");
+
if (udev_monitor_enable_receiving(udev_mon) < 0) {
connman_error("Failed to enable udev monitor");
- udev_unref(udev_ctx);
- udev_ctx = NULL;
- udev_monitor_unref(udev_mon);
- return -1;
+ return;
}
enumerate_devices(udev_ctx);
channel = g_io_channel_unix_new(fd);
if (channel == NULL)
- return 0;
+ return;
udev_watch = g_io_add_watch(channel, G_IO_IN, udev_event, udev_mon);
g_io_channel_unref(channel);
-
- return 0;
}
void __connman_udev_cleanup(void)
if (udev_ctx == NULL)
return;
+ udev_monitor_filter_remove(udev_mon);
+
udev_monitor_unref(udev_mon);
udev_unref(udev_ctx);
}