summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2010-11-26 10:10:09 (GMT)
committerMarcel Holtmann <marcel@holtmann.org>2010-11-26 10:10:09 (GMT)
commite2c6ed0aac1ae31584107c248384de51e9fe962e (patch)
treed39c6249615962fe9ae22421d88e6a1bfad28118 /scripts
parent0274fe4a18abd90764567ed2c20e8582d252928c (diff)
downloadconnman-e2c6ed0aac1ae31584107c248384de51e9fe962e.zip
connman-e2c6ed0aac1ae31584107c248384de51e9fe962e.tar.gz
connman-e2c6ed0aac1ae31584107c248384de51e9fe962e.tar.bz2
Remove support for dhclient plugin
Diffstat (limited to 'scripts')
-rw-r--r--scripts/dhclient-script.c133
-rw-r--r--scripts/dhclient.conf6
2 files changed, 0 insertions, 139 deletions
diff --git a/scripts/dhclient-script.c b/scripts/dhclient-script.c
deleted file mode 100644
index 35ede29..0000000
--- a/scripts/dhclient-script.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- *
- * Connection Manager
- *
- * Copyright (C) 2007-2010 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <dbus/dbus.h>
-
-extern char **environ;
-
-static void append(DBusMessageIter *dict, const char *pattern)
-{
- DBusMessageIter entry;
- const char *key, *value;
- char *delim;
-
- delim = strchr(pattern, '=');
- *delim = '\0';
-
- key = pattern;
- value = delim + 1;
-
- dbus_message_iter_open_container(dict, DBUS_TYPE_DICT_ENTRY,
- NULL, &entry);
-
- dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &key);
-
- dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &value);
-
- dbus_message_iter_close_container(dict, &entry);
-}
-
-int main(int argc, char *argv[])
-{
- DBusConnection *conn;
- DBusError error;
- DBusMessage *msg;
- DBusMessageIter iter, dict;
- dbus_uint32_t pid;
- char **envp, *busname, *busintf, *buspath, *reason, *interface;
-
- busname = getenv("BUSNAME");
- busintf = getenv("BUSINTF");
- buspath = getenv("BUSPATH");
-
- if (busname == NULL || busintf == NULL || buspath == NULL)
- return 0;
-
- pid = atoi(getenv("pid"));
- reason = getenv("reason");
- interface = getenv("interface");
-
- if (pid == 0 || reason == NULL)
- return 0;
-
- dbus_error_init(&error);
-
- conn = dbus_bus_get(DBUS_BUS_SYSTEM, &error);
- if (conn == NULL) {
- if (dbus_error_is_set(&error) == TRUE) {
- fprintf(stderr, "%s\n", error.message);
- dbus_error_free(&error);
- } else
- fprintf(stderr, "Failed to get on system bus\n");
- return 0;
- }
-
- msg = dbus_message_new_method_call(busname, buspath,
- busintf, "Notify");
- if (msg == NULL) {
- dbus_connection_unref(conn);
- fprintf(stderr, "Failed to allocate method call\n");
- return 0;
- }
-
- dbus_message_set_no_reply(msg, TRUE);
-
- dbus_message_append_args(msg, DBUS_TYPE_UINT32, &pid,
- DBUS_TYPE_STRING, &reason, DBUS_TYPE_INVALID);
-
- dbus_message_iter_init_append(msg, &iter);
-
- dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,
- DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
- DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_STRING_AS_STRING
- DBUS_DICT_ENTRY_END_CHAR_AS_STRING, &dict);
-
- for (envp = environ; envp && *envp; envp++) {
- if (strlen(*envp) < 5)
- continue;
-
- if (strncmp(*envp, "new_", 4) == 0 ||
- strncmp(*envp, "old_", 4) == 0 ||
- strncmp(*envp, "alia", 4) == 0)
- append(&dict, *envp);
- }
-
- dbus_message_iter_close_container(&iter, &dict);
-
- if (dbus_connection_send(conn, msg, NULL) == FALSE)
- fprintf(stderr, "Failed to send message\n");
-
- dbus_connection_flush(conn);
-
- dbus_message_unref(msg);
-
- dbus_connection_unref(conn);
-
- return 0;
-}
diff --git a/scripts/dhclient.conf b/scripts/dhclient.conf
deleted file mode 100644
index 39741b1..0000000
--- a/scripts/dhclient.conf
+++ /dev/null
@@ -1,6 +0,0 @@
-option proxy-auto-config code 252 = text;
-request subnet-mask, broadcast-address, routers, host-name,
- domain-search, domain-name, domain-name-servers,
- time-offset, time-servers, ntp-servers, interface-mtu,
- proxy-auto-config;
-require subnet-mask, domain-name-servers;