dnsproxy: Move from plugins to core
authorDaniel Wagner <daniel.wagner@bmw-carit.de>
Wed, 26 Jan 2011 08:50:29 +0000 (09:50 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 26 Jan 2011 08:55:18 +0000 (09:55 +0100)
Makefile.am
Makefile.plugins
README
configure.ac
src/connman.h
src/dnsproxy.c [moved from plugins/dnsproxy.c with 99% similarity]
src/main.c

index 4cbff38..f09c78c 100644 (file)
@@ -73,7 +73,8 @@ src_connmand_SOURCES = $(gdbus_sources) $(gdhcp_sources) \
                        src/wifi.c src/storage.c src/dbus.c src/config.c \
                        src/technology.c src/counter.c src/location.c \
                        src/session.c src/tethering.c src/ondemand.c \
-                       src/wpad.c src/wispr.c src/stats.c src/iptables.c
+                       src/wpad.c src/wispr.c src/stats.c src/iptables.c \
+                       src/dnsproxy.c
 
 src_connmand_LDADD = $(builtin_libadd) @GLIB_LIBS@ @DBUS_LIBS@ \
                                @CAPNG_LIBS@ @XTABLES_LIBS@ -lresolv -ldl
@@ -206,7 +207,6 @@ DISTCHECK_CONFIGURE_FLAGS = --disable-gtk-doc \
                                --enable-wifi \
                                --enable-bluetooth \
                                --enable-ofono \
-                               --enable-dnsproxy \
                                --enable-pacrunner \
                                --enable-google \
                                --enable-meego \
index 889705a..d8ca1b1 100644 (file)
@@ -150,18 +150,6 @@ plugins_portal_la_LDFLAGS = $(plugin_ldflags)
 endif
 endif
 
-if DNSPROXY
-if DNSPROXY_BUILTIN
-builtin_modules += dnsproxy
-builtin_sources += plugins/dnsproxy.c
-else
-plugin_LTLIBRARIES += plugins/dnsproxy.la
-plugin_objects += $(plugins_dnsproxy_la_OBJECTS)
-plugins_dnsproxy_la_CFLAGS = $(plugin_cflags)
-plugins_dnsproxy_la_LDFLAGS = $(plugin_ldflags)
-endif
-endif
-
 if PACRUNNER
 if PACRUNNER_BUILTIN
 builtin_modules += pacrunner
diff --git a/README b/README
index d19da3b..0cec62b 100644 (file)
--- a/README
+++ b/README
@@ -11,6 +11,7 @@ The following features are built-in into Connection Manager:
        - Generic plugin infrastructure
        - Device and network abstraction (with basic storage support)
        - IPv4, routing and DNS configuration
+       - DNS Proxy
 
 Various plugins can be enabled for networking support:
        - Ethernet plugin
@@ -18,7 +19,6 @@ Various plugins can be enabled for networking support:
        - Bluetooth plugin
 
 Also plugins with additional features are available:
-       - Resolver plugin (DNS proxy)
        - Loopback setup
        - PolicyKit support
 
@@ -59,21 +59,6 @@ For a working system, certain configuration options need to be enabled:
 
                Enable support for Bluetooth devices (requires BlueZ)
 
-       --enable-dnsproxy
-
-               Enable DNS proxy support for /etc/resolv.conf abstraction
-
-               The best solution for multiple connections and proper DNS
-               handling is a DNS proxy server. This binds a DNS proxy
-               server to port 53 on the loopback interface (127.0.0.1).
-
-               The /etc/resolv.conf file needs a "nameserver 127.0.0.1"
-               entry, but can now set the immutable bit or be on a read-only
-               filesystem. No further modification to that file will be made.
-
-               It is important that this is not used together with other
-               DNS proxy solution like dnsmasq.
-
        --enable-loopback
 
                Enable setup of loopback device
index 1bfff1e..1d95c6d 100644 (file)
@@ -148,13 +148,6 @@ fi
 AM_CONDITIONAL(LOOPBACK, test "${enable_loopback}" != "no")
 AM_CONDITIONAL(LOOPBACK_BUILTIN, test "${enable_loopback}" = "builtin")
 
-AC_ARG_ENABLE(dnsproxy,
-       AC_HELP_STRING([--enable-dnsproxy], [enable DNS proxy support]),
-                       [enable_dnsproxy=${enableval}], [enable_dnsproxy="no"])
-
-AM_CONDITIONAL(DNSPROXY, test "${enable_dnsproxy}" != "no")
-AM_CONDITIONAL(DNSPROXY_BUILTIN, test "${enable_dnsproxy}" = "builtin")
-
 AC_ARG_ENABLE(pacrunner,
        AC_HELP_STRING([--enable-pacrunner], [enable PAC runner support]),
                        [enable_pacrunner=${enableval}], [enable_pacrunner="no"])
index 37946f6..9d8e46c 100644 (file)
@@ -611,3 +611,6 @@ void __connman_iptables_cleanup(void);
 int __connman_iptables_command(const char *format, ...)
                                __attribute__((format(printf, 1, 2)));
 int __connman_iptables_commit(const char *table_name);
+
+int __connman_dnsproxy_init(void);
+void __connman_dnsproxy_cleanup(void);
similarity index 99%
rename from plugins/dnsproxy.c
rename to src/dnsproxy.c
index 60b7a39..f09368c 100644 (file)
 #include <sys/socket.h>
 #include <netdb.h>
 
+#include <glib.h>
+
 #define CONNMAN_API_SUBJECT_TO_CHANGE
-#include <connman/plugin.h>
-#include <connman/resolver.h>
-#include <connman/notifier.h>
 #include <connman/ondemand.h>
-#include <connman/log.h>
 
-#include <glib.h>
+#include "connman.h"
 
 #if __BYTE_ORDER == __LITTLE_ENDIAN
 struct domain_hdr {
@@ -1477,7 +1475,7 @@ static void destroy_listener(void)
        destroy_udp_listener();
 }
 
-static int dnsproxy_init(void)
+int __connman_dnsproxy_init(void)
 {
        int err;
 
@@ -1504,7 +1502,7 @@ destroy:
        return err;
 }
 
-static void dnsproxy_exit(void)
+void __connman_dnsproxy_cleanup(void)
 {
        connman_notifier_unregister(&dnsproxy_notifier);
 
@@ -1512,6 +1510,3 @@ static void dnsproxy_exit(void)
 
        destroy_listener();
 }
-
-CONNMAN_PLUGIN_DEFINE(dnsproxy, "DNS proxy resolver plugin", VERSION,
-                CONNMAN_PLUGIN_PRIORITY_DEFAULT, dnsproxy_init, dnsproxy_exit)
index 6cdf59e..a38eb60 100644 (file)
@@ -224,6 +224,7 @@ int main(int argc, char *argv[])
        __connman_config_init();
        __connman_stats_init();
 
+       __connman_dnsproxy_init();
        __connman_resolver_init();
        __connman_ipconfig_init();
        __connman_rtnl_init();
@@ -261,6 +262,7 @@ int main(int argc, char *argv[])
        __connman_rtnl_cleanup();
        __connman_ipconfig_cleanup();
        __connman_resolver_cleanup();
+       __connman_dnsproxy_cleanup();
 
        __connman_stats_cleanup();
        __connman_config_cleanup();