From: Marcel Holtmann Date: Wed, 30 Jul 2008 18:33:44 +0000 (+0200) Subject: Execute resolvconf command and create Internet element X-Git-Tag: 2.0_alpha~4792 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=18e5d7d3de2d5dabb94f8a7c9f665f02bb5ae324;p=framework%2Fconnectivity%2Fconnman.git Execute resolvconf command and create Internet element --- diff --git a/plugins/resolvconf.c b/plugins/resolvconf.c index 45d15c3..b199646 100644 --- a/plugins/resolvconf.c +++ b/plugins/resolvconf.c @@ -32,8 +32,9 @@ static int resolvconf_probe(struct connman_element *element) { const char *nameserver = NULL; + struct connman_element *internet; gchar *cmd; - //int err; + int err; DBG("element %p name %s", element, element->name); @@ -48,25 +49,42 @@ static int resolvconf_probe(struct connman_element *element) DBG("%s", cmd); - //err = system(cmd); + err = system(cmd); g_free(cmd); + internet = connman_element_create(); + + internet->type = CONNMAN_ELEMENT_TYPE_INTERNET; + + connman_element_set_data(element, internet); + + connman_element_register(internet, element); + return 0; } static void resolvconf_remove(struct connman_element *element) { + struct connman_element *internet = connman_element_get_data(element); gchar *cmd; - //int err; + int err; DBG("element %p name %s", element, element->name); + DBG("element %p name %s", element, element->name); + + connman_element_set_data(element, NULL); + + connman_element_unregister(internet); + + connman_element_unref(internet); + cmd = g_strdup_printf("resolvconf -d %s", element->netdev.name); DBG("%s", cmd); - //err = system(cmd); + err = system(cmd); g_free(cmd); }