2020-12-23 22:21:36 +01:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2019-09-25 13:13:40 +02:00
|
|
|
/*
|
2010-05-28 18:23:00 -07:00
|
|
|
* Copyright (C) 2010 Red Hat, Inc.
|
|
|
|
|
*/
|
|
|
|
|
|
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_MANAGER_AUTH_H__
|
|
|
|
|
#define __NETWORKMANAGER_MANAGER_AUTH_H__
|
2010-05-28 18:23:00 -07:00
|
|
|
|
2016-06-01 12:31:36 +02:00
|
|
|
#include "nm-connection.h"
|
2010-05-28 18:23:00 -07:00
|
|
|
|
2018-04-09 17:03:58 +02:00
|
|
|
#include "nm-auth-manager.h"
|
2010-05-28 18:23:00 -07:00
|
|
|
|
2019-05-26 18:49:55 +02:00
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2019-12-23 10:54:16 +01:00
|
|
|
typedef struct _NMAuthChain NMAuthChain;
|
2010-05-28 18:23:00 -07:00
|
|
|
|
2021-11-09 13:28:54 +01:00
|
|
|
typedef void (*NMAuthChainResultFunc)(NMAuthChain *chain,
|
2015-04-16 12:34:55 -04:00
|
|
|
GDBusMethodInvocation *context,
|
2010-05-29 23:00:46 -07:00
|
|
|
gpointer user_data);
|
2010-05-28 18:23:00 -07:00
|
|
|
|
2015-04-16 12:34:55 -04:00
|
|
|
NMAuthChain *nm_auth_chain_new_context(GDBusMethodInvocation *context,
|
2013-07-29 10:39:23 -05:00
|
|
|
NMAuthChainResultFunc done_func,
|
|
|
|
|
gpointer user_data);
|
|
|
|
|
|
2021-11-09 13:28:54 +01:00
|
|
|
NMAuthChain *nm_auth_chain_new_subject(NMAuthSubject *subject,
|
2015-04-16 12:34:55 -04:00
|
|
|
GDBusMethodInvocation *context,
|
2013-07-29 10:39:23 -05:00
|
|
|
NMAuthChainResultFunc done_func,
|
|
|
|
|
gpointer user_data);
|
|
|
|
|
|
2020-04-26 15:40:40 +02:00
|
|
|
GCancellable *nm_auth_chain_get_cancellable(NMAuthChain *self);
|
|
|
|
|
void nm_auth_chain_set_cancellable(NMAuthChain *self, GCancellable *cancellable);
|
|
|
|
|
|
2010-05-29 23:00:46 -07:00
|
|
|
gpointer nm_auth_chain_get_data(NMAuthChain *chain, const char *tag);
|
|
|
|
|
|
2011-07-01 14:18:46 -05:00
|
|
|
gpointer nm_auth_chain_steal_data(NMAuthChain *chain, const char *tag);
|
|
|
|
|
|
2021-11-09 13:28:54 +01:00
|
|
|
void nm_auth_chain_set_data_unsafe(NMAuthChain *chain,
|
|
|
|
|
const char *tag,
|
2019-05-06 10:04:16 +02:00
|
|
|
gpointer data,
|
|
|
|
|
GDestroyNotify data_destroy);
|
|
|
|
|
|
|
|
|
|
#define nm_auth_chain_set_data(chain, tag, data, data_destroy) \
|
|
|
|
|
nm_auth_chain_set_data_unsafe((chain), "" tag "", (data), (data_destroy))
|
2010-05-28 18:23:00 -07:00
|
|
|
|
2010-11-17 16:56:34 -06:00
|
|
|
NMAuthCallResult nm_auth_chain_get_result(NMAuthChain *chain, const char *permission);
|
|
|
|
|
|
2019-05-04 10:31:18 +02:00
|
|
|
void nm_auth_chain_add_call_unsafe(NMAuthChain *chain,
|
2021-11-09 13:28:54 +01:00
|
|
|
const char *permission,
|
2019-05-04 10:31:18 +02:00
|
|
|
gboolean allow_interaction);
|
|
|
|
|
|
|
|
|
|
#define nm_auth_chain_add_call(chain, permission, allow_interaction) \
|
|
|
|
|
nm_auth_chain_add_call_unsafe((chain), "" permission "", (allow_interaction))
|
2010-05-28 18:23:00 -07:00
|
|
|
|
2018-04-09 11:52:55 +02:00
|
|
|
void nm_auth_chain_destroy(NMAuthChain *chain);
|
2010-05-28 18:23:00 -07:00
|
|
|
|
2018-04-12 09:34:40 +02:00
|
|
|
NMAuthSubject *nm_auth_chain_get_subject(NMAuthChain *self);
|
|
|
|
|
|
2019-12-23 10:54:16 +01:00
|
|
|
GDBusMethodInvocation *nm_auth_chain_get_context(NMAuthChain *self);
|
|
|
|
|
|
2019-05-26 18:49:55 +02:00
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
struct CList;
|
|
|
|
|
|
|
|
|
|
static inline NMAuthChain *
|
|
|
|
|
nm_auth_chain_parent_lst_entry(struct CList *parent_lst_self)
|
|
|
|
|
{
|
|
|
|
|
return (NMAuthChain *) ((void *) parent_lst_self);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline struct CList *
|
|
|
|
|
nm_auth_chain_parent_lst_list(NMAuthChain *self)
|
|
|
|
|
{
|
|
|
|
|
return (struct CList *) ((void *) self);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2010-11-18 13:49:47 -06:00
|
|
|
/* Caller must free returned error description */
|
2014-08-14 13:34:57 +02:00
|
|
|
gboolean
|
|
|
|
|
nm_auth_is_subject_in_acl(NMConnection *connection, NMAuthSubject *subject, char **out_error_desc);
|
2011-05-18 22:20:24 -05:00
|
|
|
|
2021-11-09 13:28:54 +01:00
|
|
|
gboolean nm_auth_is_subject_in_acl_set_error(NMConnection *connection,
|
2018-04-12 09:34:40 +02:00
|
|
|
NMAuthSubject *subject,
|
|
|
|
|
GQuark err_domain,
|
|
|
|
|
int err_code,
|
2021-11-09 13:28:54 +01:00
|
|
|
GError **error);
|
2015-07-15 15:42:50 +02:00
|
|
|
|
2021-11-09 13:28:54 +01:00
|
|
|
gboolean nm_auth_is_invocation_in_acl_set_error(NMConnection *connection,
|
2020-09-24 19:11:40 +02:00
|
|
|
GDBusMethodInvocation *invocation,
|
|
|
|
|
GQuark err_domain,
|
|
|
|
|
int err_code,
|
2021-11-09 13:28:54 +01:00
|
|
|
NMAuthSubject **out_subject,
|
|
|
|
|
GError **error);
|
2020-09-24 19:11:40 +02: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
|
|
|
#endif /* __NETWORKMANAGER_MANAGER_AUTH_H__ */
|