[PATCH 1/6] settings: Add setting-resources with network drives
- From: Dominik Sommer <dominik sommer name>
- To: networkmanager-list gnome org
- Subject: [PATCH 1/6] settings: Add setting-resources with network drives
- Date: Mon, 16 Apr 2012 14:28:01 +0200
---
libnm-util/Makefile.am | 2 +
libnm-util/libnm-util.ver | 13 ++
libnm-util/nm-connection.c | 25 +++-
libnm-util/nm-connection.h | 2 +
libnm-util/nm-setting-resources.c | 381
+++++++++++++++++++++++++++++++++++++
libnm-util/nm-setting-resources.h | 90 +++++++++
diff --git a/libnm-util/Makefile.am b/libnm-util/Makefile.am
index 4d3afc8..d5df3a1 100644
--- a/libnm-util/Makefile.am
+++ b/libnm-util/Makefile.am
@@ -29,6 +29,7 @@ libnm_util_include_HEADERS = \
nm-setting-gsm.h \
nm-setting-cdma.h \
nm-setting-olpc-mesh.h \
+ nm-setting-resources.h \
nm-setting-wimax.h \
nm-setting-wired.h \
nm-setting-wireless.h \
@@ -62,6 +63,7 @@ libnm_util_la_csources = \
nm-setting-gsm.c \
nm-setting-cdma.c \
nm-setting-olpc-mesh.c \
+ nm-setting-resources.c \
nm-setting-wimax.c \
nm-setting-wired.c \
nm-setting-wireless.c \
diff --git a/libnm-util/libnm-util.ver b/libnm-util/libnm-util.ver
index eb3f1f3..c944bd3 100644
--- a/libnm-util/libnm-util.ver
+++ b/libnm-util/libnm-util.ver
@@ -27,6 +27,7 @@ global:
nm_connection_get_setting_olpc_mesh;
nm_connection_get_setting_ppp;
nm_connection_get_setting_pppoe;
+ nm_connection_get_setting_resources;
nm_connection_get_setting_serial;
nm_connection_get_setting_vlan;
nm_connection_get_setting_vpn;
@@ -357,6 +358,17 @@ global:
nm_setting_pppoe_get_type;
nm_setting_pppoe_get_username;
nm_setting_pppoe_new;
+ nm_setting_resources_get_type;
+ nm_setting_resources_new;
+ nm_setting_resources_get_num_network_drives;
+ nm_setting_resources_get_network_drive;
+ nm_setting_resources_add_network_drive;
+ nm_setting_resources_remove_network_drive_by_index;
+ nm_setting_resources_remove_network_drive_by_uri;
+ nm_setting_resources_clear_network_drives;
+ nm_setting_resources_has_network_drive;
+ nm_setting_resources_is_scheme_allowed;
+ nm_setting_resources_get_allowed_schemes;
nm_setting_secret_flags_get_type;
nm_setting_serial_error_get_type;
nm_setting_serial_error_quark;
@@ -501,6 +513,7 @@ global:
nm_utils_ip6_routes_from_gvalue;
nm_utils_ip6_routes_to_gvalue;
nm_utils_is_empty_ssid;
+ nm_utils_parse_mount_uri;
nm_utils_rsa_key_encrypt;
nm_utils_same_ssid;
nm_utils_security_type_get_type;
diff --git a/libnm-util/nm-connection.c b/libnm-util/nm-connection.c
index 1309999..decfdd8 100644
--- a/libnm-util/nm-connection.c
+++ b/libnm-util/nm-connection.c
@@ -39,6 +39,7 @@
#include "nm-setting-ip6-config.h"
#include "nm-setting-ppp.h"
#include "nm-setting-pppoe.h"
+#include "nm-setting-resources.h"
#include "nm-setting-wimax.h"
#include "nm-setting-wired.h"
#include "nm-setting-wireless.h"
@@ -117,7 +118,7 @@ static guint signals[LAST_SIGNAL] = { 0 };
static GHashTable *registered_settings = NULL;
-#define DEFAULT_MAP_SIZE 19
+#define DEFAULT_MAP_SIZE 20
static struct SettingInfo {
const char *name;
@@ -279,6 +280,11 @@ register_default_settings (void)
NM_SETTING_IP6_CONFIG_ERROR,
6, FALSE);
+ register_one_setting (NM_SETTING_RESOURCES_SETTING_NAME,
+ NM_TYPE_SETTING_RESOURCES,
+ NM_SETTING_RESOURCES_ERROR,
+ 6, FALSE);
+
/* Be sure to update DEFAULT_MAP_SIZE if you add another setting!! */
}
@@ -1557,6 +1563,23 @@ nm_connection_get_setting_pppoe (NMConnection
*connection)
}
/**
+ * nm_connection_get_setting_resources:
+ * @connection: the #NMConnection
+ *
+ * A shortcut to return any #NMSettingResources the connection might
contain.
+ *
+ * Returns: (transfer none): an #NMSettingResources if the connection
contains one, otherwise NULL
+ **/
+NMSettingResources *
+nm_connection_get_setting_resources (NMConnection *connection)
+{
+ g_return_val_if_fail (connection != NULL, NULL);
+ g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
+
+ return (NMSettingResources *) nm_connection_get_setting
(connection, NM_TYPE_SETTING_RESOURCES);
+}
+
+/**
* nm_connection_get_setting_serial:
* @connection: the #NMConnection
*
diff --git a/libnm-util/nm-connection.h b/libnm-util/nm-connection.h
index 6df74f5..23665e0 100644
--- a/libnm-util/nm-connection.h
+++ b/libnm-util/nm-connection.h
@@ -42,6 +42,7 @@
#include <nm-setting-olpc-mesh.h>
#include <nm-setting-ppp.h>
#include <nm-setting-pppoe.h>
+#include <nm-setting-resources.h>
#include <nm-setting-serial.h>
#include <nm-setting-vpn.h>
#include <nm-setting-wimax.h>
@@ -196,6 +197,7 @@ NMSettingIP6Config *
nm_connection_get_setting_ip6_config (NMConnec
NMSettingOlpcMesh * nm_connection_get_setting_olpc_mesh
(NMConnection *connection);
NMSettingPPP * nm_connection_get_setting_ppp
(NMConnection *connection);
NMSettingPPPOE * nm_connection_get_setting_pppoe
(NMConnection *connection);
+NMSettingResources * nm_connection_get_setting_resources
(NMConnection *connection);
NMSettingSerial * nm_connection_get_setting_serial
(NMConnection *connection);
NMSettingVPN * nm_connection_get_setting_vpn
(NMConnection *connection);
NMSettingWimax * nm_connection_get_setting_wimax
(NMConnection *connection);
diff --git a/libnm-util/nm-setting-resources.c
b/libnm-util/nm-setting-resources.c
new file mode 100644
index 0000000..7448e8d
--- /dev/null
+++ b/libnm-util/nm-setting-resources.c
@@ -0,0 +1,381 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+
+/*
+ * Dominik Sommer <dominik sommer name>
+ *
+ * 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.
+ *
+ * (C) Copyright 2007 - 2008 Novell, Inc.
+ * (C) Copyright 2012 Dominik Sommer
+ */
+
+#include "nm-setting-resources.h"
+
+#include <gio/gio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "nm-utils.h"
+#include "nm-param-spec-specialized.h"
+#include "nm-dbus-glib-types.h"
+
+/**
+ * nm_setting_resources_error_quark:
+ *
+ * Registers an error quark for #NMSettingResources if necessary.
+ *
+ * Returns: the error quark used for #NMSettingResources errors.
+ **/
+GQuark
+nm_setting_resources_error_quark (void)
+{
+ static GQuark quark;
+
+ if (G_UNLIKELY (!quark))
+ quark = g_quark_from_static_string
("nm-setting-resources-error-quark");
+ return quark;
+}
+
+G_DEFINE_TYPE (NMSettingResources, nm_setting_resources, NM_TYPE_SETTING)
+
+#define NM_SETTING_RESOURCES_GET_PRIVATE(o)
(G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_RESOURCES,
NMSettingResourcesPrivate))
+
+typedef struct {
+ GSList *network_drives; /* array of const char* */
+} NMSettingResourcesPrivate;
+
+enum {
+ PROP_0,
+ PROP_NETWORK_DRIVES,
+
+ LAST_PROP
+};
+
+static const char *allowed_schemes[] = {
+ "smb",
+ "dav",
+ "davs",
+ NULL
+};
+
+NMSetting *
+nm_setting_resources_new (void)
+{
+ return (NMSetting *) g_object_new (NM_TYPE_SETTING_RESOURCES, NULL);
+}
+
+/**
+ * nm_setting_resources_get_num_network_drives:
+ * @setting: the #NMSettingResources
+ *
+ * Returns: the number of configured network drives
+ **/
+guint32
+nm_setting_resources_get_num_network_drives (NMSettingResources *setting)
+{
+ g_return_val_if_fail (NM_IS_SETTING_RESOURCES (setting), 0);
+
+ return g_slist_length (NM_SETTING_RESOURCES_GET_PRIVATE
(setting)->network_drives);
+}
+
+/**
+ * nm_setting_resources_get_network_drive:
+ * @setting: the #NMSettingResources
+ * @i: index number of the network drive to return
+ *
+ * Returns: the network drive at index @i
+ **/
+const char *
+nm_setting_resources_get_network_drive (NMSettingResources *setting,
guint32 i)
+{
+ NMSettingResourcesPrivate *priv;
+
+ g_return_val_if_fail (NM_IS_SETTING_RESOURCES (setting), NULL);
+
+ priv = NM_SETTING_RESOURCES_GET_PRIVATE (setting);
+ g_return_val_if_fail (i <= g_slist_length (priv->network_drives),
NULL);
+
+ return (const char *) g_slist_nth_data (priv->network_drives, i);
+}
+
+/**
+ * nm_setting_resources_add_network_drive:
+ * @setting: the #NMSettingResources
+ * @network_drive: the uri of the new network drive to add
+ *
+ * Adds a new network drive to the setting. The given network drive is
+ * duplicated internally and is not changed by this function.
+ *
+ * Returns: %TRUE if the network drive was added; %FALSE if the network
drive
+ * was already known.
+ **/
+gboolean
+nm_setting_resources_add_network_drive (NMSettingResources *setting,
+ const char *network_drive)
+{
+ NMSettingResourcesPrivate *priv;
+ char *copy;
+ GSList *iter;
+
+ g_return_val_if_fail (NM_IS_SETTING_RESOURCES (setting), FALSE);
+ g_return_val_if_fail (network_drive != NULL, FALSE);
+
+ priv = NM_SETTING_RESOURCES_GET_PRIVATE (setting);
+ for (iter = priv->network_drives; iter; iter = g_slist_next (iter)) {
+ if (strcasecmp ((const char *) iter->data, network_drive) == 0)
+ return FALSE;
+ }
+
+ copy = g_strdup (network_drive);
+ g_return_val_if_fail (copy != NULL, FALSE);
+
+ priv->network_drives = g_slist_append (priv->network_drives, copy);
+ return TRUE;
+}
+
+/**
+ * nm_setting_resources_remove_network_drive:
+ * @setting: the #NMSettingResources
+ * @i: index number of the network drive to remove
+ *
+ * Removes the network drive at index @i.
+ **/
+void
+nm_setting_resources_remove_network_drive_by_index (NMSettingResources
*setting, guint32 i)
+{
+ NMSettingResourcesPrivate *priv;
+ GSList *elt;
+
+ g_return_if_fail (NM_IS_SETTING_RESOURCES (setting));
+
+ priv = NM_SETTING_RESOURCES_GET_PRIVATE (setting);
+ elt = g_slist_nth (priv->network_drives, i);
+ g_return_if_fail (elt != NULL);
+
+ g_free(elt->data);
+ priv->network_drives = g_slist_delete_link (priv->network_drives, elt);
+}
+
+/**
+ * nm_setting_resources_remove_network_drive:
+ * @setting: the #NMSettingResources
+ * @network_drive: the uri of the network drive to remove
+ *
+ * Removes the network drive.
+ **/
+void
+nm_setting_resources_remove_network_drive_by_uri (NMSettingResources
*setting, const char *network_drive)
+{
+ NMSettingResourcesPrivate *priv;
+ guint32 i;
+
+ g_return_if_fail (NM_IS_SETTING_RESOURCES (setting));
+ g_return_if_fail (network_drive != NULL);
+
+ priv = NM_SETTING_RESOURCES_GET_PRIVATE (setting);
+
+ for (i = 0; i <
nm_setting_resources_get_num_network_drives(setting); i++) {
+ if (strcasecmp ((char *)g_slist_nth_data (priv->network_drives,
i), network_drive) == 0)
+ {
+ nm_setting_resources_remove_network_drive_by_index(setting, i);
+ return;
+ }
+ }
+}
+
+/**
+ * nm_setting_resources_clear_network_drives:
+ * @setting: the #NMSettingResources
+ *
+ * Removes all configured network drives.
+ **/
+void
+nm_setting_resources_clear_network_drives (NMSettingResources *setting)
+{
+ NMSettingResourcesPrivate *priv = NM_SETTING_RESOURCES_GET_PRIVATE
(setting);
+
+ g_return_if_fail (NM_IS_SETTING_RESOURCES (setting));
+
+ nm_utils_slist_free (priv->network_drives, g_free);
+ priv->network_drives = NULL;
+}
+
+/**
+ * nm_setting_resources_has_network_drive:
+ * @setting: the #NMSettingResources
+ * @network_drive: the network drive to check
+ *
+ * Returns: %TRUE if this network drive is configured with these settings;
+ * %FALSE if it is unknown
+ **/
+gboolean
+nm_setting_resources_has_network_drive (NMSettingResources *setting,
const char *network_drive)
+{
+ NMSettingResourcesPrivate *priv;
+ GSList *iter;
+
+ g_return_val_if_fail (NM_IS_SETTING_RESOURCES (setting), FALSE);
+ g_return_val_if_fail (network_drive != NULL, FALSE);
+
+ priv = NM_SETTING_RESOURCES_GET_PRIVATE (setting);
+ for (iter = priv->network_drives; iter; iter = g_slist_next (iter)) {
+ if (strcasecmp ((const char *) iter->data, network_drive) == 0)
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+/**
+ * nm_setting_resources_is_scheme_allowed:
+ * @scheme: The scheme to be checked
+ *
+ * Checks if a given scheme (smb, ftp, dav, ...) is valid for auto-mounting
+ **/
+gboolean
+nm_setting_resources_is_scheme_allowed (char *scheme)
+{
+ int i = 0;
+
+ if ((scheme == NULL) || (strlen(scheme) == 0)) return FALSE;
+
+ while (allowed_schemes[i] != NULL)
+ {
+ if (strcmp(allowed_schemes[i], scheme) == 0) return TRUE;
+ i++;
+ }
+
+ return FALSE;
+}
+
+/**
+ * nm_setting_resources_get_allowed_schemes:
+ *
+ * Returns the reference to the array of char* holding the allowed schemes
+ * for auto-mounting, which is not to be modified / freed.
+ **/
+const char **
+nm_setting_resources_get_allowed_schemes (void)
+{
+ return allowed_schemes;
+}
+
+static gboolean
+verify (NMSetting *setting, GSList *all_settings, GError **error)
+{
+// NMSettingResources *self = NM_SETTING_RESOURCES (setting);
+ NMSettingResourcesPrivate *priv = NM_SETTING_RESOURCES_GET_PRIVATE
(setting);
+ GSList *iter;
+ gboolean valid = TRUE;
+
+ // Validate network drives for allowed network protocols, correct
uri scheme
+ for (iter = priv->network_drives; valid && iter; iter =
g_slist_next (iter))
+ {
+ char *scheme, *host, *folder;
+
+ // Check if uri scheme is supported:
+ if ((!nm_utils_parse_mount_uri(iter->data, &scheme, &host,
&folder)) || // uri is valid
+ (!nm_setting_resources_is_scheme_allowed(scheme)) || // uri
scheme is supported
+ (host == NULL) || (strlen(host) == 0) || // host is set
+ (((folder == NULL) || (strlen(folder) == 0)) &&
(strcmp(scheme, "smb") == 0))) // for smb scheme: folder is set
+ {
+ g_set_error (error,
+ NM_SETTING_RESOURCES_ERROR,
+ NM_SETTING_RESOURCES_ERROR_INVALID_PROPERTY,
+ NM_SETTING_RESOURCES_NETWORK_DRIVES);
+ valid = FALSE;
+ }
+
+ if (scheme != NULL) g_free(scheme);
+ if (host != NULL) g_free(host);
+ if (folder != NULL) g_free(folder);
+ }
+
+ return valid;
+}
+
+static void
+nm_setting_resources_init (NMSettingResources *setting)
+{
+ g_object_set (setting, NM_SETTING_NAME,
NM_SETTING_RESOURCES_SETTING_NAME, NULL);
+}
+
+static void
+finalize (GObject *object)
+{
+// NMSettingResources *self = NM_SETTING_RESOURCES (object);
+
+ G_OBJECT_CLASS (nm_setting_resources_parent_class)->finalize (object);
+}
+
+static void
+set_property (GObject *object, guint prop_id,
+ const GValue *value, GParamSpec *pspec)
+{
+ NMSettingResources *setting = NM_SETTING_RESOURCES (object);
+ NMSettingResourcesPrivate *priv = NM_SETTING_RESOURCES_GET_PRIVATE
(setting);
+
+ switch (prop_id) {
+ case PROP_NETWORK_DRIVES:
+ nm_utils_slist_free (priv->network_drives, g_free);
+ priv->network_drives = g_value_dup_boxed (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+get_property (GObject *object, guint prop_id,
+ GValue *value, GParamSpec *pspec)
+{
+ NMSettingResources *setting = NM_SETTING_RESOURCES (object);
+ NMSettingResourcesPrivate *priv = NM_SETTING_RESOURCES_GET_PRIVATE
(setting);
+
+ switch (prop_id) {
+ case PROP_NETWORK_DRIVES:
+ g_value_set_boxed (value, priv->network_drives);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+nm_setting_resources_class_init (NMSettingResourcesClass *setting_class)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
+ NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class);
+
+ g_type_class_add_private (setting_class, sizeof
(NMSettingResourcesPrivate));
+
+ /* virtual methods */
+ object_class->set_property = set_property;
+ object_class->get_property = get_property;
+ object_class->finalize = finalize;
+ parent_class->verify = verify;
+
+ /* Properties */
+ g_object_class_install_property
+ (object_class, PROP_NETWORK_DRIVES,
+ _nm_param_spec_specialized (NM_SETTING_RESOURCES_NETWORK_DRIVES,
+ "Network drives",
+ "The network drives to mount/unmount when
connected to / disconnected from this network",
+ DBUS_TYPE_G_LIST_OF_STRING,
+ G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));
+}
diff --git a/libnm-util/nm-setting-resources.h
b/libnm-util/nm-setting-resources.h
new file mode 100644
index 0000000..34fff3c
--- /dev/null
+++ b/libnm-util/nm-setting-resources.h
@@ -0,0 +1,90 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+
+/*
+ * Dominik Sommer <dominik sommer name>
+ *
+ * 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.
+ *
+ * (C) Copyright 2007 - 2008 Novell, Inc.
+ * (C) Copyright 2012 Dominik Sommer
+ */
+
+#ifndef NM_SETTING_RESOURCES_H
+#define NM_SETTING_RESOURCES_H
+
+#include <nm-setting.h>
+
+G_BEGIN_DECLS
+
+#define NM_TYPE_SETTING_RESOURCES
(nm_setting_resources_get_type ())
+#define NM_SETTING_RESOURCES(obj)
(G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_RESOURCES,
NMSettingResources))
+#define NM_SETTING_RESOURCES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST
((klass), NM_TYPE_SETTING_RESOURCES, NMSettingResourcesClass))
+#define NM_IS_SETTING_RESOURCES(obj)
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_RESOURCES))
+#define NM_IS_SETTING_RESOURCES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE
((obj), NM_TYPE_SETTING_RESOURCES))
+#define NM_SETTING_RESOURCES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS
((obj), NM_TYPE_SETTING_RESOURCES, NMSettingResourcesClass))
+
+#define NM_SETTING_RESOURCES_SETTING_NAME "resources"
+
+/**
+ * NMSettingResourcesError:
+ * @NM_SETTING_RESOURCES_ERROR_UNKNOWN: unknown or unclassified error
+ * @NM_SETTING_RESOURCES_ERROR_INVALID_PROPERTY: the property was invalid
+ * @NM_SETTING_RESOURCES_ERROR_MISSING_PROPERTY: the property was
missing and is
+ * required
+ */
+typedef enum {
+ NM_SETTING_RESOURCES_ERROR_UNKNOWN = 0, /*<
nick=UnknownError >*/
+ NM_SETTING_RESOURCES_ERROR_INVALID_PROPERTY, /*<
nick=InvalidProperty >*/
+ NM_SETTING_RESOURCES_ERROR_MISSING_PROPERTY, /*<
nick=MissingProperty >*/
+ NM_SETTING_RESOURCES_ERROR_NOT_ALLOWED_FOR_METHOD /*<
nick=NotAllowedForMethod >*/
+} NMSettingResourcesError;
+
+#define NM_SETTING_RESOURCES_ERROR nm_setting_resources_error_quark ()
+GQuark nm_setting_resources_error_quark (void);
+
+#define NM_SETTING_RESOURCES_NETWORK_DRIVES "network-drives"
+
+typedef struct {
+ NMSetting parent;
+} NMSettingResources;
+
+typedef struct {
+ NMSettingClass parent;
+
+ /* Padding for future expansion */
+ void (*_reserved1) (void);
+ void (*_reserved2) (void);
+ void (*_reserved3) (void);
+ void (*_reserved4) (void);
+} NMSettingResourcesClass;
+
+GType nm_setting_resources_get_type (void);
+
+NMSetting *nm_setting_resources_new (void);
+
+guint32 nm_setting_resources_get_num_network_drives
(NMSettingResources *setting);
+const char * nm_setting_resources_get_network_drive
(NMSettingResources *setting, guint32 i);
+gboolean nm_setting_resources_add_network_drive
(NMSettingResources *setting, const char *network_drive);
+void nm_setting_resources_remove_network_drive_by_index
(NMSettingResources *setting, guint32 i);
+void nm_setting_resources_remove_network_drive_by_uri
(NMSettingResources *setting, const char *network_drive);
+void nm_setting_resources_clear_network_drives
(NMSettingResources *setting);
+gboolean nm_setting_resources_has_network_drive
(NMSettingResources *setting, const char *network_drive);
+gboolean nm_setting_resources_is_scheme_allowed (char *scheme);
+const char ** nm_setting_resources_get_allowed_schemes (void);
+
+G_END_DECLS
+
+#endif /* NM_SETTING_RESOURCES_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]