summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.plugins12
-rwxr-xr-xbootstrap-configure1
-rw-r--r--configure.ac6
-rw-r--r--plugins/google.c48
4 files changed, 67 insertions, 0 deletions
diff --git a/Makefile.plugins b/Makefile.plugins
index 052a24d6..8786c473 100644
--- a/Makefile.plugins
+++ b/Makefile.plugins
@@ -178,6 +178,18 @@ plugins_dnsproxy_la_LDFLAGS = $(plugin_ldflags)
endif
endif
+if GOOGLE
+if GOOGLE_BUILTIN
+builtin_modules += google
+builtin_sources += plugins/google.c
+else
+plugin_LTLIBRARIES += plugins/google.la
+plugin_objects += $(plugins_google_la_OBJECTS)
+plugins_google_la_CFLAGS = $(plugin_cflags)
+plugins_google_la_LDFLAGS = $(plugin_ldflags)
+endif
+endif
+
if POLKIT
if POLKIT_BUILTIN
builtin_modules += polkit
diff --git a/bootstrap-configure b/bootstrap-configure
index 6d91052d..e64a271c 100755
--- a/bootstrap-configure
+++ b/bootstrap-configure
@@ -26,6 +26,7 @@ fi
--enable-openconnect=builtin \
--enable-resolvconf=builtin \
--enable-dnsproxy=builtin \
+ --enable-google=builtin \
--enable-hso=builtin \
--enable-mbm=builtin \
--enable-iwmx \
diff --git a/configure.ac b/configure.ac
index 1dc71848..365b9dc4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -179,6 +179,12 @@ AC_ARG_ENABLE(dnsproxy,
AM_CONDITIONAL(DNSPROXY, test "${enable_dnsproxy}" != "no")
AM_CONDITIONAL(DNSPROXY_BUILTIN, test "${enable_dnsproxy}" = "builtin")
+AC_ARG_ENABLE(google,
+ AC_HELP_STRING([--enable-google], [enable Google Public DNS support]),
+ [enable_google=${enableval}], [enable_google="no"])
+AM_CONDITIONAL(GOOGLE, test "${enable_google}" != "no")
+AM_CONDITIONAL(GOOGLE_BUILTIN, test "${enable_google}" = "builtin")
+
AC_ARG_ENABLE(hso,
AC_HELP_STRING([--enable-hso], [enable HSO support]),
[enable_hso=${enableval}], [enable_hso="no"])
diff --git a/plugins/google.c b/plugins/google.c
new file mode 100644
index 00000000..5e8a63f0
--- /dev/null
+++ b/plugins/google.c
@@ -0,0 +1,48 @@
+/*
+ *
+ * Connection Manager
+ *
+ * Copyright (C) 2007-2009 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/resolver.h>
+
+#define GOOGLE_DNS1 "8.8.8.8"
+#define GOOGLE_DNS2 "8.8.4.4"
+
+static int google_init(void)
+{
+ connman_resolver_append_public_server(GOOGLE_DNS1);
+ connman_resolver_append_public_server(GOOGLE_DNS2);
+
+ return 0;
+}
+
+static void google_exit(void)
+{
+ connman_resolver_remove_public_server(GOOGLE_DNS2);
+ connman_resolver_remove_public_server(GOOGLE_DNS1);
+}
+
+CONNMAN_PLUGIN_DEFINE(google, "Google Public DNS plugin", VERSION,
+ CONNMAN_PLUGIN_PRIORITY_LOW, google_init, google_exit)