mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-08 11:19:16 +02:00
libnm: add 390-subchannels property to NMDeviceEthernet
This commit is contained in:
parent
4219aa9a56
commit
bbaca1b24e
3 changed files with 45 additions and 0 deletions
|
|
@ -858,6 +858,7 @@ libnm_1_0_6 {
|
||||||
libnm_1_2_0 {
|
libnm_1_2_0 {
|
||||||
global:
|
global:
|
||||||
nm_access_point_get_last_seen;
|
nm_access_point_get_last_seen;
|
||||||
|
nm_device_ethernet_get_s390_subchannels;
|
||||||
nm_device_get_metered;
|
nm_device_get_metered;
|
||||||
nm_device_get_nm_plugin_missing;
|
nm_device_get_nm_plugin_missing;
|
||||||
nm_device_set_managed;
|
nm_device_set_managed;
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ typedef struct {
|
||||||
char *perm_hw_address;
|
char *perm_hw_address;
|
||||||
guint32 speed;
|
guint32 speed;
|
||||||
gboolean carrier;
|
gboolean carrier;
|
||||||
|
char **s390_subchannels;
|
||||||
} NMDeviceEthernetPrivate;
|
} NMDeviceEthernetPrivate;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
|
@ -50,6 +51,7 @@ enum {
|
||||||
PROP_PERM_HW_ADDRESS,
|
PROP_PERM_HW_ADDRESS,
|
||||||
PROP_SPEED,
|
PROP_SPEED,
|
||||||
PROP_CARRIER,
|
PROP_CARRIER,
|
||||||
|
PROP_S390_SUBCHANNELS,
|
||||||
|
|
||||||
LAST_PROP
|
LAST_PROP
|
||||||
};
|
};
|
||||||
|
|
@ -120,6 +122,25 @@ nm_device_ethernet_get_carrier (NMDeviceEthernet *device)
|
||||||
return NM_DEVICE_ETHERNET_GET_PRIVATE (device)->carrier;
|
return NM_DEVICE_ETHERNET_GET_PRIVATE (device)->carrier;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* nm_device_ethernet_get_s390_subchannels:
|
||||||
|
* @device: a #NMDeviceEthernet
|
||||||
|
*
|
||||||
|
* Return the list of s390 subchannels if the device supports them.
|
||||||
|
*
|
||||||
|
* Returns: (transfer none) (element-type utf8): array of strings, each specifying
|
||||||
|
* one subchannel the s390 device uses to communicate to the host.
|
||||||
|
*
|
||||||
|
* Since: 1.2
|
||||||
|
**/
|
||||||
|
const char * const *
|
||||||
|
nm_device_ethernet_get_s390_subchannels (NMDeviceEthernet *device)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (NM_IS_DEVICE_ETHERNET (device), NULL);
|
||||||
|
|
||||||
|
return (const char * const *) NM_DEVICE_ETHERNET_GET_PRIVATE (device)->s390_subchannels;
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
|
connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
|
||||||
{
|
{
|
||||||
|
|
@ -193,6 +214,7 @@ init_dbus (NMObject *object)
|
||||||
{ NM_DEVICE_ETHERNET_PERMANENT_HW_ADDRESS, &priv->perm_hw_address },
|
{ NM_DEVICE_ETHERNET_PERMANENT_HW_ADDRESS, &priv->perm_hw_address },
|
||||||
{ NM_DEVICE_ETHERNET_SPEED, &priv->speed },
|
{ NM_DEVICE_ETHERNET_SPEED, &priv->speed },
|
||||||
{ NM_DEVICE_ETHERNET_CARRIER, &priv->carrier },
|
{ NM_DEVICE_ETHERNET_CARRIER, &priv->carrier },
|
||||||
|
{ NM_DEVICE_ETHERNET_S390_SUBCHANNELS, &priv->s390_subchannels },
|
||||||
{ NULL },
|
{ NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -210,6 +232,7 @@ finalize (GObject *object)
|
||||||
|
|
||||||
g_free (priv->hw_address);
|
g_free (priv->hw_address);
|
||||||
g_free (priv->perm_hw_address);
|
g_free (priv->perm_hw_address);
|
||||||
|
g_strfreev (priv->s390_subchannels);
|
||||||
|
|
||||||
G_OBJECT_CLASS (nm_device_ethernet_parent_class)->finalize (object);
|
G_OBJECT_CLASS (nm_device_ethernet_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
@ -221,6 +244,7 @@ get_property (GObject *object,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
NMDeviceEthernet *device = NM_DEVICE_ETHERNET (object);
|
NMDeviceEthernet *device = NM_DEVICE_ETHERNET (object);
|
||||||
|
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_HW_ADDRESS:
|
case PROP_HW_ADDRESS:
|
||||||
|
|
@ -235,6 +259,9 @@ get_property (GObject *object,
|
||||||
case PROP_CARRIER:
|
case PROP_CARRIER:
|
||||||
g_value_set_boolean (value, nm_device_ethernet_get_carrier (device));
|
g_value_set_boolean (value, nm_device_ethernet_get_carrier (device));
|
||||||
break;
|
break;
|
||||||
|
case PROP_S390_SUBCHANNELS:
|
||||||
|
g_value_set_boxed (value, priv->s390_subchannels);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
|
@ -312,4 +339,18 @@ nm_device_ethernet_class_init (NMDeviceEthernetClass *eth_class)
|
||||||
G_PARAM_READABLE |
|
G_PARAM_READABLE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NMDeviceEthernet:s390-subchannels:
|
||||||
|
*
|
||||||
|
* Identifies subchannels of this network device used for
|
||||||
|
* communication with z/VM or s390 host.
|
||||||
|
*
|
||||||
|
* Since: 1.2
|
||||||
|
**/
|
||||||
|
g_object_class_install_property
|
||||||
|
(object_class, PROP_S390_SUBCHANNELS,
|
||||||
|
g_param_spec_boxed (NM_DEVICE_ETHERNET_S390_SUBCHANNELS, "", "",
|
||||||
|
G_TYPE_STRV,
|
||||||
|
G_PARAM_READABLE |
|
||||||
|
G_PARAM_STATIC_STRINGS));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ G_BEGIN_DECLS
|
||||||
#define NM_DEVICE_ETHERNET_PERMANENT_HW_ADDRESS "perm-hw-address"
|
#define NM_DEVICE_ETHERNET_PERMANENT_HW_ADDRESS "perm-hw-address"
|
||||||
#define NM_DEVICE_ETHERNET_SPEED "speed"
|
#define NM_DEVICE_ETHERNET_SPEED "speed"
|
||||||
#define NM_DEVICE_ETHERNET_CARRIER "carrier"
|
#define NM_DEVICE_ETHERNET_CARRIER "carrier"
|
||||||
|
#define NM_DEVICE_ETHERNET_S390_SUBCHANNELS "s390-subchannels"
|
||||||
|
|
||||||
struct _NMDeviceEthernet {
|
struct _NMDeviceEthernet {
|
||||||
NMDevice parent;
|
NMDevice parent;
|
||||||
|
|
@ -59,6 +60,8 @@ const char * nm_device_ethernet_get_hw_address (NMDeviceEthernet *device);
|
||||||
const char * nm_device_ethernet_get_permanent_hw_address (NMDeviceEthernet *device);
|
const char * nm_device_ethernet_get_permanent_hw_address (NMDeviceEthernet *device);
|
||||||
guint32 nm_device_ethernet_get_speed (NMDeviceEthernet *device);
|
guint32 nm_device_ethernet_get_speed (NMDeviceEthernet *device);
|
||||||
gboolean nm_device_ethernet_get_carrier (NMDeviceEthernet *device);
|
gboolean nm_device_ethernet_get_carrier (NMDeviceEthernet *device);
|
||||||
|
NM_AVAILABLE_IN_1_2
|
||||||
|
const char * const *nm_device_ethernet_get_s390_subchannels (NMDeviceEthernet *device);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue