From: Marcel Holtmann Date: Mon, 14 Dec 2009 04:09:14 +0000 (+0100) Subject: Add plugin for using Google Public DNS service X-Git-Tag: 2.0_alpha~3074 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3b16abbba0966291974964ae88c8f168ef12a7a3;p=framework%2Fconnectivity%2Fconnman.git Add plugin for using Google Public DNS service --- diff --git a/Makefile.plugins b/Makefile.plugins index 052a24d..8786c47 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 6d91052..e64a271 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 1dc7184..365b9dc 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 0000000..5e8a63f --- /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 +#endif + +#define CONNMAN_API_SUBJECT_TO_CHANGE +#include +#include + +#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)