Blame libnm-core/nm-setting-macsec.h

Packit Service 87a54e
/* SPDX-License-Identifier: LGPL-2.1-or-later */
Packit 5756e2
/*
Packit 5756e2
 * Copyright (C) 2017 Red Hat, Inc.
Packit 5756e2
 */
Packit 5756e2
Packit 5756e2
#ifndef __NM_SETTING_MACSEC_H__
Packit 5756e2
#define __NM_SETTING_MACSEC_H__
Packit 5756e2
Packit Service a1bd4f
#if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION)
Packit Service a1bd4f
    #error "Only <NetworkManager.h> can be included directly."
Packit 5756e2
#endif
Packit 5756e2
Packit 5756e2
#include "nm-setting.h"
Packit 5756e2
Packit 5756e2
G_BEGIN_DECLS
Packit 5756e2
Packit Service a1bd4f
#define NM_TYPE_SETTING_MACSEC (nm_setting_macsec_get_type())
Packit Service a1bd4f
#define NM_SETTING_MACSEC(obj) \
Packit Service a1bd4f
    (G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_SETTING_MACSEC, NMSettingMacsec))
Packit Service a1bd4f
#define NM_SETTING_MACSEC_CLASS(klass) \
Packit Service a1bd4f
    (G_TYPE_CHECK_CLASS_CAST((klass), NM_TYPE_SETTING_MACSECCONFIG, NMSettingMacsecClass))
Packit Service a1bd4f
#define NM_IS_SETTING_MACSEC(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), NM_TYPE_SETTING_MACSEC))
Packit Service a1bd4f
#define NM_IS_SETTING_MACSEC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), NM_TYPE_SETTING_MACSEC))
Packit Service a1bd4f
#define NM_SETTING_MACSEC_GET_CLASS(obj) \
Packit Service a1bd4f
    (G_TYPE_INSTANCE_GET_CLASS((obj), NM_TYPE_SETTING_MACSEC, NMSettingMacsecClass))
Packit Service a1bd4f
Packit Service a1bd4f
#define NM_SETTING_MACSEC_SETTING_NAME "macsec"
Packit Service a1bd4f
Packit Service a1bd4f
#define NM_SETTING_MACSEC_PARENT        "parent"
Packit Service a1bd4f
#define NM_SETTING_MACSEC_MODE          "mode"
Packit Service a1bd4f
#define NM_SETTING_MACSEC_ENCRYPT       "encrypt"
Packit Service a1bd4f
#define NM_SETTING_MACSEC_MKA_CAK       "mka-cak"
Packit Service a1bd4f
#define NM_SETTING_MACSEC_MKA_CAK_FLAGS "mka-cak-flags"
Packit Service a1bd4f
#define NM_SETTING_MACSEC_MKA_CKN       "mka-ckn"
Packit Service a1bd4f
#define NM_SETTING_MACSEC_PORT          "port"
Packit Service a1bd4f
#define NM_SETTING_MACSEC_VALIDATION    "validation"
Packit Service a1bd4f
#define NM_SETTING_MACSEC_SEND_SCI      "send-sci"
Packit 5756e2
Packit 5756e2
/**
Packit 5756e2
 * NMSettingMacsec:
Packit 5756e2
 *
Packit 5756e2
 * MACSec Settings
Packit 5756e2
 */
Packit 5756e2
struct _NMSettingMacsec {
Packit Service a1bd4f
    NMSetting parent;
Packit 5756e2
};
Packit 5756e2
Packit 5756e2
typedef struct {
Packit Service a1bd4f
    NMSettingClass parent;
Packit 5756e2
Packit Service a1bd4f
    /*< private >*/
Packit Service a1bd4f
    gpointer padding[4];
Packit 5756e2
} NMSettingMacsecClass;
Packit 5756e2
Packit 5756e2
/**
Packit 5756e2
 * NMSettingMacsecMode:
Packit 5756e2
 * @NM_SETTING_MACSEC_MODE_PSK: The CAK is pre-shared
Packit 5756e2
 * @NM_SETTING_MACSEC_MODE_EAP: The CAK is the result of participation in EAP
Packit 5756e2
 *
Packit 5756e2
 * #NMSettingMacsecMode controls how the CAK (Connectivity Association Key) used
Packit 5756e2
 * in MKA (MACsec Key Agreement) is obtained.
Packit 5756e2
 *
Packit 5756e2
 * Since: 1.6
Packit 5756e2
 */
Packit 5756e2
typedef enum {
Packit Service a1bd4f
    NM_SETTING_MACSEC_MODE_PSK = 0,
Packit Service a1bd4f
    NM_SETTING_MACSEC_MODE_EAP = 1,
Packit 5756e2
} NMSettingMacsecMode;
Packit 5756e2
Packit 5756e2
/**
Packit 5756e2
 * NMSettingMacsecValidation:
Packit 5756e2
 * @NM_SETTING_MACSEC_VALIDATION_DISABLE: All incoming frames are accepted if
Packit 5756e2
 *   possible
Packit 5756e2
 * @NM_SETTING_MACSEC_VALIDATION_CHECK: Non protected, invalid, or impossible to
Packit 5756e2
 *   verify frames are accepted and counted as "invalid"
Packit 5756e2
 * @NM_SETTING_MACSEC_VALIDATION_STRICT: Non protected, invalid, or impossible to
Packit 5756e2
 *   verify frames are dropped
Packit 5756e2
 *
Packit 5756e2
 * #NMSettingMacsecValidation specifies a validation mode for incoming frames.
Packit 5756e2
 *
Packit 5756e2
 * Since: 1.6
Packit 5756e2
 */
Packit 5756e2
typedef enum {
Packit Service a1bd4f
    NM_SETTING_MACSEC_VALIDATION_DISABLE = 0,
Packit Service a1bd4f
    NM_SETTING_MACSEC_VALIDATION_CHECK   = 1,
Packit Service a1bd4f
    NM_SETTING_MACSEC_VALIDATION_STRICT  = 2,
Packit 5756e2
} NMSettingMacsecValidation;
Packit 5756e2
Packit Service a1bd4f
#define NM_SETTING_MACSEC_MKA_CAK_LENGTH 32
Packit Service a1bd4f
#define NM_SETTING_MACSEC_MKA_CKN_LENGTH 64
Packit 5756e2
Packit 5756e2
NM_AVAILABLE_IN_1_6
Packit Service a1bd4f
GType nm_setting_macsec_get_type(void);
Packit 5756e2
NM_AVAILABLE_IN_1_6
Packit Service a1bd4f
NMSetting *nm_setting_macsec_new(void);
Packit 5756e2
Packit 5756e2
NM_AVAILABLE_IN_1_6
Packit Service a1bd4f
const char *nm_setting_macsec_get_parent(NMSettingMacsec *setting);
Packit 5756e2
NM_AVAILABLE_IN_1_6
Packit Service a1bd4f
NMSettingMacsecMode nm_setting_macsec_get_mode(NMSettingMacsec *setting);
Packit 5756e2
NM_AVAILABLE_IN_1_6
Packit Service a1bd4f
gboolean nm_setting_macsec_get_encrypt(NMSettingMacsec *setting);
Packit 5756e2
NM_AVAILABLE_IN_1_6
Packit Service a1bd4f
const char *nm_setting_macsec_get_mka_cak(NMSettingMacsec *setting);
Packit 5756e2
NM_AVAILABLE_IN_1_6
Packit Service a1bd4f
NMSettingSecretFlags nm_setting_macsec_get_mka_cak_flags(NMSettingMacsec *setting);
Packit 5756e2
NM_AVAILABLE_IN_1_6
Packit Service a1bd4f
const char *nm_setting_macsec_get_mka_ckn(NMSettingMacsec *setting);
Packit 5756e2
NM_AVAILABLE_IN_1_6
Packit Service a1bd4f
int nm_setting_macsec_get_port(NMSettingMacsec *setting);
Packit 5756e2
NM_AVAILABLE_IN_1_6
Packit Service a1bd4f
NMSettingMacsecValidation nm_setting_macsec_get_validation(NMSettingMacsec *setting);
Packit 5756e2
NM_AVAILABLE_IN_1_12
Packit Service a1bd4f
gboolean nm_setting_macsec_get_send_sci(NMSettingMacsec *setting);
Packit 5756e2
Packit 5756e2
G_END_DECLS
Packit 5756e2
Packit 5756e2
#endif /* __NM_SETTING_MACSEC_H__ */