Commit 1e535789 authored by Thomas Haller's avatar Thomas Haller
parents 6a54f427 297d4985
......@@ -366,8 +366,6 @@ CLEANFILES += $(DBUS_INTERFACE_DOCS)
$(dispatcher_libnm_dispatcher_core_la_OBJECTS): $(introspection_sources)
$(dispatcher_nm_dispatcher_OBJECTS): $(introspection_sources)
$(libnm_libnm_la_OBJECTS): $(introspection_sources)
$(src_libNetworkManager_la_OBJECTS): $(introspection_sources)
$(src_libNetworkManagerBase_la_OBJECTS): $(introspection_sources)
EXTRA_DIST += \
$(dbusinterfaces_DATA) \
......@@ -1423,8 +1421,10 @@ src_libNetworkManagerBase_la_SOURCES = \
src/ndisc/nm-ndisc.h \
src/ndisc/nm-ndisc-private.h \
\
src/nm-exported-object.c \
src/nm-exported-object.h \
src/nm-dbus-utils.c \
src/nm-dbus-utils.h \
src/nm-dbus-object.c \
src/nm-dbus-object.h \
src/nm-ip4-config.c \
src/nm-ip4-config.h \
src/nm-ip6-config.c \
......@@ -1452,7 +1452,6 @@ endif
src_libNetworkManagerBase_la_LIBADD = \
libnm-core/libnm-core.la \
introspection/libnmdbus.la \
$(GLIB_LIBS) \
$(SYSTEMD_JOURNAL_LIBS) \
$(LIBUDEV_LIBS) \
......@@ -1589,8 +1588,8 @@ src_libNetworkManager_la_SOURCES = \
src/nm-active-connection.h \
src/nm-audit-manager.c \
src/nm-audit-manager.h \
src/nm-bus-manager.c \
src/nm-bus-manager.h \
src/nm-dbus-manager.c \
src/nm-dbus-manager.h \
src/nm-config.c \
src/nm-config.h \
src/nm-config-data.c \
......@@ -1860,7 +1859,6 @@ src_ppp_libnm_ppp_plugin_la_LDFLAGS = \
-Wl,--version-script="$(srcdir)/src/ppp/nm-ppp-plugin.ver"
src_ppp_libnm_ppp_plugin_la_LIBADD = \
introspection/libnmdbus.la \
$(GLIB_LIBS)
$(src_ppp_libnm_ppp_plugin_la_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
......@@ -2515,7 +2513,6 @@ src_devices_adsl_libnm_device_plugin_adsl_la_LDFLAGS = \
-Wl,--version-script="$(srcdir)/linker-script-devices.ver"
src_devices_adsl_libnm_device_plugin_adsl_la_LIBADD = \
introspection/libnmdbus.la \
$(LIBUDEV_LIBS)
check-local-devices-adsl: src/devices/adsl/libnm-device-plugin-adsl.la
......@@ -2591,7 +2588,6 @@ src_devices_wwan_libnm_device_plugin_wwan_la_LDFLAGS = \
-Wl,--version-script="$(srcdir)/linker-script-devices.ver"
src_devices_wwan_libnm_device_plugin_wwan_la_LIBADD = \
introspection/libnmdbus.la \
src/devices/wwan/libnm-wwan.la \
$(GLIB_LIBS)
......@@ -2649,7 +2645,6 @@ src_devices_bluetooth_libnm_device_plugin_bluetooth_la_LDFLAGS = \
-Wl,--version-script="$(srcdir)/linker-script-devices.ver"
src_devices_bluetooth_libnm_device_plugin_bluetooth_la_LIBADD = \
introspection/libnmdbus.la \
src/devices/wwan/libnm-wwan.la \
$(GLIB_LIBS)
......@@ -2690,6 +2685,8 @@ src_devices_wifi_libnm_device_plugin_wifi_la_SOURCES = \
src/devices/wifi/nm-wifi-ap.h \
src/devices/wifi/nm-wifi-utils.c \
src/devices/wifi/nm-wifi-utils.h \
src/devices/wifi/nm-wifi-common.c \
src/devices/wifi/nm-wifi-common.h \
src/devices/wifi/nm-device-olpc-mesh.c \
src/devices/wifi/nm-device-olpc-mesh.h
......@@ -2716,7 +2713,6 @@ src_devices_wifi_libnm_device_plugin_wifi_la_LDFLAGS = \
-Wl,--version-script="$(srcdir)/linker-script-devices.ver"
src_devices_wifi_libnm_device_plugin_wifi_la_LIBADD = \
introspection/libnmdbus.la \
$(GLIB_LIBS)
check-local-devices-wifi: src/devices/wifi/libnm-device-plugin-wifi.la
......@@ -2786,7 +2782,6 @@ src_devices_team_libnm_device_plugin_team_la_LDFLAGS = \
-Wl,--version-script="$(srcdir)/linker-script-devices.ver"
src_devices_team_libnm_device_plugin_team_la_LIBADD = \
introspection/libnmdbus.la \
$(LIBTEAMDCTL_LIBS) \
$(JANSSON_LIBS) \
$(GLIB_LIBS)
......@@ -2848,7 +2843,6 @@ src_devices_ovs_libnm_device_plugin_ovs_la_LDFLAGS = \
-Wl,--version-script="$(srcdir)/linker-script-devices.ver"
src_devices_ovs_libnm_device_plugin_ovs_la_LIBADD = \
introspection/libnmdbus.la \
$(JANSSON_LIBS) \
$(GLIB_LIBS)
......
......@@ -176,11 +176,13 @@ _nm_dbus_signal_connect_data (GDBusProxy *proxy,
static void
typecheck_response (GVariant **response,
const GVariantType *reply_type,
GError **error)
typecheck_response (GVariant **response,
const GVariantType *reply_type,
GError **error)
{
if (*response && reply_type && !g_variant_is_of_type (*response, reply_type)) {
if ( *response
&& reply_type
&& !g_variant_is_of_type (*response, reply_type)) {
/* This is the same error code that g_dbus_connection_call() returns if
* @reply_type doesn't match.
*/
......
......@@ -174,6 +174,35 @@
#endif
#endif
#if NM_MORE_ASSERTS == 0
#ifndef G_DISABLE_CAST_CHECKS
/* Unless compiling with G_DISABLE_CAST_CHECKS, glib performs type checking
* during G_VARIANT_TYPE() via g_variant_type_checked_(). This is not necesary
* because commonly this cast is needed during something like
*
* g_variant_builder_init (&props, G_VARIANT_TYPE ("a{sv}"));
*
* Note that in if the variant type would be invalid, the check still
* wouldn't make the buggy code magically work. Instead of passing a
* bogus type string (bad), it would pass %NULL to g_variant_builder_init()
* (also bad).
*
* Also, a function like g_variant_builder_init() already validates
* the input type via something like
*
* g_return_if_fail (g_variant_type_is_container (type));
*
* So, by having G_VARIANT_TYPE() also validate the type, we validate
* twice, whereas the first validation is rather pointless because it
* doesn't prevent the function to be called with invalid arguments.
*
* Just patch G_VARIANT_TYPE() to perform no check.
*/
#undef G_VARIANT_TYPE
#define G_VARIANT_TYPE(type_string) ((const GVariantType *) (type_string))
#endif
#endif
#include <stdlib.h>
/*****************************************************************************/
......
......@@ -421,6 +421,23 @@ char *nm_utils_str_utf8safe_unescape_cp (const char *str);
char *nm_utils_str_utf8safe_escape_take (char *str, NMUtilsStrUtf8SafeFlags flags);
static inline void
nm_g_variant_unref_floating (GVariant *var)
{
/* often a function wants to keep a reference to an input variant.
* It uses g_variant_ref_sink() to either increase the ref-count,
* or take ownership of a possibly floating reference.
*
* If the function doesn't actually want to do anything with the
* input variant, it still must make sure that a passed in floating
* reference is consumed. Hence, this helper which:
*
* - does nothing if @var is not floating
* - unrefs (consumes) @var if it is floating. */
if (g_variant_is_floating (var))
g_variant_unref (var);
}
/*****************************************************************************/
typedef struct {
......@@ -469,36 +486,89 @@ int nm_utils_fd_read_loop_exact (int fd, void *buf, size_t nbytes, bool do_poll)
/*****************************************************************************/
#define NM_DEFINE_GDBUS_ARG_INFO(a_name, ...) \
#define NM_DEFINE_GDBUS_ARG_INFO_FULL(name_, ...) \
((GDBusArgInfo *) (&((const GDBusArgInfo) { \
.ref_count = -1, \
.name = a_name, \
.name = name_, \
__VA_ARGS__ \
})))
#define NM_DEFINE_GDBUS_ARG_INFO(name_, a_signature) \
NM_DEFINE_GDBUS_ARG_INFO_FULL ( \
name_, \
.signature = a_signature, \
)
#define NM_DEFINE_GDBUS_ARG_INFOS(...) \
((GDBusArgInfo **) ((const GDBusArgInfo *[]) { \
__VA_ARGS__ \
NULL, \
}))
#define NM_DEFINE_GDBUS_METHOD_INFO(m_name, ...) \
((GDBusMethodInfo *) (&((const GDBusMethodInfo) { \
#define NM_DEFINE_GDBUS_PROPERTY_INFO(name_, ...) \
((GDBusPropertyInfo *) (&((const GDBusPropertyInfo) { \
.ref_count = -1, \
.name = m_name, \
.name = name_, \
__VA_ARGS__ \
})))
#define NM_DEFINE_GDBUS_PROPERTY_INFO_READABLE(name_, m_signature) \
NM_DEFINE_GDBUS_PROPERTY_INFO ( \
name_, \
.signature = m_signature, \
.flags = G_DBUS_PROPERTY_INFO_FLAGS_READABLE, \
)
#define NM_DEFINE_GDBUS_PROPERTY_INFOS(...) \
((GDBusPropertyInfo **) ((const GDBusPropertyInfo *[]) { \
__VA_ARGS__ \
NULL, \
}))
#define NM_DEFINE_GDBUS_SIGNAL_INFO_INIT(name_, ...) \
{ \
.ref_count = -1, \
.name = name_, \
__VA_ARGS__ \
}
#define NM_DEFINE_GDBUS_SIGNAL_INFO(name_, ...) \
((GDBusSignalInfo *) (&((const GDBusSignalInfo) NM_DEFINE_GDBUS_SIGNAL_INFO_INIT (name_, __VA_ARGS__))))
#define NM_DEFINE_GDBUS_SIGNAL_INFOS(...) \
((GDBusSignalInfo **) ((const GDBusSignalInfo *[]) { \
__VA_ARGS__ \
NULL, \
}))
#define NM_DEFINE_GDBUS_METHOD_INFO_INIT(name_, ...) \
{ \
.ref_count = -1, \
.name = name_, \
__VA_ARGS__ \
}
#define NM_DEFINE_GDBUS_METHOD_INFO(name_, ...) \
((GDBusMethodInfo *) (&((const GDBusMethodInfo) NM_DEFINE_GDBUS_METHOD_INFO_INIT (name_, __VA_ARGS__))))
#define NM_DEFINE_GDBUS_METHOD_INFOS(...) \
((GDBusMethodInfo **) ((const GDBusMethodInfo *[]) { \
__VA_ARGS__ \
NULL, \
}))
#define NM_DEFINE_GDBUS_INTERFACE_INFO(variable, i_name, ...) \
static GDBusInterfaceInfo *const variable = ((GDBusInterfaceInfo *) (&((const GDBusInterfaceInfo) { \
#define NM_DEFINE_GDBUS_INTERFACE_INFO_INIT(name_, ...) \
{ \
.ref_count = -1, \
.name = i_name, \
.name = name_, \
__VA_ARGS__ \
}
#define NM_DEFINE_GDBUS_INTERFACE_INFO(name_, ...) \
((GDBusInterfaceInfo *) (&((const GDBusInterfaceInfo) NM_DEFINE_GDBUS_INTERFACE_INFO_INIT (name_, __VA_ARGS__))))
#define NM_DEFINE_GDBUS_INTERFACE_VTABLE(...) \
((GDBusInterfaceVTable *) (&((const GDBusInterfaceVTable) { \
__VA_ARGS__ \
})))
......
......@@ -31,7 +31,6 @@
#include "nm-core-internal.h"
#include "platform/nm-platform.h"
#include "nm-exported-object.h"
#include "nm-auth-utils.h"
/*****************************************************************************/
......@@ -880,62 +879,6 @@ nm_utils_match_connection (NMConnection *const*connections,
/*****************************************************************************/
/**
* nm_utils_g_value_set_object_path:
* @value: a #GValue, initialized to store an object path
* @object: (allow-none): an #NMExportedObject
*
* Sets @value to @object's object path. If @object is %NULL, or not
* exported, @value is set to "/".
*/
void
nm_utils_g_value_set_object_path (GValue *value, gpointer object)
{
g_return_if_fail (!object || NM_IS_EXPORTED_OBJECT (object));
if (object && nm_exported_object_is_exported (object))
g_value_set_string (value, nm_exported_object_get_path (object));
else
g_value_set_string (value, "/");
}
/**
* nm_utils_g_value_set_object_path_array:
* @value: a #GValue, initialized to store an object path
* @objects: a #GSList of #NMExportedObjects
* @filter_func: (allow-none): function to call on each object in @objects
* @user_data: data to pass to @filter_func
*
* Sets @value to an array of object paths of the objects in @objects.
*/
void
nm_utils_g_value_set_object_path_array (GValue *value,
GSList *objects,
NMUtilsObjectFunc filter_func,
gpointer user_data)
{
char **paths;
guint i;
GSList *iter;
paths = g_new (char *, g_slist_length (objects) + 1);
for (i = 0, iter = objects; iter; iter = iter->next) {
NMExportedObject *object = iter->data;
const char *path;
path = nm_exported_object_get_path (object);
if (!path)
continue;
if (filter_func && !filter_func ((GObject *) object, user_data))
continue;
paths[i++] = g_strdup (path);
}
paths[i] = NULL;
g_value_take_boxed (value, paths);
}
/*****************************************************************************/
int
nm_match_spec_device_by_pllink (const NMPlatformLink *pllink,
const char *match_device_type,
......
......@@ -48,22 +48,6 @@ NMConnection *nm_utils_match_connection (NMConnection *const*connections,
NMUtilsMatchFilterFunc match_filter_func,
gpointer match_filter_data);
void nm_utils_g_value_set_object_path (GValue *value, gpointer object);
/**
* NMUtilsObjectFunc:
* @object: the object to filter on
* @user_data: data passed to the function from the caller
*
* Returns: %TRUE if the object should be used, %FALSE if not
*/
typedef gboolean (*NMUtilsObjectFunc) (GObject *object, gpointer user_data);
void nm_utils_g_value_set_object_path_array (GValue *value,
GSList *objects,
NMUtilsObjectFunc filter_func,
gpointer user_data);
int nm_match_spec_device_by_pllink (const NMPlatformLink *pllink,
const char *match_device_type,
const GSList *specs,
......
......@@ -4,7 +4,6 @@ sources = files(
)
deps = [
libnmdbus_dep,
libudev_dep,
nm_dep
]
......
......@@ -39,8 +39,6 @@
#include "nm-setting-adsl.h"
#include "nm-utils.h"
#include "introspection/org.freedesktop.NetworkManager.Device.Adsl.h"
#include "devices/nm-device-logging.h"
_LOG_DECLARE_SELF (NMDeviceAdsl);
......@@ -655,10 +653,24 @@ dispose (GObject *object)
G_OBJECT_CLASS (nm_device_adsl_parent_class)->dispose (object);
}
static const NMDBusInterfaceInfoExtended interface_info_device_adsl = {
.parent = NM_DEFINE_GDBUS_INTERFACE_INFO_INIT (
NM_DBUS_INTERFACE_DEVICE_ADSL,
.signals = NM_DEFINE_GDBUS_SIGNAL_INFOS (
&nm_signal_info_property_changed_legacy,
),
.properties = NM_DEFINE_GDBUS_PROPERTY_INFOS (
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE_L ("Carrier", "b", NM_DEVICE_CARRIER),
),
),
.legacy_property_changed = TRUE,
};
static void
nm_device_adsl_class_init (NMDeviceAdslClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS (klass);
NMDeviceClass *parent_class = NM_DEVICE_CLASS (klass);
object_class->constructed = constructed;
......@@ -666,6 +678,8 @@ nm_device_adsl_class_init (NMDeviceAdslClass *klass)
object_class->get_property = get_property;
object_class->set_property = set_property;
dbus_object_class->interface_infos = NM_DBUS_INTERFACE_INFOS (&interface_info_device_adsl);
parent_class->get_generic_capabilities = get_generic_capabilities;
parent_class->check_connection_compatible = check_connection_compatible;
......@@ -682,8 +696,4 @@ nm_device_adsl_class_init (NMDeviceAdslClass *klass)
G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (object_class, _PROPERTY_ENUMS_LAST, obj_properties);
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
NMDBUS_TYPE_DEVICE_ADSL_SKELETON,
NULL);
}
......@@ -9,7 +9,6 @@ sources = files(
)
deps = [
libnmdbus_dep,
libnm_wwan_dep,
nm_dep
]
......
......@@ -43,8 +43,6 @@
#include "devices/wwan/nm-modem-manager.h"
#include "devices/wwan/nm-modem.h"
#include "introspection/org.freedesktop.NetworkManager.Device.Bluetooth.h"
#include "devices/nm-device-logging.h"
_LOG_DECLARE_SELF(NMDeviceBt);
......@@ -1152,10 +1150,26 @@ finalize (GObject *object)
G_OBJECT_CLASS (nm_device_bt_parent_class)->finalize (object);
}
static const NMDBusInterfaceInfoExtended interface_info_device_bluetooth = {
.parent = NM_DEFINE_GDBUS_INTERFACE_INFO_INIT (
NM_DBUS_INTERFACE_DEVICE_BLUETOOTH,
.signals = NM_DEFINE_GDBUS_SIGNAL_INFOS (
&nm_signal_info_property_changed_legacy,
),
.properties = NM_DEFINE_GDBUS_PROPERTY_INFOS (
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE_L ("HwAddress", "s", NM_DEVICE_HW_ADDRESS),
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE_L ("Name", "s", NM_DEVICE_BT_NAME),
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE_L ("BtCapabilities", "u", NM_DEVICE_BT_CAPABILITIES),
),
),
.legacy_property_changed = TRUE,
};
static void
nm_device_bt_class_init (NMDeviceBtClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS (klass);
NMDeviceClass *device_class = NM_DEVICE_CLASS (klass);
object_class->constructed = constructed;
......@@ -1164,6 +1178,8 @@ nm_device_bt_class_init (NMDeviceBtClass *klass)
object_class->dispose = dispose;
object_class->finalize = finalize;
dbus_object_class->interface_infos = NM_DBUS_INTERFACE_INFOS (&interface_info_device_bluetooth);
device_class->get_generic_capabilities = get_generic_capabilities;
device_class->can_auto_connect = can_auto_connect;
device_class->deactivate = deactivate;
......@@ -1207,8 +1223,4 @@ nm_device_bt_class_init (NMDeviceBtClass *klass)
G_TYPE_NONE, 2,
G_TYPE_UINT /*guint32 in_bytes*/,
G_TYPE_UINT /*guint32 out_bytes*/);
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
NMDBUS_TYPE_DEVICE_BLUETOOTH_SKELETON,
NULL);
}
......@@ -32,8 +32,6 @@
#include "nm-core-internal.h"
#include "nm-ip4-config.h"
#include "introspection/org.freedesktop.NetworkManager.Device.Bond.h"
#include "nm-device-logging.h"
_LOG_DECLARE_SELF(NMDeviceBond);
......@@ -607,13 +605,31 @@ nm_device_bond_init (NMDeviceBond * self)
nm_assert (nm_device_is_master (NM_DEVICE (self)));
}
static const NMDBusInterfaceInfoExtended interface_info_device_bond = {
.parent = NM_DEFINE_GDBUS_INTERFACE_INFO_INIT (
NM_DBUS_INTERFACE_DEVICE_BOND,
.signals = NM_DEFINE_GDBUS_SIGNAL_INFOS (
&nm_signal_info_property_changed_legacy,
),
.properties = NM_DEFINE_GDBUS_PROPERTY_INFOS (
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE_L ("HwAddress", "s", NM_DEVICE_HW_ADDRESS),
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE_L ("Carrier", "b", NM_DEVICE_CARRIER),
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE_L ("Slaves", "ao", NM_DEVICE_SLAVES),
),
),
.legacy_property_changed = TRUE,
};
static void
nm_device_bond_class_init (NMDeviceBondClass *klass)
{
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS (klass);
NMDeviceClass *parent_class = NM_DEVICE_CLASS (klass);
NM_DEVICE_CLASS_DECLARE_TYPES (klass, NM_SETTING_BOND_SETTING_NAME, NM_LINK_TYPE_BOND)
dbus_object_class->interface_infos = NM_DBUS_INTERFACE_INFOS (&interface_info_device_bond);
parent_class->is_master = TRUE;
parent_class->get_generic_capabilities = get_generic_capabilities;
parent_class->check_connection_compatible = check_connection_compatible;
......@@ -629,10 +645,6 @@ nm_device_bond_class_init (NMDeviceBondClass *klass)
parent_class->release_slave = release_slave;
parent_class->can_reapply_change = can_reapply_change;
parent_class->reapply_connection = reapply_connection;
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
NMDBUS_TYPE_DEVICE_BOND_SKELETON,
NULL);
}
/*****************************************************************************/
......
......@@ -30,8 +30,6 @@
#include "nm-device-factory.h"
#include "nm-core-internal.h"
#include "introspection/org.freedesktop.NetworkManager.Device.Bridge.h"
#include "nm-device-logging.h"
_LOG_DECLARE_SELF(NMDeviceBridge);
......@@ -488,13 +486,31 @@ nm_device_bridge_init (NMDeviceBridge * self)
nm_assert (nm_device_is_master (NM_DEVICE (self)));
}
static const NMDBusInterfaceInfoExtended interface_info_device_bridge = {
.parent = NM_DEFINE_GDBUS_INTERFACE_INFO_INIT (
NM_DBUS_INTERFACE_DEVICE_BRIDGE,
.signals = NM_DEFINE_GDBUS_SIGNAL_INFOS (
&nm_signal_info_property_changed_legacy,
),
.properties = NM_DEFINE_GDBUS_PROPERTY_INFOS (
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE_L ("HwAddress", "s", NM_DEVICE_HW_ADDRESS),
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE_L ("Carrier", "b", NM_DEVICE_CARRIER),
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE_L ("Slaves", "ao", NM_DEVICE_SLAVES),
),
),
.legacy_property_changed = TRUE,
};
static void
nm_device_bridge_class_init (NMDeviceBridgeClass *klass)
{
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS (klass);
NMDeviceClass *parent_class = NM_DEVICE_CLASS (klass);
NM_DEVICE_CLASS_DECLARE_TYPES (klass, NM_SETTING_BRIDGE_SETTING_NAME, NM_LINK_TYPE_BRIDGE)
dbus_object_class->interface_infos = NM_DBUS_INTERFACE_INFOS (&interface_info_device_bridge);
parent_class->is_master = TRUE;
parent_class->get_generic_capabilities = get_generic_capabilities;
parent_class->check_connection_compatible = check_connection_compatible;
......@@ -511,10 +527,6 @@ nm_device_bridge_class_init (NMDeviceBridgeClass *klass)
parent_class->enslave_slave = enslave_slave;
parent_class->release_slave = release_slave;
parent_class->get_configured_mtu = nm_device_get_configured_mtu_for_wired;
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
NMDBUS_TYPE_DEVICE_BRIDGE_SKELETON,
NULL);
}
/*****************************************************************************/
......
......@@ -28,8 +28,6 @@
#include "nm-setting-dummy.h"
#include "nm-core-internal.h"
#include "introspection/org.freedesktop.NetworkManager.Device.Dummy.h"
#include "nm-device-logging.h"
_LOG_DECLARE_SELF(NMDeviceDummy);
......@@ -156,13 +154,29 @@ nm_device_dummy_init (NMDeviceDummy *self)
{
}
static const NMDBusInterfaceInfoExtended interface_info_device_dummy = {
.parent = NM_DEFINE_GDBUS_INTERFACE_INFO_INIT (
NM_DBUS_INTERFACE_DEVICE_DUMMY,
.signals = NM_DEFINE_GDBUS_SIGNAL_INFOS (
&nm_signal_info_property_changed_legacy,
),
.properties = NM_DEFINE_GDBUS_PROPERTY_INFOS (
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE_L ("HwAddress", "s", NM_DEVICE_HW_ADDRESS),
),
),
.legacy_property_changed = TRUE,
};
static void
nm_device_dummy_class_init (NMDeviceDummyClass *klass)
{
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS (klass);
NMDeviceClass *device_class = NM_DEVICE_CLASS (klass);
NM_DEVICE_CLASS_DECLARE_TYPES (klass, NULL, NM_LINK_TYPE_DUMMY)
dbus_object_class->interface_infos = NM_DBUS_INTERFACE_INFOS (&interface_info_device_dummy);
device_class->connection_type = NM_SETTING_DUMMY_SETTING_NAME;
device_class->complete_connection = complete_connection;
device_class->check_connection_compatible = check_connection_compatible;
......@@ -171,10 +185,6 @@ nm_device_dummy_class_init (NMDeviceDummyClass *klass)
device_class->update_connection = update_connection;
device_class->act_stage1_prepare = act_stage1_prepare;
device_class->get_configured_mtu = nm_device_get_configured_mtu_for_wired;
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
NMDBUS_TYPE_DEVICE_DUMMY_SKELETON,
NULL);
}
......
......@@ -28,7 +28,6 @@
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <libudev.h>
#include "nm-device-private.h"
......@@ -52,8 +51,6 @@
#include "nm-core-internal.h"
#include "NetworkManagerUtils.h"
#include "introspection/org.freedesktop.NetworkManager.Device.Wired.h"
#include "nm-device-logging.h"
_LOG_DECLARE_SELF(NMDeviceEthernet);
......@@ -1714,10 +1711,28 @@ set_property (GObject *object, guint prop_id,
}
}
static const NMDBusInterfaceInfoExtended interface_info_device_wired = {
.parent = NM_DEFINE_GDBUS_INTERFACE_INFO_INIT (
NM_DBUS_INTERFACE_DEVICE_WIRED,
.signals = NM_DEFINE_GDBUS_SIGNAL_INFOS (
&nm_signal_info_property_changed_legacy,
),
.properties = NM_DEFINE_GDBUS_PROPERTY_INFOS (
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE_L ("HwAddress", "s", NM_DEVICE_HW_ADDRESS),
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE_L ("PermHwAddress", "s", NM_DEVICE_PERM_HW_ADDRESS),
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE_L ("Speed", "u", NM_DEVICE_ETHERNET_SPEED),
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE_L ("S390Subchannels", "as", NM_DEVICE_ETHERNET_S390_SUBCHANNELS),
NM_DEFINE_DBUS_PROPERTY_INFO_EXTENDED_READABLE_L ("Carrier", "b", NM_DEVICE_CARRIER),
),
),
.legacy_property_changed = TRUE,
};
static void
nm_device_ethernet_class_init (NMDeviceEthernetClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
NMDBusObjectClass *dbus_object_class = NM_DBUS_OBJECT_CLASS (klass);
NMDeviceClass *parent_class = NM_DEVICE_CLASS (klass);
g_type_class_add_private (object_class, sizeof (NMDeviceEthernetPrivate));
......@@ -1729,6 +1744,8 @@ nm_device_ethernet_class_init (NMDeviceEthernetClass *klass)
object_class->get_property = get_property;
object_class->set_property = set_property;
dbus_object_class->interface_infos = NM_DBUS_INTERFACE_INFOS (&interface_info_device_wired);
parent_class->get_generic_capabilities = get_generic_capabilities;
parent_class->check_connection_compatible = check_connection_compatible;
parent_class->complete_connection = complete_connection;
......@@ -1762,10 +1779,6 @@ nm_device_ethernet_class_init (NMDeviceEthernetClass *klass)
G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (object_class, _PROPERTY_ENUMS_LAST, obj_properties);
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
NMDBUS_TYPE_DEVICE_ETHERNET_SKELETON,
NULL);
}
/*****************************************************************************/
......
......@@ -26,8 +26,6 @@
#include "platform/nm-platform.h"
#include "nm-core-internal.h"