summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-12-13 20:04:06 +0100
committerMarcel Holtmann <marcel@holtmann.org>2008-12-13 20:04:06 +0100
commit2f74c0693e5f374778e5f5d329e742c390e84d37 (patch)
treec295d36a60c52f1eb281df78a5f6e4127757562b
parentc45047df7b35f3d4802cedf8fe21e2a2f8610935 (diff)
downloadconnman-2f74c0693e5f374778e5f5d329e742c390e84d37.tar.gz
connman-2f74c0693e5f374778e5f5d329e742c390e84d37.tar.bz2
connman-2f74c0693e5f374778e5f5d329e742c390e84d37.zip
Add skeleton for DNS proxy resolver plugin
-rw-r--r--plugins/Makefile.am10
-rw-r--r--plugins/dnsproxy.c64
2 files changed, 70 insertions, 4 deletions
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index 88a2d782..41f20bd2 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -2,8 +2,8 @@
plugindir = $(libdir)/connman/plugins
plugin_LTLIBRARIES = loopback.la ethernet.la wifi.la bluetooth.la \
- netdev.la dhclient.la ipv4.la \
- resolvconf.la resolvfile.la rtnllink.la
+ netdev.la dhclient.la ipv4.la rtnllink.la \
+ dnsproxy.la resolvconf.la resolvfile.la
loopback_la_SOURCES = loopback.c
@@ -23,12 +23,14 @@ dhclient_la_CFLAGS = @GLIB_CFLAGS@ @GDBUS_CFLAGS@ -DDHCLIENT=\"@DHCLIENT@\" \
ipv4_la_SOURCES = ipv4.c
+rtnllink_la_SOURCES = rtnllink.c inet.h inet.c
+
+dnsproxy_la_SOURCES = dnsproxy.c
+
resolvconf_la_SOURCES = resolvconf.c
resolvfile_la_SOURCES = resolvfile.c
-rtnllink_la_SOURCES = rtnllink.c inet.h inet.c
-
if POLKIT
plugin_LTLIBRARIES += polkit.la
diff --git a/plugins/dnsproxy.c b/plugins/dnsproxy.c
new file mode 100644
index 00000000..419d33dc
--- /dev/null
+++ b/plugins/dnsproxy.c
@@ -0,0 +1,64 @@
+/*
+ *
+ * Connection Manager
+ *
+ * Copyright (C) 2007-2008 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 <connman/plugin.h>
+#include <connman/resolver.h>
+#include <connman/log.h>
+
+static int dnsproxy_append(const char *interface, const char *domain,
+ const char *server)
+{
+ DBG("server %s", server);
+
+ return -1;
+}
+
+static int dnsproxy_remove(const char *interface, const char *domain,
+ const char *server)
+{
+ DBG("server %s", server);
+
+ return 0;
+}
+
+static struct connman_resolver dnsproxy_resolver = {
+ .name = "dnsproxy",
+ .priority = CONNMAN_RESOLVER_PRIORITY_HIGH,
+ .append = dnsproxy_append,
+ .remove = dnsproxy_remove,
+};
+
+static int dnsproxy_init(void)
+{
+ return connman_resolver_register(&dnsproxy_resolver);
+}
+
+static void dnsproxy_exit(void)
+{
+ connman_resolver_unregister(&dnsproxy_resolver);
+}
+
+CONNMAN_PLUGIN_DEFINE(dnsproxy, "DNS proxy resolver plugin", VERSION,
+ dnsproxy_init, dnsproxy_exit)