summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2010-07-21 23:21:58 -0700
committerMarcel Holtmann <marcel@holtmann.org>2010-07-21 23:21:58 -0700
commit85b59718d6cb109b5e3900715ea8d42f5eed5341 (patch)
treeee2975c300e6eb90f36ba089a4735d551e2fd0b8
parent32d1817b7b5e7f9a3044327df36433ae35a532a7 (diff)
downloadconnman-85b59718d6cb109b5e3900715ea8d42f5eed5341.tar.gz
connman-85b59718d6cb109b5e3900715ea8d42f5eed5341.tar.bz2
connman-85b59718d6cb109b5e3900715ea8d42f5eed5341.zip
Add skeleton for generic DHCP plugin
-rw-r--r--Makefile.plugins3
-rw-r--r--plugins/dhcp.c63
2 files changed, 66 insertions, 0 deletions
diff --git a/Makefile.plugins b/Makefile.plugins
index 0a7424ec..c8434c6f 100644
--- a/Makefile.plugins
+++ b/Makefile.plugins
@@ -4,6 +4,9 @@ plugin_cflags = -fvisibility=hidden -I$(srcdir)/gdbus \
plugin_ldflags = -no-undefined -module -avoid-version
+builtin_modules += dhcp
+builtin_sources += plugins/dhcp.c
+
if LOOPBACK
if LOOPBACK_BUILTIN
builtin_modules += loopback
diff --git a/plugins/dhcp.c b/plugins/dhcp.c
new file mode 100644
index 00000000..2e07c7ff
--- /dev/null
+++ b/plugins/dhcp.c
@@ -0,0 +1,63 @@
+/*
+ *
+ * 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
+
+#define CONNMAN_API_SUBJECT_TO_CHANGE
+#include <connman/plugin.h>
+#include <connman/dhcp.h>
+#include <connman/log.h>
+
+static int dhcp_request(struct connman_dhcp *dhcp)
+{
+ DBG("dhcp %p", dhcp);
+
+ return -1;
+}
+
+static int dhcp_release(struct connman_dhcp *dhcp)
+{
+ DBG("dhcp %p", dhcp);
+
+ return -1;
+}
+
+static struct connman_dhcp_driver dhcp_driver = {
+ .name = "dhcp",
+ .priority = CONNMAN_DHCP_PRIORITY_LOW,
+ .request = dhcp_request,
+ .release = dhcp_release,
+};
+
+static int dhcp_init(void)
+{
+ return connman_dhcp_driver_register(&dhcp_driver);
+}
+
+static void dhcp_exit(void)
+{
+ connman_dhcp_driver_unregister(&dhcp_driver);
+}
+
+CONNMAN_PLUGIN_DEFINE(dhcp, "Generic DHCP plugin", VERSION,
+ CONNMAN_PLUGIN_PRIORITY_LOW, dhcp_init, dhcp_exit)