devices, active-connection: port to gdbus

This commit is contained in:
Dan Winship
2015-04-15 14:53:30 -04:00
parent df6706813a
commit c050fb7cd2
36 changed files with 291 additions and 310 deletions

View File

@@ -12,6 +12,10 @@
<tp:docstring>Flags describing the access point's capabilities according to the RSN (Robust Secure Network) protocol.</tp:docstring> <tp:docstring>Flags describing the access point's capabilities according to the RSN (Robust Secure Network) protocol.</tp:docstring>
</property> </property>
<property name="Ssid" type="ay" access="read"> <property name="Ssid" type="ay" access="read">
<!-- gdbus-codegen assumes that "ay" means "non-UTF-8 string" and
won't deal with '\0' bytes correctly.
-->
<annotation name="org.gtk.GDBus.C.ForceGVariant" value="1"/>
<tp:docstring>The Service Set Identifier identifying the access point.</tp:docstring> <tp:docstring>The Service Set Identifier identifying the access point.</tp:docstring>
</property> </property>
<property name="Frequency" type="u" access="read"> <property name="Frequency" type="u" access="read">

View File

@@ -5,7 +5,6 @@
<annotation name="org.gtk.GDBus.C.Name" value="DeviceWifi"/> <annotation name="org.gtk.GDBus.C.Name" value="DeviceWifi"/>
<method name="GetAccessPoints"> <method name="GetAccessPoints">
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_device_get_access_points"/>
<arg name="access_points" type="ao" direction="out"> <arg name="access_points" type="ao" direction="out">
<tp:docstring> <tp:docstring>
List of access point object paths. List of access point object paths.
@@ -20,7 +19,6 @@
</method> </method>
<method name="GetAllAccessPoints"> <method name="GetAllAccessPoints">
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_device_get_all_access_points"/>
<arg name="access_points" type="ao" direction="out"> <arg name="access_points" type="ao" direction="out">
<tp:docstring> <tp:docstring>
List of access point object paths. List of access point object paths.
@@ -33,8 +31,6 @@
</method> </method>
<method name="RequestScan"> <method name="RequestScan">
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_device_request_scan"/>
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg name="options" type="a{sv}" direction="in"> <arg name="options" type="a{sv}" direction="in">
<tp:docstring> <tp:docstring>
Options of scan (currently unused argument). Options of scan (currently unused argument).

View File

@@ -3,7 +3,6 @@
<node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"> <node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
<interface name="org.freedesktop.NetworkManager.Device.WiMax"> <interface name="org.freedesktop.NetworkManager.Device.WiMax">
<method name="GetNspList"> <method name="GetNspList">
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_device_get_nsp_list"/>
<arg name="nsps" type="ao" direction="out"> <arg name="nsps" type="ao" direction="out">
<tp:docstring> <tp:docstring>
List of NSP object paths List of NSP object paths

View File

@@ -153,16 +153,12 @@
</property> </property>
<method name="Disconnect"> <method name="Disconnect">
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_device_disconnect"/>
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<tp:docstring> <tp:docstring>
Disconnects a device and prevents the device from automatically activating further connections without user intervention. Disconnects a device and prevents the device from automatically activating further connections without user intervention.
</tp:docstring> </tp:docstring>
</method> </method>
<method name="Delete"> <method name="Delete">
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_device_delete"/>
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<tp:docstring> <tp:docstring>
Deletes a software device from NetworkManager and removes the interface from the system. Deletes a software device from NetworkManager and removes the interface from the system.
The method returns an error when called for a hardware device. The method returns an error when called for a hardware device.

View File

@@ -7,13 +7,13 @@ AM_CPPFLAGS = \
-I${top_builddir}/src \ -I${top_builddir}/src \
-I${top_srcdir}/src/devices \ -I${top_srcdir}/src/devices \
-I${top_srcdir}/src/platform \ -I${top_srcdir}/src/platform \
-I${top_builddir}/introspection \
-I${top_srcdir}/include \ -I${top_srcdir}/include \
-I${top_builddir}/libnm-core \ -I${top_builddir}/libnm-core \
-I${top_srcdir}/libnm-core \ -I${top_srcdir}/libnm-core \
-DG_LOG_DOMAIN=\""NetworkManager-adsl"\" \ -DG_LOG_DOMAIN=\""NetworkManager-adsl"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \ -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(DBUS_CFLAGS) \
$(GUDEV_CFLAGS) $(GUDEV_CFLAGS)
GLIB_GENERATED = nm-adsl-enum-types.h nm-adsl-enum-types.c GLIB_GENERATED = nm-adsl-enum-types.h nm-adsl-enum-types.c
@@ -21,10 +21,7 @@ GLIB_MKENUMS_H_FLAGS = --identifier-prefix NM
GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM
nm_adsl_enum_types_sources = $(srcdir)/nm-device-adsl.h nm_adsl_enum_types_sources = $(srcdir)/nm-device-adsl.h
nm-device-adsl-glue.h: $(top_srcdir)/introspection/nm-device-adsl.xml BUILT_SOURCES = $(GLIB_GENERATED)
dbus-binding-tool --prefix=nm_device_adsl --mode=glib-server --output=$@ $<
BUILT_SOURCES = $(GLIB_GENERATED) nm-device-adsl-glue.h
pkglib_LTLIBRARIES = libnm-device-plugin-adsl.la pkglib_LTLIBRARIES = libnm-device-plugin-adsl.la
@@ -43,7 +40,7 @@ libnm_device_plugin_adsl_la_LDFLAGS = \
-Wl,--version-script=$(SYMBOL_VIS_FILE) -Wl,--version-script=$(SYMBOL_VIS_FILE)
libnm_device_plugin_adsl_la_LIBADD = \ libnm_device_plugin_adsl_la_LIBADD = \
$(DBUS_LIBS) \ $(top_builddir)/introspection/libnmdbus.la \
$(GUDEV_LIBS) $(GUDEV_LIBS)
CLEANFILES = $(BUILT_SOURCES) CLEANFILES = $(BUILT_SOURCES)

View File

@@ -43,7 +43,7 @@
#include "nm-setting-adsl.h" #include "nm-setting-adsl.h"
#include "nm-utils.h" #include "nm-utils.h"
#include "nm-device-adsl-glue.h" #include "nmdbus-device-adsl.h"
#include "nm-device-logging.h" #include "nm-device-logging.h"
_LOG_DECLARE_SELF (NMDeviceAdsl); _LOG_DECLARE_SELF (NMDeviceAdsl);
@@ -613,5 +613,6 @@ nm_device_adsl_class_init (NMDeviceAdslClass *klass)
parent_class->deactivate = deactivate; parent_class->deactivate = deactivate;
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass), nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_adsl_object_info); NMDBUS_TYPE_DEVICE_ADSL_SKELETON,
NULL);
} }

View File

@@ -9,23 +9,21 @@ AM_CPPFLAGS = \
-I${top_srcdir}/src/settings \ -I${top_srcdir}/src/settings \
-I${top_srcdir}/src/platform \ -I${top_srcdir}/src/platform \
-I${top_srcdir}/src/devices/wwan \ -I${top_srcdir}/src/devices/wwan \
-I${top_builddir}/introspection \
-I${top_srcdir}/include \ -I${top_srcdir}/include \
-I${top_builddir}/libnm-core \ -I${top_builddir}/libnm-core \
-I${top_srcdir}/libnm-core \ -I${top_srcdir}/libnm-core \
-DG_LOG_DOMAIN=\""NetworkManager-bluetooth"\" \ -DG_LOG_DOMAIN=\""NetworkManager-bluetooth"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \ -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(DBUS_CFLAGS) $(GLIB_CFLAGS)
GLIB_GENERATED = nm-bt-enum-types.h nm-bt-enum-types.c GLIB_GENERATED = nm-bt-enum-types.h nm-bt-enum-types.c
GLIB_MKENUMS_H_FLAGS = --identifier-prefix NM GLIB_MKENUMS_H_FLAGS = --identifier-prefix NM
GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM
nm_bt_enum_types_sources = $(srcdir)/nm-bt-error.h nm_bt_enum_types_sources = $(srcdir)/nm-bt-error.h
nm-device-bt-glue.h: $(top_srcdir)/introspection/nm-device-bt.xml BUILT_SOURCES = $(GLIB_GENERATED)
dbus-binding-tool --prefix=nm_device_bt --mode=glib-server --output=$@ $<
BUILT_SOURCES = $(GLIB_GENERATED) nm-device-bt-glue.h
pkglib_LTLIBRARIES = libnm-device-plugin-bluetooth.la pkglib_LTLIBRARIES = libnm-device-plugin-bluetooth.la
@@ -56,8 +54,9 @@ libnm_device_plugin_bluetooth_la_LDFLAGS = \
-Wl,--version-script=$(SYMBOL_VIS_FILE) -Wl,--version-script=$(SYMBOL_VIS_FILE)
libnm_device_plugin_bluetooth_la_LIBADD = \ libnm_device_plugin_bluetooth_la_LIBADD = \
$(top_builddir)/introspection/libnmdbus.la \
$(top_builddir)/src/devices/wwan/libnm-wwan.la \ $(top_builddir)/src/devices/wwan/libnm-wwan.la \
$(DBUS_LIBS) \ $(GLIB_LIBS) \
$(GUDEV_LIBS) $(GUDEV_LIBS)
if WITH_BLUEZ5_DUN if WITH_BLUEZ5_DUN

View File

@@ -37,6 +37,7 @@
#include "nm-device-bt.h" #include "nm-device-bt.h"
#include "nm-core-internal.h" #include "nm-core-internal.h"
#include "nm-platform.h" #include "nm-platform.h"
#include "nm-dbus-compat.h"
typedef struct { typedef struct {
int bluez_version; int bluez_version;

View File

@@ -35,13 +35,14 @@
#include "nm-setting-gsm.h" #include "nm-setting-gsm.h"
#include "nm-setting-serial.h" #include "nm-setting-serial.h"
#include "nm-setting-ppp.h" #include "nm-setting-ppp.h"
#include "nm-device-bt-glue.h"
#include "NetworkManagerUtils.h" #include "NetworkManagerUtils.h"
#include "nm-bt-enum-types.h" #include "nm-bt-enum-types.h"
#include "nm-utils.h" #include "nm-utils.h"
#include "nm-bt-error.h" #include "nm-bt-error.h"
#include "nm-bt-enum-types.h" #include "nm-bt-enum-types.h"
#include "nmdbus-device-bt.h"
#define MM_DBUS_SERVICE "org.freedesktop.ModemManager1" #define MM_DBUS_SERVICE "org.freedesktop.ModemManager1"
#define MM_DBUS_PATH "/org/freedesktop/ModemManager1" #define MM_DBUS_PATH "/org/freedesktop/ModemManager1"
#define MM_DBUS_INTERFACE "org.freedesktop.ModemManager1" #define MM_DBUS_INTERFACE "org.freedesktop.ModemManager1"
@@ -1194,5 +1195,6 @@ nm_device_bt_class_init (NMDeviceBtClass *klass)
G_TYPE_UINT, G_TYPE_UINT); G_TYPE_UINT, G_TYPE_UINT);
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass), nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_bt_object_info); NMDBUS_TYPE_DEVICE_BLUETOOTH_SKELETON,
NULL);
} }

View File

@@ -28,13 +28,12 @@
#include "NetworkManagerUtils.h" #include "NetworkManagerUtils.h"
#include "nm-device-private.h" #include "nm-device-private.h"
#include "nm-platform.h" #include "nm-platform.h"
#include "nm-dbus-glib-types.h"
#include "nm-enum-types.h" #include "nm-enum-types.h"
#include "nm-device-factory.h" #include "nm-device-factory.h"
#include "nm-core-internal.h" #include "nm-core-internal.h"
#include "nm-ip4-config.h" #include "nm-ip4-config.h"
#include "nm-device-bond-glue.h" #include "nmdbus-device-bond.h"
#include "nm-device-logging.h" #include "nm-device-logging.h"
_LOG_DECLARE_SELF(NMDeviceBond); _LOG_DECLARE_SELF(NMDeviceBond);
@@ -556,12 +555,13 @@ nm_device_bond_class_init (NMDeviceBondClass *klass)
g_object_class_install_property g_object_class_install_property
(object_class, PROP_SLAVES, (object_class, PROP_SLAVES,
g_param_spec_boxed (NM_DEVICE_BOND_SLAVES, "", "", g_param_spec_boxed (NM_DEVICE_BOND_SLAVES, "", "",
DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH, G_TYPE_STRV,
G_PARAM_READABLE | G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass), nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_bond_object_info); NMDBUS_TYPE_DEVICE_BOND_SKELETON,
NULL);
} }
/*************************************************************/ /*************************************************************/

View File

@@ -26,13 +26,12 @@
#include "nm-device-bridge.h" #include "nm-device-bridge.h"
#include "NetworkManagerUtils.h" #include "NetworkManagerUtils.h"
#include "nm-device-private.h" #include "nm-device-private.h"
#include "nm-dbus-glib-types.h"
#include "nm-enum-types.h" #include "nm-enum-types.h"
#include "nm-platform.h" #include "nm-platform.h"
#include "nm-device-factory.h" #include "nm-device-factory.h"
#include "nm-core-internal.h" #include "nm-core-internal.h"
#include "nm-device-bridge-glue.h" #include "nmdbus-device-bridge.h"
#include "nm-device-logging.h" #include "nm-device-logging.h"
_LOG_DECLARE_SELF(NMDeviceBridge); _LOG_DECLARE_SELF(NMDeviceBridge);
@@ -501,12 +500,13 @@ nm_device_bridge_class_init (NMDeviceBridgeClass *klass)
g_object_class_install_property g_object_class_install_property
(object_class, PROP_SLAVES, (object_class, PROP_SLAVES,
g_param_spec_boxed (NM_DEVICE_BRIDGE_SLAVES, "", "", g_param_spec_boxed (NM_DEVICE_BRIDGE_SLAVES, "", "",
DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH, G_TYPE_STRV,
G_PARAM_READABLE | G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass), nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_bridge_object_info); NMDBUS_TYPE_DEVICE_BRIDGE_SKELETON,
NULL);
} }
/*************************************************************/ /*************************************************************/

View File

@@ -50,7 +50,7 @@
#include "nm-core-internal.h" #include "nm-core-internal.h"
#include "NetworkManagerUtils.h" #include "NetworkManagerUtils.h"
#include "nm-device-ethernet-glue.h" #include "nmdbus-device-ethernet.h"
#include "nm-device-logging.h" #include "nm-device-logging.h"
_LOG_DECLARE_SELF(NMDeviceEthernet); _LOG_DECLARE_SELF(NMDeviceEthernet);
@@ -1712,7 +1712,8 @@ nm_device_ethernet_class_init (NMDeviceEthernetClass *klass)
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass), nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_ethernet_object_info); NMDBUS_TYPE_DEVICE_ETHERNET_SKELETON,
NULL);
} }
/*************************************************************/ /*************************************************************/

View File

@@ -26,7 +26,7 @@
#include "nm-platform.h" #include "nm-platform.h"
#include "nm-core-internal.h" #include "nm-core-internal.h"
#include "nm-device-generic-glue.h" #include "nmdbus-device-generic.h"
G_DEFINE_TYPE (NMDeviceGeneric, nm_device_generic, NM_TYPE_DEVICE) G_DEFINE_TYPE (NMDeviceGeneric, nm_device_generic, NM_TYPE_DEVICE)
@@ -202,5 +202,6 @@ nm_device_generic_class_init (NMDeviceGenericClass *klass)
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass), nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_generic_object_info); NMDBUS_TYPE_DEVICE_GENERIC_SKELETON,
NULL);
} }

View File

@@ -31,7 +31,7 @@
#include "nm-device-factory.h" #include "nm-device-factory.h"
#include "nm-core-internal.h" #include "nm-core-internal.h"
#include "nm-device-gre-glue.h" #include "nmdbus-device-gre.h"
#include "nm-device-logging.h" #include "nm-device-logging.h"
_LOG_DECLARE_SELF(NMDeviceGre); _LOG_DECLARE_SELF(NMDeviceGre);
@@ -187,8 +187,8 @@ nm_device_gre_class_init (NMDeviceGreClass *klass)
/* properties */ /* properties */
g_object_class_install_property g_object_class_install_property
(object_class, PROP_PARENT, (object_class, PROP_PARENT,
g_param_spec_boxed (NM_DEVICE_GRE_PARENT, "", "", g_param_spec_string (NM_DEVICE_GRE_PARENT, "", "",
DBUS_TYPE_G_OBJECT_PATH, NULL,
G_PARAM_READABLE | G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
@@ -256,7 +256,8 @@ nm_device_gre_class_init (NMDeviceGreClass *klass)
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass), nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_gre_object_info); NMDBUS_TYPE_DEVICE_GRE_SKELETON,
NULL);
} }
/*************************************************************/ /*************************************************************/

View File

@@ -33,7 +33,7 @@
#include "nm-device-factory.h" #include "nm-device-factory.h"
#include "nm-core-internal.h" #include "nm-core-internal.h"
#include "nm-device-infiniband-glue.h" #include "nmdbus-device-infiniband.h"
G_DEFINE_TYPE (NMDeviceInfiniband, nm_device_infiniband, NM_TYPE_DEVICE) G_DEFINE_TYPE (NMDeviceInfiniband, nm_device_infiniband, NM_TYPE_DEVICE)
@@ -350,7 +350,8 @@ nm_device_infiniband_class_init (NMDeviceInfinibandClass *klass)
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass), nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_infiniband_object_info); NMDBUS_TYPE_DEVICE_INFINIBAND_SKELETON,
NULL);
} }
/*************************************************************/ /*************************************************************/

View File

@@ -29,7 +29,7 @@
#include "nm-platform.h" #include "nm-platform.h"
#include "nm-device-factory.h" #include "nm-device-factory.h"
#include "nm-device-macvlan-glue.h" #include "nmdbus-device-macvlan.h"
#include "nm-device-logging.h" #include "nm-device-logging.h"
_LOG_DECLARE_SELF(NMDeviceMacvlan); _LOG_DECLARE_SELF(NMDeviceMacvlan);
@@ -144,8 +144,8 @@ nm_device_macvlan_class_init (NMDeviceMacvlanClass *klass)
/* properties */ /* properties */
g_object_class_install_property g_object_class_install_property
(object_class, PROP_PARENT, (object_class, PROP_PARENT,
g_param_spec_boxed (NM_DEVICE_MACVLAN_PARENT, "", "", g_param_spec_string (NM_DEVICE_MACVLAN_PARENT, "", "",
DBUS_TYPE_G_OBJECT_PATH, NULL,
G_PARAM_READABLE | G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
@@ -164,7 +164,8 @@ nm_device_macvlan_class_init (NMDeviceMacvlanClass *klass)
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass), nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_macvlan_object_info); NMDBUS_TYPE_DEVICE_MACVLAN_SKELETON,
NULL);
} }
/*************************************************************/ /*************************************************************/

View File

@@ -29,7 +29,7 @@
#include "nm-platform.h" #include "nm-platform.h"
#include "nm-device-factory.h" #include "nm-device-factory.h"
#include "nm-device-tun-glue.h" #include "nmdbus-device-tun.h"
#include "nm-device-logging.h" #include "nm-device-logging.h"
_LOG_DECLARE_SELF(NMDeviceTun); _LOG_DECLARE_SELF(NMDeviceTun);
@@ -232,7 +232,8 @@ nm_device_tun_class_init (NMDeviceTunClass *klass)
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass), nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_tun_object_info); NMDBUS_TYPE_DEVICE_TUN_SKELETON,
NULL);
} }

View File

@@ -34,7 +34,7 @@
#include "nm-platform.h" #include "nm-platform.h"
#include "nm-device-factory.h" #include "nm-device-factory.h"
#include "nm-device-veth-glue.h" #include "nmdbus-device-veth.h"
#include "nm-device-logging.h" #include "nm-device-logging.h"
_LOG_DECLARE_SELF(NMDeviceVeth); _LOG_DECLARE_SELF(NMDeviceVeth);
@@ -160,13 +160,14 @@ nm_device_veth_class_init (NMDeviceVethClass *klass)
/* properties */ /* properties */
g_object_class_install_property g_object_class_install_property
(object_class, PROP_PEER, (object_class, PROP_PEER,
g_param_spec_boxed (NM_DEVICE_VETH_PEER, "", "", g_param_spec_string (NM_DEVICE_VETH_PEER, "", "",
DBUS_TYPE_G_OBJECT_PATH, NULL,
G_PARAM_READABLE | G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass), nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_veth_object_info); NMDBUS_TYPE_DEVICE_VETH_SKELETON,
NULL);
} }
/*************************************************************/ /*************************************************************/

View File

@@ -37,7 +37,7 @@
#include "nm-manager.h" #include "nm-manager.h"
#include "nm-core-internal.h" #include "nm-core-internal.h"
#include "nm-device-vlan-glue.h" #include "nmdbus-device-vlan.h"
#include "nm-device-logging.h" #include "nm-device-logging.h"
_LOG_DECLARE_SELF(NMDeviceVlan); _LOG_DECLARE_SELF(NMDeviceVlan);
@@ -617,8 +617,8 @@ nm_device_vlan_class_init (NMDeviceVlanClass *klass)
/* properties */ /* properties */
g_object_class_install_property g_object_class_install_property
(object_class, PROP_PARENT, (object_class, PROP_PARENT,
g_param_spec_boxed (NM_DEVICE_VLAN_PARENT, "", "", g_param_spec_string (NM_DEVICE_VLAN_PARENT, "", "",
DBUS_TYPE_G_OBJECT_PATH, NULL,
G_PARAM_READABLE | G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
g_object_class_install_property g_object_class_install_property
@@ -628,7 +628,8 @@ nm_device_vlan_class_init (NMDeviceVlanClass *klass)
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass), nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_vlan_object_info); NMDBUS_TYPE_DEVICE_VLAN_SKELETON,
NULL);
} }
/*************************************************************/ /*************************************************************/

View File

@@ -30,7 +30,7 @@
#include "nm-utils.h" #include "nm-utils.h"
#include "nm-device-factory.h" #include "nm-device-factory.h"
#include "nm-device-vxlan-glue.h" #include "nmdbus-device-vxlan.h"
#include "nm-device-logging.h" #include "nm-device-logging.h"
_LOG_DECLARE_SELF(NMDeviceVxlan); _LOG_DECLARE_SELF(NMDeviceVxlan);
@@ -234,8 +234,8 @@ nm_device_vxlan_class_init (NMDeviceVxlanClass *klass)
/* properties */ /* properties */
g_object_class_install_property g_object_class_install_property
(object_class, PROP_PARENT, (object_class, PROP_PARENT,
g_param_spec_boxed (NM_DEVICE_VXLAN_PARENT, "", "", g_param_spec_string (NM_DEVICE_VXLAN_PARENT, "", "",
DBUS_TYPE_G_OBJECT_PATH, NULL,
G_PARAM_READABLE | G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
@@ -345,7 +345,8 @@ nm_device_vxlan_class_init (NMDeviceVxlanClass *klass)
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass), nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_vxlan_object_info); NMDBUS_TYPE_DEVICE_VXLAN_SKELETON,
NULL);
} }
/*************************************************************/ /*************************************************************/

View File

@@ -21,7 +21,6 @@
#include "config.h" #include "config.h"
#include <dbus/dbus.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
@@ -55,7 +54,6 @@
#include "nm-settings-connection.h" #include "nm-settings-connection.h"
#include "nm-connection-provider.h" #include "nm-connection-provider.h"
#include "nm-auth-utils.h" #include "nm-auth-utils.h"
#include "nm-dbus-glib-types.h"
#include "nm-dispatcher.h" #include "nm-dispatcher.h"
#include "nm-config.h" #include "nm-config.h"
#include "nm-dns-manager.h" #include "nm-dns-manager.h"
@@ -68,13 +66,11 @@
#include "nm-device-logging.h" #include "nm-device-logging.h"
_LOG_DECLARE_SELF (NMDevice); _LOG_DECLARE_SELF (NMDevice);
static void impl_device_disconnect (NMDevice *self, DBusGMethodInvocation *context); #include "nmdbus-device.h"
static void impl_device_delete (NMDevice *self, DBusGMethodInvocation *context);
static void nm_device_update_metered (NMDevice *self); static void nm_device_update_metered (NMDevice *self);
static void ip_check_ping_watch_cb (GPid pid, gint status, gpointer user_data); static void ip_check_ping_watch_cb (GPid pid, gint status, gpointer user_data);
#include "nm-device-glue.h"
G_DEFINE_ABSTRACT_TYPE (NMDevice, nm_device, NM_TYPE_EXPORTED_OBJECT) G_DEFINE_ABSTRACT_TYPE (NMDevice, nm_device, NM_TYPE_EXPORTED_OBJECT)
#define NM_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE, NMDevicePrivate)) #define NM_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE, NMDevicePrivate))
@@ -6178,7 +6174,7 @@ delete_on_deactivate_check_and_schedule (NMDevice *self, int ifindex)
static void static void
disconnect_cb (NMDevice *self, disconnect_cb (NMDevice *self,
DBusGMethodInvocation *context, GDBusMethodInvocation *context,
NMAuthSubject *subject, NMAuthSubject *subject,
GError *error, GError *error,
gpointer user_data) gpointer user_data)
@@ -6187,7 +6183,7 @@ disconnect_cb (NMDevice *self,
GError *local = NULL; GError *local = NULL;
if (error) { if (error) {
dbus_g_method_return_error (context, error); g_dbus_method_invocation_return_gerror (context, error);
nm_audit_log_device_op (NM_AUDIT_OP_DEVICE_DISCONNECT, self, FALSE, subject, error->message); nm_audit_log_device_op (NM_AUDIT_OP_DEVICE_DISCONNECT, self, FALSE, subject, error->message);
return; return;
} }
@@ -6197,16 +6193,15 @@ disconnect_cb (NMDevice *self,
local = g_error_new_literal (NM_DEVICE_ERROR, local = g_error_new_literal (NM_DEVICE_ERROR,
NM_DEVICE_ERROR_NOT_ACTIVE, NM_DEVICE_ERROR_NOT_ACTIVE,
"Device is not active"); "Device is not active");
dbus_g_method_return_error (context, local);
nm_audit_log_device_op (NM_AUDIT_OP_DEVICE_DISCONNECT, self, FALSE, subject, local->message); nm_audit_log_device_op (NM_AUDIT_OP_DEVICE_DISCONNECT, self, FALSE, subject, local->message);
g_error_free (local); g_dbus_method_invocation_take_error (context, local);
} else { } else {
nm_device_set_autoconnect (self, FALSE); nm_device_set_autoconnect (self, FALSE);
nm_device_state_changed (self, nm_device_state_changed (self,
NM_DEVICE_STATE_DEACTIVATING, NM_DEVICE_STATE_DEACTIVATING,
NM_DEVICE_STATE_REASON_USER_REQUESTED); NM_DEVICE_STATE_REASON_USER_REQUESTED);
dbus_g_method_return (context); g_dbus_method_invocation_return_value (context, NULL);
nm_audit_log_device_op (NM_AUDIT_OP_DEVICE_DISCONNECT, self, TRUE, subject, NULL); nm_audit_log_device_op (NM_AUDIT_OP_DEVICE_DISCONNECT, self, TRUE, subject, NULL);
} }
} }
@@ -6221,7 +6216,7 @@ _clear_queued_act_request (NMDevicePrivate *priv)
} }
static void static void
impl_device_disconnect (NMDevice *self, DBusGMethodInvocation *context) impl_device_disconnect (NMDevice *self, GDBusMethodInvocation *context)
{ {
NMConnection *connection; NMConnection *connection;
GError *error = NULL; GError *error = NULL;
@@ -6230,8 +6225,7 @@ impl_device_disconnect (NMDevice *self, DBusGMethodInvocation *context)
error = g_error_new_literal (NM_DEVICE_ERROR, error = g_error_new_literal (NM_DEVICE_ERROR,
NM_DEVICE_ERROR_NOT_ACTIVE, NM_DEVICE_ERROR_NOT_ACTIVE,
"This device is not active"); "This device is not active");
dbus_g_method_return_error (context, error); g_dbus_method_invocation_take_error (context, error);
g_error_free (error);
return; return;
} }
@@ -6250,25 +6244,25 @@ impl_device_disconnect (NMDevice *self, DBusGMethodInvocation *context)
static void static void
delete_cb (NMDevice *self, delete_cb (NMDevice *self,
DBusGMethodInvocation *context, GDBusMethodInvocation *context,
NMAuthSubject *subject, NMAuthSubject *subject,
GError *error, GError *error,
gpointer user_data) gpointer user_data)
{ {
if (error) { if (error) {
dbus_g_method_return_error (context, error); g_dbus_method_invocation_return_gerror (context, error);
nm_audit_log_device_op (NM_AUDIT_OP_DEVICE_DELETE, self, FALSE, subject, error->message); nm_audit_log_device_op (NM_AUDIT_OP_DEVICE_DELETE, self, FALSE, subject, error->message);
return; return;
} }
/* Authorized */ /* Authorized */
nm_platform_link_delete (NM_PLATFORM_GET, nm_device_get_ifindex (self)); nm_platform_link_delete (NM_PLATFORM_GET, nm_device_get_ifindex (self));
dbus_g_method_return (context); g_dbus_method_invocation_return_value (context, NULL);
nm_audit_log_device_op (NM_AUDIT_OP_DEVICE_DELETE, self, TRUE, subject, NULL); nm_audit_log_device_op (NM_AUDIT_OP_DEVICE_DELETE, self, TRUE, subject, NULL);
} }
static void static void
impl_device_delete (NMDevice *self, DBusGMethodInvocation *context) impl_device_delete (NMDevice *self, GDBusMethodInvocation *context)
{ {
GError *error = NULL; GError *error = NULL;
@@ -6276,8 +6270,7 @@ impl_device_delete (NMDevice *self, DBusGMethodInvocation *context)
error = g_error_new_literal (NM_DEVICE_ERROR, error = g_error_new_literal (NM_DEVICE_ERROR,
NM_DEVICE_ERROR_NOT_SOFTWARE, NM_DEVICE_ERROR_NOT_SOFTWARE,
"This device is not a software device"); "This device is not a software device");
dbus_g_method_return_error (context, error); g_dbus_method_invocation_take_error (context, error);
g_error_free (error);
return; return;
} }
@@ -9311,8 +9304,6 @@ set_property (GObject *object, guint prop_id,
} }
} }
#define DBUS_TYPE_STATE_REASON_STRUCT (dbus_g_type_get_struct ("GValueArray", G_TYPE_UINT, G_TYPE_UINT, G_TYPE_INVALID))
static void static void
get_property (GObject *object, guint prop_id, get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec) GValue *value, GParamSpec *pspec)
@@ -9376,8 +9367,8 @@ get_property (GObject *object, guint prop_id,
g_value_set_uint (value, priv->state); g_value_set_uint (value, priv->state);
break; break;
case PROP_STATE_REASON: case PROP_STATE_REASON:
g_value_take_boxed (value, dbus_g_type_specialized_construct (DBUS_TYPE_STATE_REASON_STRUCT)); g_value_take_variant (value,
dbus_g_type_struct_set (value, 0, priv->state, 1, priv->state_reason, G_MAXUINT); g_variant_new ("(uu)", priv->state, priv->state_reason));
break; break;
case PROP_ACTIVE_CONNECTION: case PROP_ACTIVE_CONNECTION:
nm_utils_g_value_set_object_path (value, priv->act_request); nm_utils_g_value_set_object_path (value, priv->act_request);
@@ -9408,7 +9399,8 @@ get_property (GObject *object, guint prop_id,
g_hash_table_iter_init (&iter, priv->available_connections); g_hash_table_iter_init (&iter, priv->available_connections);
while (g_hash_table_iter_next (&iter, (gpointer) &connection, NULL)) while (g_hash_table_iter_next (&iter, (gpointer) &connection, NULL))
g_ptr_array_add (array, g_strdup (nm_connection_get_path (connection))); g_ptr_array_add (array, g_strdup (nm_connection_get_path (connection)));
g_value_take_boxed (value, array); g_ptr_array_add (array, NULL);
g_value_take_boxed (value, (char **) g_ptr_array_free (array, FALSE));
break; break;
case PROP_PHYSICAL_PORT_ID: case PROP_PHYSICAL_PORT_ID:
g_value_set_string (value, priv->physical_port_id); g_value_set_string (value, priv->physical_port_id);
@@ -9548,29 +9540,29 @@ nm_device_class_init (NMDeviceClass *klass)
g_object_class_install_property g_object_class_install_property
(object_class, PROP_IP4_CONFIG, (object_class, PROP_IP4_CONFIG,
g_param_spec_boxed (NM_DEVICE_IP4_CONFIG, "", "", g_param_spec_string (NM_DEVICE_IP4_CONFIG, "", "",
DBUS_TYPE_G_OBJECT_PATH, NULL,
G_PARAM_READWRITE | G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
g_object_class_install_property g_object_class_install_property
(object_class, PROP_DHCP4_CONFIG, (object_class, PROP_DHCP4_CONFIG,
g_param_spec_boxed (NM_DEVICE_DHCP4_CONFIG, "", "", g_param_spec_string (NM_DEVICE_DHCP4_CONFIG, "", "",
DBUS_TYPE_G_OBJECT_PATH, NULL,
G_PARAM_READWRITE | G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
g_object_class_install_property g_object_class_install_property
(object_class, PROP_IP6_CONFIG, (object_class, PROP_IP6_CONFIG,
g_param_spec_boxed (NM_DEVICE_IP6_CONFIG, "", "", g_param_spec_string (NM_DEVICE_IP6_CONFIG, "", "",
DBUS_TYPE_G_OBJECT_PATH, NULL,
G_PARAM_READWRITE | G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
g_object_class_install_property g_object_class_install_property
(object_class, PROP_DHCP6_CONFIG, (object_class, PROP_DHCP6_CONFIG,
g_param_spec_boxed (NM_DEVICE_DHCP6_CONFIG, "", "", g_param_spec_string (NM_DEVICE_DHCP6_CONFIG, "", "",
DBUS_TYPE_G_OBJECT_PATH, NULL,
G_PARAM_READWRITE | G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
@@ -9583,15 +9575,16 @@ nm_device_class_init (NMDeviceClass *klass)
g_object_class_install_property g_object_class_install_property
(object_class, PROP_STATE_REASON, (object_class, PROP_STATE_REASON,
g_param_spec_boxed (NM_DEVICE_STATE_REASON, "", "", g_param_spec_variant (NM_DEVICE_STATE_REASON, "", "",
DBUS_TYPE_STATE_REASON_STRUCT, G_VARIANT_TYPE ("(uu)"),
NULL,
G_PARAM_READABLE | G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
g_object_class_install_property g_object_class_install_property
(object_class, PROP_ACTIVE_CONNECTION, (object_class, PROP_ACTIVE_CONNECTION,
g_param_spec_boxed (NM_DEVICE_ACTIVE_CONNECTION, "", "", g_param_spec_string (NM_DEVICE_ACTIVE_CONNECTION, "", "",
DBUS_TYPE_G_OBJECT_PATH, NULL,
G_PARAM_READABLE | G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
@@ -9656,7 +9649,7 @@ nm_device_class_init (NMDeviceClass *klass)
g_object_class_install_property g_object_class_install_property
(object_class, PROP_AVAILABLE_CONNECTIONS, (object_class, PROP_AVAILABLE_CONNECTIONS,
g_param_spec_boxed (NM_DEVICE_AVAILABLE_CONNECTIONS, "", "", g_param_spec_boxed (NM_DEVICE_AVAILABLE_CONNECTIONS, "", "",
DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH, G_TYPE_STRV,
G_PARAM_READABLE | G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
@@ -9732,8 +9725,8 @@ nm_device_class_init (NMDeviceClass *klass)
G_OBJECT_CLASS_TYPE (object_class), G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_FIRST, G_SIGNAL_RUN_FIRST,
0, NULL, NULL, NULL, 0, NULL, NULL, NULL,
/* dbus-glib context, connection, permission, allow_interaction, callback, user_data */ /* context, connection, permission, allow_interaction, callback, user_data */
G_TYPE_NONE, 6, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_POINTER, G_TYPE_POINTER); G_TYPE_NONE, 6, G_TYPE_DBUS_METHOD_INVOCATION, NM_TYPE_CONNECTION, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_POINTER, G_TYPE_POINTER);
signals[IP4_CONFIG_CHANGED] = signals[IP4_CONFIG_CHANGED] =
g_signal_new (NM_DEVICE_IP4_CONFIG_CHANGED, g_signal_new (NM_DEVICE_IP4_CONFIG_CHANGED,
@@ -9771,7 +9764,8 @@ nm_device_class_init (NMDeviceClass *klass)
G_TYPE_NONE, 0); G_TYPE_NONE, 0);
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass), nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_object_info); NMDBUS_TYPE_DEVICE_SKELETON,
"Disconnect", impl_device_disconnect,
dbus_g_error_domain_register (NM_DEVICE_ERROR, NULL, NM_TYPE_DEVICE_ERROR); "Delete", impl_device_delete,
NULL);
} }

View File

@@ -22,7 +22,6 @@
#ifndef __NETWORKMANAGER_DEVICE_H__ #ifndef __NETWORKMANAGER_DEVICE_H__
#define __NETWORKMANAGER_DEVICE_H__ #define __NETWORKMANAGER_DEVICE_H__
#include <dbus/dbus-glib.h>
#include <netinet/in.h> #include <netinet/in.h>
#include "nm-exported-object.h" #include "nm-exported-object.h"
@@ -310,7 +309,7 @@ typedef struct {
} NMDeviceClass; } NMDeviceClass;
typedef void (*NMDeviceAuthRequestFunc) (NMDevice *device, typedef void (*NMDeviceAuthRequestFunc) (NMDevice *device,
DBusGMethodInvocation *context, GDBusMethodInvocation *context,
NMAuthSubject *subject, NMAuthSubject *subject,
GError *error, GError *error,
gpointer user_data); gpointer user_data);

View File

@@ -7,13 +7,14 @@ AM_CPPFLAGS = \
-I${top_builddir}/src \ -I${top_builddir}/src \
-I${top_srcdir}/src/devices \ -I${top_srcdir}/src/devices \
-I${top_srcdir}/src/platform \ -I${top_srcdir}/src/platform \
-I${top_builddir}/introspection \
-I${top_srcdir}/include \ -I${top_srcdir}/include \
-I${top_builddir}/libnm-core \ -I${top_builddir}/libnm-core \
-I${top_srcdir}/libnm-core \ -I${top_srcdir}/libnm-core \
-DG_LOG_DOMAIN=\""NetworkManager-team"\" \ -DG_LOG_DOMAIN=\""NetworkManager-team"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \ -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(DBUS_CFLAGS) $(GLIB_CFLAGS)
if WITH_TEAMDCTL if WITH_TEAMDCTL
AM_CPPFLAGS += ${LIBTEAMDCTL_CFLAGS} AM_CPPFLAGS += ${LIBTEAMDCTL_CFLAGS}
@@ -24,13 +25,7 @@ GLIB_MKENUMS_H_FLAGS = --identifier-prefix NM
GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM
nm_team_enum_types_sources = $(srcdir)/nm-device-team.h nm_team_enum_types_sources = $(srcdir)/nm-device-team.h
glue_sources = \ BUILT_SOURCES = $(GLIB_GENERATED)
nm-device-team-glue.h
%-glue.h: $(top_srcdir)/introspection/%.xml
$(AM_V_GEN) dbus-binding-tool --prefix=$(subst -,_,$(subst -glue.h,,$@)) --mode=glib-server --output=$@ $<
BUILT_SOURCES = $(GLIB_GENERATED) $(glue_sources)
pkglib_LTLIBRARIES = libnm-device-plugin-team.la pkglib_LTLIBRARIES = libnm-device-plugin-team.la
@@ -49,7 +44,8 @@ libnm_device_plugin_team_la_LDFLAGS = \
-Wl,--version-script=$(SYMBOL_VIS_FILE) -Wl,--version-script=$(SYMBOL_VIS_FILE)
libnm_device_plugin_team_la_LIBADD = \ libnm_device_plugin_team_la_LIBADD = \
$(DBUS_LIBS) \ $(top_builddir)/introspection/libnmdbus.la \
$(GLIB_LIBS) \
$(GUDEV_LIBS) $(GUDEV_LIBS)
if WITH_TEAMDCTL if WITH_TEAMDCTL

View File

@@ -32,12 +32,12 @@
#include "NetworkManagerUtils.h" #include "NetworkManagerUtils.h"
#include "nm-device-private.h" #include "nm-device-private.h"
#include "nm-platform.h" #include "nm-platform.h"
#include "nm-dbus-glib-types.h"
#include "nm-enum-types.h" #include "nm-enum-types.h"
#include "nm-team-enum-types.h" #include "nm-team-enum-types.h"
#include "nm-core-internal.h" #include "nm-core-internal.h"
#include "nm-dbus-compat.h"
#include "nm-device-team-glue.h" #include "nmdbus-device-team.h"
#include "nm-device-logging.h" #include "nm-device-logging.h"
_LOG_DECLARE_SELF(NMDeviceTeam); _LOG_DECLARE_SELF(NMDeviceTeam);
@@ -809,11 +809,12 @@ nm_device_team_class_init (NMDeviceTeamClass *klass)
g_object_class_install_property g_object_class_install_property
(object_class, PROP_SLAVES, (object_class, PROP_SLAVES,
g_param_spec_boxed (NM_DEVICE_TEAM_SLAVES, "", "", g_param_spec_boxed (NM_DEVICE_TEAM_SLAVES, "", "",
DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH, G_TYPE_STRV,
G_PARAM_READABLE | G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass), nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_team_object_info); NMDBUS_TYPE_DEVICE_TEAM_SKELETON,
NULL);
} }

View File

@@ -13,13 +13,14 @@ AM_CPPFLAGS = \
-I${top_srcdir}/src/settings \ -I${top_srcdir}/src/settings \
-I${top_srcdir}/src/platform \ -I${top_srcdir}/src/platform \
-I${top_srcdir}/src/supplicant-manager \ -I${top_srcdir}/src/supplicant-manager \
-I${top_builddir}/introspection \
-I${top_srcdir}/include \ -I${top_srcdir}/include \
-I${top_builddir}/libnm-core \ -I${top_builddir}/libnm-core \
-I${top_srcdir}/libnm-core \ -I${top_srcdir}/libnm-core \
-DG_LOG_DOMAIN=\""NetworkManager-wifi"\" \ -DG_LOG_DOMAIN=\""NetworkManager-wifi"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \ -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(DBUS_CFLAGS) $(GLIB_CFLAGS)
GLIB_GENERATED = nm-wifi-enum-types.h nm-wifi-enum-types.c GLIB_GENERATED = nm-wifi-enum-types.h nm-wifi-enum-types.c
GLIB_MKENUMS_H_FLAGS = --identifier-prefix NM GLIB_MKENUMS_H_FLAGS = --identifier-prefix NM
@@ -29,14 +30,7 @@ nm_wifi_enum_types_sources = \
$(srcdir)/nm-wifi-ap.h \ $(srcdir)/nm-wifi-ap.h \
$(srcdir)/nm-device-olpc-mesh.h $(srcdir)/nm-device-olpc-mesh.h
glue_sources = \ BUILT_SOURCES = $(GLIB_GENERATED)
nm-device-wifi-glue.h \
nm-device-olpc-mesh-glue.h
%-glue.h: $(top_srcdir)/introspection/%.xml
$(AM_V_GEN) dbus-binding-tool --prefix=$(subst -,_,$(subst -glue.h,,$@)) --mode=glib-server --output=$@ $<
BUILT_SOURCES = $(GLIB_GENERATED) $(glue_sources)
pkglib_LTLIBRARIES = libnm-device-plugin-wifi.la pkglib_LTLIBRARIES = libnm-device-plugin-wifi.la
@@ -60,7 +54,8 @@ libnm_device_plugin_wifi_la_LDFLAGS = \
-Wl,--version-script=$(SYMBOL_VIS_FILE) -Wl,--version-script=$(SYMBOL_VIS_FILE)
libnm_device_plugin_wifi_la_LIBADD = \ libnm_device_plugin_wifi_la_LIBADD = \
$(DBUS_LIBS) \ $(top_builddir)/introspection/libnmdbus.la \
$(GLIB_LIBS) \
$(GUDEV_LIBS) $(GUDEV_LIBS)
CLEANFILES = $(BUILT_SOURCES) CLEANFILES = $(BUILT_SOURCES)

View File

@@ -26,7 +26,6 @@
#include "config.h" #include "config.h"
#include <dbus/dbus.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <string.h> #include <string.h>
#include <sys/stat.h> #include <sys/stat.h>
@@ -54,7 +53,7 @@
/* This is a bug; but we can't really change API now... */ /* This is a bug; but we can't really change API now... */
#include "nm-vpn-dbus-interface.h" #include "nm-vpn-dbus-interface.h"
#include "nm-device-olpc-mesh-glue.h" #include "nmdbus-device-olpc-mesh.h"
#include "nm-device-logging.h" #include "nm-device-logging.h"
_LOG_DECLARE_SELF(NMDeviceOlpcMesh); _LOG_DECLARE_SELF(NMDeviceOlpcMesh);
@@ -531,8 +530,8 @@ nm_device_olpc_mesh_class_init (NMDeviceOlpcMeshClass *klass)
/* Properties */ /* Properties */
g_object_class_install_property g_object_class_install_property
(object_class, PROP_COMPANION, (object_class, PROP_COMPANION,
g_param_spec_boxed (NM_DEVICE_OLPC_MESH_COMPANION, "", "", g_param_spec_string (NM_DEVICE_OLPC_MESH_COMPANION, "", "",
DBUS_TYPE_G_OBJECT_PATH, NULL,
G_PARAM_READABLE | G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
@@ -544,6 +543,7 @@ nm_device_olpc_mesh_class_init (NMDeviceOlpcMeshClass *klass)
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass), nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_olpc_mesh_object_info); NMDBUS_TYPE_DEVICE_OLPC_MESH_SKELETON,
NULL);
} }

View File

@@ -21,7 +21,6 @@
#include "config.h" #include "config.h"
#include <dbus/dbus.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
@@ -48,23 +47,10 @@
#include "nm-auth-utils.h" #include "nm-auth-utils.h"
#include "nm-settings-connection.h" #include "nm-settings-connection.h"
#include "nm-enum-types.h" #include "nm-enum-types.h"
#include "nm-dbus-glib-types.h"
#include "nm-wifi-enum-types.h" #include "nm-wifi-enum-types.h"
#include "nm-connection-provider.h" #include "nm-connection-provider.h"
static gboolean impl_device_get_access_points (NMDeviceWifi *device, #include "nmdbus-device-wifi.h"
GPtrArray **aps,
GError **err);
static gboolean impl_device_get_all_access_points (NMDeviceWifi *device,
GPtrArray **aps,
GError **err);
static void impl_device_request_scan (NMDeviceWifi *device,
GHashTable *options,
DBusGMethodInvocation *context);
#include "nm-device-wifi-glue.h"
#include "nm-device-logging.h" #include "nm-device-logging.h"
_LOG_DECLARE_SELF(NMDeviceWifi); _LOG_DECLARE_SELF(NMDeviceWifi);
@@ -1017,102 +1003,108 @@ get_sorted_ap_list (NMDeviceWifi *self)
return g_slist_sort (sorted, (GCompareFunc) ap_id_compare); return g_slist_sort (sorted, (GCompareFunc) ap_id_compare);
} }
static gboolean static void
impl_device_get_access_points (NMDeviceWifi *self, impl_device_wifi_get_access_points (NMDeviceWifi *self,
GPtrArray **aps, GDBusMethodInvocation *context)
GError **err)
{ {
GSList *sorted, *iter; GSList *sorted, *iter;
GPtrArray *paths;
*aps = g_ptr_array_new (); paths = g_ptr_array_new ();
sorted = get_sorted_ap_list (self); sorted = get_sorted_ap_list (self);
for (iter = sorted; iter; iter = iter->next) { for (iter = sorted; iter; iter = iter->next) {
NMAccessPoint *ap = NM_AP (iter->data); NMAccessPoint *ap = NM_AP (iter->data);
if (nm_ap_get_ssid (ap)) if (nm_ap_get_ssid (ap))
g_ptr_array_add (*aps, g_strdup (nm_exported_object_get_path (NM_EXPORTED_OBJECT (ap)))); g_ptr_array_add (paths, g_strdup (nm_exported_object_get_path (NM_EXPORTED_OBJECT (ap))));
} }
g_ptr_array_add (paths, NULL);
g_slist_free (sorted); g_slist_free (sorted);
return TRUE;
g_dbus_method_invocation_return_value (context, g_variant_new ("(^ao)", (char **) paths->pdata));
g_ptr_array_unref (paths);
} }
static gboolean static void
impl_device_get_all_access_points (NMDeviceWifi *self, impl_device_wifi_get_all_access_points (NMDeviceWifi *self,
GPtrArray **aps, GDBusMethodInvocation *context)
GError **err)
{ {
GSList *sorted, *iter; GSList *sorted, *iter;
GPtrArray *paths;
*aps = g_ptr_array_new (); paths = g_ptr_array_new ();
sorted = get_sorted_ap_list (self); sorted = get_sorted_ap_list (self);
for (iter = sorted; iter; iter = iter->next) for (iter = sorted; iter; iter = iter->next)
g_ptr_array_add (*aps, g_strdup (nm_exported_object_get_path (NM_EXPORTED_OBJECT (iter->data)))); g_ptr_array_add (paths, g_strdup (nm_exported_object_get_path (NM_EXPORTED_OBJECT (iter->data))));
g_ptr_array_add (paths, NULL);
g_slist_free (sorted); g_slist_free (sorted);
return TRUE;
g_dbus_method_invocation_return_value (context, g_variant_new ("(^ao)", (char **) paths->pdata));
g_ptr_array_unref (paths);
} }
static void static void
request_scan_cb (NMDevice *device, request_scan_cb (NMDevice *device,
DBusGMethodInvocation *context, GDBusMethodInvocation *context,
NMAuthSubject *subject, NMAuthSubject *subject,
GError *error, GError *error,
gpointer user_data) gpointer user_data)
{ {
NMDeviceWifi *self = NM_DEVICE_WIFI (device); NMDeviceWifi *self = NM_DEVICE_WIFI (device);
GError *local = NULL;
if (error) { if (error) {
dbus_g_method_return_error (context, error); g_dbus_method_invocation_return_gerror (context, error);
return; return;
} }
if (!check_scanning_allowed (self)) { if (!check_scanning_allowed (self)) {
local = g_error_new_literal (NM_DEVICE_ERROR, g_dbus_method_invocation_return_error_literal (context,
NM_DEVICE_ERROR,
NM_DEVICE_ERROR_NOT_ALLOWED, NM_DEVICE_ERROR_NOT_ALLOWED,
"Scanning not allowed at this time"); "Scanning not allowed at this time");
dbus_g_method_return_error (context, local);
g_error_free (local);
return; return;
} }
cancel_pending_scan (self); cancel_pending_scan (self);
request_wireless_scan (self); request_wireless_scan (self);
dbus_g_method_return (context); g_dbus_method_invocation_return_value (context, NULL);
} }
static void static void
impl_device_request_scan (NMDeviceWifi *self, impl_device_wifi_request_scan (NMDeviceWifi *self,
GHashTable *options, GDBusMethodInvocation *context,
DBusGMethodInvocation *context) GVariant *options)
{ {
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self); NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
NMDevice *device = NM_DEVICE (self); NMDevice *device = NM_DEVICE (self);
gint32 last_scan; gint32 last_scan;
GError *error;
if ( !priv->enabled if ( !priv->enabled
|| !priv->sup_iface || !priv->sup_iface
|| nm_device_get_state (device) < NM_DEVICE_STATE_DISCONNECTED || nm_device_get_state (device) < NM_DEVICE_STATE_DISCONNECTED
|| nm_device_is_activating (device)) { || nm_device_is_activating (device)) {
error = g_error_new_literal (NM_DEVICE_ERROR, g_dbus_method_invocation_return_error_literal (context,
NM_DEVICE_ERROR,
NM_DEVICE_ERROR_NOT_ALLOWED, NM_DEVICE_ERROR_NOT_ALLOWED,
"Scanning not allowed while unavailable or activating"); "Scanning not allowed while unavailable or activating");
goto error; return;
} }
if (nm_supplicant_interface_get_scanning (priv->sup_iface)) { if (nm_supplicant_interface_get_scanning (priv->sup_iface)) {
error = g_error_new_literal (NM_DEVICE_ERROR, g_dbus_method_invocation_return_error_literal (context,
NM_DEVICE_ERROR,
NM_DEVICE_ERROR_NOT_ALLOWED, NM_DEVICE_ERROR_NOT_ALLOWED,
"Scanning not allowed while already scanning"); "Scanning not allowed while already scanning");
goto error; return;
} }
last_scan = nm_supplicant_interface_get_last_scan_time (priv->sup_iface); last_scan = nm_supplicant_interface_get_last_scan_time (priv->sup_iface);
if (last_scan && (nm_utils_get_monotonic_timestamp_s () - last_scan) < 10) { if (last_scan && (nm_utils_get_monotonic_timestamp_s () - last_scan) < 10) {
error = g_error_new_literal (NM_DEVICE_ERROR, g_dbus_method_invocation_return_error_literal (context,
NM_DEVICE_ERROR,
NM_DEVICE_ERROR_NOT_ALLOWED, NM_DEVICE_ERROR_NOT_ALLOWED,
"Scanning not allowed immediately following previous scan"); "Scanning not allowed immediately following previous scan");
goto error; return;
} }
/* Ask the manager to authenticate this request for us */ /* Ask the manager to authenticate this request for us */
@@ -1124,11 +1116,6 @@ impl_device_request_scan (NMDeviceWifi *self,
TRUE, TRUE,
request_scan_cb, request_scan_cb,
NULL); NULL);
return;
error:
dbus_g_method_return_error (context, error);
g_error_free (error);
} }
static gboolean static gboolean
@@ -2922,11 +2909,12 @@ get_property (GObject *object, guint prop_id,
g_value_set_uint (value, priv->capabilities); g_value_set_uint (value, priv->capabilities);
break; break;
case PROP_ACCESS_POINTS: case PROP_ACCESS_POINTS:
array = g_ptr_array_sized_new (g_hash_table_size (priv->aps)); array = g_ptr_array_sized_new (g_hash_table_size (priv->aps) + 1);
g_hash_table_iter_init (&iter, priv->aps); g_hash_table_iter_init (&iter, priv->aps);
while (g_hash_table_iter_next (&iter, (gpointer) &dbus_path, NULL)) while (g_hash_table_iter_next (&iter, (gpointer) &dbus_path, NULL))
g_ptr_array_add (array, g_strdup (dbus_path)); g_ptr_array_add (array, g_strdup (dbus_path));
g_value_take_boxed (value, array); g_ptr_array_add (array, NULL);
g_value_take_boxed (value, (char **) g_ptr_array_free (array, FALSE));
break; break;
case PROP_ACTIVE_ACCESS_POINT: case PROP_ACTIVE_ACCESS_POINT:
nm_utils_g_value_set_object_path (value, priv->current_ap); nm_utils_g_value_set_object_path (value, priv->current_ap);
@@ -3011,14 +2999,14 @@ nm_device_wifi_class_init (NMDeviceWifiClass *klass)
g_object_class_install_property g_object_class_install_property
(object_class, PROP_ACCESS_POINTS, (object_class, PROP_ACCESS_POINTS,
g_param_spec_boxed (NM_DEVICE_WIFI_ACCESS_POINTS, "", "", g_param_spec_boxed (NM_DEVICE_WIFI_ACCESS_POINTS, "", "",
DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH, G_TYPE_STRV,
G_PARAM_READABLE | G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
g_object_class_install_property g_object_class_install_property
(object_class, PROP_ACTIVE_ACCESS_POINT, (object_class, PROP_ACTIVE_ACCESS_POINT,
g_param_spec_boxed (NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT, "", "", g_param_spec_string (NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT, "", "",
DBUS_TYPE_G_OBJECT_PATH, NULL,
G_PARAM_READABLE | G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
@@ -3044,7 +3032,7 @@ nm_device_wifi_class_init (NMDeviceWifiClass *klass)
G_STRUCT_OFFSET (NMDeviceWifiClass, access_point_added), G_STRUCT_OFFSET (NMDeviceWifiClass, access_point_added),
NULL, NULL, NULL, NULL, NULL, NULL,
G_TYPE_NONE, 1, G_TYPE_NONE, 1,
G_TYPE_OBJECT); NM_TYPE_AP);
signals[ACCESS_POINT_REMOVED] = signals[ACCESS_POINT_REMOVED] =
g_signal_new ("access-point-removed", g_signal_new ("access-point-removed",
@@ -3053,7 +3041,7 @@ nm_device_wifi_class_init (NMDeviceWifiClass *klass)
0, 0,
NULL, NULL, NULL, NULL, NULL, NULL,
G_TYPE_NONE, 1, G_TYPE_NONE, 1,
G_TYPE_OBJECT); NM_TYPE_AP);
signals[SCANNING_ALLOWED] = signals[SCANNING_ALLOWED] =
g_signal_new ("scanning-allowed", g_signal_new ("scanning-allowed",
@@ -3064,7 +3052,11 @@ nm_device_wifi_class_init (NMDeviceWifiClass *klass)
G_TYPE_BOOLEAN, 0); G_TYPE_BOOLEAN, 0);
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass), nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
&dbus_glib_nm_device_wifi_object_info); NMDBUS_TYPE_DEVICE_WIFI_SKELETON,
"GetAccessPoints", impl_device_wifi_get_access_points,
"GetAllAccessPoints", impl_device_wifi_get_all_access_points,
"RequestScan", impl_device_wifi_request_scan,
NULL);
} }

View File

@@ -33,7 +33,7 @@
#include "nm-setting-wireless.h" #include "nm-setting-wireless.h"
#include "nm-access-point-glue.h" #include "nmdbus-access-point.h"
/* /*
* Encapsulates Access Point information * Encapsulates Access Point information
@@ -46,7 +46,7 @@ typedef struct
GByteArray * ssid; GByteArray * ssid;
char * address; char * address;
NM80211Mode mode; NM80211Mode mode;
gint8 strength; guint8 strength;
guint32 freq; /* Frequency in MHz; ie 2412 (== 2.412 GHz) */ guint32 freq; /* Frequency in MHz; ie 2412 (== 2.412 GHz) */
guint32 max_bitrate;/* Maximum bitrate of the AP in Kbit/s (ie 54000 Kb/s == 54Mbit/s) */ guint32 max_bitrate;/* Maximum bitrate of the AP in Kbit/s (ie 54000 Kb/s == 54Mbit/s) */
@@ -902,9 +902,7 @@ get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec) GValue *value, GParamSpec *pspec)
{ {
NMAccessPointPrivate *priv = NM_AP_GET_PRIVATE (object); NMAccessPointPrivate *priv = NM_AP_GET_PRIVATE (object);
GArray * ssid; GVariant *ssid;
int len;
int i;
switch (prop_id) { switch (prop_id) {
case PROP_FLAGS: case PROP_FLAGS:
@@ -917,12 +915,12 @@ get_property (GObject *object, guint prop_id,
g_value_set_uint (value, priv->rsn_flags); g_value_set_uint (value, priv->rsn_flags);
break; break;
case PROP_SSID: case PROP_SSID:
len = priv->ssid ? priv->ssid->len : 0; if (priv->ssid) {
ssid = g_array_sized_new (FALSE, TRUE, sizeof (unsigned char), len); ssid = g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE,
for (i = 0; i < len; i++) priv->ssid->data, priv->ssid->len, 1);
g_array_append_val (ssid, priv->ssid->data[i]); } else
g_value_set_boxed (value, ssid); ssid = g_variant_new_array (G_VARIANT_TYPE_BYTE, NULL, 0);
g_array_free (ssid, TRUE); g_value_take_variant (value, ssid);
break; break;
case PROP_FREQUENCY: case PROP_FREQUENCY:
g_value_set_uint (value, priv->freq); g_value_set_uint (value, priv->freq);
@@ -937,7 +935,7 @@ get_property (GObject *object, guint prop_id,
g_value_set_uint (value, priv->max_bitrate); g_value_set_uint (value, priv->max_bitrate);
break; break;
case PROP_STRENGTH: case PROP_STRENGTH:
g_value_set_schar (value, priv->strength); g_value_set_uchar (value, priv->strength);
break; break;
case PROP_LAST_SEEN: case PROP_LAST_SEEN:
g_value_set_int (value, g_value_set_int (value,
@@ -1004,8 +1002,9 @@ nm_ap_class_init (NMAccessPointClass *ap_class)
g_object_class_install_property g_object_class_install_property
(object_class, PROP_SSID, (object_class, PROP_SSID,
g_param_spec_boxed (NM_AP_SSID, "", "", g_param_spec_variant (NM_AP_SSID, "", "",
DBUS_TYPE_G_UCHAR_ARRAY, G_VARIANT_TYPE ("ay"),
NULL,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property g_object_class_install_property
@@ -1034,8 +1033,8 @@ nm_ap_class_init (NMAccessPointClass *ap_class)
g_object_class_install_property g_object_class_install_property
(object_class, PROP_STRENGTH, (object_class, PROP_STRENGTH,
g_param_spec_char (NM_AP_STRENGTH, "", "", g_param_spec_uchar (NM_AP_STRENGTH, "", "",
G_MININT8, G_MAXINT8, 0, 0, G_MAXINT8, 0,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property g_object_class_install_property
@@ -1045,6 +1044,7 @@ nm_ap_class_init (NMAccessPointClass *ap_class)
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (ap_class), nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (ap_class),
&dbus_glib_nm_access_point_object_info); NMDBUS_TYPE_ACCESS_POINT_SKELETON,
NULL);
} }

View File

@@ -1,4 +1,5 @@
AM_CPPFLAGS = \ AM_CPPFLAGS = \
-I$(top_builddir)/introspection \
-I$(top_srcdir)/include \ -I$(top_srcdir)/include \
-I$(top_srcdir)/libnm-core \ -I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \ -I$(top_builddir)/libnm-core \
@@ -9,8 +10,7 @@ AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\""NetworkManager-wifi"\" \ -DG_LOG_DOMAIN=\""NetworkManager-wifi"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \ -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \ $(GLIB_CFLAGS)
$(DBUS_CFLAGS)
noinst_PROGRAMS = test-wifi-ap-utils noinst_PROGRAMS = test-wifi-ap-utils

View File

@@ -24,7 +24,6 @@
#include "nm-default.h" #include "nm-default.h"
#include "nm-wifi-ap-utils.h" #include "nm-wifi-ap-utils.h"
#include "nm-dbus-glib-types.h"
#include "nm-core-internal.h" #include "nm-core-internal.h"

View File

@@ -8,13 +8,14 @@ AM_CPPFLAGS = \
-I${top_srcdir}/src/devices \ -I${top_srcdir}/src/devices \
-I${top_srcdir}/src/settings \ -I${top_srcdir}/src/settings \
-I${top_srcdir}/src/platform \ -I${top_srcdir}/src/platform \
-I${top_builddir}/introspection \
-I${top_srcdir}/include \ -I${top_srcdir}/include \
-I${top_builddir}/libnm-core \ -I${top_builddir}/libnm-core \
-I${top_srcdir}/libnm-core \ -I${top_srcdir}/libnm-core \
-DG_LOG_DOMAIN=\""NetworkManager-wwan"\" \ -DG_LOG_DOMAIN=\""NetworkManager-wwan"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \ -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \
$(MM_GLIB_CFLAGS) $(MM_GLIB_CFLAGS)
BUILT_SOURCES = $(null) BUILT_SOURCES = $(null)
@@ -45,31 +46,29 @@ WWAN_SYMBOL_VIS_FILE=$(srcdir)/wwan-exports.ver
libnm_wwan_la_LDFLAGS = \ libnm_wwan_la_LDFLAGS = \
-avoid-version \ -avoid-version \
-Wl,--version-script=$(WWAN_SYMBOL_VIS_FILE) -Wl,--version-script=$(WWAN_SYMBOL_VIS_FILE)
libnm_wwan_la_LIBADD = $(DBUS_LIBS) $(MM_GLIB_LIBS) libnm_wwan_la_LIBADD = \
$(top_builddir)/introspection/libnmdbus.la \
$(GLIB_LIBS) \
$(MM_GLIB_LIBS)
########################################################### ###########################################################
nm-device-modem-glue.h: $(top_srcdir)/introspection/nm-device-modem.xml
dbus-binding-tool --prefix=nm_device_modem --mode=glib-server --output=$@ $<
BUILT_SOURCES += nm-device-modem-glue.h
SYMBOL_VIS_FILE=$(srcdir)/exports.ver SYMBOL_VIS_FILE=$(srcdir)/exports.ver
libnm_device_plugin_wwan_la_SOURCES = \ libnm_device_plugin_wwan_la_SOURCES = \
nm-wwan-factory.c \ nm-wwan-factory.c \
nm-wwan-factory.h \ nm-wwan-factory.h \
nm-device-modem.c \ nm-device-modem.c \
nm-device-modem.h \ nm-device-modem.h
nm-device-modem-glue.h
libnm_device_plugin_wwan_la_LDFLAGS = \ libnm_device_plugin_wwan_la_LDFLAGS = \
-module -avoid-version \ -module -avoid-version \
-Wl,--version-script=$(SYMBOL_VIS_FILE) -Wl,--version-script=$(SYMBOL_VIS_FILE)
libnm_device_plugin_wwan_la_LIBADD = \ libnm_device_plugin_wwan_la_LIBADD = \
$(top_builddir)/introspection/libnmdbus.la \
libnm-wwan.la \ libnm-wwan.la \
$(DBUS_LIBS) $(GLIB_LIBS)
########################################################### ###########################################################

View File

@@ -35,12 +35,12 @@
#include "nm-device-logging.h" #include "nm-device-logging.h"
_LOG_DECLARE_SELF(NMDeviceModem); _LOG_DECLARE_SELF(NMDeviceModem);
#include "nmdbus-device-modem.h"
G_DEFINE_TYPE (NMDeviceModem, nm_device_modem, NM_TYPE_DEVICE) G_DEFINE_TYPE (NMDeviceModem, nm_device_modem, NM_TYPE_DEVICE)
#define NM_DEVICE_MODEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_MODEM, NMDeviceModemPrivate)) #define NM_DEVICE_MODEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_MODEM, NMDeviceModemPrivate))
#include "nm-device-modem-glue.h"
typedef struct { typedef struct {
NMModem *modem; NMModem *modem;
NMDeviceModemCapabilities caps; NMDeviceModemCapabilities caps;
@@ -794,5 +794,6 @@ nm_device_modem_class_init (NMDeviceModemClass *mclass)
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (mclass), nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (mclass),
&dbus_glib_nm_device_modem_object_info); NMDBUS_TYPE_DEVICE_MODEM_SKELETON,
NULL);
} }

View File

@@ -28,7 +28,6 @@
#include "nm-default.h" #include "nm-default.h"
#include "NetworkManagerUtils.h" #include "NetworkManagerUtils.h"
#include "nm-device-private.h" #include "nm-device-private.h"
#include "nm-dbus-glib-types.h"
#include "nm-modem-enum-types.h" #include "nm-modem-enum-types.h"
#include "nm-route-manager.h" #include "nm-route-manager.h"

View File

@@ -461,7 +461,7 @@ get_property (GObject *object, guint prop_id,
device = nm_active_connection_get_device (NM_ACTIVE_CONNECTION (object)); device = nm_active_connection_get_device (NM_ACTIVE_CONNECTION (object));
if (!device) { if (!device) {
g_value_set_boxed (value, "/"); g_value_set_string (value, "/");
return; return;
} }

View File

@@ -24,13 +24,13 @@
#include "nm-default.h" #include "nm-default.h"
#include "nm-active-connection.h" #include "nm-active-connection.h"
#include "nm-dbus-interface.h" #include "nm-dbus-interface.h"
#include "nm-dbus-glib-types.h"
#include "nm-device.h" #include "nm-device.h"
#include "nm-settings-connection.h" #include "nm-settings-connection.h"
#include "nm-auth-utils.h" #include "nm-auth-utils.h"
#include "nm-auth-subject.h" #include "nm-auth-subject.h"
#include "NetworkManagerUtils.h" #include "NetworkManagerUtils.h"
#include "nm-active-connection-glue.h"
#include "nmdbus-active-connection.h"
/* Base class for anything implementing the Connection.Active D-Bus interface */ /* Base class for anything implementing the Connection.Active D-Bus interface */
G_DEFINE_ABSTRACT_TYPE (NMActiveConnection, nm_active_connection, NM_TYPE_EXPORTED_OBJECT) G_DEFINE_ABSTRACT_TYPE (NMActiveConnection, nm_active_connection, NM_TYPE_EXPORTED_OBJECT)
@@ -586,7 +586,7 @@ nm_active_connection_get_assumed (NMActiveConnection *self)
static void static void
auth_done (NMAuthChain *chain, auth_done (NMAuthChain *chain,
GError *error, GError *error,
DBusGMethodInvocation *unused, GDBusMethodInvocation *unused,
gpointer user_data) gpointer user_data)
{ {
NMActiveConnection *self = NM_ACTIVE_CONNECTION (user_data); NMActiveConnection *self = NM_ACTIVE_CONNECTION (user_data);
@@ -720,10 +720,10 @@ set_property (GObject *object, guint prop_id,
nm_active_connection_set_master (NM_ACTIVE_CONNECTION (object), g_value_get_object (value)); nm_active_connection_set_master (NM_ACTIVE_CONNECTION (object), g_value_get_object (value));
break; break;
case PROP_SPECIFIC_OBJECT: case PROP_SPECIFIC_OBJECT:
tmp = g_value_get_boxed (value); tmp = g_value_get_string (value);
/* NM uses "/" to mean NULL */ /* NM uses "/" to mean NULL */
if (g_strcmp0 (tmp, "/") != 0) if (g_strcmp0 (tmp, "/") != 0)
priv->specific_object = g_value_dup_boxed (value); priv->specific_object = g_strdup (tmp);
break; break;
case PROP_DEFAULT: case PROP_DEFAULT:
priv->is_default = !!g_value_get_boolean (value); priv->is_default = !!g_value_get_boolean (value);
@@ -752,7 +752,7 @@ get_property (GObject *object, guint prop_id,
switch (prop_id) { switch (prop_id) {
case PROP_CONNECTION: case PROP_CONNECTION:
g_value_set_boxed (value, nm_connection_get_path (priv->connection)); g_value_set_string (value, nm_connection_get_path (priv->connection));
break; break;
case PROP_ID: case PROP_ID:
g_value_set_string (value, nm_connection_get_id (priv->connection)); g_value_set_string (value, nm_connection_get_id (priv->connection));
@@ -764,13 +764,14 @@ get_property (GObject *object, guint prop_id,
g_value_set_string (value, nm_connection_get_connection_type (priv->connection)); g_value_set_string (value, nm_connection_get_connection_type (priv->connection));
break; break;
case PROP_SPECIFIC_OBJECT: case PROP_SPECIFIC_OBJECT:
g_value_set_boxed (value, priv->specific_object ? priv->specific_object : "/"); g_value_set_string (value, priv->specific_object ? priv->specific_object : "/");
break; break;
case PROP_DEVICES: case PROP_DEVICES:
devices = g_ptr_array_sized_new (1); devices = g_ptr_array_sized_new (2);
if (priv->device && priv->state < NM_ACTIVE_CONNECTION_STATE_DEACTIVATED) if (priv->device && priv->state < NM_ACTIVE_CONNECTION_STATE_DEACTIVATED)
g_ptr_array_add (devices, g_strdup (nm_exported_object_get_path (NM_EXPORTED_OBJECT (priv->device)))); g_ptr_array_add (devices, g_strdup (nm_exported_object_get_path (NM_EXPORTED_OBJECT (priv->device))));
g_value_take_boxed (value, devices); g_ptr_array_add (devices, NULL);
g_value_take_boxed (value, (char **) g_ptr_array_free (devices, FALSE));
break; break;
case PROP_STATE: case PROP_STATE:
if (priv->state_set) if (priv->state_set)
@@ -787,19 +788,19 @@ get_property (GObject *object, guint prop_id,
break; break;
case PROP_IP4_CONFIG: case PROP_IP4_CONFIG:
/* The IP and DHCP config properties may be overridden by a subclass */ /* The IP and DHCP config properties may be overridden by a subclass */
g_value_set_boxed (value, "/"); g_value_set_string (value, "/");
break; break;
case PROP_DHCP4_CONFIG: case PROP_DHCP4_CONFIG:
g_value_set_boxed (value, "/"); g_value_set_string (value, "/");
break; break;
case PROP_DEFAULT6: case PROP_DEFAULT6:
g_value_set_boolean (value, priv->is_default6); g_value_set_boolean (value, priv->is_default6);
break; break;
case PROP_IP6_CONFIG: case PROP_IP6_CONFIG:
g_value_set_boxed (value, "/"); g_value_set_string (value, "/");
break; break;
case PROP_DHCP6_CONFIG: case PROP_DHCP6_CONFIG:
g_value_set_boxed (value, "/"); g_value_set_string (value, "/");
break; break;
case PROP_VPN: case PROP_VPN:
g_value_set_boolean (value, priv->vpn); g_value_set_boolean (value, priv->vpn);
@@ -888,8 +889,8 @@ nm_active_connection_class_init (NMActiveConnectionClass *ac_class)
/* D-Bus exported properties */ /* D-Bus exported properties */
g_object_class_install_property g_object_class_install_property
(object_class, PROP_CONNECTION, (object_class, PROP_CONNECTION,
g_param_spec_boxed (NM_ACTIVE_CONNECTION_CONNECTION, "", "", g_param_spec_string (NM_ACTIVE_CONNECTION_CONNECTION, "", "",
DBUS_TYPE_G_OBJECT_PATH, NULL,
G_PARAM_READABLE | G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
@@ -916,15 +917,15 @@ nm_active_connection_class_init (NMActiveConnectionClass *ac_class)
g_object_class_install_property g_object_class_install_property
(object_class, PROP_SPECIFIC_OBJECT, (object_class, PROP_SPECIFIC_OBJECT,
g_param_spec_boxed (NM_ACTIVE_CONNECTION_SPECIFIC_OBJECT, "", "", g_param_spec_string (NM_ACTIVE_CONNECTION_SPECIFIC_OBJECT, "", "",
DBUS_TYPE_G_OBJECT_PATH, NULL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
g_object_class_install_property g_object_class_install_property
(object_class, PROP_DEVICES, (object_class, PROP_DEVICES,
g_param_spec_boxed (NM_ACTIVE_CONNECTION_DEVICES, "", "", g_param_spec_boxed (NM_ACTIVE_CONNECTION_DEVICES, "", "",
DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH, G_TYPE_STRV,
G_PARAM_READABLE | G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
@@ -946,15 +947,15 @@ nm_active_connection_class_init (NMActiveConnectionClass *ac_class)
g_object_class_install_property g_object_class_install_property
(object_class, PROP_IP4_CONFIG, (object_class, PROP_IP4_CONFIG,
g_param_spec_boxed (NM_ACTIVE_CONNECTION_IP4_CONFIG, "", "", g_param_spec_string (NM_ACTIVE_CONNECTION_IP4_CONFIG, "", "",
DBUS_TYPE_G_OBJECT_PATH, NULL,
G_PARAM_READABLE | G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
g_object_class_install_property g_object_class_install_property
(object_class, PROP_DHCP4_CONFIG, (object_class, PROP_DHCP4_CONFIG,
g_param_spec_boxed (NM_ACTIVE_CONNECTION_DHCP4_CONFIG, "", "", g_param_spec_string (NM_ACTIVE_CONNECTION_DHCP4_CONFIG, "", "",
DBUS_TYPE_G_OBJECT_PATH, NULL,
G_PARAM_READABLE | G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
@@ -967,15 +968,15 @@ nm_active_connection_class_init (NMActiveConnectionClass *ac_class)
g_object_class_install_property g_object_class_install_property
(object_class, PROP_IP6_CONFIG, (object_class, PROP_IP6_CONFIG,
g_param_spec_boxed (NM_ACTIVE_CONNECTION_IP6_CONFIG, "", "", g_param_spec_string (NM_ACTIVE_CONNECTION_IP6_CONFIG, "", "",
DBUS_TYPE_G_OBJECT_PATH, NULL,
G_PARAM_READABLE | G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
g_object_class_install_property g_object_class_install_property
(object_class, PROP_DHCP6_CONFIG, (object_class, PROP_DHCP6_CONFIG,
g_param_spec_boxed (NM_ACTIVE_CONNECTION_DHCP6_CONFIG, "", "", g_param_spec_string (NM_ACTIVE_CONNECTION_DHCP6_CONFIG, "", "",
DBUS_TYPE_G_OBJECT_PATH, NULL,
G_PARAM_READABLE | G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
@@ -988,8 +989,8 @@ nm_active_connection_class_init (NMActiveConnectionClass *ac_class)
g_object_class_install_property g_object_class_install_property
(object_class, PROP_MASTER, (object_class, PROP_MASTER,
g_param_spec_boxed (NM_ACTIVE_CONNECTION_MASTER, "", "", g_param_spec_string (NM_ACTIVE_CONNECTION_MASTER, "", "",
DBUS_TYPE_G_OBJECT_PATH, NULL,
G_PARAM_READABLE | G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
@@ -1045,6 +1046,7 @@ nm_active_connection_class_init (NMActiveConnectionClass *ac_class)
G_TYPE_NONE, 1, G_TYPE_UINT); G_TYPE_NONE, 1, G_TYPE_UINT);
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (ac_class), nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (ac_class),
&dbus_glib_nm_active_connection_object_info); NMDBUS_TYPE_ACTIVE_CONNECTION_SKELETON,
NULL);
} }

View File

@@ -34,7 +34,6 @@
#include "nm-ip6-config.h" #include "nm-ip6-config.h"
#include "nm-platform.h" #include "nm-platform.h"
#include "nm-active-connection.h" #include "nm-active-connection.h"
#include "nm-dbus-glib-types.h"
#include "NetworkManagerUtils.h" #include "NetworkManagerUtils.h"
#include "settings/nm-settings-connection.h" #include "settings/nm-settings-connection.h"
#include "nm-dispatcher.h" #include "nm-dispatcher.h"
@@ -44,7 +43,7 @@
#include "nm-route-manager.h" #include "nm-route-manager.h"
#include "nm-firewall-manager.h" #include "nm-firewall-manager.h"
#include "nm-vpn-connection-glue.h" #include "nmdbus-vpn-connection.h"
G_DEFINE_TYPE (NMVpnConnection, nm_vpn_connection, NM_TYPE_ACTIVE_CONNECTION) G_DEFINE_TYPE (NMVpnConnection, nm_vpn_connection, NM_TYPE_ACTIVE_CONNECTION)
@@ -2354,6 +2353,7 @@ nm_vpn_connection_class_init (NMVpnConnectionClass *connection_class)
G_TYPE_NONE, 0); G_TYPE_NONE, 0);
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (connection_class), nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (connection_class),
&dbus_glib_nm_vpn_connection_object_info); NMDBUS_TYPE_VPN_CONNECTION_SKELETON,
NULL);
} }