|
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 Service |
2bceb2 |
#include "libnm/nm-default-libnm.h"
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
#include "nm-device-macsec.h"
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
#include "nm-device-private.h"
|
|
Packit |
5756e2 |
#include "nm-object-private.h"
|
|
Packit |
5756e2 |
#include "nm-utils.h"
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
/*****************************************************************************/
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
NM_GOBJECT_PROPERTIES_DEFINE_BASE(PROP_PARENT,
|
|
Packit Service |
a1bd4f |
PROP_SCI,
|
|
Packit Service |
a1bd4f |
PROP_CIPHER_SUITE,
|
|
Packit Service |
a1bd4f |
PROP_ICV_LENGTH,
|
|
Packit Service |
a1bd4f |
PROP_WINDOW,
|
|
Packit Service |
a1bd4f |
PROP_ENCODING_SA,
|
|
Packit Service |
a1bd4f |
PROP_ENCRYPT,
|
|
Packit Service |
a1bd4f |
PROP_PROTECT,
|
|
Packit Service |
a1bd4f |
PROP_INCLUDE_SCI,
|
|
Packit Service |
a1bd4f |
PROP_ES,
|
|
Packit Service |
a1bd4f |
PROP_SCB,
|
|
Packit Service |
a1bd4f |
PROP_REPLAY_PROTECT,
|
|
Packit Service |
a1bd4f |
PROP_VALIDATION, );
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
typedef struct {
|
|
Packit Service |
a1bd4f |
NMLDBusPropertyO parent;
|
|
Packit Service |
a1bd4f |
char * validation;
|
|
Packit Service |
a1bd4f |
guint64 sci;
|
|
Packit Service |
a1bd4f |
guint64 cipher_suite;
|
|
Packit Service |
a1bd4f |
guint32 window;
|
|
Packit Service |
a1bd4f |
guint8 icv_length;
|
|
Packit Service |
a1bd4f |
guint8 encoding_sa;
|
|
Packit Service |
a1bd4f |
bool encrypt;
|
|
Packit Service |
a1bd4f |
bool protect;
|
|
Packit Service |
a1bd4f |
bool include_sci;
|
|
Packit Service |
a1bd4f |
bool es;
|
|
Packit Service |
a1bd4f |
bool scb;
|
|
Packit Service |
a1bd4f |
bool replay_protect;
|
|
Packit |
5756e2 |
} NMDeviceMacsecPrivate;
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
struct _NMDeviceMacsec {
|
|
Packit Service |
a1bd4f |
NMDevice parent;
|
|
Packit Service |
a1bd4f |
NMDeviceMacsecPrivate _priv;
|
|
Packit |
5756e2 |
};
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
struct _NMDeviceMacsecClass {
|
|
Packit Service |
a1bd4f |
NMDeviceClass parent;
|
|
Packit |
5756e2 |
};
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
G_DEFINE_TYPE(NMDeviceMacsec, nm_device_macsec, NM_TYPE_DEVICE)
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
#define NM_DEVICE_MACSEC_GET_PRIVATE(self) \
|
|
Packit Service |
a1bd4f |
_NM_GET_PRIVATE(self, NMDeviceMacsec, NM_IS_DEVICE_MACSEC, NMObject, NMDevice)
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
/*****************************************************************************/
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
/**
|
|
Packit |
5756e2 |
* nm_device_macsec_get_parent:
|
|
Packit |
5756e2 |
* @device: a #NMDeviceMacsec
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Returns: (transfer none): the device's parent device
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Since: 1.6
|
|
Packit |
5756e2 |
**/
|
|
Packit |
5756e2 |
NMDevice *
|
|
Packit Service |
a1bd4f |
nm_device_macsec_get_parent(NMDeviceMacsec *device)
|
|
Packit |
5756e2 |
{
|
|
Packit Service |
a1bd4f |
g_return_val_if_fail(NM_IS_DEVICE_MACSEC(device), NULL);
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
return nml_dbus_property_o_get_obj(&NM_DEVICE_MACSEC_GET_PRIVATE(device)->parent);
|
|
Packit |
5756e2 |
}
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
/**
|
|
Packit |
5756e2 |
* nm_device_macsec_get_hw_address: (skip)
|
|
Packit |
5756e2 |
* @device: a #NMDeviceMacsec
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Gets the hardware (MAC) address of the #NMDeviceMacsec
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Returns: the hardware address. This is the internal string used by the
|
|
Packit |
5756e2 |
* device, and must not be modified.
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Since: 1.6
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Deprecated: 1.24: Use nm_device_get_hw_address() instead.
|
|
Packit |
5756e2 |
**/
|
|
Packit |
5756e2 |
const char *
|
|
Packit Service |
a1bd4f |
nm_device_macsec_get_hw_address(NMDeviceMacsec *device)
|
|
Packit |
5756e2 |
{
|
|
Packit Service |
a1bd4f |
g_return_val_if_fail(NM_IS_DEVICE_MACSEC(device), NULL);
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
return nm_device_get_hw_address(NM_DEVICE(device));
|
|
Packit |
5756e2 |
}
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
/**
|
|
Packit |
5756e2 |
* nm_device_macsec_get_sci:
|
|
Packit |
5756e2 |
* @device: a #NMDeviceMacsec
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Gets the Secure Channel Identifier in use
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Returns: the SCI
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Since: 1.6
|
|
Packit |
5756e2 |
**/
|
|
Packit |
5756e2 |
guint64
|
|
Packit Service |
a1bd4f |
nm_device_macsec_get_sci(NMDeviceMacsec *device)
|
|
Packit |
5756e2 |
{
|
|
Packit Service |
a1bd4f |
g_return_val_if_fail(NM_IS_DEVICE_MACSEC(device), 0);
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
return NM_DEVICE_MACSEC_GET_PRIVATE(device)->sci;
|
|
Packit |
5756e2 |
}
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
/**
|
|
Packit |
5756e2 |
* nm_device_macsec_get_icv_length:
|
|
Packit |
5756e2 |
* @device: a #NMDeviceMacsec
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Gets the length of ICV (Integrity Check Value)
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Returns: the length of ICV
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Since: 1.6
|
|
Packit |
5756e2 |
**/
|
|
Packit |
5756e2 |
guint8
|
|
Packit Service |
a1bd4f |
nm_device_macsec_get_icv_length(NMDeviceMacsec *device)
|
|
Packit |
5756e2 |
{
|
|
Packit Service |
a1bd4f |
g_return_val_if_fail(NM_IS_DEVICE_MACSEC(device), 0);
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
return NM_DEVICE_MACSEC_GET_PRIVATE(device)->icv_length;
|
|
Packit |
5756e2 |
}
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
/**
|
|
Packit |
5756e2 |
* nm_device_macsec_get_cipher_suite:
|
|
Packit |
5756e2 |
* @device: a #NMDeviceMacsec
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Gets the set of cryptographic algorithms in use
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Returns: the set of cryptographic algorithms in use
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Since: 1.6
|
|
Packit |
5756e2 |
**/
|
|
Packit |
5756e2 |
guint64
|
|
Packit Service |
a1bd4f |
nm_device_macsec_get_cipher_suite(NMDeviceMacsec *device)
|
|
Packit |
5756e2 |
{
|
|
Packit Service |
a1bd4f |
g_return_val_if_fail(NM_IS_DEVICE_MACSEC(device), 0);
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
return NM_DEVICE_MACSEC_GET_PRIVATE(device)->cipher_suite;
|
|
Packit |
5756e2 |
}
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
/**
|
|
Packit |
5756e2 |
* nm_device_macsec_get_window:
|
|
Packit |
5756e2 |
* @device: a #NMDeviceMacsec
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Gets the size of the replay window
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Returns: size of the replay window
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Since: 1.6
|
|
Packit |
5756e2 |
**/
|
|
Packit |
5756e2 |
guint
|
|
Packit Service |
a1bd4f |
nm_device_macsec_get_window(NMDeviceMacsec *device)
|
|
Packit |
5756e2 |
{
|
|
Packit Service |
a1bd4f |
g_return_val_if_fail(NM_IS_DEVICE_MACSEC(device), 0);
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
return NM_DEVICE_MACSEC_GET_PRIVATE(device)->window;
|
|
Packit |
5756e2 |
}
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
/**
|
|
Packit |
5756e2 |
* nm_device_macsec_get_encoding_sa:
|
|
Packit |
5756e2 |
* @device: a #NMDeviceMacsec
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Gets the value of the Association Number (0..3) for the Security
|
|
Packit |
5756e2 |
* Association in use.
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Returns: the current Security Association
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Since: 1.6
|
|
Packit |
5756e2 |
**/
|
|
Packit |
5756e2 |
guint8
|
|
Packit Service |
a1bd4f |
nm_device_macsec_get_encoding_sa(NMDeviceMacsec *device)
|
|
Packit |
5756e2 |
{
|
|
Packit Service |
a1bd4f |
g_return_val_if_fail(NM_IS_DEVICE_MACSEC(device), 0);
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
return NM_DEVICE_MACSEC_GET_PRIVATE(device)->encoding_sa;
|
|
Packit |
5756e2 |
}
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
/**
|
|
Packit |
5756e2 |
* nm_device_macsec_get_validation:
|
|
Packit |
5756e2 |
* @device: a #NMDeviceMacsec
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Gets the validation mode for incoming packets (strict, check,
|
|
Packit |
5756e2 |
* disabled)
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Returns: the validation mode
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Since: 1.6
|
|
Packit |
5756e2 |
**/
|
|
Packit |
5756e2 |
const char *
|
|
Packit Service |
a1bd4f |
nm_device_macsec_get_validation(NMDeviceMacsec *device)
|
|
Packit |
5756e2 |
{
|
|
Packit Service |
a1bd4f |
g_return_val_if_fail(NM_IS_DEVICE_MACSEC(device), NULL);
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
return NM_DEVICE_MACSEC_GET_PRIVATE(device)->validation;
|
|
Packit |
5756e2 |
}
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
/**
|
|
Packit |
5756e2 |
* nm_device_macsec_get_encrypt:
|
|
Packit |
5756e2 |
* @device: a #NMDeviceMacsec
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Gets whether encryption of transmitted frames is enabled
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Returns: whether encryption is enabled
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Since: 1.6
|
|
Packit |
5756e2 |
**/
|
|
Packit |
5756e2 |
gboolean
|
|
Packit Service |
a1bd4f |
nm_device_macsec_get_encrypt(NMDeviceMacsec *device)
|
|
Packit |
5756e2 |
{
|
|
Packit Service |
a1bd4f |
g_return_val_if_fail(NM_IS_DEVICE_MACSEC(device), FALSE);
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
return NM_DEVICE_MACSEC_GET_PRIVATE(device)->encrypt;
|
|
Packit |
5756e2 |
}
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
/**
|
|
Packit |
5756e2 |
* nm_device_macsec_get_protect:
|
|
Packit |
5756e2 |
* @device: a #NMDeviceMacsec
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Gets whether protection of transmitted frames is enabled
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Returns: whether protection is enabled
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Since: 1.6
|
|
Packit |
5756e2 |
**/
|
|
Packit |
5756e2 |
gboolean
|
|
Packit Service |
a1bd4f |
nm_device_macsec_get_protect(NMDeviceMacsec *device)
|
|
Packit |
5756e2 |
{
|
|
Packit Service |
a1bd4f |
g_return_val_if_fail(NM_IS_DEVICE_MACSEC(device), FALSE);
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
return NM_DEVICE_MACSEC_GET_PRIVATE(device)->protect;
|
|
Packit |
5756e2 |
}
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
/**
|
|
Packit |
5756e2 |
* nm_device_macsec_get_include_sci:
|
|
Packit |
5756e2 |
* @device: a #NMDeviceMacsec
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Gets whether the SCI is always included in SecTAG for transmitted
|
|
Packit |
5756e2 |
* frames
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Returns: whether the SCI is always included
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Since: 1.6
|
|
Packit |
5756e2 |
**/
|
|
Packit |
5756e2 |
gboolean
|
|
Packit Service |
a1bd4f |
nm_device_macsec_get_include_sci(NMDeviceMacsec *device)
|
|
Packit |
5756e2 |
{
|
|
Packit Service |
a1bd4f |
g_return_val_if_fail(NM_IS_DEVICE_MACSEC(device), FALSE);
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
return NM_DEVICE_MACSEC_GET_PRIVATE(device)->include_sci;
|
|
Packit |
5756e2 |
}
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
/**
|
|
Packit |
5756e2 |
* nm_device_macsec_get_es:
|
|
Packit |
5756e2 |
* @device: a #NMDeviceMacsec
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Gets whether the ES (End station) bit is enabled in SecTAG for
|
|
Packit |
5756e2 |
* transmitted frames
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Returns: whether the ES (End station) bit is enabled
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Since: 1.6
|
|
Packit |
5756e2 |
**/
|
|
Packit |
5756e2 |
gboolean
|
|
Packit Service |
a1bd4f |
nm_device_macsec_get_es(NMDeviceMacsec *device)
|
|
Packit |
5756e2 |
{
|
|
Packit Service |
a1bd4f |
g_return_val_if_fail(NM_IS_DEVICE_MACSEC(device), FALSE);
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
return NM_DEVICE_MACSEC_GET_PRIVATE(device)->es;
|
|
Packit |
5756e2 |
}
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
/**
|
|
Packit |
5756e2 |
* nm_device_macsec_get_scb:
|
|
Packit |
5756e2 |
* @device: a #NMDeviceMacsec
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Gets whether the SCB (Single Copy Broadcast) bit is enabled in
|
|
Packit |
5756e2 |
* SecTAG for transmitted frames
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Returns: whether the SCB (Single Copy Broadcast) bit is enabled
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Since: 1.6
|
|
Packit |
5756e2 |
**/
|
|
Packit |
5756e2 |
gboolean
|
|
Packit Service |
a1bd4f |
nm_device_macsec_get_scb(NMDeviceMacsec *device)
|
|
Packit |
5756e2 |
{
|
|
Packit Service |
a1bd4f |
g_return_val_if_fail(NM_IS_DEVICE_MACSEC(device), FALSE);
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
return NM_DEVICE_MACSEC_GET_PRIVATE(device)->scb;
|
|
Packit |
5756e2 |
}
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
/**
|
|
Packit |
5756e2 |
* nm_device_macsec_get_replay_protect:
|
|
Packit |
5756e2 |
* @device: a #NMDeviceMacsec
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Gets whether replay protection is enabled
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Returns: whether replay protection is enabled
|
|
Packit |
5756e2 |
*
|
|
Packit |
5756e2 |
* Since: 1.6
|
|
Packit |
5756e2 |
**/
|
|
Packit |
5756e2 |
gboolean
|
|
Packit Service |
a1bd4f |
nm_device_macsec_get_replay_protect(NMDeviceMacsec *device)
|
|
Packit |
5756e2 |
{
|
|
Packit Service |
a1bd4f |
g_return_val_if_fail(NM_IS_DEVICE_MACSEC(device), FALSE);
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
return NM_DEVICE_MACSEC_GET_PRIVATE(device)->replay_protect;
|
|
Packit |
5756e2 |
}
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
/***********************************************************/
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
static void
|
|
Packit Service |
a1bd4f |
nm_device_macsec_init(NMDeviceMacsec *device)
|
|
Packit Service |
a1bd4f |
{}
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
static void
|
|
Packit Service |
a1bd4f |
finalize(GObject *object)
|
|
Packit |
5756e2 |
{
|
|
Packit Service |
a1bd4f |
NMDeviceMacsecPrivate *priv = NM_DEVICE_MACSEC_GET_PRIVATE(object);
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
g_free(priv->validation);
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
G_OBJECT_CLASS(nm_device_macsec_parent_class)->finalize(object);
|
|
Packit |
5756e2 |
}
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
static void
|
|
Packit Service |
a1bd4f |
get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
|
|
Packit |
5756e2 |
{
|
|
Packit Service |
a1bd4f |
NMDeviceMacsec *device = NM_DEVICE_MACSEC(object);
|
|
Packit Service |
a1bd4f |
|
|
Packit Service |
a1bd4f |
switch (prop_id) {
|
|
Packit Service |
a1bd4f |
case PROP_PARENT:
|
|
Packit Service |
a1bd4f |
g_value_set_object(value, nm_device_macsec_get_parent(device));
|
|
Packit Service |
a1bd4f |
break;
|
|
Packit Service |
a1bd4f |
case PROP_SCI:
|
|
Packit Service |
a1bd4f |
g_value_set_uint64(value, nm_device_macsec_get_sci(device));
|
|
Packit Service |
a1bd4f |
break;
|
|
Packit Service |
a1bd4f |
case PROP_ICV_LENGTH:
|
|
Packit Service |
a1bd4f |
g_value_set_uchar(value, nm_device_macsec_get_icv_length(device));
|
|
Packit Service |
a1bd4f |
break;
|
|
Packit Service |
a1bd4f |
case PROP_CIPHER_SUITE:
|
|
Packit Service |
a1bd4f |
g_value_set_uint64(value, nm_device_macsec_get_cipher_suite(device));
|
|
Packit Service |
a1bd4f |
break;
|
|
Packit Service |
a1bd4f |
case PROP_WINDOW:
|
|
Packit Service |
a1bd4f |
g_value_set_uint(value, nm_device_macsec_get_window(device));
|
|
Packit Service |
a1bd4f |
break;
|
|
Packit Service |
a1bd4f |
case PROP_ENCODING_SA:
|
|
Packit Service |
a1bd4f |
g_value_set_uchar(value, nm_device_macsec_get_encoding_sa(device));
|
|
Packit Service |
a1bd4f |
break;
|
|
Packit Service |
a1bd4f |
case PROP_VALIDATION:
|
|
Packit Service |
a1bd4f |
g_value_set_string(value, nm_device_macsec_get_validation(device));
|
|
Packit Service |
a1bd4f |
break;
|
|
Packit Service |
a1bd4f |
case PROP_ENCRYPT:
|
|
Packit Service |
a1bd4f |
g_value_set_boolean(value, nm_device_macsec_get_encrypt(device));
|
|
Packit Service |
a1bd4f |
break;
|
|
Packit Service |
a1bd4f |
case PROP_PROTECT:
|
|
Packit Service |
a1bd4f |
g_value_set_boolean(value, nm_device_macsec_get_protect(device));
|
|
Packit Service |
a1bd4f |
break;
|
|
Packit Service |
a1bd4f |
case PROP_INCLUDE_SCI:
|
|
Packit Service |
a1bd4f |
g_value_set_boolean(value, nm_device_macsec_get_include_sci(device));
|
|
Packit Service |
a1bd4f |
break;
|
|
Packit Service |
a1bd4f |
case PROP_ES:
|
|
Packit Service |
a1bd4f |
g_value_set_boolean(value, nm_device_macsec_get_es(device));
|
|
Packit Service |
a1bd4f |
break;
|
|
Packit Service |
a1bd4f |
case PROP_SCB:
|
|
Packit Service |
a1bd4f |
g_value_set_boolean(value, nm_device_macsec_get_scb(device));
|
|
Packit Service |
a1bd4f |
break;
|
|
Packit Service |
a1bd4f |
case PROP_REPLAY_PROTECT:
|
|
Packit Service |
a1bd4f |
g_value_set_boolean(value, nm_device_macsec_get_replay_protect(device));
|
|
Packit Service |
a1bd4f |
break;
|
|
Packit Service |
a1bd4f |
default:
|
|
Packit Service |
a1bd4f |
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
|
|
Packit Service |
a1bd4f |
break;
|
|
Packit Service |
a1bd4f |
}
|
|
Packit |
5756e2 |
}
|
|
Packit |
5756e2 |
|
|
Packit Service |
a1bd4f |
const NMLDBusMetaIface _nml_dbus_meta_iface_nm_device_macsec = NML_DBUS_META_IFACE_INIT_PROP(
|
|
Packit Service |
a1bd4f |
NM_DBUS_INTERFACE_DEVICE_MACSEC,
|
|
Packit Service |
a1bd4f |
nm_device_macsec_get_type,
|
|
Packit Service |
a1bd4f |
NML_DBUS_META_INTERFACE_PRIO_INSTANTIATE_30,
|
|
Packit Service |
a1bd4f |
NML_DBUS_META_IFACE_DBUS_PROPERTIES(
|
|
Packit Service |
a1bd4f |
NML_DBUS_META_PROPERTY_INIT_T("CipherSuite",
|
|
Packit Service |
a1bd4f |
PROP_CIPHER_SUITE,
|
|
Packit Service |
a1bd4f |
NMDeviceMacsec,
|
|
Packit Service |
a1bd4f |
_priv.cipher_suite),
|
|
Packit Service |
a1bd4f |
NML_DBUS_META_PROPERTY_INIT_Y("EncodingSa",
|
|
Packit Service |
a1bd4f |
PROP_ENCODING_SA,
|
|
Packit Service |
a1bd4f |
NMDeviceMacsec,
|
|
Packit Service |
a1bd4f |
_priv.encoding_sa),
|
|
Packit Service |
a1bd4f |
NML_DBUS_META_PROPERTY_INIT_B("Encrypt", PROP_ENCRYPT, NMDeviceMacsec, _priv.encrypt),
|
|
Packit Service |
a1bd4f |
NML_DBUS_META_PROPERTY_INIT_B("Es", PROP_ES, NMDeviceMacsec, _priv.es),
|
|
Packit Service |
a1bd4f |
NML_DBUS_META_PROPERTY_INIT_Y("IcvLength",
|
|
Packit Service |
a1bd4f |
PROP_ICV_LENGTH,
|
|
Packit Service |
a1bd4f |
NMDeviceMacsec,
|
|
Packit Service |
a1bd4f |
_priv.icv_length),
|
|
Packit Service |
a1bd4f |
NML_DBUS_META_PROPERTY_INIT_B("IncludeSci",
|
|
Packit Service |
a1bd4f |
PROP_INCLUDE_SCI,
|
|
Packit Service |
a1bd4f |
NMDeviceMacsec,
|
|
Packit Service |
a1bd4f |
_priv.include_sci),
|
|
Packit Service |
a1bd4f |
NML_DBUS_META_PROPERTY_INIT_O_PROP("Parent",
|
|
Packit Service |
a1bd4f |
PROP_PARENT,
|
|
Packit Service |
a1bd4f |
NMDeviceMacsec,
|
|
Packit Service |
a1bd4f |
_priv.parent,
|
|
Packit Service |
a1bd4f |
nm_device_get_type),
|
|
Packit Service |
a1bd4f |
NML_DBUS_META_PROPERTY_INIT_B("Protect", PROP_PROTECT, NMDeviceMacsec, _priv.protect),
|
|
Packit Service |
a1bd4f |
NML_DBUS_META_PROPERTY_INIT_B("ReplayProtect",
|
|
Packit Service |
a1bd4f |
PROP_REPLAY_PROTECT,
|
|
Packit Service |
a1bd4f |
NMDeviceMacsec,
|
|
Packit Service |
a1bd4f |
_priv.replay_protect),
|
|
Packit Service |
a1bd4f |
NML_DBUS_META_PROPERTY_INIT_B("Scb", PROP_SCB, NMDeviceMacsec, _priv.scb),
|
|
Packit Service |
a1bd4f |
NML_DBUS_META_PROPERTY_INIT_T("Sci", PROP_SCI, NMDeviceMacsec, _priv.sci),
|
|
Packit Service |
a1bd4f |
NML_DBUS_META_PROPERTY_INIT_S("Validation",
|
|
Packit Service |
a1bd4f |
PROP_VALIDATION,
|
|
Packit Service |
a1bd4f |
NMDeviceMacsec,
|
|
Packit Service |
a1bd4f |
_priv.validation),
|
|
Packit Service |
a1bd4f |
NML_DBUS_META_PROPERTY_INIT_U("Window", PROP_WINDOW, NMDeviceMacsec, _priv.window), ), );
|
|
Packit |
5756e2 |
|
|
Packit |
5756e2 |
static void
|
|
Packit Service |
a1bd4f |
nm_device_macsec_class_init(NMDeviceMacsecClass *klass)
|
|
Packit |
5756e2 |
{
|
|
Packit Service |
a1bd4f |
GObjectClass * object_class = G_OBJECT_CLASS(klass);
|
|
Packit Service |
a1bd4f |
NMObjectClass *nm_object_class = NM_OBJECT_CLASS(klass);
|
|
Packit Service |
a1bd4f |
|
|
Packit Service |
a1bd4f |
object_class->get_property = get_property;
|
|
Packit Service |
a1bd4f |
object_class->finalize = finalize;
|
|
Packit Service |
a1bd4f |
|
|
Packit Service |
a1bd4f |
_NM_OBJECT_CLASS_INIT_PRIV_PTR_DIRECT(nm_object_class, NMDeviceMacsec);
|
|
Packit Service |
a1bd4f |
|
|
Packit Service |
a1bd4f |
_NM_OBJECT_CLASS_INIT_PROPERTY_O_FIELDS_1(nm_object_class, NMDeviceMacsecPrivate, parent);
|
|
Packit Service |
a1bd4f |
|
|
Packit Service |
a1bd4f |
/**
|
|
Packit Service |
a1bd4f |
* NMDeviceMacsec:parent:
|
|
Packit Service |
a1bd4f |
*
|
|
Packit Service |
a1bd4f |
* The devices's parent device.
|
|
Packit Service |
a1bd4f |
*
|
|
Packit Service |
a1bd4f |
* Since: 1.6
|
|
Packit Service |
a1bd4f |
**/
|
|
Packit Service |
a1bd4f |
obj_properties[PROP_PARENT] = g_param_spec_object(NM_DEVICE_MACSEC_PARENT,
|
|
Packit Service |
a1bd4f |
"",
|
|
Packit Service |
a1bd4f |
"",
|
|
Packit Service |
a1bd4f |
NM_TYPE_DEVICE,
|
|
Packit Service |
a1bd4f |
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
|
Packit Service |
a1bd4f |
|
|
Packit Service |
a1bd4f |
/**
|
|
Packit Service |
a1bd4f |
* NMDeviceMacsec:sci:
|
|
Packit Service |
a1bd4f |
*
|
|
Packit Service |
a1bd4f |
* The Secure Channel Identifier in use.
|
|
Packit Service |
a1bd4f |
*
|
|
Packit Service |
a1bd4f |
* Since: 1.6
|
|
Packit Service |
a1bd4f |
**/
|
|
Packit Service |
a1bd4f |
obj_properties[PROP_SCI] = g_param_spec_uint64(NM_DEVICE_MACSEC_SCI,
|
|
Packit Service |
a1bd4f |
"",
|
|
Packit Service |
a1bd4f |
"",
|
|
Packit Service |
a1bd4f |
0,
|
|
Packit Service |
a1bd4f |
G_MAXUINT64,
|
|
Packit Service |
a1bd4f |
0,
|
|
Packit Service |
a1bd4f |
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
|
Packit Service |
a1bd4f |
|
|
Packit Service |
a1bd4f |
/**
|
|
Packit Service |
a1bd4f |
* NMDeviceMacsec:icv-length:
|
|
Packit Service |
a1bd4f |
*
|
|
Packit Service |
a1bd4f |
* The length of ICV (Integrity Check Value).
|
|
Packit Service |
a1bd4f |
*
|
|
Packit Service |
a1bd4f |
* Since: 1.6
|
|
Packit Service |
a1bd4f |
**/
|
|
Packit Service |
a1bd4f |
obj_properties[PROP_ICV_LENGTH] = g_param_spec_uchar(NM_DEVICE_MACSEC_ICV_LENGTH,
|
|
Packit Service |
a1bd4f |
"",
|
|
Packit Service |
a1bd4f |
"",
|
|
Packit Service |
a1bd4f |
0,
|
|
Packit Service |
a1bd4f |
G_MAXUINT8,
|
|
Packit Service |
a1bd4f |
0,
|
|
Packit Service |
a1bd4f |
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
|
Packit Service |
a1bd4f |
|
|
Packit Service |
a1bd4f |
/**
|
|
Packit Service |
a1bd4f |
* NMDeviceMacsec:cipher-suite:
|
|
Packit Service |
a1bd4f |
*
|
|
Packit Service |
a1bd4f |
* The set of cryptographic algorithms in use.
|
|
Packit Service |
a1bd4f |
*
|
|
Packit Service |
a1bd4f |
* Since: 1.6
|
|
Packit Service |
a1bd4f |
**/
|
|
Packit Service |
a1bd4f |
obj_properties[PROP_CIPHER_SUITE] =
|
|
Packit Service |
a1bd4f |
g_param_spec_uint64(NM_DEVICE_MACSEC_CIPHER_SUITE,
|
|
Packit Service |
a1bd4f |
"",
|
|
Packit Service |
a1bd4f |
"",
|
|
Packit Service |
a1bd4f |
0,
|
|
Packit Service |
a1bd4f |
G_MAXUINT64,
|
|
Packit Service |
a1bd4f |
0,
|
|
Packit Service |
a1bd4f |
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
|
Packit Service |
a1bd4f |
|
|
Packit Service |
a1bd4f |
/**
|
|
Packit Service |
a1bd4f |
* NMDeviceMacsec:window:
|
|
Packit Service |
a1bd4f |
*
|
|
Packit Service |
a1bd4f |
* The size of the replay window.
|
|
Packit Service |
a1bd4f |
*
|
|
Packit Service |
a1bd4f |
* Since: 1.6
|
|
Packit Service |
a1bd4f |
**/
|
|
Packit Service |
a1bd4f |
obj_properties[PROP_WINDOW] = g_param_spec_uint(NM_DEVICE_MACSEC_WINDOW,
|
|
Packit Service |
a1bd4f |
"",
|
|
Packit Service |
a1bd4f |
"",
|
|
Packit Service |
a1bd4f |
0,
|
|
Packit Service |
a1bd4f |
G_MAXUINT32,
|
|
Packit Service |
a1bd4f |
0,
|
|
Packit Service |
a1bd4f |
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
|
Packit Service |
a1bd4f |
|
|
Packit Service |
a1bd4f |
/**
|
|
Packit Service |
a1bd4f |
* NMDeviceMacsec:encoding-sa:
|
|
Packit Service |
a1bd4f |
*
|
|
Packit Service |
a1bd4f |
* The value of the Association Number (0..3) for the Security
|
|
Packit Service |
a1bd4f |
* Association in use.
|
|
Packit Service |
a1bd4f |
*
|
|
Packit Service |
a1bd4f |
* Since: 1.6
|
|
Packit Service |
a1bd4f |
**/
|
|
Packit Service |
a1bd4f |
obj_properties[PROP_ENCODING_SA] =
|
|
Packit Service |
a1bd4f |
g_param_spec_uchar(NM_DEVICE_MACSEC_ENCODING_SA,
|
|
Packit Service |
a1bd4f |
"",
|
|
Packit Service |
a1bd4f |
"",
|
|
Packit Service |
a1bd4f |
0,
|
|
Packit Service |
a1bd4f |
G_MAXUINT8,
|
|
Packit Service |
a1bd4f |
0,
|
|
Packit Service |
a1bd4f |
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
|
Packit Service |
a1bd4f |
|
|
Packit Service |
a1bd4f |
/**
|
|
Packit Service |
a1bd4f |
* NMDeviceMacsec:validation:
|
|
Packit Service |
a1bd4f |
*
|
|
Packit Service |
a1bd4f |
* The validation mode for incoming packets (strict, check,
|
|
Packit Service |
a1bd4f |
* disabled).
|
|
Packit Service |
a1bd4f |
*
|
|
Packit Service |
a1bd4f |
* Since: 1.6
|
|
Packit Service |
a1bd4f |
**/
|
|
Packit Service |
a1bd4f |
obj_properties[PROP_VALIDATION] =
|
|
Packit Service |
a1bd4f |
g_param_spec_string(NM_DEVICE_MACSEC_VALIDATION,
|
|
Packit Service |
a1bd4f |
"",
|
|
Packit Service |
a1bd4f |
"",
|
|
Packit Service |
a1bd4f |
NULL,
|
|
Packit Service |
a1bd4f |
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
|
Packit Service |
a1bd4f |
|
|
Packit Service |
a1bd4f |
/**
|
|
Packit Service |
a1bd4f |
* NMDeviceMacsec:encrypt:
|
|
Packit Service |
a1bd4f |
*
|
|
Packit Service |
a1bd4f |
* Whether encryption of transmitted frames is enabled.
|
|
Packit Service |
a1bd4f |
*
|
|
Packit Service |
a1bd4f |
* Since: 1.6
|
|
Packit Service |
a1bd4f |
**/
|
|
Packit Service |
a1bd4f |
obj_properties[PROP_ENCRYPT] = g_param_spec_boolean(NM_DEVICE_MACSEC_ENCRYPT,
|
|
Packit Service |
a1bd4f |
"",
|
|
Packit Service |
a1bd4f |
"",
|
|
Packit Service |
a1bd4f |
FALSE,
|
|
Packit Service |
a1bd4f |
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
|
Packit Service |
a1bd4f |
|
|
Packit Service |
a1bd4f |
/**
|
|
Packit Service |
a1bd4f |
* NMDeviceMacsec:protect:
|
|
Packit Service |
a1bd4f |
*
|
|
Packit Service |
a1bd4f |
* Whether protection of transmitted frames is enabled.
|
|
Packit Service |
a1bd4f |
*
|
|
Packit Service |
a1bd4f |
* Since: 1.6
|
|
Packit Service |
a1bd4f |
**/
|
|
Packit Service |
a1bd4f |
obj_properties[PROP_PROTECT] = g_param_spec_boolean(NM_DEVICE_MACSEC_PROTECT,
|
|
Packit Service |
a1bd4f |
"",
|
|
Packit Service |
a1bd4f |
"",
|
|
Packit Service |
a1bd4f |
FALSE,
|
|
Packit Service |
a1bd4f |
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
|
Packit Service |
a1bd4f |
|
|
Packit Service |
a1bd4f |
/**
|
|
Packit Service |
a1bd4f |
* NMDeviceMacsec:include-sci:
|
|
Packit Service |
a1bd4f |
*
|
|
Packit Service |
a1bd4f |
* Whether the SCI is always included in SecTAG for transmitted
|
|
Packit Service |
a1bd4f |
* frames.
|
|
Packit Service |
a1bd4f |
*
|
|
Packit Service |
a1bd4f |
* Since: 1.6
|
|
Packit Service |
a1bd4f |
**/
|
|
Packit Service |
a1bd4f |
obj_properties[PROP_INCLUDE_SCI] =
|
|
Packit Service |
a1bd4f |
g_param_spec_boolean(NM_DEVICE_MACSEC_INCLUDE_SCI,
|
|
Packit Service |
a1bd4f |
"",
|
|
Packit Service |
a1bd4f |
"",
|
|
Packit Service |
a1bd4f |
FALSE,
|
|
Packit Service |
a1bd4f |
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
|
Packit Service |
a1bd4f |
|
|
Packit Service |
a1bd4f |
/**
|
|
Packit Service |
a1bd4f |
* NMDeviceMacsec:es:
|
|
Packit Service |
a1bd4f |
*
|
|
Packit Service |
a1bd4f |
* Whether the ES (End station) bit is enabled in SecTAG for
|
|
Packit Service |
a1bd4f |
* transmitted frames.
|
|
Packit Service |
a1bd4f |
*
|
|
Packit Service |
a1bd4f |
* Since: 1.6
|
|
Packit Service |
a1bd4f |
**/
|
|
Packit Service |
a1bd4f |
obj_properties[PROP_ES] = g_param_spec_boolean(NM_DEVICE_MACSEC_ES,
|
|
Packit Service |
a1bd4f |
"",
|
|
Packit Service |
a1bd4f |
"",
|
|
Packit Service |
a1bd4f |
FALSE,
|
|
Packit Service |
a1bd4f |
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
|
Packit Service |
a1bd4f |
|
|
Packit Service |
a1bd4f |
/**
|
|
Packit Service |
a1bd4f |
* NMDeviceMacsec:scb:
|
|
Packit Service |
a1bd4f |
*
|
|
Packit Service |
a1bd4f |
* Whether the SCB (Single Copy Broadcast) bit is enabled in
|
|
Packit Service |
a1bd4f |
* SecTAG for transmitted frames.
|
|
Packit Service |
a1bd4f |
*
|
|
Packit Service |
a1bd4f |
* Since: 1.6
|
|
Packit Service |
a1bd4f |
**/
|
|
Packit Service |
a1bd4f |
obj_properties[PROP_SCB] = g_param_spec_boolean(NM_DEVICE_MACSEC_SCB,
|
|
Packit Service |
a1bd4f |
"",
|
|
Packit Service |
a1bd4f |
"",
|
|
Packit Service |
a1bd4f |
FALSE,
|
|
Packit Service |
a1bd4f |
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
|
Packit Service |
a1bd4f |
|
|
Packit Service |
a1bd4f |
/**
|
|
Packit Service |
a1bd4f |
* NMDeviceMacsec:replay-protect:
|
|
Packit Service |
a1bd4f |
*
|
|
Packit Service |
a1bd4f |
* Whether replay protection is enabled.
|
|
Packit Service |
a1bd4f |
*
|
|
Packit Service |
a1bd4f |
* Since: 1.6
|
|
Packit Service |
a1bd4f |
**/
|
|
Packit Service |
a1bd4f |
obj_properties[PROP_REPLAY_PROTECT] =
|
|
Packit Service |
a1bd4f |
g_param_spec_boolean(NM_DEVICE_MACSEC_REPLAY_PROTECT,
|
|
Packit Service |
a1bd4f |
"",
|
|
Packit Service |
a1bd4f |
"",
|
|
Packit Service |
a1bd4f |
FALSE,
|
|
Packit Service |
a1bd4f |
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
|
Packit Service |
a1bd4f |
|
|
Packit Service |
a1bd4f |
_nml_dbus_meta_class_init_with_properties(object_class, &_nml_dbus_meta_iface_nm_device_macsec);
|
|
Packit |
5756e2 |
}
|