Blame src/nm-auth-utils.h

Packit Service a1bd4f
/* SPDX-License-Identifier: GPL-2.0+ */
Packit 5756e2
/*
Packit 5756e2
 * Copyright (C) 2010 Red Hat, Inc.
Packit 5756e2
 */
Packit 5756e2
Packit 5756e2
#ifndef __NETWORKMANAGER_MANAGER_AUTH_H__
Packit 5756e2
#define __NETWORKMANAGER_MANAGER_AUTH_H__
Packit 5756e2
Packit 5756e2
#include "nm-connection.h"
Packit 5756e2
Packit 5756e2
#include "nm-auth-manager.h"
Packit 5756e2
Packit 5756e2
/*****************************************************************************/
Packit 5756e2
Packit 5756e2
typedef struct _NMAuthChain NMAuthChain;
Packit 5756e2
Packit Service a1bd4f
typedef void (*NMAuthChainResultFunc)(NMAuthChain *          chain,
Packit Service a1bd4f
                                      GDBusMethodInvocation *context,
Packit Service a1bd4f
                                      gpointer               user_data);
Packit 5756e2
Packit Service a1bd4f
NMAuthChain *nm_auth_chain_new_context(GDBusMethodInvocation *context,
Packit Service a1bd4f
                                       NMAuthChainResultFunc  done_func,
Packit Service a1bd4f
                                       gpointer               user_data);
Packit 5756e2
Packit Service a1bd4f
NMAuthChain *nm_auth_chain_new_subject(NMAuthSubject *        subject,
Packit Service a1bd4f
                                       GDBusMethodInvocation *context,
Packit Service a1bd4f
                                       NMAuthChainResultFunc  done_func,
Packit Service a1bd4f
                                       gpointer               user_data);
Packit 5756e2
Packit Service a1bd4f
GCancellable *nm_auth_chain_get_cancellable(NMAuthChain *self);
Packit Service a1bd4f
void          nm_auth_chain_set_cancellable(NMAuthChain *self, GCancellable *cancellable);
Packit 5756e2
Packit Service a1bd4f
gpointer nm_auth_chain_get_data(NMAuthChain *chain, const char *tag);
Packit 5756e2
Packit Service a1bd4f
gpointer nm_auth_chain_steal_data(NMAuthChain *chain, const char *tag);
Packit 5756e2
Packit Service a1bd4f
void nm_auth_chain_set_data_unsafe(NMAuthChain *  chain,
Packit Service a1bd4f
                                   const char *   tag,
Packit Service a1bd4f
                                   gpointer       data,
Packit Service a1bd4f
                                   GDestroyNotify data_destroy);
Packit 5756e2
Packit 5756e2
#define nm_auth_chain_set_data(chain, tag, data, data_destroy) \
Packit Service a1bd4f
    nm_auth_chain_set_data_unsafe((chain), "" tag "", (data), (data_destroy))
Packit 5756e2
Packit Service a1bd4f
NMAuthCallResult nm_auth_chain_get_result(NMAuthChain *chain, const char *permission);
Packit 5756e2
Packit Service a1bd4f
void nm_auth_chain_add_call_unsafe(NMAuthChain *chain,
Packit Service a1bd4f
                                   const char * permission,
Packit Service a1bd4f
                                   gboolean     allow_interaction);
Packit 5756e2
Packit 5756e2
#define nm_auth_chain_add_call(chain, permission, allow_interaction) \
Packit Service a1bd4f
    nm_auth_chain_add_call_unsafe((chain), "" permission "", (allow_interaction))
Packit 5756e2
Packit Service a1bd4f
void nm_auth_chain_destroy(NMAuthChain *chain);
Packit 5756e2
Packit Service a1bd4f
NMAuthSubject *nm_auth_chain_get_subject(NMAuthChain *self);
Packit 5756e2
Packit Service a1bd4f
GDBusMethodInvocation *nm_auth_chain_get_context(NMAuthChain *self);
Packit 5756e2
Packit 5756e2
/*****************************************************************************/
Packit 5756e2
Packit 5756e2
struct CList;
Packit 5756e2
Packit 5756e2
static inline NMAuthChain *
Packit Service a1bd4f
nm_auth_chain_parent_lst_entry(struct CList *parent_lst_self)
Packit 5756e2
{
Packit Service a1bd4f
    return (NMAuthChain *) ((void *) parent_lst_self);
Packit 5756e2
}
Packit 5756e2
Packit 5756e2
static inline struct CList *
Packit Service a1bd4f
nm_auth_chain_parent_lst_list(NMAuthChain *self)
Packit 5756e2
{
Packit Service a1bd4f
    return (struct CList *) ((void *) self);
Packit 5756e2
}
Packit 5756e2
Packit 5756e2
/*****************************************************************************/
Packit 5756e2
Packit 5756e2
/* Caller must free returned error description */
Packit Service a1bd4f
gboolean
Packit Service a1bd4f
nm_auth_is_subject_in_acl(NMConnection *connection, NMAuthSubject *subject, char **out_error_desc);
Packit Service a1bd4f
Packit Service a1bd4f
gboolean nm_auth_is_subject_in_acl_set_error(NMConnection * connection,
Packit Service a1bd4f
                                             NMAuthSubject *subject,
Packit Service a1bd4f
                                             GQuark         err_domain,
Packit Service a1bd4f
                                             int            err_code,
Packit Service a1bd4f
                                             GError **      error);
Packit Service a1bd4f
Packit Service a1bd4f
gboolean nm_auth_is_invocation_in_acl_set_error(NMConnection *         connection,
Packit Service a1bd4f
                                                GDBusMethodInvocation *invocation,
Packit Service a1bd4f
                                                GQuark                 err_domain,
Packit Service a1bd4f
                                                int                    err_code,
Packit Service a1bd4f
                                                NMAuthSubject **       out_subject,
Packit Service a1bd4f
                                                GError **              error);
Packit 5756e2
Packit 5756e2
#endif /* __NETWORKMANAGER_MANAGER_AUTH_H__ */