summaryrefslogtreecommitdiff
path: root/libnm-glib/nm-dns-manager.h
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2013-03-19 09:16:26 -0400
committerDan Winship <danw@gnome.org>2013-12-15 09:20:24 -0500
commit2b38323b184876e32b9258f02415d5995a76f8d6 (patch)
tree78b25b503d7f44ed6a2a0c605e2895b22521303d /libnm-glib/nm-dns-manager.h
parentcc9bd5bd293739de0eb2b3a9f790eed6ecd4c709 (diff)
downloadNetworkManager-2b38323b184876e32b9258f02415d5995a76f8d6.tar.gz
libnm-glib: add NMDnsManager [WIP]danw/wip/dnspubdanw/dnspub-bgo603321
https://bugzilla.gnome.org/show_bug.cgi?id=603321
Diffstat (limited to 'libnm-glib/nm-dns-manager.h')
-rw-r--r--libnm-glib/nm-dns-manager.h89
1 files changed, 89 insertions, 0 deletions
diff --git a/libnm-glib/nm-dns-manager.h b/libnm-glib/nm-dns-manager.h
new file mode 100644
index 0000000000..436612b836
--- /dev/null
+++ b/libnm-glib/nm-dns-manager.h
@@ -0,0 +1,89 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/*
+ * libnm_glib -- Access network status & information from glib applications
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA.
+ *
+ * Copyright 2013 Red Hat, Inc.
+ */
+
+#ifndef NM_DNS_MANAGER_H
+#define NM_DNS_MANAGER_H
+
+#include "nm-object.h"
+
+G_BEGIN_DECLS
+
+#define NM_TYPE_DNS_MANAGER (nm_dns_manager_get_type ())
+#define NM_DNS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DNS_MANAGER, NMDnsManager))
+#define NM_DNS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DNS_MANAGER, NMDnsManagerClass))
+#define NM_IS_DNS_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DNS_MANAGER))
+#define NM_IS_DNS_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DNS_MANAGER))
+#define NM_DNS_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DNS_MANAGER, NMDnsManagerClass))
+
+#define NM_DNS_MANAGER_NAMESERVERS "nameservers"
+#define NM_DNS_MANAGER_DOMAIN "domain"
+#define NM_DNS_MANAGER_SEARCHES "searches"
+#define NM_DNS_MANAGER_NIS_DOMAIN "nis-domain"
+#define NM_DNS_MANAGER_NIS_SERVERS "nis-servers"
+#define NM_DNS_MANAGER_WINS_SERVERS "wins-servers"
+#define NM_DNS_MANAGER_SPLIT_DNS "split-dns"
+
+typedef struct {
+ NMObject parent;
+} NMDnsManager;
+
+typedef struct {
+ NMObjectClass parent;
+
+ /* Padding for future expansion */
+ void (*_reserved1) (void);
+ void (*_reserved2) (void);
+ void (*_reserved3) (void);
+ void (*_reserved4) (void);
+ void (*_reserved5) (void);
+ void (*_reserved6) (void);
+} NMDnsManagerClass;
+
+GType nm_dns_manager_get_type (void);
+
+NMDnsManager *nm_dns_manager_new (void);
+
+void nm_dns_manager_new_async (GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+NMDnsManager *nm_dns_manager_new_finish (GAsyncResult *result,
+ GError **error);
+
+const char **nm_dns_manager_get_nameservers (NMDnsManager *mgr);
+const char *nm_dns_manager_get_domain (NMDnsManager *mgr);
+const char **nm_dns_manager_get_searches (NMDnsManager *mgr);
+const char **nm_dns_manager_get_nis_servers (NMDnsManager *mgr);
+const char *nm_dns_manager_get_nis_domain (NMDnsManager *mgr);
+const char **nm_dns_manager_get_wins_servers (NMDnsManager *mgr);
+
+typedef struct {
+ char *interface;
+ char **nameservers;
+ char **domains;
+ char **ip_ranges;
+} NMDnsManagerNetwork;
+
+const GPtrArray *nm_dns_manager_get_split_dns (NMDnsManager *mgr);
+
+G_END_DECLS
+
+#endif /* NM_DNS_MANAGER_H */