2010-12-10 12:38:19 -06:00
|
|
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
|
|
|
|
|
/* NetworkManager -- Network link manager
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program 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 General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
|
*
|
2011-01-26 18:36:08 -06:00
|
|
|
* Copyright (C) 2010 - 2011 Red Hat, Inc.
|
2010-12-10 12:38:19 -06:00
|
|
|
*/
|
|
|
|
|
|
all: fix up multiple-include-guard defines
Previously, src/nm-ip4-config.h, libnm/nm-ip4-config.h, and
libnm-glib/nm-ip4-config.h all used "NM_IP4_CONFIG_H" as an include
guard, which meant that nm-test-utils.h could not tell which of them
was being included (and so, eg, if you tried to include
nm-ip4-config.h in a libnm test, it would fail to compile because
nm-test-utils.h was referring to symbols in src/nm-ip4-config.h).
Fix this by changing the include guards in the non-API-stable parts of
the tree:
- libnm-glib/nm-ip4-config.h remains NM_IP4_CONFIG_H
- libnm/nm-ip4-config.h now uses __NM_IP4_CONFIG_H__
- src/nm-ip4-config.h now uses __NETWORKMANAGER_IP4_CONFIG_H__
And likewise for all other headers.
The two non-"nm"-prefixed headers, libnm/NetworkManager.h and
src/NetworkManagerUtils.h are now __NETWORKMANAGER_H__ and
__NETWORKMANAGER_UTILS_H__ respectively, which, while not entirely
consistent with the general scheme, do still mostly make sense in
isolation.
2014-08-13 14:10:11 -04:00
|
|
|
#ifndef __NETWORKMANAGER_AGENT_MANAGER_H__
|
|
|
|
|
#define __NETWORKMANAGER_AGENT_MANAGER_H__
|
2010-12-10 12:38:19 -06:00
|
|
|
|
2010-12-13 13:11:51 -06:00
|
|
|
#include <nm-connection.h>
|
2015-04-13 13:31:42 -04:00
|
|
|
|
|
|
|
|
#include "nm-exported-object.h"
|
2011-06-28 15:48:12 +02:00
|
|
|
#include "nm-secret-agent.h"
|
2010-12-13 13:11:51 -06:00
|
|
|
|
2010-12-10 12:38:19 -06:00
|
|
|
#define NM_TYPE_AGENT_MANAGER (nm_agent_manager_get_type ())
|
|
|
|
|
#define NM_AGENT_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_AGENT_MANAGER, NMAgentManager))
|
|
|
|
|
#define NM_AGENT_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_AGENT_MANAGER, NMAgentManagerClass))
|
|
|
|
|
#define NM_IS_AGENT_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_AGENT_MANAGER))
|
2012-07-27 13:15:54 +02:00
|
|
|
#define NM_IS_AGENT_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_AGENT_MANAGER))
|
2010-12-10 12:38:19 -06:00
|
|
|
#define NM_AGENT_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_AGENT_MANAGER, NMAgentManagerClass))
|
|
|
|
|
|
2014-07-17 17:06:44 -04:00
|
|
|
struct _NMAgentManager {
|
2015-04-13 13:31:42 -04:00
|
|
|
NMExportedObject parent;
|
2014-07-17 17:06:44 -04:00
|
|
|
};
|
2010-12-10 12:38:19 -06:00
|
|
|
|
|
|
|
|
typedef struct {
|
2015-04-13 13:31:42 -04:00
|
|
|
NMExportedObjectClass parent;
|
2011-06-28 15:48:12 +02:00
|
|
|
|
|
|
|
|
/* Signals */
|
|
|
|
|
void (*agent_registered) (NMAgentManager *agent_mgr, NMSecretAgent *agent);
|
2010-12-10 12:38:19 -06:00
|
|
|
} NMAgentManagerClass;
|
|
|
|
|
|
|
|
|
|
GType nm_agent_manager_get_type (void);
|
|
|
|
|
|
2011-01-27 10:41:02 -06:00
|
|
|
NMAgentManager *nm_agent_manager_get (void);
|
2010-12-13 13:11:51 -06:00
|
|
|
|
2011-02-02 12:17:58 -06:00
|
|
|
/* If no agent fulfilled the secrets request, agent_dbus_owner will be NULL */
|
2010-12-13 13:11:51 -06:00
|
|
|
typedef void (*NMAgentSecretsResultFunc) (NMAgentManager *manager,
|
|
|
|
|
guint32 call_id,
|
2011-02-02 12:17:58 -06:00
|
|
|
const char *agent_dbus_owner,
|
2011-03-31 18:39:09 -05:00
|
|
|
const char *agent_uname,
|
2011-02-02 16:19:15 -06:00
|
|
|
gboolean agent_has_modify,
|
2011-01-26 13:32:25 -06:00
|
|
|
const char *setting_name,
|
2014-07-07 10:11:46 -04:00
|
|
|
NMSecretAgentGetSecretsFlags flags,
|
2011-01-27 10:41:02 -06:00
|
|
|
GHashTable *secrets,
|
2010-12-13 13:11:51 -06:00
|
|
|
GError *error,
|
|
|
|
|
gpointer user_data,
|
2011-01-27 10:41:02 -06:00
|
|
|
gpointer other_data2,
|
|
|
|
|
gpointer other_data3);
|
2010-12-13 13:11:51 -06:00
|
|
|
|
|
|
|
|
guint32 nm_agent_manager_get_secrets (NMAgentManager *manager,
|
|
|
|
|
NMConnection *connection,
|
2013-11-05 14:36:38 -05:00
|
|
|
NMAuthSubject *subject,
|
2011-01-27 10:41:02 -06:00
|
|
|
GHashTable *existing_secrets,
|
2010-12-13 13:11:51 -06:00
|
|
|
const char *setting_name,
|
2014-07-07 10:11:46 -04:00
|
|
|
NMSecretAgentGetSecretsFlags flags,
|
2013-06-19 17:51:09 -05:00
|
|
|
const char **hints,
|
2010-12-13 13:11:51 -06:00
|
|
|
NMAgentSecretsResultFunc callback,
|
|
|
|
|
gpointer callback_data,
|
|
|
|
|
gpointer other_data2,
|
|
|
|
|
gpointer other_data3);
|
|
|
|
|
|
|
|
|
|
void nm_agent_manager_cancel_secrets (NMAgentManager *manager,
|
|
|
|
|
guint32 request_id);
|
2010-12-10 12:38:19 -06:00
|
|
|
|
2011-01-31 23:10:33 -06:00
|
|
|
guint32 nm_agent_manager_save_secrets (NMAgentManager *manager,
|
|
|
|
|
NMConnection *connection,
|
2013-11-05 14:36:38 -05:00
|
|
|
NMAuthSubject *subject);
|
2011-01-31 23:10:33 -06:00
|
|
|
|
2011-01-31 23:33:46 -06:00
|
|
|
guint32 nm_agent_manager_delete_secrets (NMAgentManager *manager,
|
2013-11-05 14:36:38 -05:00
|
|
|
NMConnection *connection);
|
2011-01-31 23:33:46 -06:00
|
|
|
|
2011-07-01 14:36:01 -05:00
|
|
|
NMSecretAgent *nm_agent_manager_get_agent_by_user (NMAgentManager *manager,
|
|
|
|
|
const char *username);
|
|
|
|
|
|
2013-06-20 23:07:49 -05:00
|
|
|
gboolean nm_agent_manager_all_agents_have_capability (NMAgentManager *manager,
|
2013-11-05 14:36:38 -05:00
|
|
|
NMAuthSubject *subject,
|
2013-06-20 23:07:49 -05:00
|
|
|
NMSecretAgentCapabilities capability);
|
|
|
|
|
|
all: fix up multiple-include-guard defines
Previously, src/nm-ip4-config.h, libnm/nm-ip4-config.h, and
libnm-glib/nm-ip4-config.h all used "NM_IP4_CONFIG_H" as an include
guard, which meant that nm-test-utils.h could not tell which of them
was being included (and so, eg, if you tried to include
nm-ip4-config.h in a libnm test, it would fail to compile because
nm-test-utils.h was referring to symbols in src/nm-ip4-config.h).
Fix this by changing the include guards in the non-API-stable parts of
the tree:
- libnm-glib/nm-ip4-config.h remains NM_IP4_CONFIG_H
- libnm/nm-ip4-config.h now uses __NM_IP4_CONFIG_H__
- src/nm-ip4-config.h now uses __NETWORKMANAGER_IP4_CONFIG_H__
And likewise for all other headers.
The two non-"nm"-prefixed headers, libnm/NetworkManager.h and
src/NetworkManagerUtils.h are now __NETWORKMANAGER_H__ and
__NETWORKMANAGER_UTILS_H__ respectively, which, while not entirely
consistent with the general scheme, do still mostly make sense in
isolation.
2014-08-13 14:10:11 -04:00
|
|
|
#endif /* __NETWORKMANAGER_AGENT_MANAGER_H__ */
|