summaryrefslogtreecommitdiffstats
path: root/src/shell-network-agent.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:54:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:54:43 +0000
commite4283f6d48b98e764b988b43bbc86b9d52e6ec94 (patch)
treec8f7f7a6c2f5faa2942d27cefc6fd46cca492656 /src/shell-network-agent.h
parentInitial commit. (diff)
downloadgnome-shell-e4283f6d48b98e764b988b43bbc86b9d52e6ec94.tar.xz
gnome-shell-e4283f6d48b98e764b988b43bbc86b9d52e6ec94.zip
Adding upstream version 43.9.upstream/43.9upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/shell-network-agent.h')
-rw-r--r--src/shell-network-agent.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/src/shell-network-agent.h b/src/shell-network-agent.h
new file mode 100644
index 0000000..0ffde02
--- /dev/null
+++ b/src/shell-network-agent.h
@@ -0,0 +1,73 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+#ifndef __SHELL_NETWORK_AGENT_H__
+#define __SHELL_NETWORK_AGENT_H__
+
+#include <glib-object.h>
+#include <glib.h>
+#include <NetworkManager.h>
+#include <nm-secret-agent-old.h>
+
+G_BEGIN_DECLS
+
+typedef enum {
+ SHELL_NETWORK_AGENT_CONFIRMED,
+ SHELL_NETWORK_AGENT_USER_CANCELED,
+ SHELL_NETWORK_AGENT_INTERNAL_ERROR
+} ShellNetworkAgentResponse;
+
+typedef struct _ShellNetworkAgent ShellNetworkAgent;
+typedef struct _ShellNetworkAgentClass ShellNetworkAgentClass;
+typedef struct _ShellNetworkAgentPrivate ShellNetworkAgentPrivate;
+
+#define SHELL_TYPE_NETWORK_AGENT (shell_network_agent_get_type ())
+#define SHELL_NETWORK_AGENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHELL_TYPE_NETWORK_AGENT, ShellNetworkAgent))
+#define SHELL_IS_NETWORK_AGENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SHELL_TYPE_NETWORK_AGENT))
+#define SHELL_NETWORK_AGENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHELL_TYPE_NETWORK_AGENT, ShellNetworkAgentClass))
+#define SHELL_IS_NETWORK_AGENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHELL_TYPE_NETWORK_AGENT))
+#define SHELL_NETWORK_AGENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHELL_TYPE_NETWORK_AGENT, ShellNetworkAgentClass))
+
+struct _ShellNetworkAgent
+{
+ /*< private >*/
+ NMSecretAgentOld parent_instance;
+
+ ShellNetworkAgentPrivate *priv;
+};
+
+struct _ShellNetworkAgentClass
+{
+ /*< private >*/
+ NMSecretAgentOldClass parent_class;
+};
+
+/* used by SHELL_TYPE_NETWORK_AGENT */
+GType shell_network_agent_get_type (void);
+
+void shell_network_agent_add_vpn_secret (ShellNetworkAgent *self,
+ gchar *request_id,
+ gchar *setting_key,
+ gchar *setting_value);
+void shell_network_agent_set_password (ShellNetworkAgent *self,
+ gchar *request_id,
+ gchar *setting_key,
+ gchar *setting_value);
+void shell_network_agent_respond (ShellNetworkAgent *self,
+ gchar *request_id,
+ ShellNetworkAgentResponse response);
+
+void shell_network_agent_search_vpn_plugin (ShellNetworkAgent *self,
+ const char *service,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+NMVpnPluginInfo *shell_network_agent_search_vpn_plugin_finish (ShellNetworkAgent *self,
+ GAsyncResult *result,
+ GError **error);
+
+/* If these are kept in sync with nm-applet, secrets will be shared */
+#define SHELL_KEYRING_UUID_TAG "connection-uuid"
+#define SHELL_KEYRING_SN_TAG "setting-name"
+#define SHELL_KEYRING_SK_TAG "setting-key"
+
+G_END_DECLS
+
+#endif /* __SHELL_NETWORK_AGENT_H__ */