From: Marcel Holtmann Date: Sat, 13 Dec 2008 19:04:06 +0000 (+0100) Subject: Add skeleton for DNS proxy resolver plugin X-Git-Tag: 0.3~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2f74c0693e5f374778e5f5d329e742c390e84d37;p=platform%2Fupstream%2Fconnman.git Add skeleton for DNS proxy resolver plugin --- diff --git a/plugins/Makefile.am b/plugins/Makefile.am index 88a2d78..41f20bd 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 0000000..419d33d --- /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 +#endif + +#include +#include +#include + +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)