summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-12-14 05:09:14 +0100
committerMarcel Holtmann <marcel@holtmann.org>2009-12-14 05:09:14 +0100
commit3b16abbba0966291974964ae88c8f168ef12a7a3 (patch)
tree02c34691f221f5638a48a11bc8bcae73cb63b88e /plugins
parenta70633c31fb0525b9411c259a394f67c1f489ab1 (diff)
downloadconnman-3b16abbba0966291974964ae88c8f168ef12a7a3.tar.gz
connman-3b16abbba0966291974964ae88c8f168ef12a7a3.tar.bz2
connman-3b16abbba0966291974964ae88c8f168ef12a7a3.zip
Add plugin for using Google Public DNS service
Diffstat (limited to 'plugins')
-rw-r--r--plugins/google.c48
1 files changed, 48 insertions, 0 deletions
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)