From 6877508042fec2f80b5340981edb728a0c715725 Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Fri, 9 Jul 2010 18:05:41 +0200 Subject: Convert udhcp plugin to connman task The udhcp plugin was still using the old and deprecated plugins/task.c API. --- scripts/udhcpc-script.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/udhcpc-script.c b/scripts/udhcpc-script.c index a3f3b214..5d417b59 100644 --- a/scripts/udhcpc-script.c +++ b/scripts/udhcpc-script.c @@ -39,6 +39,7 @@ int main(int argc, char *argv[]) DBusMessage *msg; char *busname, *interface, *address, *netmask, *broadcast; char *gateway, *dns; + char *path; if (argc < 2) return 0; @@ -50,6 +51,10 @@ int main(int argc, char *argv[]) interface = getenv("interface"); + path = getenv("PATH"); + if (path == NULL) + path = ""; + address = getenv("ip"); if (address == NULL) address = ""; @@ -82,8 +87,9 @@ int main(int argc, char *argv[]) return 0; } - msg = dbus_message_new_method_call(busname, UDHCPC_PATH, - UDHCPC_INTF, argv[1]); + msg = dbus_message_new_method_call(busname, path, + "org.moblin.connman.Task", + "Notify"); if (msg == NULL) { dbus_connection_unref(conn); fprintf(stderr, "Failed to allocate method call\n"); @@ -98,6 +104,7 @@ int main(int argc, char *argv[]) DBUS_TYPE_STRING, &broadcast, DBUS_TYPE_STRING, &gateway, DBUS_TYPE_STRING, &dns, + DBUS_TYPE_STRING, &argv[1], DBUS_TYPE_INVALID); if (dbus_connection_send(conn, msg, NULL) == FALSE) -- cgit v1.2.3