libnm: embed private structure in NMSetting and avoid g_type_class_add_private()

Historically, the NMSetting types were in public headers. Theoretically,
that allowed users to subtype our classes. However in practice that was
impossible because they lacked required access to internal functions to
fully create an NMSetting class outside of libnm. And it also was not
useful, because you simply cannot extend libnm by subtyping a libnm
class. And supporting such a use case would be hard and limit what we can
do in libnm.

Having GObject structs in public headers also require that we don't
change it's layout. The ABI of those structs must not change, if anybody
out there was actually subclassing our GObjects.

In libnm 1.34 (commit e46d484fae ('libnm: hide NMSetting types from
public headers')) we moved the structs from headers to internal.
This would have caused a compiler error if anybody was using those
struct definitions. However, we still didn't change the ABI/layout so
that we didn't break users who relied on it (for whatever reason).

It doesn't seem there were any affected user. We waited long enough.
Change internal ABI.

No longer use g_type_class_add_private(). Instead, embed the private
structs directly (_NM_GET_PRIVATE()) or indirectly
(_NM_GET_PRIVATE_PTR()) in the object.

The main benefit is for debugging in the debugger, where we can now
easily find the private data. Previously that was so cumbersome to be
effectively impossible.

It's also the fastest possible way, since NM_SETTING_*_GET_PRIVATE()
literally resolves to "&self->_priv" (plus static asserts and
nm_assert() for type checking).

_NM_GET_PRIVATE() also propagates constness and requires that the
argument is a compatible pointer type (at compile time).

Note that g_type_class_add_private() is also deprecated in glib 2.58 and
replaced by G_ADD_PRIVATE(). For one, we still don't rely on 2.58. Also,
G_ADD_PRIVATE() is a worse solution as it supports a usecase that we
don't care for (public structs in headers). _NM_GET_PRIVATE() is still
faster, works with older glib and most importantly: is better for
debugging as you can find the private data from an object pointer.

For NMSettingIPConfig this is rather awkward, because all direct
properties require a common "klass->private_offset". This was however
the case before this change. Nothing new here. And if you ever touch
this and do something wrong, many unit tests will fail. It's almost
impossible to get wrong, albeit it can be confusing to understand.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1773
This commit is contained in:
Thomas Haller 2023-10-24 19:05:50 +02:00
parent 8122d99505
commit bd8d49495b
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
40 changed files with 158 additions and 321 deletions

9
NEWS
View file

@ -1,3 +1,12 @@
=============================================
NetworkManager-1.46
Overview of changes since NetworkManager-1.46
=============================================
* Change internal ABI of NMSetting types and NMSimpleConnection. The layout of
these structs was already hidden from public headers since 1.34 and this change
should not be noticeable.
=============================================
NetworkManager-1.44
Overview of changes since NetworkManager-1.42

View file

@ -34,6 +34,7 @@ typedef struct {
*/
struct _NMSetting6Lowpan {
NMSetting parent;
NMSetting6LowpanPrivate _priv;
};
struct _NMSetting6LowpanClass {
@ -43,7 +44,7 @@ struct _NMSetting6LowpanClass {
G_DEFINE_TYPE(NMSetting6Lowpan, nm_setting_6lowpan, NM_TYPE_SETTING)
#define NM_SETTING_6LOWPAN_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_6LOWPAN, NMSetting6LowpanPrivate))
_NM_GET_PRIVATE(o, NMSetting6Lowpan, NM_IS_SETTING_6LOWPAN, NMSetting)
/*****************************************************************************/
@ -156,8 +157,6 @@ nm_setting_6lowpan_class_init(NMSetting6LowpanClass *klass)
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array();
g_type_class_add_private(klass, sizeof(NMSetting6LowpanPrivate));
object_class->get_property = _nm_setting_property_get_property_direct;
object_class->set_property = _nm_setting_property_set_property_direct;
@ -185,5 +184,5 @@ nm_setting_6lowpan_class_init(NMSetting6LowpanClass *klass)
NM_META_SETTING_TYPE_6LOWPAN,
NULL,
properties_override,
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
G_STRUCT_OFFSET(NMSetting6Lowpan, _priv));
}

View file

@ -190,19 +190,17 @@ typedef struct {
*/
struct _NMSetting8021x {
NMSetting parent;
/* In the past, this struct was public API. Preserve ABI! */
NMSetting8021xPrivate _priv;
};
struct _NMSetting8021xClass {
NMSettingClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSetting8021x, nm_setting_802_1x, NM_TYPE_SETTING)
#define NM_SETTING_802_1X_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_802_1X, NMSetting8021xPrivate))
_NM_GET_PRIVATE(o, NMSetting8021x, NM_IS_SETTING_802_1X, NMSetting)
/*****************************************************************************/
@ -3201,8 +3199,6 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass)
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array();
g_type_class_add_private(klass, sizeof(NMSetting8021xPrivate));
object_class->get_property = get_property;
object_class->set_property = set_property;
object_class->finalize = finalize;
@ -4352,5 +4348,5 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass)
NM_META_SETTING_TYPE_802_1X,
NULL,
properties_override,
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
G_STRUCT_OFFSET(NMSetting8021x, _priv));
}

View file

@ -47,19 +47,17 @@ typedef struct {
*/
struct _NMSettingAdsl {
NMSetting parent;
/* In the past, this struct was public API. Preserve ABI! */
NMSettingAdslPrivate _priv;
};
struct _NMSettingAdslClass {
NMSettingClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingAdsl, nm_setting_adsl, NM_TYPE_SETTING)
#define NM_SETTING_ADSL_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_ADSL, NMSettingAdslPrivate))
_NM_GET_PRIVATE(o, NMSettingAdsl, NM_IS_SETTING_ADSL, NMSetting)
/*****************************************************************************/
@ -267,8 +265,6 @@ nm_setting_adsl_class_init(NMSettingAdslClass *klass)
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array();
g_type_class_add_private(klass, sizeof(NMSettingAdslPrivate));
object_class->get_property = _nm_setting_property_get_property_direct;
object_class->set_property = _nm_setting_property_set_property_direct;
@ -380,5 +376,5 @@ nm_setting_adsl_class_init(NMSettingAdslClass *klass)
NM_META_SETTING_TYPE_ADSL,
NULL,
properties_override,
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
G_STRUCT_OFFSET(NMSettingAdsl, _priv));
}

View file

@ -43,19 +43,17 @@ typedef struct {
*/
struct _NMSettingBluetooth {
NMSetting parent;
/* In the past, this struct was public API. Preserve ABI! */
NMSettingBluetoothPrivate _priv;
};
struct _NMSettingBluetoothClass {
NMSettingClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingBluetooth, nm_setting_bluetooth, NM_TYPE_SETTING)
#define NM_SETTING_BLUETOOTH_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_BLUETOOTH, NMSettingBluetoothPrivate))
_NM_GET_PRIVATE(o, NMSettingBluetooth, NM_IS_SETTING_BLUETOOTH, NMSetting)
/*****************************************************************************/
@ -254,8 +252,6 @@ nm_setting_bluetooth_class_init(NMSettingBluetoothClass *klass)
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array();
g_type_class_add_private(klass, sizeof(NMSettingBluetoothPrivate));
object_class->get_property = _nm_setting_property_get_property_direct;
object_class->set_property = _nm_setting_property_set_property_direct;
@ -295,5 +291,5 @@ nm_setting_bluetooth_class_init(NMSettingBluetoothClass *klass)
NM_META_SETTING_TYPE_BLUETOOTH,
NULL,
properties_override,
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
G_STRUCT_OFFSET(NMSettingBluetooth, _priv));
}

View file

@ -45,19 +45,17 @@ typedef struct {
*/
struct _NMSettingBond {
NMSetting parent;
/* In the past, this struct was public API. Preserve ABI! */
NMSettingBondPrivate _priv;
};
struct _NMSettingBondClass {
NMSettingClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingBond, nm_setting_bond, NM_TYPE_SETTING)
#define NM_SETTING_BOND_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_BOND, NMSettingBondPrivate))
_NM_GET_PRIVATE(o, NMSettingBond, NM_IS_SETTING_BOND, NMSetting)
/*****************************************************************************/
@ -1322,8 +1320,6 @@ nm_setting_bond_class_init(NMSettingBondClass *klass)
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array();
g_type_class_add_private(klass, sizeof(NMSettingBondPrivate));
object_class->get_property = get_property;
object_class->set_property = set_property;
object_class->finalize = finalize;
@ -1380,5 +1376,5 @@ nm_setting_bond_class_init(NMSettingBondClass *klass)
NM_META_SETTING_TYPE_BOND,
NULL,
properties_override,
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
G_STRUCT_OFFSET(NMSettingBond, _priv));
}

View file

@ -46,19 +46,17 @@ typedef struct {
*/
struct _NMSettingBridgePort {
NMSetting parent;
/* In the past, this struct was public API. Preserve ABI! */
NMSettingBridgePortPrivate _priv;
};
struct _NMSettingBridgePortClass {
NMSettingClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingBridgePort, nm_setting_bridge_port, NM_TYPE_SETTING)
#define NM_SETTING_BRIDGE_PORT_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_BRIDGE_PORT, NMSettingBridgePortPrivate))
_NM_GET_PRIVATE(o, NMSettingBridgePort, NM_IS_SETTING_BRIDGE_PORT, NMSetting)
/*****************************************************************************/
@ -455,8 +453,6 @@ nm_setting_bridge_port_class_init(NMSettingBridgePortClass *klass)
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array();
g_type_class_add_private(klass, sizeof(NMSettingBridgePortPrivate));
object_class->get_property = get_property;
object_class->set_property = set_property;
object_class->finalize = finalize;
@ -579,5 +575,5 @@ nm_setting_bridge_port_class_init(NMSettingBridgePortClass *klass)
NM_META_SETTING_TYPE_BRIDGE_PORT,
NULL,
properties_override,
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
G_STRUCT_OFFSET(NMSettingBridgePort, _priv));
}

View file

@ -43,19 +43,17 @@ typedef struct {
*/
struct _NMSettingCdma {
NMSetting parent;
/* In the past, this struct was public API. Preserve ABI! */
NMSettingCdmaPrivate _priv;
};
struct _NMSettingCdmaClass {
NMSettingClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingCdma, nm_setting_cdma, NM_TYPE_SETTING)
#define NM_SETTING_CDMA_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_CDMA, NMSettingCdmaPrivate))
_NM_GET_PRIVATE(o, NMSettingCdma, NM_IS_SETTING_CDMA, NMSetting)
/*****************************************************************************/
@ -218,8 +216,6 @@ nm_setting_cdma_class_init(NMSettingCdmaClass *klass)
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array();
g_type_class_add_private(klass, sizeof(NMSettingCdmaPrivate));
object_class->get_property = _nm_setting_property_get_property_direct;
object_class->set_property = _nm_setting_property_set_property_direct;
@ -309,5 +305,5 @@ nm_setting_cdma_class_init(NMSettingCdmaClass *klass)
NM_META_SETTING_TYPE_CDMA,
NULL,
properties_override,
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
G_STRUCT_OFFSET(NMSettingCdma, _priv));
}

View file

@ -110,19 +110,17 @@ typedef struct {
*/
struct _NMSettingConnection {
NMSetting parent;
/* In the past, this struct was public API. Preserve ABI! */
NMSettingConnectionPrivate _priv;
};
struct _NMSettingConnectionClass {
NMSettingClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingConnection, nm_setting_connection, NM_TYPE_SETTING)
#define NM_SETTING_CONNECTION_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_CONNECTION, NMSettingConnectionPrivate))
_NM_GET_PRIVATE(o, NMSettingConnection, NM_IS_SETTING_CONNECTION, NMSetting)
/*****************************************************************************/
@ -1810,8 +1808,6 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array();
g_type_class_add_private(klass, sizeof(NMSettingConnectionPrivate));
object_class->get_property = get_property;
object_class->set_property = set_property;
object_class->finalize = finalize;
@ -2779,5 +2775,5 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
NM_META_SETTING_TYPE_CONNECTION,
NULL,
properties_override,
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
G_STRUCT_OFFSET(NMSettingConnection, _priv));
}

View file

@ -72,19 +72,16 @@ typedef struct {
*/
struct _NMSettingDcb {
NMSetting parent;
/* In the past, this struct was public API. Preserve ABI! */
NMSettingDcbPrivate _priv;
};
struct _NMSettingDcbClass {
NMSettingClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingDcb, nm_setting_dcb, NM_TYPE_SETTING)
#define NM_SETTING_DCB_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_DCB, NMSettingDcbPrivate))
#define NM_SETTING_DCB_GET_PRIVATE(o) _NM_GET_PRIVATE(o, NMSettingDcb, NM_IS_SETTING_DCB, NMSetting)
/*****************************************************************************/
@ -845,8 +842,6 @@ nm_setting_dcb_class_init(NMSettingDcbClass *klass)
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array();
g_type_class_add_private(klass, sizeof(NMSettingDcbPrivate));
object_class->get_property = get_property;
object_class->set_property = set_property;
@ -1230,5 +1225,5 @@ nm_setting_dcb_class_init(NMSettingDcbClass *klass)
NM_META_SETTING_TYPE_DCB,
NULL,
properties_override,
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
G_STRUCT_OFFSET(NMSettingDcb, _priv));
}

View file

@ -28,13 +28,10 @@
*/
struct _NMSettingDummy {
NMSetting parent;
/* In the past, this struct was public API. Preserve ABI! */
};
struct _NMSettingDummyClass {
NMSettingClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingDummy, nm_setting_dummy, NM_TYPE_SETTING)

View file

@ -23,10 +23,6 @@
/*****************************************************************************/
typedef struct {
int dummy;
} NMSettingGenericPrivate;
/**
* NMSettingGeneric:
*
@ -34,20 +30,14 @@ typedef struct {
*/
struct _NMSettingGeneric {
NMSetting parent;
/* In the past, this struct was public API. Preserve ABI! */
};
struct _NMSettingGenericClass {
NMSettingClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingGeneric, nm_setting_generic, NM_TYPE_SETTING)
#define NM_SETTING_GENERIC_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_GENERIC, NMSettingGenericPrivate))
/*****************************************************************************/
static void
@ -72,7 +62,5 @@ nm_setting_generic_class_init(NMSettingGenericClass *klass)
{
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
g_type_class_add_private(klass, sizeof(NMSettingGenericPrivate));
_nm_setting_class_commit(setting_class, NM_META_SETTING_TYPE_GENERIC, NULL, NULL, 0);
}

View file

@ -66,19 +66,16 @@ typedef struct {
*/
struct _NMSettingGsm {
NMSetting parent;
/* In the past, this struct was public API. Preserve ABI! */
NMSettingGsmPrivate _priv;
};
struct _NMSettingGsmClass {
NMSettingClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingGsm, nm_setting_gsm, NM_TYPE_SETTING)
#define NM_SETTING_GSM_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_GSM, NMSettingGsmPrivate))
#define NM_SETTING_GSM_GET_PRIVATE(o) _NM_GET_PRIVATE(o, NMSettingGsm, NM_IS_SETTING_GSM, NMSetting)
/*****************************************************************************/
@ -565,8 +562,6 @@ nm_setting_gsm_class_init(NMSettingGsmClass *klass)
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array();
g_type_class_add_private(klass, sizeof(NMSettingGsmPrivate));
object_class->get_property = _nm_setting_property_get_property_direct;
object_class->set_property = _nm_setting_property_set_property_direct;
@ -854,5 +849,5 @@ nm_setting_gsm_class_init(NMSettingGsmClass *klass)
NM_META_SETTING_TYPE_GSM,
NULL,
properties_override,
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
G_STRUCT_OFFSET(NMSettingGsm, _priv));
}

View file

@ -48,19 +48,17 @@ typedef struct {
*/
struct _NMSettingInfiniband {
NMSetting parent;
/* In the past, this struct was public API. Preserve ABI! */
NMSettingInfinibandPrivate _priv;
};
struct _NMSettingInfinibandClass {
NMSettingClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingInfiniband, nm_setting_infiniband, NM_TYPE_SETTING)
#define NM_SETTING_INFINIBAND_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_INFINIBAND, NMSettingInfinibandPrivate))
_NM_GET_PRIVATE(o, NMSettingInfiniband, NM_IS_SETTING_INFINIBAND, NMSetting)
/*****************************************************************************/
@ -332,8 +330,6 @@ nm_setting_infiniband_class_init(NMSettingInfinibandClass *klass)
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array();
g_type_class_add_private(klass, sizeof(NMSettingInfinibandPrivate));
object_class->get_property = _nm_setting_property_get_property_direct;
object_class->set_property = _nm_setting_property_set_property_direct;
@ -492,5 +488,5 @@ nm_setting_infiniband_class_init(NMSettingInfinibandClass *klass)
NM_META_SETTING_TYPE_INFINIBAND,
NULL,
properties_override,
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
G_STRUCT_OFFSET(NMSettingInfiniband, _priv));
}

View file

@ -4014,7 +4014,7 @@ _NM_SETTING_IP_CONFIG_GET_PRIVATE(NMSettingIPConfig *self)
klass = NM_SETTING_IP_CONFIG_GET_CLASS(self);
nm_assert(klass->private_offset < 0);
nm_assert(klass->private_offset > 0);
return (gpointer) (((char *) ((gpointer) self)) + klass->private_offset);
}

View file

@ -56,19 +56,17 @@ typedef struct {
*/
struct _NMSettingIPTunnel {
NMSetting parent;
/* In the past, this struct was public API. Preserve ABI! */
NMSettingIPTunnelPrivate _priv;
};
struct _NMSettingIPTunnelClass {
NMSettingClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingIPTunnel, nm_setting_ip_tunnel, NM_TYPE_SETTING)
#define NM_SETTING_IP_TUNNEL_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_IP_TUNNEL, NMSettingIPTunnelPrivate))
_NM_GET_PRIVATE(o, NMSettingIPTunnel, NM_IS_SETTING_IP_TUNNEL, NMSetting)
/*****************************************************************************/
@ -566,8 +564,6 @@ nm_setting_ip_tunnel_class_init(NMSettingIPTunnelClass *klass)
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array();
g_type_class_add_private(klass, sizeof(NMSettingIPTunnelPrivate));
object_class->get_property = _nm_setting_property_get_property_direct;
object_class->set_property = _nm_setting_property_set_property_direct;
@ -861,5 +857,5 @@ nm_setting_ip_tunnel_class_init(NMSettingIPTunnelClass *klass)
NM_META_SETTING_TYPE_IP_TUNNEL,
NULL,
properties_override,
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
G_STRUCT_OFFSET(NMSettingIPTunnel, _priv));
}

View file

@ -57,19 +57,17 @@ typedef struct {
*/
struct _NMSettingIP4Config {
NMSettingIPConfig parent;
/* In the past, this struct was public API. Preserve ABI! */
NMSettingIP4ConfigPrivate _priv;
};
struct _NMSettingIP4ConfigClass {
NMSettingIPConfigClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingIP4Config, nm_setting_ip4_config, NM_TYPE_SETTING_IP_CONFIG)
#define NM_SETTING_IP4_CONFIG_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_IP4_CONFIG, NMSettingIP4ConfigPrivate))
_NM_GET_PRIVATE(o, NMSettingIP4Config, NM_IS_SETTING_IP4_CONFIG, NMSettingIPConfig, NMSetting)
/*****************************************************************************/
@ -616,14 +614,12 @@ nm_setting_ip4_config_class_init(NMSettingIP4ConfigClass *klass)
NMSettingIPConfigClass *setting_ip_config_class = NM_SETTING_IP_CONFIG_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array_ip_config(AF_INET);
g_type_class_add_private(klass, sizeof(NMSettingIP4ConfigPrivate));
object_class->get_property = _nm_setting_property_get_property_direct;
object_class->set_property = _nm_setting_property_set_property_direct;
setting_class->verify = verify;
setting_ip_config_class->private_offset = g_type_class_get_instance_private_offset(klass);
setting_ip_config_class->private_offset = G_STRUCT_OFFSET(NMSettingIP4Config, _priv);
setting_ip_config_class->is_ipv4 = TRUE;
setting_ip_config_class->addr_family = AF_INET;
@ -1317,5 +1313,5 @@ nm_setting_ip4_config_class_init(NMSettingIP4ConfigClass *klass)
NM_META_SETTING_TYPE_IP4_CONFIG,
NULL,
properties_override,
setting_ip_config_class->private_offset);
G_STRUCT_OFFSET(NMSettingIP4Config, _priv));
}

View file

@ -66,19 +66,17 @@ typedef struct {
*/
struct _NMSettingIP6Config {
NMSettingIPConfig parent;
/* In the past, this struct was public API. Preserve ABI! */
NMSettingIP6ConfigPrivate _priv;
};
struct _NMSettingIP6ConfigClass {
NMSettingIPConfigClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingIP6Config, nm_setting_ip6_config, NM_TYPE_SETTING_IP_CONFIG)
#define NM_SETTING_IP6_CONFIG_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_IP6_CONFIG, NMSettingIP6ConfigPrivate))
_NM_GET_PRIVATE(o, NMSettingIP6Config, NM_IS_SETTING_IP6_CONFIG, NMSettingIPConfig, NMSetting)
/*****************************************************************************/
@ -628,14 +626,12 @@ nm_setting_ip6_config_class_init(NMSettingIP6ConfigClass *klass)
NMSettingIPConfigClass *setting_ip_config_class = NM_SETTING_IP_CONFIG_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array_ip_config(AF_INET6);
g_type_class_add_private(klass, sizeof(NMSettingIP6ConfigPrivate));
object_class->get_property = _nm_setting_property_get_property_direct;
object_class->set_property = _nm_setting_property_set_property_direct;
setting_class->verify = verify;
setting_ip_config_class->private_offset = g_type_class_get_instance_private_offset(klass);
setting_ip_config_class->private_offset = G_STRUCT_OFFSET(NMSettingIP6Config, _priv);
setting_ip_config_class->is_ipv4 = FALSE;
setting_ip_config_class->addr_family = AF_INET6;
@ -1444,5 +1440,5 @@ nm_setting_ip6_config_class_init(NMSettingIP6ConfigClass *klass)
NM_META_SETTING_TYPE_IP6_CONFIG,
NULL,
properties_override,
setting_ip_config_class->private_offset);
G_STRUCT_OFFSET(NMSettingIP6Config, _priv));
}

View file

@ -56,19 +56,17 @@ typedef struct {
*/
struct _NMSettingMacsec {
NMSetting parent;
/* In the past, this struct was public API. Preserve ABI! */
NMSettingMacsecPrivate _priv;
};
struct _NMSettingMacsecClass {
NMSettingClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingMacsec, nm_setting_macsec, NM_TYPE_SETTING)
#define NM_SETTING_MACSEC_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_MACSEC, NMSettingMacsecPrivate))
_NM_GET_PRIVATE(o, NMSettingMacsec, NM_IS_SETTING_MACSEC, NMSetting)
/*****************************************************************************/
@ -436,8 +434,6 @@ nm_setting_macsec_class_init(NMSettingMacsecClass *klass)
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array();
g_type_class_add_private(klass, sizeof(NMSettingMacsecPrivate));
object_class->get_property = _nm_setting_property_get_property_direct;
object_class->set_property = _nm_setting_property_set_property_direct;
@ -604,5 +600,5 @@ nm_setting_macsec_class_init(NMSettingMacsecClass *klass)
NM_META_SETTING_TYPE_MACSEC,
NULL,
properties_override,
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
G_STRUCT_OFFSET(NMSettingMacsec, _priv));
}

View file

@ -41,19 +41,17 @@ typedef struct {
*/
struct _NMSettingMacvlan {
NMSetting parent;
/* In the past, this struct was public API. Preserve ABI! */
NMSettingMacvlanPrivate _priv;
};
struct _NMSettingMacvlanClass {
NMSettingClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingMacvlan, nm_setting_macvlan, NM_TYPE_SETTING)
#define NM_SETTING_MACVLAN_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_MACVLAN, NMSettingMacvlanPrivate))
_NM_GET_PRIVATE(o, NMSettingMacvlan, NM_IS_SETTING_MACVLAN, NMSetting)
/*****************************************************************************/
@ -207,8 +205,6 @@ nm_setting_macvlan_class_init(NMSettingMacvlanClass *klass)
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array();
g_type_class_add_private(klass, sizeof(NMSettingMacvlanPrivate));
object_class->get_property = _nm_setting_property_get_property_direct;
object_class->set_property = _nm_setting_property_set_property_direct;
@ -289,5 +285,5 @@ nm_setting_macvlan_class_init(NMSettingMacvlanClass *klass)
NM_META_SETTING_TYPE_MACVLAN,
NULL,
properties_override,
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
G_STRUCT_OFFSET(NMSettingMacvlan, _priv));
}

View file

@ -40,19 +40,17 @@ typedef struct {
*/
struct _NMSettingOlpcMesh {
NMSetting parent;
/* In the past, this struct was public API. Preserve ABI! */
NMSettingOlpcMeshPrivate _priv;
};
struct _NMSettingOlpcMeshClass {
NMSettingClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingOlpcMesh, nm_setting_olpc_mesh, NM_TYPE_SETTING)
#define NM_SETTING_OLPC_MESH_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_OLPC_MESH, NMSettingOlpcMeshPrivate))
_NM_GET_PRIVATE(o, NMSettingOlpcMesh, NM_IS_SETTING_OLPC_MESH, NMSetting)
/*****************************************************************************/
@ -171,8 +169,6 @@ nm_setting_olpc_mesh_class_init(NMSettingOlpcMeshClass *klass)
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array();
g_type_class_add_private(klass, sizeof(NMSettingOlpcMeshPrivate));
object_class->get_property = _nm_setting_property_get_property_direct;
object_class->set_property = _nm_setting_property_set_property_direct;
@ -231,5 +227,5 @@ nm_setting_olpc_mesh_class_init(NMSettingOlpcMeshClass *klass)
NM_META_SETTING_TYPE_OLPC_MESH,
NULL,
properties_override,
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
G_STRUCT_OFFSET(NMSettingOlpcMesh, _priv));
}

View file

@ -69,19 +69,16 @@ typedef struct {
*/
struct _NMSettingPpp {
NMSetting parent;
/* In the past, this struct was public API. Preserve ABI! */
NMSettingPppPrivate _priv;
};
struct _NMSettingPppClass {
NMSettingClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingPpp, nm_setting_ppp, NM_TYPE_SETTING)
#define NM_SETTING_PPP_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_PPP, NMSettingPppPrivate))
#define NM_SETTING_PPP_GET_PRIVATE(o) _NM_GET_PRIVATE(o, NMSettingPpp, NM_IS_SETTING_PPP, NMSetting)
/*****************************************************************************/
@ -402,8 +399,6 @@ nm_setting_ppp_class_init(NMSettingPppClass *klass)
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array();
g_type_class_add_private(klass, sizeof(NMSettingPppPrivate));
object_class->get_property = _nm_setting_property_get_property_direct;
object_class->set_property = _nm_setting_property_set_property_direct;
@ -698,5 +693,5 @@ nm_setting_ppp_class_init(NMSettingPppClass *klass)
NM_META_SETTING_TYPE_PPP,
NULL,
properties_override,
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
G_STRUCT_OFFSET(NMSettingPpp, _priv));
}

View file

@ -44,19 +44,17 @@ typedef struct {
*/
struct _NMSettingPppoe {
NMSetting parent;
/* In the past, this struct was public API. Preserve ABI! */
NMSettingPppoePrivate _priv;
};
struct _NMSettingPppoeClass {
NMSettingClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingPppoe, nm_setting_pppoe, NM_TYPE_SETTING)
#define NM_SETTING_PPPOE_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_PPPOE, NMSettingPppoePrivate))
_NM_GET_PRIVATE(o, NMSettingPppoe, NM_IS_SETTING_PPPOE, NMSetting)
/*****************************************************************************/
@ -220,8 +218,6 @@ nm_setting_pppoe_class_init(NMSettingPppoeClass *klass)
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array();
g_type_class_add_private(klass, sizeof(NMSettingPppoePrivate));
object_class->get_property = _nm_setting_property_get_property_direct;
object_class->set_property = _nm_setting_property_set_property_direct;
@ -306,5 +302,5 @@ nm_setting_pppoe_class_init(NMSettingPppoeClass *klass)
NM_META_SETTING_TYPE_PPPOE,
NULL,
properties_override,
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
G_STRUCT_OFFSET(NMSettingPppoe, _priv));
}

View file

@ -80,6 +80,8 @@ void _nm_connection_private_clear(NMConnectionPrivate *priv);
/*****************************************************************************/
struct _NMSettingPrivate;
/**
* NMSetting:
*
@ -88,14 +90,12 @@ void _nm_connection_private_clear(NMConnectionPrivate *priv);
*/
struct _NMSetting {
GObject parent;
/* In the past, this struct was public API. Preserve ABI! */
struct _NMSettingPrivate *_priv;
};
struct _NMSettingClass {
GObjectClass parent;
/* In the past, this struct was public API. Preserve ABI! */
int (*verify)(NMSetting *setting, NMConnection *connection, GError **error);
gboolean (*verify_secrets)(NMSetting *setting, NMConnection *connection, GError **error);
@ -120,8 +120,6 @@ struct _NMSettingClass {
NMSettingClearSecretsWithFlagsFn func,
gpointer user_data);
void (*padding_1)(void);
void (*duplicate_copy_properties)(const struct _NMSettInfoSetting *sett_info,
NMSetting *src,
NMSetting *dst);
@ -158,30 +156,13 @@ struct _NMSettingClass {
*/
struct _NMSettingIPConfig {
NMSetting parent;
/* In the past, this struct was public API. Preserve ABI! */
};
struct _NMSettingIPConfigClass {
NMSettingClass parent;
/* In the past, this struct was public API. Preserve ABI! */
union {
gpointer _dummy1;
int private_offset;
};
union {
gpointer _dummy2;
gint8 addr_family;
};
union {
gpointer _dummy3;
bool is_ipv4;
};
gpointer padding[5];
};
typedef struct {

View file

@ -42,18 +42,17 @@ typedef struct {
*/
struct _NMSettingProxy {
NMSetting parent;
NMSettingProxyPrivate _priv;
};
struct _NMSettingProxyClass {
NMSettingClass parent;
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingProxy, nm_setting_proxy, NM_TYPE_SETTING)
#define NM_SETTING_PROXY_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_PROXY, NMSettingProxyPrivate))
_NM_GET_PRIVATE(o, NMSettingProxy, NM_IS_SETTING_PROXY, NMSetting)
/*****************************************************************************/
@ -233,8 +232,6 @@ nm_setting_proxy_class_init(NMSettingProxyClass *klass)
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array();
g_type_class_add_private(klass, sizeof(NMSettingProxyPrivate));
object_class->get_property = _nm_setting_property_get_property_direct;
object_class->set_property = _nm_setting_property_set_property_direct;
@ -350,5 +347,5 @@ nm_setting_proxy_class_init(NMSettingProxyClass *klass)
NM_META_SETTING_TYPE_PROXY,
NULL,
properties_override,
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
G_STRUCT_OFFSET(NMSettingProxy, _priv));
}

View file

@ -43,19 +43,17 @@ typedef struct {
*/
struct _NMSettingSerial {
NMSetting parent;
/* In the past, this struct was public API. Preserve ABI! */
NMSettingSerialPrivate _priv;
};
struct _NMSettingSerialClass {
NMSettingClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingSerial, nm_setting_serial, NM_TYPE_SETTING)
#define NM_SETTING_SERIAL_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_SERIAL, NMSettingSerialPrivate))
_NM_GET_PRIVATE(o, NMSettingSerial, NM_IS_SETTING_SERIAL, NMSetting)
/*****************************************************************************/
@ -226,8 +224,6 @@ nm_setting_serial_class_init(NMSettingSerialClass *klass)
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array();
g_type_class_add_private(klass, sizeof(NMSettingSerialPrivate));
object_class->get_property = get_property;
object_class->set_property = set_property;
@ -341,5 +337,5 @@ nm_setting_serial_class_init(NMSettingSerialClass *klass)
NM_META_SETTING_TYPE_SERIAL,
NULL,
properties_override,
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
G_STRUCT_OFFSET(NMSettingSerial, _priv));
}

View file

@ -42,19 +42,17 @@ typedef struct {
*/
struct _NMSettingTeamPort {
NMSetting parent;
/* In the past, this struct was public API. Preserve ABI! */
NMSettingTeamPortPrivate _priv;
};
struct _NMSettingTeamPortClass {
NMSettingClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingTeamPort, nm_setting_team_port, NM_TYPE_SETTING)
#define NM_SETTING_TEAM_PORT_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_TEAM_PORT, NMSettingTeamPortPrivate))
_NM_GET_PRIVATE(o, NMSettingTeamPort, NM_IS_SETTING_TEAM_PORT, NMSetting)
/*****************************************************************************/
@ -532,8 +530,6 @@ nm_setting_team_port_class_init(NMSettingTeamPortClass *klass)
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array();
g_type_class_add_private(klass, sizeof(NMSettingTeamPortPrivate));
object_class->get_property = get_property;
object_class->set_property = set_property;
object_class->finalize = finalize;
@ -702,5 +698,5 @@ nm_setting_team_port_class_init(NMSettingTeamPortClass *klass)
NM_META_SETTING_TYPE_TEAM_PORT,
NULL,
properties_override,
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
G_STRUCT_OFFSET(NMSettingTeamPort, _priv));
}

View file

@ -746,19 +746,17 @@ typedef struct {
*/
struct _NMSettingTeam {
NMSetting parent;
/* In the past, this struct was public API. Preserve ABI! */
NMSettingTeamPrivate _priv;
};
struct _NMSettingTeamClass {
NMSettingClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingTeam, nm_setting_team, NM_TYPE_SETTING)
#define NM_SETTING_TEAM_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_TEAM, NMSettingTeamPrivate))
_NM_GET_PRIVATE(o, NMSettingTeam, NM_IS_SETTING_TEAM, NMSetting)
/*****************************************************************************/
@ -1498,8 +1496,6 @@ nm_setting_team_class_init(NMSettingTeamClass *klass)
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array();
g_type_class_add_private(klass, sizeof(NMSettingTeamPrivate));
object_class->get_property = get_property;
object_class->set_property = set_property;
object_class->finalize = finalize;
@ -1842,5 +1838,5 @@ nm_setting_team_class_init(NMSettingTeamClass *klass)
NM_META_SETTING_TYPE_TEAM,
NULL,
properties_override,
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
G_STRUCT_OFFSET(NMSettingTeam, _priv));
}

View file

@ -47,19 +47,16 @@ typedef struct {
*/
struct _NMSettingTun {
NMSetting parent;
/* In the past, this struct was public API. Preserve ABI! */
NMSettingTunPrivate _priv;
};
struct _NMSettingTunClass {
NMSettingClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingTun, nm_setting_tun, NM_TYPE_SETTING)
#define NM_SETTING_TUN_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_TUN, NMSettingTunPrivate))
#define NM_SETTING_TUN_GET_PRIVATE(o) _NM_GET_PRIVATE(o, NMSettingTun, NM_IS_SETTING_TUN, NMSetting)
/*****************************************************************************/
@ -223,8 +220,6 @@ nm_setting_tun_class_init(NMSettingTunClass *klass)
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array();
g_type_class_add_private(klass, sizeof(NMSettingTunPrivate));
object_class->get_property = _nm_setting_property_get_property_direct;
object_class->set_property = _nm_setting_property_set_property_direct;
@ -342,5 +337,5 @@ nm_setting_tun_class_init(NMSettingTunClass *klass)
NM_META_SETTING_TYPE_TUN,
NULL,
properties_override,
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
G_STRUCT_OFFSET(NMSettingTun, _priv));
}

View file

@ -50,19 +50,17 @@ typedef struct {
*/
struct _NMSettingVlan {
NMSetting parent;
/* In the past, this struct was public API. Preserve ABI! */
NMSettingVlanPrivate _priv;
};
struct _NMSettingVlanClass {
NMSettingClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingVlan, nm_setting_vlan, NM_TYPE_SETTING)
#define NM_SETTING_VLAN_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_VLAN, NMSettingVlanPrivate))
_NM_GET_PRIVATE(o, NMSettingVlan, NM_IS_SETTING_VLAN, NMSetting)
/*****************************************************************************/
@ -848,8 +846,6 @@ nm_setting_vlan_class_init(NMSettingVlanClass *klass)
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array();
g_type_class_add_private(klass, sizeof(NMSettingVlanPrivate));
object_class->get_property = get_property;
object_class->set_property = set_property;
object_class->finalize = finalize;
@ -1039,5 +1035,5 @@ nm_setting_vlan_class_init(NMSettingVlanClass *klass)
NM_META_SETTING_TYPE_VLAN,
NULL,
properties_override,
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
G_STRUCT_OFFSET(NMSettingVlan, _priv));
}

View file

@ -81,19 +81,16 @@ typedef struct {
*/
struct _NMSettingVpn {
NMSetting parent;
/* In the past, this struct was public API. Preserve ABI! */
NMSettingVpnPrivate _priv;
};
struct _NMSettingVpnClass {
NMSettingClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingVpn, nm_setting_vpn, NM_TYPE_SETTING)
#define NM_SETTING_VPN_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_VPN, NMSettingVpnPrivate))
#define NM_SETTING_VPN_GET_PRIVATE(o) _NM_GET_PRIVATE(o, NMSettingVpn, NM_IS_SETTING_VPN, NMSetting)
/*****************************************************************************/
@ -1067,8 +1064,6 @@ nm_setting_vpn_class_init(NMSettingVpnClass *klass)
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array();
g_type_class_add_private(klass, sizeof(NMSettingVpnPrivate));
object_class->get_property = get_property;
object_class->set_property = set_property;
object_class->finalize = finalize;
@ -1211,5 +1206,5 @@ nm_setting_vpn_class_init(NMSettingVpnClass *klass)
NM_META_SETTING_TYPE_VPN,
NULL,
properties_override,
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
G_STRUCT_OFFSET(NMSettingVpn, _priv));
}

View file

@ -67,19 +67,17 @@ typedef struct {
*/
struct _NMSettingVxlan {
NMSetting parent;
/* In the past, this struct was public API. Preserve ABI! */
NMSettingVxlanPrivate _priv;
};
struct _NMSettingVxlanClass {
NMSettingClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingVxlan, nm_setting_vxlan, NM_TYPE_SETTING)
#define NM_SETTING_VXLAN_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_VXLAN, NMSettingVxlanPrivate))
_NM_GET_PRIVATE(o, NMSettingVxlan, NM_IS_SETTING_VXLAN, NMSetting)
/*****************************************************************************/
@ -428,8 +426,6 @@ nm_setting_vxlan_class_init(NMSettingVxlanClass *klass)
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array();
g_type_class_add_private(klass, sizeof(NMSettingVxlanPrivate));
object_class->get_property = _nm_setting_property_get_property_direct;
object_class->set_property = _nm_setting_property_set_property_direct;
@ -722,5 +718,5 @@ nm_setting_vxlan_class_init(NMSettingVxlanClass *klass)
NM_META_SETTING_TYPE_VXLAN,
NULL,
properties_override,
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
G_STRUCT_OFFSET(NMSettingVxlan, _priv));
}

View file

@ -42,19 +42,17 @@ typedef struct {
*/
struct _NMSettingWimax {
NMSetting parent;
/* In the past, this struct was public API. Preserve ABI! */
NMSettingWimaxPrivate _priv;
};
struct _NMSettingWimaxClass {
NMSettingClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingWimax, nm_setting_wimax, NM_TYPE_SETTING)
#define NM_SETTING_WIMAX_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_WIMAX, NMSettingWimaxPrivate))
_NM_GET_PRIVATE(o, NMSettingWimax, NM_IS_SETTING_WIMAX, NMSetting)
/*****************************************************************************/
@ -157,8 +155,6 @@ nm_setting_wimax_class_init(NMSettingWimaxClass *klass)
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array();
g_type_class_add_private(klass, sizeof(NMSettingWimaxPrivate));
object_class->get_property = _nm_setting_property_get_property_direct;
object_class->set_property = _nm_setting_property_set_property_direct;
@ -206,5 +202,5 @@ nm_setting_wimax_class_init(NMSettingWimaxClass *klass)
NM_META_SETTING_TYPE_WIMAX,
NULL,
properties_override,
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
G_STRUCT_OFFSET(NMSettingWimax, _priv));
}

View file

@ -76,19 +76,17 @@ typedef struct {
*/
struct _NMSettingWired {
NMSetting parent;
/* In the past, this struct was public API. Preserve ABI! */
NMSettingWiredPrivate _priv;
};
struct _NMSettingWiredClass {
NMSettingClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingWired, nm_setting_wired, NM_TYPE_SETTING)
#define NM_SETTING_WIRED_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_WIRED, NMSettingWiredPrivate))
_NM_GET_PRIVATE(o, NMSettingWired, NM_IS_SETTING_WIRED, NMSetting)
/*****************************************************************************/
@ -1172,8 +1170,6 @@ nm_setting_wired_class_init(NMSettingWiredClass *klass)
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array();
g_type_class_add_private(klass, sizeof(NMSettingWiredPrivate));
object_class->get_property = get_property;
object_class->set_property = set_property;
object_class->finalize = finalize;
@ -1675,5 +1671,5 @@ nm_setting_wired_class_init(NMSettingWiredClass *klass)
NM_META_SETTING_TYPE_WIRED,
NULL,
properties_override,
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
G_STRUCT_OFFSET(NMSettingWired, _priv));
}

View file

@ -91,21 +91,17 @@ typedef struct {
*/
struct _NMSettingWirelessSecurity {
NMSetting parent;
/* In the past, this struct was public API. Preserve ABI! */
NMSettingWirelessSecurityPrivate _priv;
};
struct _NMSettingWirelessSecurityClass {
NMSettingClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingWirelessSecurity, nm_setting_wireless_security, NM_TYPE_SETTING)
#define NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), \
NM_TYPE_SETTING_WIRELESS_SECURITY, \
NMSettingWirelessSecurityPrivate))
_NM_GET_PRIVATE(o, NMSettingWirelessSecurity, NM_IS_SETTING_WIRELESS_SECURITY, NMSetting)
/*****************************************************************************/
@ -1389,8 +1385,6 @@ nm_setting_wireless_security_class_init(NMSettingWirelessSecurityClass *klass)
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array();
g_type_class_add_private(klass, sizeof(NMSettingWirelessSecurityPrivate));
object_class->get_property = get_property;
object_class->set_property = set_property;
object_class->finalize = finalize;
@ -1894,5 +1888,5 @@ nm_setting_wireless_security_class_init(NMSettingWirelessSecurityClass *klass)
NM_META_SETTING_TYPE_WIRELESS_SECURITY,
NULL,
properties_override,
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
G_STRUCT_OFFSET(NMSettingWirelessSecurity, _priv));
}

View file

@ -73,19 +73,17 @@ typedef struct {
*/
struct _NMSettingWireless {
NMSetting parent;
/* In the past, this struct was public API. Preserve ABI! */
NMSettingWirelessPrivate _priv;
};
struct _NMSettingWirelessClass {
NMSettingClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
G_DEFINE_TYPE(NMSettingWireless, nm_setting_wireless, NM_TYPE_SETTING)
#define NM_SETTING_WIRELESS_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_WIRELESS, NMSettingWirelessPrivate))
_NM_GET_PRIVATE(o, NMSettingWireless, NM_IS_SETTING_WIRELESS, NMSetting)
/*****************************************************************************/
@ -1309,8 +1307,6 @@ nm_setting_wireless_class_init(NMSettingWirelessClass *klass)
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array();
g_type_class_add_private(klass, sizeof(NMSettingWirelessPrivate));
object_class->set_property = set_property;
object_class->get_property = get_property;
object_class->finalize = finalize;
@ -1925,5 +1921,5 @@ nm_setting_wireless_class_init(NMSettingWirelessClass *klass)
NM_META_SETTING_TYPE_WIRELESS,
NULL,
properties_override,
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
G_STRUCT_OFFSET(NMSettingWireless, _priv));
}

View file

@ -58,6 +58,7 @@ typedef struct {
*/
struct _NMSettingWpan {
NMSetting parent;
NMSettingWpanPrivate _priv;
};
struct _NMSettingWpanClass {
@ -67,7 +68,7 @@ struct _NMSettingWpanClass {
G_DEFINE_TYPE(NMSettingWpan, nm_setting_wpan, NM_TYPE_SETTING)
#define NM_SETTING_WPAN_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING_WPAN, NMSettingWpanPrivate))
_NM_GET_PRIVATE(o, NMSettingWpan, NM_IS_SETTING_WPAN, NMSetting)
/*****************************************************************************/
@ -228,8 +229,6 @@ nm_setting_wpan_class_init(NMSettingWpanClass *klass)
NMSettingClass *setting_class = NM_SETTING_CLASS(klass);
GArray *properties_override = _nm_sett_info_property_override_create_array();
g_type_class_add_private(setting_class, sizeof(NMSettingWpanPrivate));
object_class->get_property = _nm_setting_property_get_property_direct;
object_class->set_property = _nm_setting_property_set_property_direct;
@ -334,5 +333,5 @@ nm_setting_wpan_class_init(NMSettingWpanClass *klass)
NM_META_SETTING_TYPE_WPAN,
NULL,
properties_override,
NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
G_STRUCT_OFFSET(NMSettingWpan, _priv));
}

View file

@ -58,14 +58,13 @@ typedef struct {
NM_GOBJECT_PROPERTIES_DEFINE(NMSetting, PROP_NAME, );
typedef struct {
typedef struct _NMSettingPrivate {
GenData *gendata;
} NMSettingPrivate;
G_DEFINE_ABSTRACT_TYPE(NMSetting, nm_setting, G_TYPE_OBJECT)
#define NM_SETTING_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), NM_TYPE_SETTING, NMSettingPrivate))
#define NM_SETTING_GET_PRIVATE(o) _NM_GET_PRIVATE_PTR(o, NMSetting, NM_IS_SETTING)
/*****************************************************************************/
@ -429,16 +428,6 @@ has_property_type:
setting_class->setting_info = &nm_meta_setting_infos[meta_type];
sett_info->setting_class = setting_class;
if (private_offset == NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS) {
int o;
o = g_type_class_get_instance_private_offset(setting_class);
nm_assert(o != NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS);
nm_assert(o > G_MININT16);
nm_assert(o < 0);
private_offset = o;
}
sett_info->private_offset = private_offset;
if (detail)
@ -4374,7 +4363,13 @@ get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
static void
nm_setting_init(NMSetting *setting)
{}
{
NMSettingPrivate *priv;
priv = G_TYPE_INSTANCE_GET_PRIVATE(setting, NM_TYPE_SETTING, NMSettingPrivate);
setting->_priv = priv;
}
static void
constructed(GObject *object)

View file

@ -30,13 +30,10 @@ int _nm_simple_connection_private_offset;
*/
struct _NMSimpleConnection {
GObject parent;
/* In the past, this struct was public API. Preserve ABI! */
};
struct _NMSimpleConnectionClass {
GObjectClass parent;
/* In the past, this struct was public API. Preserve ABI! */
gpointer padding[4];
};
static void nm_simple_connection_interface_init(NMConnectionInterface *iface);

View file

@ -920,8 +920,6 @@ struct _NMSettInfoSetting {
NMSettInfoSettDetail detail;
};
#define NM_SETT_INFO_PRIVATE_OFFSET_FROM_CLASS ((gint16) G_MININT16)
static inline gpointer
_nm_setting_get_private(NMSetting *self, const NMSettInfoSetting *sett_info, guint16 offset)
{