mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-07 16:38:32 +02:00
shared: move NMSetting8021xSchemeVtable to "shared/nm-setting-metadata.h"
This commit is contained in:
parent
c79e84368a
commit
2c9ef8cf2e
7 changed files with 113 additions and 105 deletions
|
|
@ -344,31 +344,4 @@ gboolean _nm_utils_team_config_equal (const char *conf1, const char *conf2, g
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
const char *setting_key;
|
|
||||||
NMSetting8021xCKScheme (*scheme_func) (NMSetting8021x *setting);
|
|
||||||
NMSetting8021xCKFormat (*format_func) (NMSetting8021x *setting);
|
|
||||||
const char * (*path_func) (NMSetting8021x *setting);
|
|
||||||
GBytes * (*blob_func) (NMSetting8021x *setting);
|
|
||||||
const char * (*uri_func) (NMSetting8021x *setting);
|
|
||||||
const char * (*passwd_func) (NMSetting8021x *setting);
|
|
||||||
NMSettingSecretFlags (*pwflag_func) (NMSetting8021x *setting);
|
|
||||||
const char *file_suffix;
|
|
||||||
} NMSetting8021xSchemeVtable;
|
|
||||||
|
|
||||||
enum {
|
|
||||||
NM_SETTING_802_1X_SCHEME_TYPE_CA_CERT,
|
|
||||||
NM_SETTING_802_1X_SCHEME_TYPE_PHASE2_CA_CERT,
|
|
||||||
NM_SETTING_802_1X_SCHEME_TYPE_CLIENT_CERT,
|
|
||||||
NM_SETTING_802_1X_SCHEME_TYPE_PHASE2_CLIENT_CERT,
|
|
||||||
NM_SETTING_802_1X_SCHEME_TYPE_PRIVATE_KEY,
|
|
||||||
NM_SETTING_802_1X_SCHEME_TYPE_PHASE2_PRIVATE_KEY,
|
|
||||||
|
|
||||||
NM_SETTING_802_1X_SCHEME_TYPE_UNKNOWN,
|
|
||||||
};
|
|
||||||
|
|
||||||
extern const NMSetting8021xSchemeVtable nm_setting_8021x_scheme_vtable[NM_SETTING_802_1X_SCHEME_TYPE_UNKNOWN + 1];
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@
|
||||||
#include "nm-setting-8021x.h"
|
#include "nm-setting-8021x.h"
|
||||||
|
|
||||||
#include "nm-core-internal.h"
|
#include "nm-core-internal.h"
|
||||||
|
#include "nm-setting-metadata.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -179,84 +179,6 @@ nm_setting_802_1x_new (void)
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
const NMSetting8021xSchemeVtable nm_setting_8021x_scheme_vtable[] = {
|
|
||||||
[NM_SETTING_802_1X_SCHEME_TYPE_CA_CERT] = {
|
|
||||||
.setting_key = NM_SETTING_802_1X_CA_CERT,
|
|
||||||
.scheme_func = nm_setting_802_1x_get_ca_cert_scheme,
|
|
||||||
.format_func = NULL,
|
|
||||||
.path_func = nm_setting_802_1x_get_ca_cert_path,
|
|
||||||
.blob_func = nm_setting_802_1x_get_ca_cert_blob,
|
|
||||||
.uri_func = nm_setting_802_1x_get_ca_cert_uri,
|
|
||||||
.passwd_func = nm_setting_802_1x_get_ca_cert_password,
|
|
||||||
.pwflag_func = nm_setting_802_1x_get_ca_cert_password_flags,
|
|
||||||
.file_suffix = "ca-cert",
|
|
||||||
},
|
|
||||||
|
|
||||||
[NM_SETTING_802_1X_SCHEME_TYPE_PHASE2_CA_CERT] = {
|
|
||||||
.setting_key = NM_SETTING_802_1X_PHASE2_CA_CERT,
|
|
||||||
.scheme_func = nm_setting_802_1x_get_phase2_ca_cert_scheme,
|
|
||||||
.format_func = NULL,
|
|
||||||
.path_func = nm_setting_802_1x_get_phase2_ca_cert_path,
|
|
||||||
.blob_func = nm_setting_802_1x_get_phase2_ca_cert_blob,
|
|
||||||
.uri_func = nm_setting_802_1x_get_phase2_ca_cert_uri,
|
|
||||||
.passwd_func = nm_setting_802_1x_get_phase2_ca_cert_password,
|
|
||||||
.pwflag_func = nm_setting_802_1x_get_phase2_ca_cert_password_flags,
|
|
||||||
.file_suffix = "inner-ca-cert",
|
|
||||||
},
|
|
||||||
|
|
||||||
[NM_SETTING_802_1X_SCHEME_TYPE_CLIENT_CERT] = {
|
|
||||||
.setting_key = NM_SETTING_802_1X_CLIENT_CERT,
|
|
||||||
.scheme_func = nm_setting_802_1x_get_client_cert_scheme,
|
|
||||||
.format_func = NULL,
|
|
||||||
.path_func = nm_setting_802_1x_get_client_cert_path,
|
|
||||||
.blob_func = nm_setting_802_1x_get_client_cert_blob,
|
|
||||||
.uri_func = nm_setting_802_1x_get_client_cert_uri,
|
|
||||||
.passwd_func = nm_setting_802_1x_get_client_cert_password,
|
|
||||||
.pwflag_func = nm_setting_802_1x_get_client_cert_password_flags,
|
|
||||||
.file_suffix = "client-cert",
|
|
||||||
},
|
|
||||||
|
|
||||||
[NM_SETTING_802_1X_SCHEME_TYPE_PHASE2_CLIENT_CERT] = {
|
|
||||||
.setting_key = NM_SETTING_802_1X_PHASE2_CLIENT_CERT,
|
|
||||||
.scheme_func = nm_setting_802_1x_get_phase2_client_cert_scheme,
|
|
||||||
.format_func = NULL,
|
|
||||||
.path_func = nm_setting_802_1x_get_phase2_client_cert_path,
|
|
||||||
.blob_func = nm_setting_802_1x_get_phase2_client_cert_blob,
|
|
||||||
.uri_func = nm_setting_802_1x_get_phase2_client_cert_uri,
|
|
||||||
.passwd_func = nm_setting_802_1x_get_phase2_client_cert_password,
|
|
||||||
.pwflag_func = nm_setting_802_1x_get_phase2_client_cert_password_flags,
|
|
||||||
.file_suffix = "inner-client-cert",
|
|
||||||
},
|
|
||||||
|
|
||||||
[NM_SETTING_802_1X_SCHEME_TYPE_PRIVATE_KEY] = {
|
|
||||||
.setting_key = NM_SETTING_802_1X_PRIVATE_KEY,
|
|
||||||
.scheme_func = nm_setting_802_1x_get_private_key_scheme,
|
|
||||||
.format_func = nm_setting_802_1x_get_private_key_format,
|
|
||||||
.path_func = nm_setting_802_1x_get_private_key_path,
|
|
||||||
.blob_func = nm_setting_802_1x_get_private_key_blob,
|
|
||||||
.uri_func = nm_setting_802_1x_get_private_key_uri,
|
|
||||||
.passwd_func = nm_setting_802_1x_get_private_key_password,
|
|
||||||
.pwflag_func = nm_setting_802_1x_get_private_key_password_flags,
|
|
||||||
.file_suffix = "private-key",
|
|
||||||
},
|
|
||||||
|
|
||||||
[NM_SETTING_802_1X_SCHEME_TYPE_PHASE2_PRIVATE_KEY] = {
|
|
||||||
.setting_key = NM_SETTING_802_1X_PHASE2_PRIVATE_KEY,
|
|
||||||
.scheme_func = nm_setting_802_1x_get_phase2_private_key_scheme,
|
|
||||||
.format_func = nm_setting_802_1x_get_phase2_private_key_format,
|
|
||||||
.path_func = nm_setting_802_1x_get_phase2_private_key_path,
|
|
||||||
.blob_func = nm_setting_802_1x_get_phase2_private_key_blob,
|
|
||||||
.uri_func = nm_setting_802_1x_get_phase2_private_key_uri,
|
|
||||||
.passwd_func = nm_setting_802_1x_get_phase2_private_key_password,
|
|
||||||
.pwflag_func = nm_setting_802_1x_get_phase2_private_key_password_flags,
|
|
||||||
.file_suffix = "inner-private-key",
|
|
||||||
},
|
|
||||||
|
|
||||||
[NM_SETTING_802_1X_SCHEME_TYPE_UNKNOWN] = { NULL },
|
|
||||||
};
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nm_setting_802_1x_get_num_eap_methods:
|
* nm_setting_802_1x_get_num_eap_methods:
|
||||||
* @setting: the #NMSetting8021x
|
* @setting: the #NMSetting8021x
|
||||||
|
|
|
||||||
|
|
@ -23,3 +23,82 @@
|
||||||
|
|
||||||
#include "nm-setting-metadata.h"
|
#include "nm-setting-metadata.h"
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
const NMSetting8021xSchemeVtable nm_setting_8021x_scheme_vtable[] = {
|
||||||
|
[NM_SETTING_802_1X_SCHEME_TYPE_CA_CERT] = {
|
||||||
|
.setting_key = NM_SETTING_802_1X_CA_CERT,
|
||||||
|
.scheme_func = nm_setting_802_1x_get_ca_cert_scheme,
|
||||||
|
.format_func = NULL,
|
||||||
|
.path_func = nm_setting_802_1x_get_ca_cert_path,
|
||||||
|
.blob_func = nm_setting_802_1x_get_ca_cert_blob,
|
||||||
|
.uri_func = nm_setting_802_1x_get_ca_cert_uri,
|
||||||
|
.passwd_func = nm_setting_802_1x_get_ca_cert_password,
|
||||||
|
.pwflag_func = nm_setting_802_1x_get_ca_cert_password_flags,
|
||||||
|
.file_suffix = "ca-cert",
|
||||||
|
},
|
||||||
|
|
||||||
|
[NM_SETTING_802_1X_SCHEME_TYPE_PHASE2_CA_CERT] = {
|
||||||
|
.setting_key = NM_SETTING_802_1X_PHASE2_CA_CERT,
|
||||||
|
.scheme_func = nm_setting_802_1x_get_phase2_ca_cert_scheme,
|
||||||
|
.format_func = NULL,
|
||||||
|
.path_func = nm_setting_802_1x_get_phase2_ca_cert_path,
|
||||||
|
.blob_func = nm_setting_802_1x_get_phase2_ca_cert_blob,
|
||||||
|
.uri_func = nm_setting_802_1x_get_phase2_ca_cert_uri,
|
||||||
|
.passwd_func = nm_setting_802_1x_get_phase2_ca_cert_password,
|
||||||
|
.pwflag_func = nm_setting_802_1x_get_phase2_ca_cert_password_flags,
|
||||||
|
.file_suffix = "inner-ca-cert",
|
||||||
|
},
|
||||||
|
|
||||||
|
[NM_SETTING_802_1X_SCHEME_TYPE_CLIENT_CERT] = {
|
||||||
|
.setting_key = NM_SETTING_802_1X_CLIENT_CERT,
|
||||||
|
.scheme_func = nm_setting_802_1x_get_client_cert_scheme,
|
||||||
|
.format_func = NULL,
|
||||||
|
.path_func = nm_setting_802_1x_get_client_cert_path,
|
||||||
|
.blob_func = nm_setting_802_1x_get_client_cert_blob,
|
||||||
|
.uri_func = nm_setting_802_1x_get_client_cert_uri,
|
||||||
|
.passwd_func = nm_setting_802_1x_get_client_cert_password,
|
||||||
|
.pwflag_func = nm_setting_802_1x_get_client_cert_password_flags,
|
||||||
|
.file_suffix = "client-cert",
|
||||||
|
},
|
||||||
|
|
||||||
|
[NM_SETTING_802_1X_SCHEME_TYPE_PHASE2_CLIENT_CERT] = {
|
||||||
|
.setting_key = NM_SETTING_802_1X_PHASE2_CLIENT_CERT,
|
||||||
|
.scheme_func = nm_setting_802_1x_get_phase2_client_cert_scheme,
|
||||||
|
.format_func = NULL,
|
||||||
|
.path_func = nm_setting_802_1x_get_phase2_client_cert_path,
|
||||||
|
.blob_func = nm_setting_802_1x_get_phase2_client_cert_blob,
|
||||||
|
.uri_func = nm_setting_802_1x_get_phase2_client_cert_uri,
|
||||||
|
.passwd_func = nm_setting_802_1x_get_phase2_client_cert_password,
|
||||||
|
.pwflag_func = nm_setting_802_1x_get_phase2_client_cert_password_flags,
|
||||||
|
.file_suffix = "inner-client-cert",
|
||||||
|
},
|
||||||
|
|
||||||
|
[NM_SETTING_802_1X_SCHEME_TYPE_PRIVATE_KEY] = {
|
||||||
|
.setting_key = NM_SETTING_802_1X_PRIVATE_KEY,
|
||||||
|
.scheme_func = nm_setting_802_1x_get_private_key_scheme,
|
||||||
|
.format_func = nm_setting_802_1x_get_private_key_format,
|
||||||
|
.path_func = nm_setting_802_1x_get_private_key_path,
|
||||||
|
.blob_func = nm_setting_802_1x_get_private_key_blob,
|
||||||
|
.uri_func = nm_setting_802_1x_get_private_key_uri,
|
||||||
|
.passwd_func = nm_setting_802_1x_get_private_key_password,
|
||||||
|
.pwflag_func = nm_setting_802_1x_get_private_key_password_flags,
|
||||||
|
.file_suffix = "private-key",
|
||||||
|
},
|
||||||
|
|
||||||
|
[NM_SETTING_802_1X_SCHEME_TYPE_PHASE2_PRIVATE_KEY] = {
|
||||||
|
.setting_key = NM_SETTING_802_1X_PHASE2_PRIVATE_KEY,
|
||||||
|
.scheme_func = nm_setting_802_1x_get_phase2_private_key_scheme,
|
||||||
|
.format_func = nm_setting_802_1x_get_phase2_private_key_format,
|
||||||
|
.path_func = nm_setting_802_1x_get_phase2_private_key_path,
|
||||||
|
.blob_func = nm_setting_802_1x_get_phase2_private_key_blob,
|
||||||
|
.uri_func = nm_setting_802_1x_get_phase2_private_key_uri,
|
||||||
|
.passwd_func = nm_setting_802_1x_get_phase2_private_key_password,
|
||||||
|
.pwflag_func = nm_setting_802_1x_get_phase2_private_key_password_flags,
|
||||||
|
.file_suffix = "inner-private-key",
|
||||||
|
},
|
||||||
|
|
||||||
|
[NM_SETTING_802_1X_SCHEME_TYPE_UNKNOWN] = { NULL },
|
||||||
|
};
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
|
||||||
|
|
@ -22,4 +22,35 @@
|
||||||
#ifndef __NM_SETTING_METADATA_H__
|
#ifndef __NM_SETTING_METADATA_H__
|
||||||
#define __NM_SETTING_METADATA_H__
|
#define __NM_SETTING_METADATA_H__
|
||||||
|
|
||||||
|
#include "nm-setting-8021x.h"
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
const char *setting_key;
|
||||||
|
NMSetting8021xCKScheme (*scheme_func) (NMSetting8021x *setting);
|
||||||
|
NMSetting8021xCKFormat (*format_func) (NMSetting8021x *setting);
|
||||||
|
const char * (*path_func) (NMSetting8021x *setting);
|
||||||
|
GBytes * (*blob_func) (NMSetting8021x *setting);
|
||||||
|
const char * (*uri_func) (NMSetting8021x *setting);
|
||||||
|
const char * (*passwd_func) (NMSetting8021x *setting);
|
||||||
|
NMSettingSecretFlags (*pwflag_func) (NMSetting8021x *setting);
|
||||||
|
const char *file_suffix;
|
||||||
|
} NMSetting8021xSchemeVtable;
|
||||||
|
|
||||||
|
enum {
|
||||||
|
NM_SETTING_802_1X_SCHEME_TYPE_CA_CERT,
|
||||||
|
NM_SETTING_802_1X_SCHEME_TYPE_PHASE2_CA_CERT,
|
||||||
|
NM_SETTING_802_1X_SCHEME_TYPE_CLIENT_CERT,
|
||||||
|
NM_SETTING_802_1X_SCHEME_TYPE_PHASE2_CLIENT_CERT,
|
||||||
|
NM_SETTING_802_1X_SCHEME_TYPE_PRIVATE_KEY,
|
||||||
|
NM_SETTING_802_1X_SCHEME_TYPE_PHASE2_PRIVATE_KEY,
|
||||||
|
|
||||||
|
NM_SETTING_802_1X_SCHEME_TYPE_UNKNOWN,
|
||||||
|
};
|
||||||
|
|
||||||
|
extern const NMSetting8021xSchemeVtable nm_setting_8021x_scheme_vtable[NM_SETTING_802_1X_SCHEME_TYPE_UNKNOWN + 1];
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
#endif /* __NM_SETTING_METADATA_H__ */
|
#endif /* __NM_SETTING_METADATA_H__ */
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@
|
||||||
#include "nm-utils.h"
|
#include "nm-utils.h"
|
||||||
#include "nm-core-internal.h"
|
#include "nm-core-internal.h"
|
||||||
#include "NetworkManagerUtils.h"
|
#include "NetworkManagerUtils.h"
|
||||||
|
#include "nm-setting-metadata.h"
|
||||||
|
|
||||||
#include "nms-ifcfg-rh-common.h"
|
#include "nms-ifcfg-rh-common.h"
|
||||||
#include "nms-ifcfg-rh-reader.h"
|
#include "nms-ifcfg-rh-reader.h"
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@
|
||||||
#include "settings/nm-settings-plugin.h"
|
#include "settings/nm-settings-plugin.h"
|
||||||
#include "nm-core-internal.h"
|
#include "nm-core-internal.h"
|
||||||
#include "NetworkManagerUtils.h"
|
#include "NetworkManagerUtils.h"
|
||||||
|
#include "nm-setting-metadata.h"
|
||||||
|
|
||||||
#include "nms-ifnet-net-utils.h"
|
#include "nms-ifnet-net-utils.h"
|
||||||
#include "nms-ifnet-wpa-parser.h"
|
#include "nms-ifnet-wpa-parser.h"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue