1/* SPDX-License-Identifier: LGPL-2.1-or-later */
2/*
3 * Copyright (C) 2007 - 2008 Novell, Inc.
4 * Copyright (C) 2007 - 2011 Red Hat, Inc.
5 */
6
7#ifndef __NM_REMOTE_CONNECTION_H__
8#define __NM_REMOTE_CONNECTION_H__
9
10#if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION)
11#error "Only <NetworkManager.h> can be included directly."
12#endif
13
14#include "nm-object.h"
15
16G_BEGIN_DECLS
17
18#define NM_TYPE_REMOTE_CONNECTION (nm_remote_connection_get_type())
19#define NM_REMOTE_CONNECTION(obj) \
20 (G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_REMOTE_CONNECTION, NMRemoteConnection))
21#define NM_REMOTE_CONNECTION_CLASS(klass) \
22 (G_TYPE_CHECK_CLASS_CAST((klass), NM_TYPE_REMOTE_CONNECTION, NMRemoteConnectionClass))
23#define NM_IS_REMOTE_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), NM_TYPE_REMOTE_CONNECTION))
24#define NM_IS_REMOTE_CONNECTION_CLASS(klass) \
25 (G_TYPE_CHECK_CLASS_TYPE((klass), NM_TYPE_REMOTE_CONNECTION))
26#define NM_REMOTE_CONNECTION_GET_CLASS(obj) \
27 (G_TYPE_INSTANCE_GET_CLASS((obj), NM_TYPE_REMOTE_CONNECTION, NMRemoteConnectionClass))
28
29/* Properties */
30#define NM_REMOTE_CONNECTION_DBUS_CONNECTION "dbus-connection"
31#define NM_REMOTE_CONNECTION_PATH "path"
32#define NM_REMOTE_CONNECTION_UNSAVED "unsaved"
33#define NM_REMOTE_CONNECTION_FLAGS "flags"
34#define NM_REMOTE_CONNECTION_FILENAME "filename"
35#define NM_REMOTE_CONNECTION_VERSION_ID "version-id"
36#define NM_REMOTE_CONNECTION_VISIBLE "visible"
37
38/**
39 * NMRemoteConnection:
40 */
41typedef struct _NMRemoteConnection NMRemoteConnection;
42typedef struct _NMRemoteConnectionClass NMRemoteConnectionClass;
43
44GType nm_remote_connection_get_type(void);
45
46NM_AVAILABLE_IN_1_12
47void nm_remote_connection_update2(NMRemoteConnection *connection,
48 GVariant *settings,
49 NMSettingsUpdate2Flags flags,
50 GVariant *args,
51 GCancellable *cancellable,
52 GAsyncReadyCallback callback,
53 gpointer user_data);
54NM_AVAILABLE_IN_1_12
55GVariant *nm_remote_connection_update2_finish(NMRemoteConnection *connection,
56 GAsyncResult *result,
57 GError **error);
58
59_NM_DEPRECATED_SYNC_METHOD
60gboolean nm_remote_connection_commit_changes(NMRemoteConnection *connection,
61 gboolean save_to_disk,
62 GCancellable *cancellable,
63 GError **error);
64
65void nm_remote_connection_commit_changes_async(NMRemoteConnection *connection,
66 gboolean save_to_disk,
67 GCancellable *cancellable,
68 GAsyncReadyCallback callback,
69 gpointer user_data);
70gboolean nm_remote_connection_commit_changes_finish(NMRemoteConnection *connection,
71 GAsyncResult *result,
72 GError **error);
73
74_NM_DEPRECATED_SYNC_METHOD
75gboolean nm_remote_connection_save(NMRemoteConnection *connection,
76 GCancellable *cancellable,
77 GError **error);
78
79void nm_remote_connection_save_async(NMRemoteConnection *connection,
80 GCancellable *cancellable,
81 GAsyncReadyCallback callback,
82 gpointer user_data);
83gboolean nm_remote_connection_save_finish(NMRemoteConnection *connection,
84 GAsyncResult *result,
85 GError **error);
86
87_NM_DEPRECATED_SYNC_METHOD
88gboolean nm_remote_connection_delete(NMRemoteConnection *connection,
89 GCancellable *cancellable,
90 GError **error);
91
92void nm_remote_connection_delete_async(NMRemoteConnection *connection,
93 GCancellable *cancellable,
94 GAsyncReadyCallback callback,
95 gpointer user_data);
96gboolean nm_remote_connection_delete_finish(NMRemoteConnection *connection,
97 GAsyncResult *result,
98 GError **error);
99
100GVariant *nm_remote_connection_get_secrets(NMRemoteConnection *connection,
101 const char *setting_name,
102 GCancellable *cancellable,
103 GError **error);
104
105void nm_remote_connection_get_secrets_async(NMRemoteConnection *connection,
106 const char *setting_name,
107 GCancellable *cancellable,
108 GAsyncReadyCallback callback,
109 gpointer user_data);
110GVariant *nm_remote_connection_get_secrets_finish(NMRemoteConnection *connection,
111 GAsyncResult *result,
112 GError **error);
113
114gboolean nm_remote_connection_get_unsaved(NMRemoteConnection *connection);
115
116NM_AVAILABLE_IN_1_12
117NMSettingsConnectionFlags nm_remote_connection_get_flags(NMRemoteConnection *connection);
118
119NM_AVAILABLE_IN_1_12
120const char *nm_remote_connection_get_filename(NMRemoteConnection *connection);
121
122gboolean nm_remote_connection_get_visible(NMRemoteConnection *connection);
123
124NM_AVAILABLE_IN_1_44
125guint64 nm_remote_connection_get_version_id(NMRemoteConnection *connection);
126
127G_END_DECLS
128
129#endif /* __NM_REMOTE_CONNECTION__ */
130

source code of include/libnm/nm-remote-connection.h