|
Packit Service |
87a54e |
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
Packit |
5756e2 |
/*
|
|
Packit |
5756e2 |
* Copyright (C) 2008 Novell, Inc.
|
|
Packit |
5756e2 |
* Copyright (C) 2015 Red Hat, Inc.
|
|
Packit |
5756e2 |
*/
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
#ifndef __NM_KEYFILE_INTERNAL_H__
|
|
Packit |
5756e2 |
#define __NM_KEYFILE_INTERNAL_H__
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
#if !((NETWORKMANAGER_COMPILATION) &NM_NETWORKMANAGER_COMPILATION_WITH_LIBNM_CORE_INTERNAL)
|
|
Packit Service |
a1bd4f |
#error Cannot use this header.
|
|
Packit |
5756e2 |
#endif
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
#include <sys/types.h>
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
#include "nm-keyfile.h"
|
|
Packit Service |
a1bd4f |
|
|
Packit |
5756e2 |
#include "nm-connection.h"
|
|
Packit |
5756e2 |
#include "nm-setting-8021x.h"
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
#include "nm-core-internal.h"
|
|
Packit |
5756e2 |
#include "nm-meta-setting.h"
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
/*****************************************************************************/
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
#define NM_KEYFILE_CERT_SCHEME_PREFIX_PATH "file://"
|
|
Packit |
5756e2 |
#define NM_KEYFILE_CERT_SCHEME_PREFIX_PKCS11 "pkcs11:"
|
|
Packit Service |
a1bd4f |
#define NM_KEYFILE_CERT_SCHEME_PREFIX_BLOB "data:;base64,"
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
char *nm_keyfile_detect_unqualified_path_scheme(const char * base_dir,
|
|
Packit Service |
a1bd4f |
gconstpointer pdata,
|
|
Packit Service |
a1bd4f |
gsize data_len,
|
|
Packit Service |
a1bd4f |
gboolean consider_exists,
|
|
Packit Service |
a1bd4f |
gboolean * out_exists);
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
gboolean nm_keyfile_read_ensure_id(NMConnection *connection, const char *fallback_id);
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
gboolean nm_keyfile_read_ensure_uuid(NMConnection *connection, const char *fallback_uuid_seed);
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
/*****************************************************************************/
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
/**
|
|
Packit |
5756e2 |
* NMKeyfileHandlerDataWarn:
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* this struct is passed as @handler_data for the @NMKeyfileReadHandler of
|
|
Packit Service |
a1bd4f |
* type %NM_KEYFILE_HANDLER_TYPE_WARN.
|
|
Packit |
5756e2 |
*/
|
|
Packit |
5756e2 |
typedef struct {
|
|
Packit Service |
a1bd4f |
NMKeyfileWarnSeverity severity;
|
|
Packit Service |
a1bd4f |
char * message;
|
|
Packit Service |
a1bd4f |
const char * fmt;
|
|
Packit Service |
a1bd4f |
va_list ap;
|
|
Packit |
5756e2 |
} NMKeyfileHandlerDataWarn;
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
/**
|
|
Packit |
5756e2 |
* NMKeyfileHandlerDataWriteCert:
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* this struct is passed as @handler_data for the @NMKeyfileWriteHandler of
|
|
Packit Service |
a1bd4f |
* type %NM_KEYFILE_HANDLER_TYPE_WRITE_CERT.
|
|
Packit |
5756e2 |
*/
|
|
Packit |
5756e2 |
typedef struct {
|
|
Packit Service |
a1bd4f |
const NMSetting8021xSchemeVtable *vtable;
|
|
Packit |
5756e2 |
} NMKeyfileHandlerDataWriteCert;
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
struct _NMKeyfileHandlerData {
|
|
Packit Service |
a1bd4f |
NMKeyfileHandlerType type;
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
GError **p_error;
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
const char *kf_group_name;
|
|
Packit Service |
a1bd4f |
const char *kf_key;
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
NMSetting * cur_setting;
|
|
Packit Service |
a1bd4f |
const char *cur_property;
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
union {
|
|
Packit Service |
a1bd4f |
NMKeyfileHandlerDataWarn warn;
|
|
Packit Service |
a1bd4f |
NMKeyfileHandlerDataWriteCert write_cert;
|
|
Packit Service |
a1bd4f |
};
|
|
Packit |
5756e2 |
};
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
/*****************************************************************************/
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
const char *_nm_keyfile_handler_data_warn_get_message(const NMKeyfileHandlerData *handler_data);
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
/*****************************************************************************/
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
char *
|
|
Packit Service |
a1bd4f |
nm_keyfile_plugin_kf_get_string(GKeyFile *kf, const char *group, const char *key, GError **error);
|
|
Packit Service |
a1bd4f |
void nm_keyfile_plugin_kf_set_string(GKeyFile * kf,
|
|
Packit Service |
a1bd4f |
const char *group,
|
|
Packit Service |
a1bd4f |
const char *key,
|
|
Packit Service |
a1bd4f |
const char *value);
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
int nm_key_file_get_boolean(GKeyFile *kf, const char *group, const char *key, int default_value);
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
void _nm_keyfile_copy(GKeyFile *dst, GKeyFile *src);
|
|
Packit Service |
a1bd4f |
gboolean _nm_keyfile_a_contains_all_in_b(GKeyFile *kf_a, GKeyFile *kf_b);
|
|
Packit Service |
a1bd4f |
gboolean _nm_keyfile_equals(GKeyFile *kf_a, GKeyFile *kf_b, gboolean consider_order);
|
|
Packit Service |
a1bd4f |
gboolean _nm_keyfile_has_values(GKeyFile *keyfile);
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
/*****************************************************************************/
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
#define NM_KEYFILE_GROUP_NMMETA ".nmmeta"
|
|
Packit Service |
a1bd4f |
#define NM_KEYFILE_KEY_NMMETA_NM_GENERATED "nm-generated"
|
|
Packit Service |
a1bd4f |
#define NM_KEYFILE_KEY_NMMETA_VOLATILE "volatile"
|
|
Packit Service |
a1bd4f |
#define NM_KEYFILE_KEY_NMMETA_EXTERNAL "external"
|
|
Packit Service |
a1bd4f |
#define NM_KEYFILE_KEY_NMMETA_SHADOWED_STORAGE "shadowed-storage"
|
|
Packit Service |
a1bd4f |
#define NM_KEYFILE_KEY_NMMETA_SHADOWED_OWNED "shadowed-owned"
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
#define NM_KEYFILE_PATH_NAME_LIB NMLIBDIR "/system-connections"
|
|
Packit Service |
a1bd4f |
#define NM_KEYFILE_PATH_NAME_ETC_DEFAULT NMCONFDIR "/system-connections"
|
|
Packit Service |
a1bd4f |
#define NM_KEYFILE_PATH_NAME_RUN NMRUNDIR "/system-connections"
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
#define NM_KEYFILE_PATH_SUFFIX_NMCONNECTION ".nmconnection"
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
#define NM_KEYFILE_PATH_SUFFIX_NMMETA ".nmmeta"
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
#define NM_KEYFILE_PATH_NMMETA_SYMLINK_NULL "/dev/null"
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
gboolean nm_keyfile_utils_ignore_filename(const char *filename, gboolean require_extension);
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
char *nm_keyfile_utils_create_filename(const char *filename, gboolean with_extension);
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
#endif /* __NM_KEYFILE_INTERNAL_H__ */
|