summaryrefslogtreecommitdiff
path: root/libnm/nm-client.h
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2014-09-29 10:58:16 -0400
committerDan Winship <danw@gnome.org>2014-10-10 12:40:19 -0400
commit6f3d1f95262abbf5101d6f88ecfa292d575e0d4f (patch)
treebffa6c50529d46377f71da8907dcd734a8e7a366 /libnm/nm-client.h
parentc1f1e9618126e618e9f10d9a5ce74b2ef7101e76 (diff)
downloadNetworkManager-6f3d1f95262abbf5101d6f88ecfa292d575e0d4f.tar.gz
libnm: merge NMRemoteSettings into NMClient
Make NMRemoteSettings internal and have NMClient wrap all of its APIs, just like it does with NMManager.
Diffstat (limited to 'libnm/nm-client.h')
-rw-r--r--libnm/nm-client.h76
1 files changed, 76 insertions, 0 deletions
diff --git a/libnm/nm-client.h b/libnm/nm-client.h
index bcb897eada..99de7e003a 100644
--- a/libnm/nm-client.h
+++ b/libnm/nm-client.h
@@ -29,9 +29,11 @@
#include <glib.h>
#include <glib-object.h>
#include <gio/gio.h>
+
#include <nm-dbus-interface.h>
#include "nm-device.h"
#include "nm-active-connection.h"
+#include "nm-remote-connection.h"
#include "nm-vpn-connection.h"
G_BEGIN_DECLS
@@ -59,6 +61,15 @@ G_BEGIN_DECLS
#define NM_CLIENT_PRIMARY_CONNECTION "primary-connection"
#define NM_CLIENT_ACTIVATING_CONNECTION "activating-connection"
#define NM_CLIENT_DEVICES "devices"
+#define NM_CLIENT_CONNECTIONS "connections"
+#define NM_CLIENT_HOSTNAME "hostname"
+#define NM_CLIENT_CAN_MODIFY "can-modify"
+
+#define NM_CLIENT_DEVICE_ADDED "device-added"
+#define NM_CLIENT_DEVICE_REMOVED "device-removed"
+#define NM_CLIENT_PERMISSION_CHANGED "permission-changed"
+#define NM_CLIENT_CONNECTION_ADDED "connection-added"
+#define NM_CLIENT_CONNECTION_REMOVED "connection-removed"
/**
* NMClientPermission:
@@ -131,12 +142,18 @@ typedef enum {
* @NM_CLIENT_ERROR_UNKNOWN: unknown or unclassified error
* @NM_CLIENT_ERROR_MANAGER_NOT_RUNNING: an operation that requires NetworkManager
* failed because NetworkManager is not running
+ * @NM_CLIENT_ERROR_CONNECTION_REMOVED: the #NMRemoteConnection object
+ * was removed before it was completely initialized
+ * @NM_CLIENT_ERROR_CONNECTION_UNAVAILABLE: the #NMRemoteConnection object
+ * is not visible or otherwise unreadable
*
* Describes errors that may result from operations involving a #NMClient.
**/
typedef enum {
NM_CLIENT_ERROR_UNKNOWN = 0, /*< nick=UnknownError >*/
NM_CLIENT_ERROR_MANAGER_NOT_RUNNING, /*< nick=ManagerNotRunning >*/
+ NM_CLIENT_ERROR_CONNECTION_REMOVED, /*< nick=ConnectionRemoved >*/
+ NM_CLIENT_ERROR_CONNECTION_UNAVAILABLE, /*< nick=ConnectionUnavailable >*/
} NMClientError;
#define NM_CLIENT_ERROR nm_client_error_quark ()
@@ -155,6 +172,8 @@ typedef struct {
void (*permission_changed) (NMClient *client,
NMClientPermission permission,
NMClientPermissionResult result);
+ void (*connection_added) (NMClient *client, NMRemoteConnection *connection);
+ void (*connection_removed) (NMClient *client, NMRemoteConnection *connection);
/*< private >*/
gpointer padding[8];
@@ -218,6 +237,19 @@ NMConnectivityState nm_client_check_connectivity_finish (NMClient *client,
GAsyncResult *result,
GError **error);
+gboolean nm_client_save_hostname (NMClient *client,
+ const char *hostname,
+ GCancellable *cancellable,
+ GError **error);
+void nm_client_save_hostname_async (NMClient *client,
+ const char *hostname,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+gboolean nm_client_save_hostname_finish (NMClient *client,
+ GAsyncResult *result,
+ GError **error);
+
/* Devices */
const GPtrArray *nm_client_get_devices (NMClient *client);
@@ -266,6 +298,50 @@ gboolean nm_client_deactivate_connection_finish (NMClient *client,
GAsyncResult *result,
GError **error);
+/* Connections */
+
+GSList *nm_client_list_connections (NMClient *client);
+
+NMRemoteConnection *nm_client_get_connection_by_id (NMClient *client, const char *id);
+NMRemoteConnection *nm_client_get_connection_by_path (NMClient *client, const char *path);
+NMRemoteConnection *nm_client_get_connection_by_uuid (NMClient *client, const char *uuid);
+
+void nm_client_add_connection_async (NMClient *client,
+ NMConnection *connection,
+ gboolean save_to_disk,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+NMRemoteConnection *nm_client_add_connection_finish (NMClient *client,
+ GAsyncResult *result,
+ GError **error);
+
+gboolean nm_client_load_connections (NMClient *client,
+ char **filenames,
+ char ***failures,
+ GCancellable *cancellable,
+ GError **error);
+void nm_client_load_connections_async (NMClient *client,
+ char **filenames,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+gboolean nm_client_load_connections_finish (NMClient *client,
+ char ***failures,
+ GAsyncResult *result,
+ GError **error);
+
+gboolean nm_client_reload_connections (NMClient *client,
+ GCancellable *cancellable,
+ GError **error);
+void nm_client_reload_connections_async (NMClient *client,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+gboolean nm_client_reload_connections_finish (NMClient *client,
+ GAsyncResult *result,
+ GError **error);
+
G_END_DECLS
#endif /* __NM_CLIENT_H__ */