Some SlackBuild scripts for Slackware.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

188 lines
5.5 KiB

diff --git a/src/dns-manager/Makefile.am b/src/dns-manager/Makefile.am
index e6c2ff2..a9d1c39 100644
--- a/src/dns-manager/Makefile.am
+++ b/src/dns-manager/Makefile.am
@@ -16,6 +16,8 @@ libdns_manager_la_SOURCES = \
nm-dns-plugin.c \
nm-dns-dnsmasq.h \
nm-dns-dnsmasq.c \
+ nm-dns-none.h \
+ nm-dns-none.c \
nm-dns-utils.h \
nm-dns-utils.c
diff --git a/src/dns-manager/nm-dns-manager.c b/src/dns-manager/nm-dns-manager.c
index fb42663..fcd458b 100644
--- a/src/dns-manager/nm-dns-manager.c
+++ b/src/dns-manager/nm-dns-manager.c
@@ -1043,6 +1043,8 @@ load_plugins (NMDnsManager *self, const char **plugins)
for (iter = plugins; iter && *iter; iter++) {
if (!strcasecmp (*iter, "dnsmasq"))
plugin = NM_DNS_PLUGIN (nm_dns_dnsmasq_new ());
+ else if (!strcasecmp (*iter, "none"))
+ plugin = NM_DNS_PLUGIN(nm_dns_none_new());
else {
nm_log_warn (LOGD_DNS, "Unknown DNS plugin '%s'", *iter);\
continue;
diff --git a/src/dns-manager/nm-dns-none.c b/src/dns-manager/nm-dns-none.c
new file mode 100644
index 0000000..dce7323
--- /dev/null
+++ b/src/dns-manager/nm-dns-none.c
@@ -0,0 +1,102 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2014 Damien Goutte-Gattat
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <glib.h>
+#include <glib/gi18n.h>
+
+#include "nm-dns-none.h"
+
+G_DEFINE_TYPE (NMDnsNone, nm_dns_none, NM_TYPE_DNS_PLUGIN)
+
+#define NM_DNS_NONE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DNS_NONE, NMDnsNonePrivate))
+
+typedef struct {
+ guint32 foo;
+} NMDnsNonePrivate;
+
+/*******************************************/
+
+static gboolean
+update (NMDnsPlugin *plugin,
+ const GSList *vpn_configs,
+ const GSList *dev_configs,
+ const GSList *other_configs,
+ const char *hostname)
+{
+ return TRUE;
+}
+
+static void
+child_quit (NMDnsPlugin *plugin, gint status)
+{
+}
+
+static gboolean
+init (NMDnsPlugin *plugin)
+{
+ return TRUE;
+}
+
+static gboolean
+is_caching (NMDnsPlugin *plugin)
+{
+ return TRUE;
+}
+
+static const char *
+get_name (NMDnsPlugin *plugin)
+{
+ return "none";
+}
+
+/****************************************************************/
+
+NMDnsNone *
+nm_dns_none_new (void)
+{
+ return (NMDnsNone *) g_object_new (NM_TYPE_DNS_NONE, NULL);
+}
+
+static void
+nm_dns_none_init (NMDnsNone *self)
+{
+}
+
+static void
+dispose (GObject *object)
+{
+ G_OBJECT_CLASS (nm_dns_none_parent_class)->dispose (object);
+}
+
+static void
+nm_dns_none_class_init (NMDnsNoneClass *dns_class)
+{
+ NMDnsPluginClass *plugin_class = NM_DNS_PLUGIN_CLASS (dns_class);
+ GObjectClass *object_class = G_OBJECT_CLASS (dns_class);
+
+ g_type_class_add_private (dns_class, sizeof (NMDnsNonePrivate));
+
+ object_class->dispose = dispose;
+
+ plugin_class->init = init;
+ plugin_class->child_quit = child_quit;
+ plugin_class->is_caching = is_caching;
+ plugin_class->update = update;
+ plugin_class->get_name = get_name;
+}
diff --git a/src/dns-manager/nm-dns-none.h b/src/dns-manager/nm-dns-none.h
new file mode 100644
index 0000000..f519193
--- /dev/null
+++ b/src/dns-manager/nm-dns-none.h
@@ -0,0 +1,48 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/*
+ * Copyright (C) 2014 Damien Goutte-Gattat
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef NM_DNS_NONE_H
+#define NM_DNS_NONE_H
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include "nm-dns-plugin.h"
+
+#define NM_TYPE_DNS_NONE (nm_dns_none_get_type ())
+#define NM_DNS_NONE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DNS_NONE, NMDnsNone))
+#define NM_DNS_NONE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DNS_NONE, NMDnsNoneClass))
+#define NM_IS_DNS_NONE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DNS_NONE))
+#define NM_IS_DNS_NONE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DNS_NONE))
+#define NM_DNS_NONE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DNS_NONE, NMDnsNoneClass))
+
+typedef struct {
+ NMDnsPlugin parent;
+} NMDnsNone;
+
+typedef struct {
+ NMDnsPluginClass parent;
+} NMDnsNoneClass;
+
+GType nm_dns_none_get_type (void);
+
+NMDnsNone *nm_dns_none_new (void);
+
+#endif /* NM_DNS_NONE_H */
+