summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2019-03-05 08:44:57 +0100
committerLubomir Rintel <lkundrak@v3.sk>2019-03-19 17:15:15 +0100
commit1de8383ad9fdfc8f552117e5d109bdfa7005634b (patch)
tree7b44996c8430157f2739b18148952859ea9e6b5f
parent32e0bf1421263b07a1dde74d9281253cc1ea49ab (diff)
all: goodbye libnm-glib
This removes libnm-glib, libnm-glib-vpn, and libnm-util for good. The it has been replaced with libnm since NetworkManager 1.0, disabled by default since 1.12 and no up-to-date distributions ship it for years now. Removing the libraries allows us to: * Remove the horrible hacks that were in place to deal with accidental use of both the new and old library in a single process. * Relief the translators of maintenance burden of similar yet different strings. * Get rid of known bad code without chances of ever getting fixed (libnm-glib/nm-object.c and libnm-glib/nm-object-cache.c) * Generally lower the footprint of the releases and our workspace If there are some really really legacy users; they can just build libnm-glib and friends from the NetworkManager-1.16 distribution. The D-Bus API is stable and old libnm-glib will keep working forever. https://github.com/NetworkManager/NetworkManager/pull/308
-rw-r--r--.travis.yml1
-rw-r--r--Makefile.am725
-rw-r--r--NEWS3
-rwxr-xr-xautogen.sh2
-rw-r--r--config.h.meson3
-rw-r--r--configure.ac36
-rwxr-xr-xcontrib/fedora/REQUIRED_PACKAGES1
-rw-r--r--contrib/fedora/rpm/NetworkManager.spec97
-rwxr-xr-xcontrib/scripts/nm-ci-run.sh2
-rw-r--r--docs/libnm-glib/Makefile.am79
-rw-r--r--docs/libnm-glib/libnm-glib-docs.xml117
-rw-r--r--docs/libnm-glib/libnm-glib.pngbin82140 -> 0 bytes
-rw-r--r--docs/libnm-glib/libnm-glib.svg893
-rw-r--r--docs/libnm-glib/libnm-glib.types55
-rw-r--r--docs/libnm-glib/meson.build39
-rw-r--r--docs/libnm-glib/version.xml.in1
-rw-r--r--docs/libnm-util/Makefile.am74
-rw-r--r--docs/libnm-util/libnm-util-docs.sgml96
-rw-r--r--docs/libnm-util/meson.build32
-rw-r--r--docs/libnm-util/version.xml.in1
-rw-r--r--docs/meson.build5
-rw-r--r--libnm-core/nm-setting.c15
-rw-r--r--libnm-glib/libnm-glib-test.c426
-rw-r--r--libnm-glib/libnm-glib-vpn.pc.in13
-rw-r--r--libnm-glib/libnm-glib-vpn.ver29
-rw-r--r--libnm-glib/libnm-glib.pc.in13
-rw-r--r--libnm-glib/libnm-glib.ver309
-rw-r--r--libnm-glib/libnm_glib.c580
-rw-r--r--libnm-glib/libnm_glib.h58
-rw-r--r--libnm-glib/meson.build286
-rw-r--r--libnm-glib/nm-access-point.c720
-rw-r--r--libnm-glib/nm-access-point.h98
-rw-r--r--libnm-glib/nm-active-connection.c851
-rw-r--r--libnm-glib/nm-active-connection.h105
-rw-r--r--libnm-glib/nm-client.c2514
-rw-r--r--libnm-glib/nm-client.h269
-rw-r--r--libnm-glib/nm-dbus-helpers-private.h33
-rw-r--r--libnm-glib/nm-dbus-helpers.c47
-rw-r--r--libnm-glib/nm-device-adsl.c245
-rw-r--r--libnm-glib/nm-device-adsl.h75
-rw-r--r--libnm-glib/nm-device-bond.c346
-rw-r--r--libnm-glib/nm-device-bond.h82
-rw-r--r--libnm-glib/nm-device-bridge.c358
-rw-r--r--libnm-glib/nm-device-bridge.h84
-rw-r--r--libnm-glib/nm-device-bt.c372
-rw-r--r--libnm-glib/nm-device-bt.h90
-rw-r--r--libnm-glib/nm-device-ethernet.c391
-rw-r--r--libnm-glib/nm-device-ethernet.h87
-rw-r--r--libnm-glib/nm-device-generic.c310
-rw-r--r--libnm-glib/nm-device-generic.h79
-rw-r--r--libnm-glib/nm-device-infiniband.c310
-rw-r--r--libnm-glib/nm-device-infiniband.h82
-rw-r--r--libnm-glib/nm-device-modem.c290
-rw-r--r--libnm-glib/nm-device-modem.h79
-rw-r--r--libnm-glib/nm-device-olpc-mesh.c325
-rw-r--r--libnm-glib/nm-device-olpc-mesh.h81
-rw-r--r--libnm-glib/nm-device-private.h27
-rw-r--r--libnm-glib/nm-device-team.c352
-rw-r--r--libnm-glib/nm-device-team.h85
-rw-r--r--libnm-glib/nm-device-vlan.c390
-rw-r--r--libnm-glib/nm-device-vlan.h89
-rw-r--r--libnm-glib/nm-device-wifi.c837
-rw-r--r--libnm-glib/nm-device-wifi.h115
-rw-r--r--libnm-glib/nm-device-wimax.c795
-rw-r--r--libnm-glib/nm-device-wimax.h109
-rw-r--r--libnm-glib/nm-device.c2375
-rw-r--r--libnm-glib/nm-device.h191
-rw-r--r--libnm-glib/nm-dhcp4-config.c218
-rw-r--r--libnm-glib/nm-dhcp4-config.h66
-rw-r--r--libnm-glib/nm-dhcp6-config.c218
-rw-r--r--libnm-glib/nm-dhcp6-config.h66
-rw-r--r--libnm-glib/nm-glib-enum-types.c.template62
-rw-r--r--libnm-glib/nm-glib-enum-types.h.template21
-rw-r--r--libnm-glib/nm-ip4-config.c472
-rw-r--r--libnm-glib/nm-ip4-config.h79
-rw-r--r--libnm-glib/nm-ip6-config.c498
-rw-r--r--libnm-glib/nm-ip6-config.h81
-rw-r--r--libnm-glib/nm-object-cache.c90
-rw-r--r--libnm-glib/nm-object-cache.h35
-rw-r--r--libnm-glib/nm-object-private.h93
-rw-r--r--libnm-glib/nm-object.c1576
-rw-r--r--libnm-glib/nm-object.h91
-rw-r--r--libnm-glib/nm-remote-connection-private.h33
-rw-r--r--libnm-glib/nm-remote-connection.c954
-rw-r--r--libnm-glib/nm-remote-connection.h148
-rw-r--r--libnm-glib/nm-remote-settings.c1569
-rw-r--r--libnm-glib/nm-remote-settings.h159
-rw-r--r--libnm-glib/nm-secret-agent.c1052
-rw-r--r--libnm-glib/nm-secret-agent.h307
-rw-r--r--libnm-glib/nm-types-private.h33
-rw-r--r--libnm-glib/nm-types.c375
-rw-r--r--libnm-glib/nm-types.h54
-rw-r--r--libnm-glib/nm-vpn-connection.c270
-rw-r--r--libnm-glib/nm-vpn-connection.h73
-rw-r--r--libnm-glib/nm-vpn-enum-types.c.template37
-rw-r--r--libnm-glib/nm-vpn-enum-types.h.template21
-rw-r--r--libnm-glib/nm-vpn-plugin-ui-interface.c246
-rw-r--r--libnm-glib/nm-vpn-plugin-ui-interface.h271
-rw-r--r--libnm-glib/nm-vpn-plugin-utils.c189
-rw-r--r--libnm-glib/nm-vpn-plugin-utils.h39
-rw-r--r--libnm-glib/nm-vpn-plugin.c1041
-rw-r--r--libnm-glib/nm-vpn-plugin.h175
-rw-r--r--libnm-glib/nm-wimax-nsp.c331
-rw-r--r--libnm-glib/nm-wimax-nsp.h91
-rw-r--r--libnm-glib/tests/meson.build30
-rw-r--r--libnm-glib/tests/test-nm-client.c1156
-rw-r--r--libnm-glib/tests/test-remote-settings-client.c470
-rw-r--r--libnm-util/COPYING488
-rw-r--r--libnm-util/NetworkManager.h555
-rw-r--r--libnm-util/NetworkManagerVPN.h294
-rw-r--r--libnm-util/crypto.c749
-rw-r--r--libnm-util/crypto.h141
-rw-r--r--libnm-util/crypto_gnutls.c465
-rw-r--r--libnm-util/crypto_nss.c555
-rw-r--r--libnm-util/libnm-util.pc.in13
-rw-r--r--libnm-util/libnm-util.ver671
-rw-r--r--libnm-util/meson.build217
-rw-r--r--libnm-util/nm-connection.c2212
-rw-r--r--libnm-util/nm-connection.h256
-rw-r--r--libnm-util/nm-dbus-glib-types.h45
-rw-r--r--libnm-util/nm-gvaluearray-compat.h104
-rw-r--r--libnm-util/nm-param-spec-specialized.c973
-rw-r--r--libnm-util/nm-param-spec-specialized.h41
-rw-r--r--libnm-util/nm-setting-8021x.c3730
-rw-r--r--libnm-util/nm-setting-8021x.h294
-rw-r--r--libnm-util/nm-setting-adsl.c462
-rw-r--r--libnm-util/nm-setting-adsl.h96
-rw-r--r--libnm-util/nm-setting-bluetooth.c298
-rw-r--r--libnm-util/nm-setting-bluetooth.h100
-rw-r--r--libnm-util/nm-setting-bond.c834
-rw-r--r--libnm-util/nm-setting-bond.h120
-rw-r--r--libnm-util/nm-setting-bridge-port.c279
-rw-r--r--libnm-util/nm-setting-bridge-port.h86
-rw-r--r--libnm-util/nm-setting-bridge.c576
-rw-r--r--libnm-util/nm-setting-bridge.h102
-rw-r--r--libnm-util/nm-setting-cdma.c347
-rw-r--r--libnm-util/nm-setting-cdma.h87
-rw-r--r--libnm-util/nm-setting-connection.c1332
-rw-r--r--libnm-util/nm-setting-connection.h151
-rw-r--r--libnm-util/nm-setting-dcb.c1219
-rw-r--r--libnm-util/nm-setting-dcb.h185
-rw-r--r--libnm-util/nm-setting-generic.c100
-rw-r--r--libnm-util/nm-setting-generic.h78
-rw-r--r--libnm-util/nm-setting-gsm.c714
-rw-r--r--libnm-util/nm-setting-gsm.h204
-rw-r--r--libnm-util/nm-setting-infiniband.c474
-rw-r--r--libnm-util/nm-setting-infiniband.h85
-rw-r--r--libnm-util/nm-setting-ip4-config.c1853
-rw-r--r--libnm-util/nm-setting-ip4-config.h235
-rw-r--r--libnm-util/nm-setting-ip6-config.c1776
-rw-r--r--libnm-util/nm-setting-ip6-config.h258
-rw-r--r--libnm-util/nm-setting-olpc-mesh.c275
-rw-r--r--libnm-util/nm-setting-olpc-mesh.h82
-rw-r--r--libnm-util/nm-setting-ppp.c822
-rw-r--r--libnm-util/nm-setting-ppp.h115
-rw-r--r--libnm-util/nm-setting-pppoe.c342
-rw-r--r--libnm-util/nm-setting-pppoe.h87
-rw-r--r--libnm-util/nm-setting-private.h125
-rw-r--r--libnm-util/nm-setting-serial.c319
-rw-r--r--libnm-util/nm-setting-serial.h89
-rw-r--r--libnm-util/nm-setting-team-port.c197
-rw-r--r--libnm-util/nm-setting-team-port.h79
-rw-r--r--libnm-util/nm-setting-team.c254
-rw-r--r--libnm-util/nm-setting-team.h81
-rw-r--r--libnm-util/nm-setting-vlan.c852
-rw-r--r--libnm-util/nm-setting-vlan.h164
-rw-r--r--libnm-util/nm-setting-vpn.c922
-rw-r--r--libnm-util/nm-setting-vpn.h121
-rw-r--r--libnm-util/nm-setting-wimax.c278
-rw-r--r--libnm-util/nm-setting-wimax.h78
-rw-r--r--libnm-util/nm-setting-wired.c1029
-rw-r--r--libnm-util/nm-setting-wired.h131
-rw-r--r--libnm-util/nm-setting-wireless-security.c1552
-rw-r--r--libnm-util/nm-setting-wireless-security.h178
-rw-r--r--libnm-util/nm-setting-wireless.c1286
-rw-r--r--libnm-util/nm-setting-wireless.h177
-rw-r--r--libnm-util/nm-setting.c1505
-rw-r--r--libnm-util/nm-setting.h334
-rw-r--r--libnm-util/nm-utils-enum-types.c.template65
-rw-r--r--libnm-util/nm-utils-enum-types.h.template21
-rw-r--r--libnm-util/nm-utils-private.h34
-rw-r--r--libnm-util/nm-utils.c2608
-rw-r--r--libnm-util/nm-utils.h190
-rw-r--r--libnm-util/nm-value-transforms.c593
-rw-r--r--libnm-util/nm-version.h149
-rw-r--r--libnm-util/tests/meson.build45
-rw-r--r--libnm-util/tests/test-crypto.c403
-rw-r--r--libnm-util/tests/test-general.c2560
-rw-r--r--libnm-util/tests/test-libnm-linking.c45
-rw-r--r--libnm-util/tests/test-secrets.c684
-rw-r--r--libnm-util/tests/test-setting-8021x.c407
-rw-r--r--libnm-util/tests/test-setting-dcb.c319
-rw-r--r--libnm-util/tests/test-settings-defaults.c127
-rw-r--r--libnm/fake-typelib/NMClient.gir9
-rw-r--r--libnm/fake-typelib/NetworkManager.gir10
-rw-r--r--libnm/fake-typelib/meson.build30
-rw-r--r--libnm/fake-typelib/typelibs.gresource.xml7
-rw-r--r--libnm/meson.build5
-rw-r--r--libnm/nm-libnm-utils.c82
-rw-r--r--meson.build37
-rw-r--r--meson_options.txt1
-rw-r--r--po/POTFILES.in31
-rw-r--r--shared/nm-default.h20
-rw-r--r--shared/nm-test-libnm-utils.h27
-rw-r--r--shared/nm-test-utils-impl.c139
-rw-r--r--shared/nm-utils/nm-test-utils.h8
-rwxr-xr-xtools/run-nm-test.sh2
-rwxr-xr-xtools/test-build.sh2
-rw-r--r--valgrind.suppressions2
-rw-r--r--vapi/NMClient-1.0.metadata121
-rw-r--r--vapi/NetworkManager-1.0.metadata164
-rw-r--r--vapi/libnm-glib.deps3
-rw-r--r--vapi/libnm-util.deps2
-rw-r--r--vapi/meson.build22
214 files changed, 11 insertions, 74760 deletions
diff --git a/.travis.yml b/.travis.yml
index 6dd6ae049..ca6b370cd 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -12,7 +12,6 @@ addons:
- libtool
- pkg-config
- intltool
- - libdbus-glib-1-dev
- libdbus-1-dev
- libiw-dev
- libglib2.0-dev
diff --git a/Makefile.am b/Makefile.am
index 7064eb15c..e322b4499 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -97,12 +97,6 @@ SUBDIRS += \
docs/libnm \
docs/api
-if WITH_LEGACY_LIBRARIES
-SUBDIRS += \
- docs/libnm-util \
- docs/libnm-glib
-endif
-
endif
dflt_cppflags = -std=gnu11
@@ -160,7 +154,6 @@ check_so_symbols = \
DISTCHECK_CONFIGURE_FLAGS = \
--enable-tests=yes \
--with-valgrind=no \
- --with-libnm-glib=yes \
--enable-gtk-doc \
--enable-more-warnings=error \
--with-udev-dir=$$dc_install_base/lib/udev \
@@ -172,14 +165,11 @@ DISTCHECK_CONFIGURE_FLAGS = \
$(NULL)
dist-configure-check:
- @echo "*** 'make dist' requires '--enable-gtk-doc --enable-introspection --with-libnm-glib'. ***"
+ @echo "*** 'make dist' requires '--enable-gtk-doc --enable-introspection'. ***"
@false
if !BUILD_DOCS
dist_configure_check += dist-configure-check
endif
-if !WITH_LEGACY_LIBRARIES
-dist_configure_check += dist-configure-check
-endif
dist: $(dist_configure_check) $(dist_dependencies)
@@ -187,12 +177,6 @@ DISTCLEANFILES += intltool-extract intltool-merge intltool-update
###############################################################################
-if WITH_LEGACY_LIBRARIES
-pkgconfig_DATA += NetworkManager.pc
-endif
-
-###############################################################################
-
polkit_policydir = $(datadir)/polkit-1/actions
dist_polkit_policy_in_in_files = \
@@ -1267,36 +1251,6 @@ libnm/libnm.typelib: libnm/libnm.gir
INTROSPECTION_GIRS += libnm/NM-1.0.gir
-if WITH_FAKE_TYPELIBS
-
-libnm/fake-typelib/NetworkManager.typelib: libnm/fake-typelib/NetworkManager.gir libnm/fake-typelib/.dirstamp
- $(AM_V_GEN) $(INTROSPECTION_COMPILER) $< -o $@
-
-libnm/fake-typelib/NMClient.typelib: libnm/fake-typelib/NMClient.gir libnm/fake-typelib/.dirstamp
- $(AM_V_GEN) $(INTROSPECTION_COMPILER) $< -o $@
-
-libnm/fake-typelib/typelibs.c: libnm/fake-typelib/typelibs.gresource.xml libnm/fake-typelib/NetworkManager.typelib libnm/fake-typelib/NMClient.typelib
- $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< --target=$@ --sourcedir=$(builddir)/libnm/fake-typelib --generate-source --manual-register
-
-nodist_libnm_libnm_utils_la_SOURCES = \
- libnm/fake-typelib/typelibs.c
-
-CLEANFILES += \
- libnm/fake-typelib/typelibs.c \
- libnm/fake-typelib/NMClient.typelib \
- libnm/fake-typelib/NetworkManager.typelib
-endif
-
-endif
-
-EXTRA_DIST += \
- libnm/fake-typelib/NetworkManager.gir \
- libnm/fake-typelib/NMClient.gir \
- libnm/fake-typelib/typelibs.gresource.xml \
- libnm/fake-typelib/meson.build
-
-if HAVE_INTROSPECTION
-
libnm_noinst_data = \
libnm/nm-property-docs.xml \
libnm/nm-settings-docs-overrides.xml \
@@ -4383,660 +4337,6 @@ CLEANFILES += \
data/server.conf
###############################################################################
-# libnm-util
-###############################################################################
-
-if WITH_LEGACY_LIBRARIES
-
-lib_LTLIBRARIES += libnm-util/libnm-util.la
-
-libnm_util_libnm_util_includedir=$(includedir)/NetworkManager
-
-libnm_util_cppflags = \
- $(dflt_cppflags) \
- -I$(srcdir)/libnm-util \
- -I$(builddir)/libnm-util \
- -I$(srcdir)/shared \
- -I$(builddir)/shared \
- -DG_LOG_DOMAIN=\""libnm-util"\" \
- -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_UTIL \
- $(GLIB_CFLAGS) \
- $(DBUS_CFLAGS) \
- $(UUID_CFLAGS)
-
-libnm_util_lib_h_pub_real = \
- shared/nm-version-macros.h \
- libnm-util/NetworkManager.h \
- libnm-util/NetworkManagerVPN.h \
- libnm-util/nm-connection.h \
- libnm-util/nm-setting.h \
- libnm-util/nm-setting-8021x.h \
- libnm-util/nm-setting-adsl.h \
- libnm-util/nm-setting-bluetooth.h \
- libnm-util/nm-setting-bond.h \
- libnm-util/nm-setting-team.h \
- libnm-util/nm-setting-team-port.h \
- libnm-util/nm-setting-bridge.h \
- libnm-util/nm-setting-bridge-port.h \
- libnm-util/nm-setting-connection.h \
- libnm-util/nm-setting-dcb.h \
- libnm-util/nm-setting-infiniband.h \
- libnm-util/nm-setting-ip4-config.h \
- libnm-util/nm-setting-vlan.h \
- libnm-util/nm-setting-ip6-config.h \
- libnm-util/nm-setting-ppp.h \
- libnm-util/nm-setting-pppoe.h \
- libnm-util/nm-setting-serial.h \
- libnm-util/nm-setting-generic.h \
- libnm-util/nm-setting-gsm.h \
- libnm-util/nm-setting-cdma.h \
- libnm-util/nm-setting-olpc-mesh.h \
- libnm-util/nm-setting-wimax.h \
- libnm-util/nm-setting-wired.h \
- libnm-util/nm-setting-wireless.h \
- libnm-util/nm-setting-wireless-security.h \
- libnm-util/nm-setting-vpn.h \
- libnm-util/nm-utils.h \
- libnm-util/nm-version.h
-libnm_util_lib_h_pub_mkenums = \
- libnm-util/nm-utils-enum-types.h
-libnm_util_lib_h_priv = \
- libnm-util/crypto.h \
- libnm-util/nm-dbus-glib-types.h \
- libnm-util/nm-gvaluearray-compat.h \
- libnm-util/nm-param-spec-specialized.h \
- libnm-util/nm-setting-private.h \
- libnm-util/nm-utils-private.h
-
-libnm_util_libnm_util_include_HEADERS = \
- $(libnm_util_lib_h_pub_real)
-
-nodist_libnm_util_libnm_util_include_HEADERS = \
- $(libnm_util_lib_h_pub_mkenums)
-
-libnm_util_lib_c_real = \
- libnm-util/crypto.c \
- libnm-util/nm-connection.c \
- libnm-util/nm-param-spec-specialized.c \
- libnm-util/nm-setting.c \
- libnm-util/nm-setting-8021x.c \
- libnm-util/nm-setting-adsl.c \
- libnm-util/nm-setting-bluetooth.c \
- libnm-util/nm-setting-bond.c \
- libnm-util/nm-setting-team.c \
- libnm-util/nm-setting-team-port.c \
- libnm-util/nm-setting-bridge.c \
- libnm-util/nm-setting-bridge-port.c \
- libnm-util/nm-setting-connection.c \
- libnm-util/nm-setting-dcb.c \
- libnm-util/nm-setting-infiniband.c \
- libnm-util/nm-setting-ip4-config.c \
- libnm-util/nm-setting-vlan.c \
- libnm-util/nm-setting-ip6-config.c \
- libnm-util/nm-setting-ppp.c \
- libnm-util/nm-setting-pppoe.c \
- libnm-util/nm-setting-serial.c \
- libnm-util/nm-setting-generic.c \
- libnm-util/nm-setting-gsm.c \
- libnm-util/nm-setting-cdma.c \
- libnm-util/nm-setting-olpc-mesh.c \
- libnm-util/nm-setting-wimax.c \
- libnm-util/nm-setting-wired.c \
- libnm-util/nm-setting-wireless.c \
- libnm-util/nm-setting-wireless-security.c \
- libnm-util/nm-setting-vpn.c \
- libnm-util/nm-utils.c \
- libnm-util/nm-value-transforms.c
-libnm_util_lib_c_mkenums = \
- libnm-util/nm-utils-enum-types.c
-
-libnm_util_libnm_util_la_SOURCES = \
- $(libnm_util_lib_c_real) \
- $(libnm_util_lib_h_pub_real) \
- $(libnm_util_lib_h_priv)
-
-nodist_libnm_util_libnm_util_la_SOURCES = \
- $(libnm_util_lib_h_pub_mkenums) \
- $(libnm_util_lib_c_mkenums)
-
-$(libnm_util_libnm_util_la_OBJECTS): $(libnm_util_lib_h_pub_mkenums)
-
-libnm_util_libnm_util_la_CPPFLAGS = $(libnm_util_cppflags)
-
-
-GLIB_GENERATED += \
- $(libnm_util_lib_h_pub_mkenums) \
- $(libnm_util_lib_c_mkenums)
-nm_utils_enum_types_sources = $(filter-out libnm-util/NetworkManager%,$(libnm_util_lib_h_pub_real))
-
-$(libnm_util_libnm_util_la_OBJECTS): $(libnm_util_lib_h_pub_mkenums)
-
-libnm_util_libnm_util_la_LIBADD = \
- shared/nm-utils/libnm-utils-base.la \
- $(GLIB_LIBS) \
- $(DBUS_LIBS) \
- $(UUID_LIBS)
-
-libnm_util_libnm_util_la_LDFLAGS = \
- -Wl,--version-script=$(srcdir)/libnm-util/libnm-util.ver \
- -version-info "9:0:7"
-
-if WITH_GNUTLS
-libnm_util_cppflags += $(GNUTLS_CFLAGS)
-libnm_util_lib_c_real += libnm-util/crypto_gnutls.c
-libnm_util_libnm_util_la_LIBADD += $(GNUTLS_LIBS)
-endif
-
-if WITH_NSS
-libnm_util_cppflags += $(NSS_CFLAGS)
-libnm_util_lib_c_real += libnm-util/crypto_nss.c
-libnm_util_libnm_util_la_LIBADD += $(NSS_LIBS)
-endif
-
-EXTRA_DIST += \
- libnm-util/crypto_gnutls.c \
- libnm-util/crypto_nss.c
-
-check_ltlibraries += libnm-util/libtest-crypto.la
-
-libnm_util_libtest_crypto_la_SOURCES = \
- libnm-util/crypto.c
-libnm_util_libtest_crypto_la_CPPFLAGS = $(libnm_util_cppflags)
-libnm_util_libtest_crypto_la_LIBADD = \
- $(GLIB_LIBS)
-
-if WITH_GNUTLS
-libnm_util_libtest_crypto_la_SOURCES += libnm-util/crypto_gnutls.c
-libnm_util_libtest_crypto_la_LIBADD += $(GNUTLS_LIBS)
-endif
-
-if WITH_NSS
-libnm_util_libtest_crypto_la_SOURCES += libnm-util/crypto_nss.c
-libnm_util_libtest_crypto_la_LIBADD += $(NSS_LIBS)
-endif
-
-pkgconfig_DATA += libnm-util/libnm-util.pc
-
-DISTCLEANFILES += libnm-util/libnm-util.pc
-
-EXTRA_DIST += \
- libnm-util/COPYING \
- libnm-util/libnm-util.pc.in \
- libnm-util/libnm-util.ver \
- libnm-util/nm-utils-enum-types.c.template \
- libnm-util/nm-utils-enum-types.h.template \
- libnm-util/meson.build
-
-if HAVE_INTROSPECTION
-libnm-util/NetworkManager-1.0.gir: libnm-util/libnm-util.la
-libnm_util_NetworkManager_1_0_gir_INCLUDES = GObject-2.0 DBusGLib-1.0
-libnm_util_NetworkManager_1_0_gir_PACKAGES = gobject-2.0 dbus-glib-1
-libnm_util_NetworkManager_1_0_gir_EXPORT_PACKAGES = libnm-util
-libnm_util_NetworkManager_1_0_gir_CFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/libnm-util
-libnm_util_NetworkManager_1_0_gir_LIBS = libnm-util/libnm-util.la
-libnm_util_NetworkManager_1_0_gir_FILES = \
- $(libnm_util_lib_h_pub_mkenums) \
- $(libnm_util_lib_h_pub_real) \
- $(libnm_util_lib_c_mkenums) \
- $(libnm_util_lib_c_real)
-libnm_util_NetworkManager_1_0_gir_SCANNERFLAGS = \
- -I$(srcdir)/shared \
- -I$(builddir)/shared \
- -I$(srcdir)/libnm-util \
- -I$(builddir)/libnm-util \
- --warn-all --identifier-prefix=NM --symbol-prefix=nm
-
-libnm-util/NetworkManager-1.0.typelib: libnm-util/NetworkManager-1.0.gir
- $(INTROSPECTION_COMPILER) "--includedir=$(srcdir)/libnm-util" "--includedir=$(builddir)/libnm-util" $< -o $@
-
-INTROSPECTION_GIRS += libnm-util/NetworkManager-1.0.gir
-endif
-
-check-local-exports-libnm-util: libnm-util/libnm-util.la
- $(srcdir)/tools/check-exports.sh "$(builddir)/libnm-util/.libs/libnm-util.so" "$(srcdir)/libnm-util/libnm-util.ver"
-
-check_local += check-local-exports-libnm-util
-
-dist_dependencies += libnm-util/libnm-util.la
-
-###############################################################################
-# libnm-util/tests
-###############################################################################
-
-libnm_util_tests_cppflags = \
- $(dflt_cppflags) \
- -I$(srcdir)/shared \
- -I$(builddir)/shared \
- -I$(srcdir)/libnm-util \
- -I$(builddir)/libnm-util \
- $(GLIB_CFLAGS) \
- $(DBUS_CFLAGS) \
- -DNETWORKMANAGER_COMPILATION_TEST \
- -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_UTIL \
- $(SANITIZER_EXEC_CFLAGS) \
- $(NULL)
-
-libnm_util_tests_ldadd = \
- libnm-util/libnm-util.la \
- $(GLIB_LIBS) \
- $(DBUS_LIBS)
-
-libnm_util_tests_ldflags = \
- $(SANITIZER_EXEC_LDFLAGS)
-
-check_programs += \
- libnm-util/tests/test-settings-defaults \
- libnm-util/tests/test-crypto \
- libnm-util/tests/test-secrets \
- libnm-util/tests/test-general \
- libnm-util/tests/test-setting-8021x \
- libnm-util/tests/test-setting-dcb
-
-check_programs_norun += \
- libnm-util/tests/test-libnm-linking
-
-libnm_util_tests_test_settings_defaults_CPPFLAGS = $(libnm_util_tests_cppflags)
-libnm_util_tests_test_settings_defaults_LDADD = $(libnm_util_tests_ldadd)
-libnm_util_tests_test_settings_defaults_LDFLAGS = $(libnm_util_tests_ldflags)
-
-libnm_util_tests_test_crypto_CPPFLAGS = $(libnm_util_tests_cppflags)
-libnm_util_tests_test_crypto_LDADD = \
- libnm-util/libtest-crypto.la \
- $(libnm_util_tests_ldadd)
-libnm_util_tests_test_crypto_LDFLAGS = $(libnm_util_tests_ldflags)
-
-libnm_util_tests_test_secrets_CPPFLAGS = $(libnm_util_tests_cppflags)
-libnm_util_tests_test_secrets_LDADD = $(libnm_util_tests_ldadd)
-libnm_util_tests_test_secrets_LDFLAGS = $(libnm_util_tests_ldflags)
-
-libnm_util_tests_test_general_DEPENDENCIES = libnm-util/tests/test-libnm-linking
-libnm_util_tests_test_general_CPPFLAGS = $(libnm_util_tests_cppflags)
-libnm_util_tests_test_general_LDADD = $(libnm_util_tests_ldadd)
-libnm_util_tests_test_general_LDFLAGS = $(libnm_util_tests_ldflags)
-
-libnm_util_tests_test_setting_8021x_CPPFLAGS = $(libnm_util_tests_cppflags)
-libnm_util_tests_test_setting_8021x_LDADD = $(libnm_util_tests_ldadd)
-libnm_util_tests_test_setting_8021x_LDFLAGS = $(libnm_util_tests_ldflags)
-
-libnm_util_tests_test_setting_dcb_CPPFLAGS = $(libnm_util_tests_cppflags)
-libnm_util_tests_test_setting_dcb_LDADD = $(libnm_util_tests_ldadd)
-libnm_util_tests_test_setting_dcb_LDFLAGS = $(libnm_util_tests_ldflags)
-
-libnm_util_tests_test_libnm_linking_CPPFLAGS = $(libnm_util_tests_cppflags)
-libnm_util_tests_test_libnm_linking_LDADD = \
- libnm/libnm.la \
- $(libnm_util_tests_ldadd)
-libnm_util_tests_test_libnm_linking_LDFLAGS = $(libnm_util_tests_ldflags)
-
-$(libnm_util_tests_test_settings_defaults_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
-$(libnm_util_tests_test_crypto_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
-$(libnm_util_tests_test_secrets_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
-$(libnm_util_tests_test_general_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
-$(libnm_util_tests_test_setting_8021x_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
-$(libnm_util_tests_test_setting_dcb_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
-$(libnm_util_tests_test_libnm_linking_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
-
-EXTRA_DIST += \
- libnm-util/tests/meson.build
-
-###############################################################################
-# libnm-glib
-###############################################################################
-
-libnm_glib_cppflags = \
- $(dflt_cppflags) \
- -I$(srcdir)/shared \
- -I$(builddir)/shared \
- -I$(srcdir)/libnm-util \
- -I$(builddir)/libnm-util \
- -I$(srcdir)/libnm-glib \
- -I$(builddir)/libnm-glib \
- -DG_LOG_DOMAIN=\""libnm-glib"\" \
- -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_GLIB \
- $(DBUS_CFLAGS) \
- $(GLIB_CFLAGS)
-
-
-noinst_LTLIBRARIES += libnm-glib/libdeprecated-nm-glib.la
-
-libnm_glib_libdeprecated_nm_glib_la_SOURCES = \
- libnm-glib/libnm_glib.h \
- libnm-glib/libnm_glib.c
-
-libnm_glib_libdeprecated_nm_glib_la_CPPFLAGS = \
- $(libnm_glib_cppflags) \
- -Wno-deprecated-declarations \
- -Wno-deprecated
-
-libnm_glib_libdeprecated_nm_glib_la_LIBADD = \
- $(DBUS_LIBS) \
- $(GLIB_LIBS)
-
-libdeprecateddir = $(includedir)/libnm-glib
-libdeprecated_HEADERS = \
- libnm-glib/libnm_glib.h
-
-
-lib_LTLIBRARIES += libnm-glib/libnm-glib.la
-
-libnm_glib_libnmincludedir = $(includedir)/libnm-glib
-libnm_glib_libnmvpndir = $(includedir)/libnm-glib
-
-libnm_glib_lib_h_pub_real = \
- libnm-glib/nm-object.h \
- libnm-glib/nm-client.h \
- libnm-glib/nm-device.h \
- libnm-glib/nm-device-ethernet.h \
- libnm-glib/nm-device-infiniband.h \
- libnm-glib/nm-device-adsl.h \
- libnm-glib/nm-device-wifi.h \
- libnm-glib/nm-device-bt.h \
- libnm-glib/nm-device-olpc-mesh.h \
- libnm-glib/nm-device-bond.h \
- libnm-glib/nm-device-team.h \
- libnm-glib/nm-device-bridge.h \
- libnm-glib/nm-device-vlan.h \
- libnm-glib/nm-device-generic.h \
- libnm-glib/nm-access-point.h \
- libnm-glib/nm-ip4-config.h \
- libnm-glib/nm-device-modem.h \
- libnm-glib/nm-vpn-connection.h \
- libnm-glib/nm-types.h \
- libnm-glib/nm-active-connection.h \
- libnm-glib/nm-dhcp4-config.h \
- libnm-glib/nm-ip6-config.h \
- libnm-glib/nm-dhcp6-config.h \
- libnm-glib/nm-remote-connection.h \
- libnm-glib/nm-remote-settings.h \
- libnm-glib/nm-secret-agent.h \
- libnm-glib/nm-device-wimax.h \
- libnm-glib/nm-wimax-nsp.h
-libnm_glib_lib_h_pub_mkenums = \
- libnm-glib/nm-glib-enum-types.h
-libnm_glib_lib_h_priv = \
- libnm-glib/nm-object-private.h \
- libnm-glib/nm-device-private.h \
- libnm-glib/nm-types-private.h \
- libnm-glib/nm-object-cache.h \
- libnm-glib/nm-remote-connection-private.h \
- libnm-glib/nm-dbus-helpers-private.h
-
-libnm_glib_libnminclude_HEADERS = \
- $(libnm_glib_lib_h_pub_real)
-nodist_libnm_glib_libnminclude_HEADERS = \
- $(libnm_glib_lib_h_pub_mkenums)
-
-libnm_glib_vpn_h_real = \
- libnm-glib/nm-vpn-plugin.h \
- libnm-glib/nm-vpn-plugin-ui-interface.h \
- libnm-glib/nm-vpn-plugin-utils.h
-libnm_glib_vpn_h_mkenums = \
- libnm-glib/nm-vpn-enum-types.h
-
-libnm_glib_libnmvpn_HEADERS = \
- $(libnm_glib_vpn_h_real)
-
-nodist_libnm_glib_libnmvpn_HEADERS = \
- $(libnm_glib_vpn_h_mkenums)
-
-libnm_glib_lib_c_real = \
- libnm-glib/nm-object.c \
- libnm-glib/nm-dbus-helpers.c \
- libnm-glib/nm-client.c \
- libnm-glib/nm-device.c \
- libnm-glib/nm-device-ethernet.c \
- libnm-glib/nm-device-infiniband.c \
- libnm-glib/nm-device-adsl.c \
- libnm-glib/nm-device-wifi.c \
- libnm-glib/nm-device-bt.c \
- libnm-glib/nm-device-olpc-mesh.c \
- libnm-glib/nm-device-bond.c \
- libnm-glib/nm-device-team.c \
- libnm-glib/nm-device-bridge.c \
- libnm-glib/nm-device-vlan.c \
- libnm-glib/nm-device-generic.c \
- libnm-glib/nm-access-point.c \
- libnm-glib/nm-ip4-config.c \
- libnm-glib/nm-device-modem.c \
- libnm-glib/nm-vpn-connection.c \
- libnm-glib/nm-types.c \
- libnm-glib/nm-object-cache.c \
- libnm-glib/nm-active-connection.c \
- libnm-glib/nm-dhcp4-config.c \
- libnm-glib/nm-ip6-config.c \
- libnm-glib/nm-dhcp6-config.c \
- libnm-glib/nm-remote-connection.c \
- libnm-glib/nm-remote-settings.c \
- libnm-glib/nm-secret-agent.c \
- libnm-glib/nm-device-wimax.c \
- libnm-glib/nm-wimax-nsp.c
-libnm_glib_lib_c_mkenums = \
- libnm-glib/nm-glib-enum-types.c
-
-libnm_glib_libnm_glib_la_SOURCES = \
- $(libnm_glib_lib_c_real) \
- $(libnm_glib_lib_h_pub_real) \
- $(libnm_glib_lib_h_priv)
-
-nodist_libnm_glib_libnm_glib_la_SOURCES = \
- $(libnm_glib_lib_c_mkenums) \
- $(libnm_glib_lib_h_pub_mkenums)
-
-libnm_glib_libnm_glib_la_CPPFLAGS = \
- $(libnm_glib_cppflags) \
- $(LIBUDEV_CFLAGS) \
- $(NULL)
-
-libnm_glib_libnm_glib_la_LDFLAGS = \
- -Wl,--version-script=$(srcdir)/libnm-glib/libnm-glib.ver \
- -version-info "13:0:9"
-
-libnm_glib_libnm_glib_la_LIBADD = \
- libnm-util/libnm-util.la \
- libnm-glib/libdeprecated-nm-glib.la \
- shared/nm-utils/libnm-utils-udev.la \
- $(GLIB_LIBS) \
- $(DBUS_LIBS) \
- $(LIBUDEV_LIBS) \
- $(NULL)
-
-$(libnm_glib_libnm_glib_la_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
-
-GLIB_GENERATED += \
- $(libnm_glib_lib_h_pub_mkenums) \
- $(libnm_glib_lib_c_mkenums)
-nm_glib_enum_types_sources = $(libnm_glib_lib_h_pub_real)
-
-$(libnm_glib_libnm_glib_la_OBJECTS): $(libnm_glib_lib_h_pub_mkenums)
-
-check_programs_norun += libnm-glib/libnm-glib-test
-
-libnm_glib_libnm_glib_test_CFLAGS = $(libnm_glib_cppflags)
-libnm_glib_libnm_glib_test_LDADD = \
- libnm-glib/libnm-glib.la \
- libnm-util/libnm-util.la \
- $(GLIB_LIBS) \
- $(DBUS_LIBS)
-$(libnm_glib_libnm_glib_test_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
-
-lib_LTLIBRARIES += libnm-glib/libnm-glib-vpn.la
-
-libnm_glib_vpn_c_real = \
- libnm-glib/nm-vpn-plugin.c \
- libnm-glib/nm-vpn-plugin-ui-interface.c \
- libnm-glib/nm-vpn-plugin-utils.c
-libnm_glib_vpn_c_mkenums = \
- libnm-glib/nm-vpn-enum-types.c
-libnm_glib_libnm_glib_vpn_la_SOURCES = \
- $(libnm_glib_vpn_c_real)
-nodist_libnm_glib_libnm_glib_vpn_la_SOURCES = \
- $(libnm_glib_vpn_c_mkenums)
-libnm_glib_libnm_glib_vpn_la_CPPFLAGS = $(libnm_glib_cppflags)
-libnm_glib_libnm_glib_vpn_la_LIBADD = \
- libnm-util/libnm-util.la \
- $(GLIB_LIBS) \
- $(DBUS_LIBS)
-libnm_glib_libnm_glib_vpn_la_LDFLAGS = \
- -Wl,--version-script=$(srcdir)/libnm-glib/libnm-glib-vpn.ver \
- -version-info "3:0:2"
-$(libnm_glib_libnm_glib_vpn_la_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
-
-
-GLIB_GENERATED += \
- $(libnm_glib_vpn_h_mkenums) \
- $(libnm_glib_vpn_c_mkenums)
-nm_vpn_enum_types_sources = $(libnm_glib_vpn_h_real)
-
-$(libnm_glib_libnm_glib_vpn_la_OBJECTS): $(libnm_glib_vpn_h_mkenums)
-
-libnm-glib/nm-vpn-plugin-glue.h: introspection/org.freedesktop.NetworkManager.VPN.Plugin.xml
- $(AM_V_GEN) dbus-binding-tool --prefix=nm_vpn_plugin --mode=glib-server --output=$@ $<
-
-libnm-glib/nm-secret-agent-glue.h: introspection/org.freedesktop.NetworkManager.SecretAgent.xml
- $(AM_V_GEN) dbus-binding-tool --prefix=nm_secret_agent --mode=glib-server --output=$@ $<
-
-CLEANFILES += \
- libnm-glib/nm-vpn-plugin-glue.h \
- libnm-glib/nm-secret-agent-glue.h
-
-$(libnm_glib_libnm_glib_vpn_la_OBJECTS): libnm-glib/nm-vpn-plugin-glue.h
-$(libnm_glib_libnm_glib_la_OBJECTS): libnm-glib/nm-secret-agent-glue.h
-
-
-pkgconfig_DATA += \
- libnm-glib/libnm-glib.pc \
- libnm-glib/libnm-glib-vpn.pc
-
-DISTCLEANFILES += \
- libnm-glib/libnm-glib.pc \
- libnm-glib/libnm-glib.pc
-
-EXTRA_DIST += \
- libnm-glib/libnm-glib.pc.in \
- libnm-glib/libnm-glib-vpn.pc.in \
- libnm-glib/libnm-glib.ver \
- libnm-glib/libnm-glib-vpn.ver \
- libnm-glib/nm-vpn-enum-types.c.template \
- libnm-glib/nm-vpn-enum-types.h.template \
- libnm-glib/nm-glib-enum-types.c.template \
- libnm-glib/nm-glib-enum-types.h.template \
- libnm-glib/meson.build
-
-if HAVE_INTROSPECTION
-libnm-glib/NMClient-1.0.gir: libnm-glib/libnm-glib.la $(builddir)/libnm-util/NetworkManager-1.0.gir
-libnm_glib_NMClient_1_0_gir_INCLUDES = Gio-2.0 DBusGLib-1.0
-libnm_glib_NMClient_1_0_gir_PACKAGES = gio-2.0 dbus-glib-1
-libnm_glib_NMClient_1_0_gir_EXPORT_PACKAGES = libnm-glib libnm-glib-vpn
-libnm_glib_NMClient_1_0_gir_CFLAGS = $(libnm_glib_cppflags)
-libnm_glib_NMClient_1_0_gir_LIBS = \
- libnm-glib/libnm-glib.la \
- libnm-util/libnm-util.la
-libnm_glib_NMClient_1_0_gir_FILES = \
- $(libnm_glib_lib_h_pub_mkenums) \
- $(libnm_glib_lib_h_pub_real) \
- $(libnm_glib_lib_c_mkenums) \
- $(libnm_glib_lib_c_real)
-libnm_glib_NMClient_1_0_gir_SCANNERFLAGS = \
- -I$(srcdir)/libnm-util \
- -I$(builddir)/libnm-util \
- -I$(srcdir)/libnm-glib \
- -I$(builddir)/libnm-glib \
- --warn-all --identifier-prefix=NM --symbol-prefix=nm \
- --include-uninstalled=$(builddir)/libnm-util/NetworkManager-1.0.gir
-
-libnm-glib/NMClient-1.0.typelib: libnm-glib/NMClient-1.0.gir
- $(INTROSPECTION_COMPILER) "--includedir=$(srcdir)/libnm-util" "--includedir=$(builddir)/libnm-util" $< -o $@
-
-INTROSPECTION_GIRS += libnm-glib/NMClient-1.0.gir
-endif
-
-check-local-exports-libnm-glib:
- $(srcdir)/tools/check-exports.sh $(builddir)/libnm-glib/.libs/libnm-glib.so $(srcdir)/libnm-glib/libnm-glib.ver
-
-check_local += check-local-exports-libnm-glib
-
-dist_dependencies += \
- libnm-glib/libnm-glib.la \
- libnm-glib/libnm-glib-vpn.la
-
-###############################################################################
-# libnm-glib/tests
-###############################################################################
-
-libnm_glib_tests_cppflags = \
- $(dflt_cppflags) \
- -I$(srcdir)/shared \
- -I$(builddir)/shared \
- -I$(srcdir)/libnm-util \
- -I$(builddir)/libnm-util \
- -I$(srcdir)/libnm-glib \
- -DNETWORKMANAGER_COMPILATION_TEST \
- -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_GLIB \
- $(GLIB_CFLAGS) \
- $(DBUS_CFLAGS) \
- $(NULL)
-
-if HAVE_INTROSPECTION
-check-local-libnm-glib-nm-client: libnm-glib/tests/test-nm-client
- ( $(LOG_COMPILER) "$(builddir)/libnm-glib/tests/test-nm-client"; r="$$?"; test "$$r" = 0 -o "$$r" = 77 ) || \
- ( $(LOG_COMPILER) "$(builddir)/libnm-glib/tests/test-nm-client"; r="$$?"; test "$$r" = 0 -o "$$r" = 77 ) || \
- ( $(LOG_COMPILER) "$(builddir)/libnm-glib/tests/test-nm-client"; r="$$?"; test "$$r" = 0 -o "$$r" = 77 ) || \
- ( $(LOG_COMPILER) "$(builddir)/libnm-glib/tests/test-nm-client"; r="$$?"; test "$$r" = 0 -o "$$r" = 77 ) || \
- ( $(LOG_COMPILER) "$(builddir)/libnm-glib/tests/test-nm-client"; r="$$?"; test "$$r" = 0 -o "$$r" = 77 ) || \
- false
-
-check_local += check-local-libnm-glib-nm-client
-endif
-check_programs_norun += libnm-glib/tests/test-nm-client
-
-if HAVE_INTROSPECTION
-check_programs += libnm-glib/tests/test-remote-settings-client
-else
-check_programs_norun += libnm-glib/tests/test-remote-settings-client
-endif
-
-libnm_glib_tests_test_nm_client_CPPFLAGS = $(libnm_glib_tests_cppflags)
-
-libnm_glib_tests_test_nm_client_SOURCES = \
- shared/nm-test-utils-impl.c \
- shared/nm-test-libnm-utils.h \
- libnm-glib/tests/test-nm-client.c
-
-libnm_glib_tests_test_nm_client_LDADD = \
- libnm-util/libnm-util.la \
- libnm-glib/libnm-glib.la \
- $(GLIB_LIBS) \
- $(DBUS_LIBS)
-
-$(libnm_glib_tests_test_nm_client_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
-
-
-libnm_glib_tests_test_remote_settings_client_CPPFLAGS = $(libnm_glib_tests_cppflags)
-
-libnm_glib_tests_test_remote_settings_client_SOURCES = \
- shared/nm-test-utils-impl.c \
- shared/nm-test-libnm-utils.h \
- libnm-glib/tests/test-remote-settings-client.c
-
-libnm_glib_tests_test_remote_settings_client_LDADD = \
- libnm-util/libnm-util.la \
- libnm-glib/libnm-glib.la \
- $(GLIB_LIBS) \
- $(DBUS_LIBS)
-
-$(libnm_glib_tests_test_remote_settings_client_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
-
-# tools/test-networkmanager-service.py uses libnm's typelib. Ensure it
-# is built first.
-$(libnm_glib_tests_test_nm_client_OBJECTS): $(libnm_NM_1_0_typelib)
-$(libnm_glib_tests_test_remote_settings_client_OBJECTS): $(libnm_NM_1_0_typelib)
-
-endif
-
-EXTRA_DIST += \
- libnm-glib/tests/meson.build
-
-###############################################################################
# man
###############################################################################
@@ -5160,29 +4460,12 @@ if ENABLE_VAPIGEN
VAPIGEN_VAPIS += \
vapi/libnm.vapi
-if WITH_LEGACY_LIBRARIES
-VAPIGEN_VAPIS += \
- vapi/libnm-util.vapi \
- vapi/libnm-glib.vapi
-endif
-
vapi/libnm.vapi: $(builddir)/libnm/NM-1.0.gir vapi/libnm.deps vapi/NM-1.0.metadata
-vapi/libnm-util.vapi: $(builddir)/libnm-util/NetworkManager-1.0.gir vapi/libnm-util.deps vapi/NetworkManager-1.0.metadata
-vapi/libnm-glib.vapi: $(builddir)/libnm-glib/NMClient-1.0.gir vapi/libnm-glib.deps vapi/NMClient-1.0.metadata vapi/libnm-util.vapi
vapi_libnm_vapi_METADATADIRS = $(srcdir)/vapi
vapi_libnm_vapi_FILES = $(builddir)/libnm/NM-1.0.gir
vapi_libnm_vapi_DEPS = gio-2.0
-vapi_libnm_util_vapi_METADATADIRS = $(srcdir)/vapi
-vapi_libnm_util_vapi_FILES = $(builddir)/libnm-util/NetworkManager-1.0.gir
-
-vapi_libnm_glib_vapi_METADATADIRS = $(srcdir)/vapi
-vapi_libnm_glib_vapi_FILES = $(builddir)/libnm-glib/NMClient-1.0.gir
-vapi_libnm_glib_vapi_VAPIDIRS = $(builddir)/vapi
-vapi_libnm_glib_vapi_GIRDIRS = $(builddir)/libnm-util
-vapi_libnm_glib_vapi_DEPS = gio-2.0 dbus-glib-1 libnm-util
-
vapi_DATA += \
$(VAPIGEN_VAPIS) \
$(VAPIGEN_VAPIS:.vapi=.deps)
@@ -5193,11 +4476,7 @@ endif
EXTRA_DIST += \
vapi/NM-1.0.metadata \
- vapi/NetworkManager-1.0.metadata \
- vapi/NMClient-1.0.metadata \
vapi/libnm.deps \
- vapi/libnm-util.deps \
- vapi/libnm-glib.deps \
vapi/meson.build
###############################################################################
@@ -5322,7 +4601,7 @@ uninstall-hook: $(uninstall_hook)
###############################################################################
cscope:
- cscope -b -q -R -sshared -ssrc -slibnm-core -slibnm -slibnm-glib -slibnm-util -sclients;
+ cscope -b -q -R -sshared -ssrc -slibnm-core -slibnm -sclients;
###############################################################################
diff --git a/NEWS b/NEWS
index e060a3d90..b5476a19a 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,9 @@ The API is subject to change and not guaranteed to be compatible
with the later release.
USE AT YOUR OWN RISK. NOT RECOMMENDED FOR PRODUCTION USE!
+* The libnm-glib library, deprecated in favor of libnm since NetworkManager 1.0,
+ and disabled by default since NetworkManager 1.12 has now been removed.
+
=============================================
NetworkManager-1.16
Overview of changes since NetworkManager-1.14
diff --git a/autogen.sh b/autogen.sh
index 836bb6030..9bb029488 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -28,5 +28,5 @@ AUTOPOINT='intltoolize --automake --copy' autoreconf --force --install --verbose
cd $olddir
if test -z "$NOCONFIGURE"; then
- exec $srcdir/configure --enable-maintainer-mode --enable-more-warnings=error --enable-gtk-doc --enable-introspection --with-libnm-glib "$@"
+ exec $srcdir/configure --enable-maintainer-mode --enable-more-warnings=error --enable-gtk-doc --enable-introspection "$@"
fi
diff --git a/config.h.meson b/config.h.meson
index c8f980552..957e428f8 100644
--- a/config.h.meson
+++ b/config.h.meson
@@ -197,9 +197,6 @@
/* Define if you have dhcpcd */
#mesondefine WITH_DHCPCD
-/* Define for libnm to prevent GIR from loading libnm-glib */
-#mesondefine WITH_FAKE_TYPELIBS
-
/* Define if JANSSON is enabled */
#mesondefine WITH_JANSSON
diff --git a/configure.ac b/configure.ac
index 1c00e4b81..334d9272d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -256,34 +256,6 @@ AC_SUBST(GLIB_LIBS)
GOBJECT_INTROSPECTION_CHECK([0.9.6])
-AC_ARG_WITH(libnm-glib,
- AS_HELP_STRING([--with-libnm-glib],
- [build legacy libraries]))
-fake_typelibs=no
-if test "$with_libnm_glib" == "yes"; then
- PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.1 dbus-glib-1 >= 0.94, :,
- [AC_MSG_FAILURE([$DBUS_PKG_ERRORS
-
-Configure with --without-libnm-glib if you do not need the legacy libraries])
- ])
-
- if test "${found_introspection}" = "yes"; then
- AC_PATH_PROG(GLIB_COMPILE_RESOURCES, glib-compile-resources)
- if ! test x"$GLIB_COMPILE_RESOURCES" = x""; then
- fake_typelibs=yes
- fi
- fi
-else
- with_libnm_glib=no
-fi
-AM_CONDITIONAL(WITH_LEGACY_LIBRARIES, test "$with_libnm_glib" == "yes")
-if test "$fake_typelibs" = "yes"; then
- AC_DEFINE(WITH_FAKE_TYPELIBS, 1, [Define for libnm to prevent GIR from loading libnm-glib])
-else
- AC_DEFINE(WITH_FAKE_TYPELIBS, 0, [Define for libnm to prevent GIR from loading libnm-glib])
-fi
-AM_CONDITIONAL(WITH_FAKE_TYPELIBS, test "${fake_typelibs}" = "yes")
-
PKG_CHECK_MODULES([LIBUDEV], [libudev >= 175])
# Qt4
@@ -1274,17 +1246,10 @@ AC_CONFIG_FILES([
Makefile
shared/nm-version-macros.h
libnm/libnm.pc
-libnm-util/libnm-util.pc
-libnm-glib/libnm-glib.pc
-libnm-glib/libnm-glib-vpn.pc
po/Makefile.in
data/org.freedesktop.NetworkManager.policy.in
docs/api/Makefile
docs/api/version.xml
-docs/libnm-glib/Makefile
-docs/libnm-glib/version.xml
-docs/libnm-util/Makefile
-docs/libnm-util/version.xml
docs/libnm/Makefile
docs/libnm/version.xml
NetworkManager.pc
@@ -1333,7 +1298,6 @@ echo " ofono: $with_ofono"
echo " concheck: $enable_concheck"
echo " libteamdctl: $enable_teamdctl"
echo " ovs: $enable_ovs"
-echo " libnm-glib: $with_libnm_glib"
echo " nmcli: $build_nmcli"
echo " nmtui: $build_nmtui"
echo " iwd: $ac_with_iwd"
diff --git a/contrib/fedora/REQUIRED_PACKAGES b/contrib/fedora/REQUIRED_PACKAGES
index 4938ae916..00216e3f8 100755
--- a/contrib/fedora/REQUIRED_PACKAGES
+++ b/contrib/fedora/REQUIRED_PACKAGES
@@ -28,7 +28,6 @@ install \
bzip2 \
cscope \
dbus-devel \
- dbus-glib-devel \
dbus-python \
dbus-x11 \
dhclient \
diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec
index e3293bb7c..608ece7b0 100644
--- a/contrib/fedora/rpm/NetworkManager.spec
+++ b/contrib/fedora/rpm/NetworkManager.spec
@@ -7,8 +7,6 @@
# Note that it contains __PLACEHOLDERS__ that will be replaced by the accompanying 'build.sh' script.
-%global dbus_glib_version 0.100
-
%global wireless_tools_version 1:28-0pre9
%global wpa_supplicant_version 1:1.1
@@ -60,11 +58,6 @@
%bcond_with test
%bcond_with lto
%bcond_with sanitizer
-%if 0%{?fedora} > 28 || 0%{?rhel} > 7
-%bcond_with libnm_glib
-%else
-%bcond_without libnm_glib
-%endif
%if 0%{?fedora}
%bcond_without connectivity_fedora
%else
@@ -156,7 +149,6 @@ BuildRequires: intltool
BuildRequires: gettext-devel
BuildRequires: dbus-devel >= %{dbus_version}
-BuildRequires: dbus-glib-devel >= %{dbus_glib_version}
%if 0%{?fedora}
BuildRequires: wireless-tools-devel >= %{wireless_tools_version}
%endif
@@ -344,37 +336,6 @@ This package contains NetworkManager support for PPP.
%endif
-%package glib
-Summary: Libraries for adding NetworkManager support to applications (old API).
-Group: Development/Libraries
-Requires: dbus >= %{dbus_version}
-Requires: dbus-glib >= %{dbus_glib_version}
-Conflicts: NetworkManager-libnm < %{epoch}:%{version}-%{release}
-
-%description glib
-This package contains the libraries that make it easier to use some
-NetworkManager functionality from applications that use glib. This is
-the older NetworkManager API. See also NetworkManager-libnm.
-
-
-%package glib-devel
-Summary: Header files for adding NetworkManager support to applications (old API).
-Group: Development/Libraries
-Requires: %{name}-glib%{?_isa} = %{epoch}:%{version}-%{release}
-Requires: glib2-devel
-Requires: pkgconfig
-Requires: dbus-glib-devel >= %{dbus_glib_version}
-Provides: %{name}-devel = %{epoch}:%{version}-%{release}
-Provides: %{name}-devel%{?_isa} = %{epoch}:%{version}-%{release}
-Obsoletes: %{name}-devel < %{epoch}:%{version}-%{release}
-
-%description glib-devel
-This package contains the header and pkg-config files for development
-applications using NetworkManager functionality from applications that
-use glib.
-This is the older NetworkManager API. See also NetworkManager-libnm-devel.
-
-
%package libnm
Summary: Libraries for adding NetworkManager support to applications (new API).
Group: Development/Libraries
@@ -566,12 +527,7 @@ by nm-connection-editor and nm-applet in a non-graphical environment.
-Dconfig_plugins_default='ifcfg-rh' \
-Dconfig_dns_rc_manager_default=symlink \
-Dconfig_logging_backend_default=journal \
- -Djson_validation=true \
-%if %{with libnm_glib}
- -Dlibnm_glib=true
-%else
- -Dlibnm_glib=false
-%endif
+ -Djson_validation=true
%meson_build
@@ -687,12 +643,7 @@ intltoolize --automake --copy --force
--with-config-plugins-default='ifcfg-rh' \
--with-config-dns-rc-manager-default=symlink \
--with-config-logging-backend-default=journal \
- --enable-json-validation \
-%if %{with libnm_glib}
- --with-libnm-glib
-%else
- --without-libnm-glib
-%endif
+ --enable-json-validation
make %{?_smp_mflags}
@@ -802,9 +753,6 @@ fi
%if 0%{?fedora} < 28
-%post glib -p /sbin/ldconfig
-%postun glib -p /sbin/ldconfig
-
%post libnm -p /sbin/ldconfig
%postun libnm -p /sbin/ldconfig
%endif
@@ -913,47 +861,6 @@ fi
%endif
-%if %{with libnm_glib}
-%files glib -f %{name}.lang
-%{_libdir}/libnm-glib.so.*
-%{_libdir}/libnm-glib-vpn.so.*
-%{_libdir}/libnm-util.so.*
-%{_libdir}/girepository-1.0/NetworkManager-1.0.typelib
-%{_libdir}/girepository-1.0/NMClient-1.0.typelib
-%endif
-
-
-%if %{with libnm_glib}
-%files glib-devel
-%dir %{_includedir}/libnm-glib
-%dir %{_includedir}/%{name}
-%{_includedir}/libnm-glib/*.h
-%{_includedir}/%{name}/%{name}.h
-%{_includedir}/%{name}/NetworkManagerVPN.h
-%{_includedir}/%{name}/nm-setting*.h
-%{_includedir}/%{name}/nm-connection.h
-%{_includedir}/%{name}/nm-utils-enum-types.h
-%{_includedir}/%{name}/nm-utils.h
-%{_includedir}/%{name}/nm-version.h
-%{_includedir}/%{name}/nm-version-macros.h
-%{_libdir}/pkgconfig/libnm-glib.pc
-%{_libdir}/pkgconfig/libnm-glib-vpn.pc
-%{_libdir}/pkgconfig/libnm-util.pc
-%{_libdir}/pkgconfig/%{name}.pc
-%{_libdir}/libnm-glib.so
-%{_libdir}/libnm-glib-vpn.so
-%{_libdir}/libnm-util.so
-%{_datadir}/gir-1.0/NetworkManager-1.0.gir
-%{_datadir}/gir-1.0/NMClient-1.0.gir
-%dir %{_datadir}/gtk-doc/html/libnm-glib
-%{_datadir}/gtk-doc/html/libnm-glib/*
-%dir %{_datadir}/gtk-doc/html/libnm-util
-%{_datadir}/gtk-doc/html/libnm-util/*
-%{_datadir}/vala/vapi/libnm-*.deps
-%{_datadir}/vala/vapi/libnm-*.vapi
-%endif
-
-
%files libnm -f %{name}.lang
%{_libdir}/libnm.so.*
%{_libdir}/girepository-1.0/NM-1.0.typelib
diff --git a/contrib/scripts/nm-ci-run.sh b/contrib/scripts/nm-ci-run.sh
index 707293367..7b53d927b 100755
--- a/contrib/scripts/nm-ci-run.sh
+++ b/contrib/scripts/nm-ci-run.sh
@@ -98,7 +98,6 @@ run_autotools() {
--enable-tests=yes \
--with-crypto=$_WITH_CRYPTO \
\
- --with-libnm-glib=yes \
--with-iwd=yes \
--with-ofono=yes \
--enable-teamdctl=$_WITH_LIBTEAM \
@@ -167,7 +166,6 @@ run_meson() {
-D crypto=$_WITH_CRYPTO \
-D docs=$_WITH_DOCS \
\
- -D libnm_glib=true \
-D iwd=true \
-D ofono=true \
-D teamdctl=$_WITH_LIBTEAM \
diff --git a/docs/libnm-glib/Makefile.am b/docs/libnm-glib/Makefile.am
deleted file mode 100644
index dab2e3f7f..000000000
--- a/docs/libnm-glib/Makefile.am
+++ /dev/null
@@ -1,79 +0,0 @@
-## Process this file with automake to produce Makefile.in
-AUTOMAKE_OPTIONS = 1.6
-
-# The name of the module
-DOC_MODULE=libnm-glib
-
-# The top-level SGML file.
-DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml
-
-# The directory containing the source code. Relative to $(srcdir).
-# gtk-doc will search all .c & .h files beneath here for inline comments
-# documenting functions and macros.
-DOC_SOURCE_DIR=$(top_srcdir)/libnm-glib
-
-# Extra options to supply to gtkdoc-scan.
-SCAN_OPTIONS=
-
-# Extra options to supply to gtkdoc-mkdb.
-MKDB_OPTIONS=--sgml-mode --output-format=xml
-
-# Extra options to supply to gtkdoc-fixref.
-FIXXREF_OPTIONS=
-
-# Used for dependencies.
-HFILE_GLOB=$(top_srcdir)/libnm-glib/*.h
-CFILE_GLOB=$(top_srcdir)/libnm-glib/*.c
-
-# Header files to ignore when scanning.
-IGNORE_HFILES= \
- common.h \
- nm-dbus-helpers-private.h \
- nm-device-private.h \
- nm-object-cache.h \
- nm-object-private.h \
- nm-remote-connection-private.h \
- nm-types-private.h \
- nm-secret-agent-glue.h \
- nm-vpn-plugin-glue.h
-
-# Images to copy into HTML directory.
-HTML_IMAGES = libnm-glib.png
-
-# Extra XML files that are included by $(DOC_MAIN_SGML_FILE).
-content_files = version.xml
-
-# Other files to distribute.
-extra_files = libnm-glib.png
-
-
-# CFLAGS and LDFLAGS for compiling scan program. Only needed
-# if $(DOC_MODULE).types is non-empty.
-GTKDOC_CFLAGS = \
- -I$(top_srcdir)/shared \
- -I$(top_builddir)/shared \
- -I$(top_srcdir)/libnm-util \
- -I$(top_builddir)/libnm-util \
- -I$(top_srcdir)/libnm-glib \
- -I$(top_builddir)/libnm-glib \
- -DNM_VERSION_MIN_REQUIRED=NM_VERSION_0_9_8 \
- $(GLIB_CFLAGS) \
- $(DBUS_CFLAGS)
-
-GTKDOC_LIBS = \
- $(top_builddir)/libnm-glib/libnm-glib.la \
- $(GLIB_LIBS)
-
-
-# include common portion ...
-include $(top_srcdir)/gtk-doc.make
-
-EXTRA_DIST += version.xml.in meson.build
-
-CLEANFILES += \
- libnm-glib-sections.txt \
- libnm-glib-overrides.txt \
- html/* \
- tmpl/* \
- xml/*
-
diff --git a/docs/libnm-glib/libnm-glib-docs.xml b/docs/libnm-glib/libnm-glib-docs.xml
deleted file mode 100644
index 07551fb82..000000000
--- a/docs/libnm-glib/libnm-glib-docs.xml
+++ /dev/null
@@ -1,117 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
- "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
- <!ENTITY version SYSTEM "version.xml">
-]>
-
-<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
- <bookinfo>
- <title>libnm-glib Reference Manual</title>
- <releaseinfo>
- for libnm-glib &version;
- The latest version of this documentation can be found on-line at
- <ulink url="https://developer.gnome.org/libnm-glib/stable/">https://developer.gnome.org/libnm-glib/stable/</ulink>.
- </releaseinfo>
-
- <copyright>
- <year>2012</year>
- <year>2013</year>
- <year>2014</year>
- <year>2015</year>
- <year>2016</year>
- <year>2017</year>
- <year>2018</year>
- <holder>The NetworkManager Authors</holder>
- </copyright>
-
- <legalnotice>
- <para>
- Permission is granted to copy, distribute and/or modify this
- document under the terms of the <citetitle>GNU Free
- Documentation License</citetitle>, Version 1.1 or any later
- version published by the Free Software Foundation with no
- Invariant Sections, no Front-Cover Texts, and no Back-Cover
- Texts. You may obtain a copy of the <citetitle>GNU Free
- Documentation License</citetitle> from the Free Software
- Foundation by visiting <ulink type="http"
- url="http://www.fsf.org">their Web site</ulink> or by writing
- to:
-
- <address>
- The Free Software Foundation, Inc.,
- <street>51 Franklin Street</street> - Fifth Floor,
- <city>Boston</city>, <state>MA</state> <postcode>02110-1301</postcode>,
- <country>USA</country>
- </address>
- </para>
- </legalnotice>
- </bookinfo>
-
- <chapter id="ref-overview">
- <title>Object Overview</title>
- <para>
- libnm-glib maps closely to the actual D-Bus API that NetworkManager
- provides, simply wrapping the remote D-Bus objects as native GObjects,
- mapping D-Bus signals and properties to GObject signals and properties,
- and providing helpful accessor and utility functions. As such, objects
- in the libnm-glib API have the same properties, behavior, signals, and
- semantics as the NM D-Bus API.
- </para>
- <para>
- The following is a rough overview of the libnm-glib object structure and
- how to use the various parts of it:
- <mediaobject id="libnm-glib-overview">
- <imageobject>
- <imagedata fileref="libnm-glib.png" format="PNG"/>
- </imageobject>
- </mediaobject>
- </para>
- </chapter>
-
- <chapter>
- <title>libnm-glib API Reference</title>
- <xi:include href="xml/nm-client.xml"/>
- <xi:include href="xml/nm-active-connection.xml"/>
- <xi:include href="xml/nm-device.xml"/>
- <xi:include href="xml/nm-device-ethernet.xml"/>
- <xi:include href="xml/nm-device-wifi.xml"/>
- <xi:include href="xml/nm-device-modem.xml"/>
- <xi:include href="xml/nm-device-bt.xml"/>
- <xi:include href="xml/nm-device-wimax.xml"/>
- <xi:include href="xml/nm-device-adsl.xml"/>
- <xi:include href="xml/nm-device-bond.xml"/>
- <xi:include href="xml/nm-device-bridge.xml"/>
- <xi:include href="xml/nm-device-team.xml"/>
- <xi:include href="xml/nm-device-generic.xml"/>
- <xi:include href="xml/nm-device-infiniband.xml"/>
- <xi:include href="xml/nm-device-vlan.xml"/>
- <xi:include href="xml/nm-device-olpc-mesh.xml"/>
- <xi:include href="xml/nm-wimax-nsp.xml"/>
- <xi:include href="xml/nm-access-point.xml"/>
- <xi:include href="xml/nm-ip4-config.xml"/>
- <xi:include href="xml/nm-ip6-config.xml"/>
- <xi:include href="xml/nm-dhcp4-config.xml"/>
- <xi:include href="xml/nm-dhcp6-config.xml"/>
- <xi:include href="xml/nm-object.xml"/>
- <xi:include href="xml/nm-remote-connection.xml"/>
- <xi:include href="xml/nm-remote-settings.xml"/>
- <xi:include href="xml/nm-types.xml"/>
- <xi:include href="xml/nm-secret-agent.xml"/>
- <xi:include href="xml/nm-vpn-connection.xml"/>
- <xi:include href="xml/nm-vpn-plugin.xml"/>
- <xi:include href="xml/nm-vpn-plugin-ui-interface.xml"/>
- <xi:include href="xml/nm-vpn-plugin-utils.xml"/>
- </chapter>
-
- <chapter id="object-tree">
- <title>Object Hierarchy</title>
- <xi:include href="xml/tree_index.sgml"/>
- </chapter>
- <index id="api-index-full">
- <title>API Index</title>
- <xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
- </index>
-
- <xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
-</book>
-
diff --git a/docs/libnm-glib/libnm-glib.png b/docs/libnm-glib/libnm-glib.png
deleted file mode 100644
index dc0007284..000000000
--- a/docs/libnm-glib/libnm-glib.png
+++ /dev/null
Binary files differ
diff --git a/docs/libnm-glib/libnm-glib.svg b/docs/libnm-glib/libnm-glib.svg
deleted file mode 100644
index 6bbfa2951..000000000
--- a/docs/libnm-glib/libnm-glib.svg
+++ /dev/null
@@ -1,893 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="1052.3622"
- height="744.09448"
- id="svg2"
- version="1.1"
- inkscape:version="0.48.1 r9760"
- sodipodi:docname="libnm-glib.svg">
- <defs
- id="defs4">
- <marker
- inkscape:stockid="Arrow1Lend"
- orient="auto"
- refY="0"
- refX="0"
- id="Arrow1Lend"
- style="overflow:visible">
- <path
- id="path4069"
- d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
- style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none"
- transform="matrix(-0.8,0,0,-0.8,-10,0)"
- inkscape:connector-curvature="0" />
- </marker>
- <marker
- inkscape:stockid="Arrow1Lend"
- orient="auto"
- refY="0"
- refX="0"
- id="Arrow1Lend-2"
- style="overflow:visible">
- <path
- id="path4069-0"
- d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
- style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none"
- transform="matrix(-0.8,0,0,-0.8,-10,0)"
- inkscape:connector-curvature="0" />
- </marker>
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="0.98994949"
- inkscape:cx="433.76249"
- inkscape:cy="491.18568"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- inkscape:window-width="1280"
- inkscape:window-height="739"
- inkscape:window-x="0"
- inkscape:window-y="26"
- inkscape:window-maximized="1" />
- <metadata
- id="metadata7">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(0,-308.2677)">
- <text
- xml:space="preserve"
- style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
- x="283.85287"
- y="97.768028"
- id="text3783"
- sodipodi:linespacing="125%"><tspan
- sodipodi:role="line"
- id="tspan3787"
- x="283.85287"
- y="97.768028"></tspan></text>
- <flowRoot
- xml:space="preserve"
- id="flowRoot3789"
- style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion3791"><rect
- id="rect3793"
- width="139.40105"
- height="113.13708"
- x="265.6701"
- y="97.768028" /></flowRegion><flowPara
- id="flowPara3795"></flowPara></flowRoot> <flowRoot
- xml:space="preserve"
- id="flowRoot3797"
- style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"><flowRegion
- id="flowRegion3799"><rect
- id="rect3801"
- width="208.09143"
- height="133.34013"
- x="273.75134"
- y="121.00153"
- style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans" /></flowRegion><flowPara
- id="flowPara3803"></flowPara></flowRoot> <flowRoot
- xml:space="preserve"
- id="flowRoot3825"
- style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"><flowRegion
- id="flowRegion3827"><rect
- id="rect3829"
- width="175.76654"
- height="41.416256"
- x="28.284271"
- y="88.676651" /></flowRegion><flowPara
- id="flowPara3831">Propr</flowPara></flowRoot> <g
- id="g5635"
- transform="translate(-64.649763,3.0507627)">
- <text
- sodipodi:linespacing="125%"
- id="text3755-0"
- y="341.21481"
- x="573.86121"
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans Bold"
- xml:space="preserve"><tspan
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans Bold"
- y="341.21481"
- x="573.86121"
- id="tspan3757-1"
- sodipodi:role="line">NMClient</tspan></text>
- <text
- sodipodi:linespacing="125%"
- id="text3833-6"
- y="357.37726"
- x="529.33325"
- style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
- xml:space="preserve"><tspan
- id="tspan3837-8"
- y="357.37726"
- x="529.33325"
- sodipodi:role="line">Base object; provides access to</tspan><tspan
- id="tspan4548"
- y="369.87726"
- x="529.33325"
- sodipodi:role="line">network device objects, active</tspan><tspan
- id="tspan4550"
- y="382.37726"
- x="529.33325"
- sodipodi:role="line">network connection objects and</tspan><tspan
- id="tspan4552"
- y="394.87726"
- x="529.33325"
- sodipodi:role="line">general network state information</tspan></text>
- </g>
- <text
- xml:space="preserve"
- style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
- x="104.07935"
- y="372.52951"
- id="text3833-6-7"
- sodipodi:linespacing="125%"><tspan
- sodipodi:role="line"
- x="104.07935"
- y="372.52951"
- id="tspan4552-6" /></text>
- <rect
- style="fill:none;stroke:#01003d;stroke-width:2.85214233;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:10.49999982"
- id="rect2985"
- width="209.21587"
- height="312.09604"
- x="12.270507"
- y="319.61136" />
- <text
- xml:space="preserve"
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans Bold"
- x="40.322777"
- y="344.24524"
- id="text3755"
- sodipodi:linespacing="125%"><tspan
- sodipodi:role="line"
- id="tspan3757"
- x="40.322777"
- y="344.24524"
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans Bold">NMRemoteSettings</tspan></text>
- <text
- xml:space="preserve"
- style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
- x="19.192902"
- y="360.40768"
- id="text3833"
- sodipodi:linespacing="125%"><tspan
- sodipodi:role="line"
- x="19.192902"
- y="360.40768"
- id="tspan3839">Retrieves, adds, and notifes of changes</tspan><tspan
- sodipodi:role="line"
- x="19.192902"
- y="372.90768"
- id="tspan3837">to network configuration objects</tspan><tspan
- sodipodi:role="line"
- x="19.192902"
- y="385.40768"
- id="tspan4682">(called NMRemoteConnections) </tspan></text>
- <rect
- style="fill:none;stroke:#01003d;stroke-width:1.13669348;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:10.49999982"
- id="rect2985-8"
- width="176.20061"
- height="82.832512"
- x="29.077385"
- y="403.84424" />
- <text
- xml:space="preserve"
- style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
- x="38.158276"
- y="424.04724"
- id="text3755-3"
- sodipodi:linespacing="125%"><tspan
- sodipodi:role="line"
- id="tspan3757-8"
- x="38.158276"
- y="424.04724"
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans">NMRemoteConnection</tspan></text>
- <text
- xml:space="preserve"
- style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
- x="36.03054"
- y="443.60046"
- id="text3833-0"
- sodipodi:linespacing="125%"><tspan
- sodipodi:role="line"
- x="36.03054"
- y="443.60046"
- id="tspan3837-7">The basic unit of network</tspan><tspan
- sodipodi:role="line"
- x="36.03054"
- y="456.10046"
- id="tspan3873">configuration information,</tspan><tspan
- sodipodi:role="line"
- x="36.03054"
- y="468.60046"
- id="tspan3875">contains all settings required to</tspan><tspan
- sodipodi:role="line"
- x="36.03054"
- y="481.10046"
- id="tspan3877">connect to a specific network.</tspan></text>
- <rect
- style="fill:none;stroke:#01003d;stroke-width:0.68221813;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:10.49999982"
- id="rect2985-8-4"
- width="176.20061"
- height="29.837376"
- x="28.067242"
- y="494.75793" />
- <text
- xml:space="preserve"
- style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
- x="37.148129"
- y="514.96094"
- id="text3755-3-9"
- sodipodi:linespacing="125%"><tspan
- sodipodi:role="line"
- id="tspan3757-8-0"
- x="37.148129"
- y="514.96094"
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans">NMRemoteConnection</tspan></text>
- <rect
- style="fill:none;stroke:#01003d;stroke-width:0.68221813;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:10.49999982"
- id="rect2985-8-4-6"
- width="176.20061"
- height="29.837376"
- x="28.06724"
- y="532.36725" />
- <text
- xml:space="preserve"
- style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
- x="37.148129"
- y="552.57025"
- id="text3755-3-9-3"
- sodipodi:linespacing="125%"><tspan
- sodipodi:role="line"
- id="tspan3757-8-0-8"
- x="37.148129"
- y="552.57025"
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans">NMRemoteConnection</tspan></text>
- <rect
- style="fill:none;stroke:#01003d;stroke-width:0.68221813;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:10.49999982"
- id="rect2985-8-4-8"
- width="176.20061"
- height="29.837376"
- x="28.067238"
- y="569.74286" />
- <text
- xml:space="preserve"
- style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
- x="37.148125"
- y="589.94586"
- id="text3755-3-9-6"
- sodipodi:linespacing="125%"><tspan
- sodipodi:role="line"
- id="tspan3757-8-0-6"
- x="37.148125"
- y="589.94586"
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans">NMRemoteConnection</tspan></text>
- <g
- id="g5581">
- <path
- transform="translate(24,308.27784)"
- d="m 75.76144,306.19336 a 3.5355339,3.5355339 0 1 1 -7.071068,0 3.5355339,3.5355339 0 1 1 7.071068,0 z"
- sodipodi:ry="3.5355339"
- sodipodi:rx="3.5355339"
- sodipodi:cy="306.19336"
- sodipodi:cx="72.225906"
- id="path4776"
- style="fill:#000000;fill-opacity:1;stroke:#01003d;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:10.49999982"
- sodipodi:type="arc" />
- <path
- d="m 75.76144,306.19336 a 3.5355339,3.5355339 0 1 1 -7.071068,0 3.5355339,3.5355339 0 1 1 7.071068,0 z"
- sodipodi:ry="3.5355339"
- sodipodi:rx="3.5355339"
- sodipodi:cy="306.19336"
- sodipodi:cx="72.225906"
- id="path4776-1"
- style="fill:#000000;fill-opacity:1;stroke:#01003d;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:10.49999982"
- sodipodi:type="arc"
- transform="translate(44.950515,308.27784)" />
- <path
- d="m 75.76144,306.19336 a 3.5355339,3.5355339 0 1 1 -7.071068,0 3.5355339,3.5355339 0 1 1 7.071068,0 z"
- sodipodi:ry="3.5355339"
- sodipodi:rx="3.5355339"
- sodipodi:cy="306.19336"
- sodipodi:cx="72.225906"
- id="path4776-1-4"
- style="fill:#000000;fill-opacity:1;stroke:#01003d;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:10.49999982"
- sodipodi:type="arc"
- transform="translate(65.901025,308.27784)" />
- </g>
- <rect
- style="fill:none;stroke:#c30000;stroke-width:2.71445656;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:10.49999982"
- id="rect2985-5"
- width="641.21594"
- height="454.62848"
- x="286.68472"
- y="321.29346" />
- <g
- id="g5644"
- transform="translate(348.50263,-5.0507629)">
- <rect
- y="466.47369"
- x="346.26532"
- height="68.182198"
- width="176.20061"
- id="rect2985-8-9"
- style="fill:none;stroke:#01003d;stroke-width:1.03128445;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:10.49999982" />
- <text
- sodipodi:linespacing="125%"
- id="text3755-3-5"
- y="486.6767"
- x="400.8031"
- style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
- xml:space="preserve"><tspan
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
- y="486.6767"
- x="400.8031"
- id="tspan3757-8-00"
- sodipodi:role="line">NMDevice</tspan></text>
- <text
- sodipodi:linespacing="125%"
- id="text3833-0-5"
- y="501.17917"
- x="353.21848"
- style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
- xml:space="preserve"><tspan
- id="tspan3877-3"
- y="501.17917"
- x="353.21848"
- sodipodi:role="line">Represents a known network</tspan><tspan
- id="tspan5003"
- y="513.6792"
- x="353.21848"
- sodipodi:role="line">interface that may be used to</tspan><tspan
- id="tspan5005"
- y="526.1792"
- x="353.21848"
- sodipodi:role="line">connect to a network</tspan></text>
- </g>
- <text
- xml:space="preserve"
- style="font-size:9px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
- x="706.53918"
- y="144.96414"
- id="text5191"
- sodipodi:linespacing="125%"
- transform="matrix(0.91955281,0.39296645,-0.39296645,0.91955281,0,0)"><tspan
- sodipodi:role="line"
- id="tspan5193"
- x="706.53918"
- y="144.96414">nm_client_get_devices()</tspan></text>
- <g
- id="g5623"
- transform="translate(-419.9159,137.94419)">
- <rect
- y="447.99072"
- x="721.03192"
- height="96.526291"
- width="176.20061"
- id="rect2985-8-9-7"
- style="fill:none;stroke:#01003d;stroke-width:1.22705996;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:10.49999982" />
- <text
- sodipodi:linespacing="125%"
- id="text3755-3-5-9"
- y="465.92065"
- x="740.21436"
- style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
- xml:space="preserve"><tspan
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
- y="465.92065"
- x="740.21436"
- id="tspan3757-8-00-9"
- sodipodi:role="line">NMActiveConnection</tspan></text>
- <text
- sodipodi:linespacing="125%"
- id="text3833-0-5-2"
- y="478.42313"
- x="723.98505"
- style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
- xml:space="preserve"><tspan
- id="tspan5005-7"
- y="478.42313"
- x="723.98505"
- sodipodi:role="line">Represents an active connection</tspan><tspan
- id="tspan5236"
- y="490.92313"
- x="723.98505"
- sodipodi:role="line">to a specific network, using</tspan><tspan
- id="tspan5238"
- y="503.42313"
- x="723.98505"
- sodipodi:role="line">settings from an</tspan><tspan
- id="tspan5240"
- y="515.9231"
- x="723.98505"
- sodipodi:role="line">NMRemoteConnection,and</tspan><tspan
- id="tspan5449"
- y="528.4231"
- x="723.98505"
- sodipodi:role="line">provided by on or more NMDevice</tspan><tspan
- id="tspan5451"
- y="540.9231"
- x="723.98505"
- sodipodi:role="line">objects.</tspan></text>
- </g>
- <text
- xml:space="preserve"
- style="font-size:9px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
- x="270.79764"
- y="722.53766"
- id="text5191-5"
- sodipodi:linespacing="125%"
- transform="matrix(0.94281033,-0.33332969,0.33332969,0.94281033,0,0)"><tspan
- sodipodi:role="line"
- id="tspan5193-8"
- x="270.79764"
- y="722.53766">nm_active_connection_get_devices()</tspan></text>
- <g
- id="g6720"
- transform="translate(-23.213166,-3.4365595)">
- <g
- transform="translate(320.19803,-24.89035)"
- id="g5561">
- <rect
- style="fill:none;stroke:#01003d;stroke-width:0.54146165;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:10.49999982"
- id="rect2985-8-9-3-4"
- width="126.1828"
- height="26.245613"
- x="397.53818"
- y="597.80267" />
- <text
- xml:space="preserve"
- style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
- x="419.1745"
- y="615.39911"
- id="text3755-3-5-1-8"
- sodipodi:linespacing="125%"><tspan
- sodipodi:role="line"
- id="tspan3757-8-00-3-7"
- x="419.1745"
- y="615.39911"
- style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans">NMDeviceWifi</tspan></text>
- </g>
- <g
- transform="translate(175.74622,-53.780741)"
- id="g5566">
- <rect
- style="fill:none;stroke:#01003d;stroke-width:0.54146165;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:10.49999982"
- id="rect2985-8-9-3-5"
- width="126.1828"
- height="26.245613"
- x="541.98999"
- y="659.422" />
- <text
- xml:space="preserve"
- style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
- x="552.62244"
- y="677.01843"
- id="text3755-3-5-1-9"
- sodipodi:linespacing="125%"><tspan
- sodipodi:role="line"
- x="552.62244"
- y="677.01843"
- style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
- id="tspan5526">NMDeviceModem</tspan></text>
- </g>
- <g
- transform="translate(390.90872,-24.082284)"
- id="g5571">
- <rect
- style="fill:none;stroke:#01003d;stroke-width:0.54146165;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:10.49999982"
- id="rect2985-8-9-3-2"
- width="126.1828"
- height="26.245613"
- x="326.82748"
- y="662.45251" />
- <text
- xml:space="preserve"
- style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
- x="330"
- y="680.04895"
- id="text3755-3-5-1-7"
- sodipodi:linespacing="125%"><tspan
- sodipodi:role="line"
- id="tspan3757-8-00-3-1"
- x="330"
- y="680.04895"
- style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans">NMDeviceInfiniband</tspan></text>
- </g>
- <g
- transform="translate(278.7818,-37.820326)"
- id="g5576">
- <rect
- style="fill:none;stroke:#01003d;stroke-width:0.54146165;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:10.49999982"
- id="rect2985-8-9-3-7"
- width="126.1828"
- height="26.245613"
- x="438.95441"
- y="708.91949" />
- <text
- xml:space="preserve"
- style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
- x="442.65225"
- y="726.51593"
- id="text3755-3-5-1-0"
- sodipodi:linespacing="125%"><tspan
- sodipodi:role="line"
- x="442.65225"
- y="726.51593"
- style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
- id="tspan5552">NMDeviceBluetooth</tspan></text>
- </g>
- <g
- id="g5581-7"
- transform="translate(663.65119,96.47973)">
- <path
- sodipodi:type="arc"
- style="fill:#000000;fill-opacity:1;stroke:#01003d;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:10.49999982"
- id="path4776-10"
- sodipodi:cx="72.225906"
- sodipodi:cy="306.19336"
- sodipodi:rx="3.5355339"
- sodipodi:ry="3.5355339"
- d="m 75.76144,306.19336 c 0,1.95262 -1.582912,3.53553 -3.535534,3.53553 -1.952621,0 -3.535534,-1.58291 -3.535534,-3.53553 0,-1.95262 1.582913,-3.53553 3.535534,-3.53553 1.952622,0 3.535534,1.58291 3.535534,3.53553 z"
- transform="translate(24,308.27784)" />
- <path
- transform="translate(44.950515,308.27784)"
- sodipodi:type="arc"
- style="fill:#000000;fill-opacity:1;stroke:#01003d;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:10.49999982"
- id="path4776-1-0"
- sodipodi:cx="72.225906"
- sodipodi:cy="306.19336"
- sodipodi:rx="3.5355339"
- sodipodi:ry="3.5355339"
- d="m 75.76144,306.19336 c 0,1.95262 -1.582912,3.53553 -3.535534,3.53553 -1.952621,0 -3.535534,-1.58291 -3.535534,-3.53553 0,-1.95262 1.582913,-3.53553 3.535534,-3.53553 1.952622,0 3.535534,1.58291 3.535534,3.53553 z" />
- <path
- transform="translate(65.901025,308.27784)"
- sodipodi:type="arc"
- style="fill:#000000;fill-opacity:1;stroke:#01003d;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:10.49999982"
- id="path4776-1-4-7"
- sodipodi:cx="72.225906"
- sodipodi:cy="306.19336"
- sodipodi:rx="3.5355339"
- sodipodi:ry="3.5355339"
- d="m 75.76144,306.19336 c 0,1.95262 -1.582912,3.53553 -3.535534,3.53553 -1.952621,0 -3.535534,-1.58291 -3.535534,-3.53553 0,-1.95262 1.582913,-3.53553 3.535534,-3.53553 1.952622,0 3.535534,1.58291 3.535534,3.53553 z" />
- </g>
- <g
- transform="translate(371.71582,-10.142135)"
- id="g5556">
- <rect
- style="fill:none;stroke:#01003d;stroke-width:0.54146165;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:10.49999982"
- id="rect2985-8-9-3"
- width="126.1828"
- height="26.245613"
- x="346.02039"
- y="550.3255" />
- <text
- xml:space="preserve"
- style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
- x="352.6069"
- y="567.92194"
- id="text3755-3-5-1"
- sodipodi:linespacing="125%"><tspan
- sodipodi:role="line"
- id="tspan3757-8-00-3"
- x="352.6069"
- y="567.92194"
- style="font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans">NMDeviceEthernet</tspan></text>
- </g>
- </g>
- <path
- style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend)"
- d="M 553.56359,93.556243 699.43095,153.15523"
- id="path6047"
- inkscape:connector-type="polyline"
- inkscape:connector-curvature="3"
- inkscape:connection-end="#g5644"
- inkscape:connection-end-point="d4"
- transform="translate(0,308.2677)" />
- <path
- style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend)"
- d="M 477.31663,294.89252 694.76795,218.28417"
- id="path6231"
- inkscape:connector-type="polyline"
- inkscape:connector-curvature="3"
- inkscape:connection-start="#g5623"
- inkscape:connection-start-point="d4"
- inkscape:connection-end="#g5644"
- inkscape:connection-end-point="d4"
- transform="translate(0,308.2677)" />
- <path
- style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend)"
- d="M 537.40115,93.556243 419.9937,277.66721"
- id="path6415"
- inkscape:connector-type="polyline"
- inkscape:connector-curvature="3"
- inkscape:connection-end="#g5623"
- inkscape:connection-end-point="d4"
- transform="translate(0,308.2677)" />
- <text
- xml:space="preserve"
- style="font-size:9px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
- x="-235.89041"
- y="662.71521"
- id="text5191-5-1"
- sodipodi:linespacing="125%"
- transform="matrix(0.53998594,-0.84167404,0.84167404,0.53998594,0,0)"><tspan
- sodipodi:role="line"
- id="tspan5193-8-5"
- x="-235.89041"
- y="662.71521">nm_client_get_active_connections()</tspan></text>
- <text
- xml:space="preserve"
- style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
- x="824.3454"
- y="617.99652"
- id="text6932"
- sodipodi:linespacing="125%"><tspan
- sodipodi:role="line"
- id="tspan6934"
- x="824.3454"
- y="617.99652">(Device subclasses)</tspan></text>
- <text
- xml:space="preserve"
- style="font-size:9px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
- x="685.34247"
- y="161.22107"
- id="text5191-9"
- sodipodi:linespacing="125%"
- transform="matrix(0.91955281,0.39296645,-0.39296645,0.91955281,0,0)"><tspan
- sodipodi:role="line"
- id="tspan5193-1"
- x="685.34247"
- y="161.22107">Gets all known interfaces</tspan></text>
- <text
- xml:space="preserve"
- style="font-size:9px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
- x="251.42001"
- y="738.39777"
- id="text5191-5-5"
- sodipodi:linespacing="125%"
- transform="matrix(0.94354535,-0.33124338,0.33124338,0.94354535,0,0)"><tspan
- sodipodi:role="line"
- id="tspan5193-8-1"
- x="251.42001"
- y="738.39777">Gets interfaces used by this active connection</tspan></text>
- <text
- xml:space="preserve"
- style="font-size:9px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
- x="-227.90929"
- y="680.09265"
- id="text5191-5-1-7"
- sodipodi:linespacing="125%"
- transform="matrix(0.54025777,-0.84149958,0.84149958,0.54025777,0,0)"><tspan
- sodipodi:role="line"
- id="tspan5193-8-5-2"
- x="-227.90929"
- y="680.09265">Gets all active network connections</tspan></text>
- <path
- style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend-2)"
- d="M 314.15744,683.6768 C 282.94516,704.65454 170.8596,719.38945 163.64471,598.82399"
- id="path7053"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="cc" />
- <text
- xml:space="preserve"
- style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
- x="19.152279"
- y="706.91034"
- id="text7239"
- sodipodi:linespacing="125%"><tspan
- sodipodi:role="line"
- id="tspan7241"
- x="19.152279"
- y="706.91034">Retrieve the NMRemoteConnection that provides</tspan><tspan
- sodipodi:role="line"
- x="19.152279"
- y="719.41034"
- id="tspan7243">configuration settings for the NMActiveConnection</tspan><tspan
- sodipodi:role="line"
- x="19.152279"
- y="731.91034"
- id="tspan7245">by getting its object path with</tspan><tspan
- sodipodi:role="line"
- x="19.152279"
- y="744.41034"
- id="tspan7247">nm_active_connection_get_connection() and then</tspan><tspan
- sodipodi:role="line"
- x="19.152279"
- y="756.91034"
- id="tspan7249">passing the returned path to</tspan><tspan
- sodipodi:role="line"
- x="19.152279"
- y="769.41034"
- id="tspan7251">nm_remote_settings_get_connection_by_path()</tspan></text>
- <text
- xml:space="preserve"
- style="font-size:18px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans Bold"
- x="10.101524"
- y="653.3316"
- id="text7253"
- sodipodi:linespacing="125%"><tspan
- sodipodi:role="line"
- id="tspan7255"
- x="10.101524"
- y="653.3316">Network</tspan><tspan
- sodipodi:role="line"
- x="10.101524"
- y="675.8316"
- id="tspan7278">Configuration</tspan></text>
- <text
- xml:space="preserve"
- style="font-size:18px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans Bold"
- x="284.19009"
- y="798.65869"
- id="text7253-4"
- sodipodi:linespacing="125%"><tspan
- sodipodi:role="line"
- id="tspan7255-8"
- x="284.19009"
- y="798.65869">Network Control</tspan></text>
- <text
- xml:space="preserve"
- style="font-size:10px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans"
- x="701.04297"
- y="363.09201"
- id="text7239-7"
- sodipodi:linespacing="125%"><tspan
- sodipodi:role="line"
- x="701.04297"
- y="363.09201"
- id="tspan7251-6">Connect to a network by calling</tspan><tspan
- sodipodi:role="line"
- x="701.04297"
- y="375.59201"
- id="tspan7336">nm_client_activate_connection() and</tspan><tspan
- sodipodi:role="line"
- x="701.04297"
- y="388.09201"
- id="tspan7338">passing the NMDevice to use, along with</tspan><tspan
- sodipodi:role="line"
- x="701.04297"
- y="400.59201"
- id="tspan7342">the NMRemoteConnection that contains</tspan><tspan
- sodipodi:role="line"
- x="701.04297"
- y="413.09201"
- id="tspan7346">the settings that describe how to connect</tspan><tspan
- sodipodi:role="line"
- x="701.04297"
- y="425.59201"
- id="tspan7350">to that network</tspan></text>
- <g
- id="g5623-9"
- transform="translate(-369.71587,253.62599)">
- <g
- id="g7418"
- transform="translate(-28.915799,-13.111678)">
- <rect
- style="fill:none;stroke:#01003d;stroke-width:0.57918203;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:10.49999982"
- id="rect2985-8-9-7-5"
- width="155.24031"
- height="24.408838"
- x="721.03192"
- y="447.99072" />
- <text
- xml:space="preserve"
- style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
- x="725.99634"
- y="465.41437"
- id="text3755-3-5-9-3"
- sodipodi:linespacing="125%"><tspan
- sodipodi:role="line"
- id="tspan3757-8-00-9-0"
- x="725.99634"
- y="465.41437"
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans">NMActiveConnection</tspan></text>
- </g>
- <g
- transform="translate(-28.915799,18.947049)"
- id="g7418-5">
- <rect
- style="fill:none;stroke:#01003d;stroke-width:0.57918203;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:10.49999982"
- id="rect2985-8-9-7-5-7"
- width="155.24031"
- height="24.408838"
- x="721.03192"
- y="447.99072" />
- <text
- xml:space="preserve"
- style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
- x="725.99634"
- y="465.41437"
- id="text3755-3-5-9-3-7"
- sodipodi:linespacing="125%"><tspan
- sodipodi:role="line"
- id="tspan3757-8-00-9-0-0"
- x="725.99634"
- y="465.41437"
- style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans">NMActiveConnection</tspan></text>
- </g>
- </g>
- <g
- transform="translate(282.84399,143.9366)"
- id="g5581-6">
- <path
- transform="translate(24,308.27784)"
- d="m 75.76144,306.19336 c 0,1.95262 -1.582912,3.53553 -3.535534,3.53553 -1.952621,0 -3.535534,-1.58291 -3.535534,-3.53553 0,-1.95262 1.582913,-3.53553 3.535534,-3.53553 1.952622,0 3.535534,1.58291 3.535534,3.53553 z"
- sodipodi:ry="3.5355339"
- sodipodi:rx="3.5355339"
- sodipodi:cy="306.19336"
- sodipodi:cx="72.225906"
- id="path4776-6"
- style="fill:#000000;fill-opacity:1;stroke:#01003d;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:10.49999982"
- sodipodi:type="arc" />
- <path
- d="m 75.76144,306.19336 c 0,1.95262 -1.582912,3.53553 -3.535534,3.53553 -1.952621,0 -3.535534,-1.58291 -3.535534,-3.53553 0,-1.95262 1.582913,-3.53553 3.535534,-3.53553 1.952622,0 3.535534,1.58291 3.535534,3.53553 z"
- sodipodi:ry="3.5355339"
- sodipodi:rx="3.5355339"
- sodipodi:cy="306.19336"
- sodipodi:cx="72.225906"
- id="path4776-1-2"
- style="fill:#000000;fill-opacity:1;stroke:#01003d;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:10.49999982"
- sodipodi:type="arc"
- transform="translate(44.950515,308.27784)" />
- <path
- d="m 75.76144,306.19336 c 0,1.95262 -1.582912,3.53553 -3.535534,3.53553 -1.952621,0 -3.535534,-1.58291 -3.535534,-3.53553 0,-1.95262 1.582913,-3.53553 3.535534,-3.53553 1.952622,0 3.535534,1.58291 3.535534,3.53553 z"
- sodipodi:ry="3.5355339"
- sodipodi:rx="3.5355339"
- sodipodi:cy="306.19336"
- sodipodi:cx="72.225906"
- id="path4776-1-4-6"
- style="fill:#000000;fill-opacity:1;stroke:#01003d;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:10.49999982"
- sodipodi:type="arc"
- transform="translate(65.901025,308.27784)" />
- </g>
- </g>
-</svg>
diff --git a/docs/libnm-glib/libnm-glib.types b/docs/libnm-glib/libnm-glib.types
deleted file mode 100644
index 1cb7d4062..000000000
--- a/docs/libnm-glib/libnm-glib.types
+++ /dev/null
@@ -1,55 +0,0 @@
-#include "nm-client.h"
-#include "nm-object.h"
-#include "nm-device.h"
-#include "nm-device-ethernet.h"
-#include "nm-device-wifi.h"
-#include "nm-device-modem.h"
-#include "nm-device-bt.h"
-#include "nm-device-wimax.h"
-#include "nm-device-olpc-mesh.h"
-#include "nm-device-adsl.h"
-#include "nm-device-infiniband.h"
-#include "nm-device-bond.h"
-#include "nm-device-bridge.h"
-#include "nm-device-team.h"
-#include "nm-device-generic.h"
-#include "nm-device-vlan.h"
-#include "nm-access-point.h"
-#include "nm-ip4-config.h"
-#include "nm-ip6-config.h"
-#include "nm-active-connection.h"
-#include "nm-dhcp4-config.h"
-#include "nm-dhcp6-config.h"
-#include "nm-remote-settings.h"
-#include "nm-remote-connection.h"
-#include "nm-secret-agent.h"
-#include "nm-vpn-connection.h"
-
-nm_client_get_type
-nm_object_get_type
-nm_device_get_type
-nm_device_ethernet_get_type
-nm_device_wifi_get_type
-nm_device_modem_get_type
-nm_device_bt_get_type
-nm_device_wimax_get_type
-nm_device_olpc_mesh_get_type
-nm_device_adsl_get_type
-nm_device_infiniband_get_type
-nm_device_bond_get_type
-nm_device_bridge_get_type
-nm_device_team_get_type
-nm_device_generic_get_type
-nm_device_vlan_get_type
-nm_wimax_nsp_get_type
-nm_access_point_get_type
-nm_ip4_config_get_type
-nm_ip6_config_get_type
-nm_active_connection_get_type
-nm_dhcp4_config_get_type
-nm_dhcp6_config_get_type
-nm_remote_settings_get_type
-nm_remote_connection_get_type
-nm_secret_agent_get_type
-nm_vpn_connection_get_type
-
diff --git a/docs/libnm-glib/meson.build b/docs/libnm-glib/meson.build
deleted file mode 100644
index 622669ee7..000000000
--- a/docs/libnm-glib/meson.build
+++ /dev/null
@@ -1,39 +0,0 @@
-doc_module = libnm_glib_name
-
-private_headers = [
- 'common.h',
- 'nm-dbus-helpers-private.h',
- 'nm-device-private.h',
- 'nm-object-cache.h',
- 'nm-object-private.h',
- 'nm-remote-connection-private.h',
- 'nm-types-private.h',
- 'nm-secret-agent-glue.h',
- 'nm-vpn-plugin-glue.h',
-]
-
-configure_file(
- input: version_xml + '.in',
- output: version_xml,
- configuration: version_conf,
-)
-
-gnome.gtkdoc(
- doc_module,
- main_xml: doc_module + '-docs.xml',
- src_dir: join_paths(meson.source_root(), 'libnm-glib'),
- dependencies: [
- libnm_glib_dep,
- libnm_glib_vpn_dep,
- ],
- scan_args: [
- '--rebuild-types',
- '--rebuild-sections',
- '--ignore-headers=' + ' '.join(private_headers),
- ],
- scanobjs_args: '--type-init-func="g_type_init();"',
- fixxref_args: '--html-dir=' + join_paths(nm_prefix, gnome.gtkdoc_html_dir(doc_module)),
- gobject_typesfile: doc_module + '.types',
- html_assets: doc_module + '.png',
- install: true,
-)
diff --git a/docs/libnm-glib/version.xml.in b/docs/libnm-glib/version.xml.in
deleted file mode 100644
index d78bda934..000000000
--- a/docs/libnm-glib/version.xml.in
+++ /dev/null
@@ -1 +0,0 @@
-@VERSION@
diff --git a/docs/libnm-util/Makefile.am b/docs/libnm-util/Makefile.am
deleted file mode 100644
index 5b8d7260a..000000000
--- a/docs/libnm-util/Makefile.am
+++ /dev/null
@@ -1,74 +0,0 @@
-## Process this file with automake to produce Makefile.in
-AUTOMAKE_OPTIONS = 1.6
-
-# The name of the module
-DOC_MODULE=libnm-util
-
-# The top-level SGML file.
-DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
-
-# The directory containing the source code. Relative to $(srcdir).
-# gtk-doc will search all .c & .h files beneath here for inline comments
-# documenting functions and macros.
-DOC_SOURCE_DIR= \
- $(top_builddir)/libnm-util \
- $(top_srcdir)/libnm-util
-
-# Extra options to supply to gtkdoc-scan.
-SCAN_OPTIONS=--rebuild-types --rebuild-sections
-
-# Extra options to supply to gtkdoc-mkdb.
-MKDB_OPTIONS=--sgml-mode --output-format=xml
-
-# Extra options to supply to gtkdoc-fixref.
-FIXXREF_OPTIONS=
-
-# Used for dependencies.
-HFILE_GLOB=$(top_srcdir)/libnm-util/*.h
-CFILE_GLOB=$(top_srcdir)/libnm-util/*.c
-
-# Header files to ignore when scanning.
-IGNORE_HFILES= \
- crypto.h \
- nm-utils-private.h \
- nm-setting-private.h \
- nm-param-spec-specialized.h \
- nm-test-utils.h \
- nm-version.h
-
-# Images to copy into HTML directory.
-HTML_IMAGES =
-
-# Extra XML files that are included by $(DOC_MAIN_SGML_FILE).
-content_files = version.xml
-
-# Other files to distribute.
-extra_files =
-
-
-# CFLAGS and LDFLAGS for compiling scan program. Only needed
-# if $(DOC_MODULE).types is non-empty.
-GTKDOC_CFLAGS = \
- -I$(top_srcdir)/libnm-util \
- -DNM_VERSION_MIN_REQUIRED=NM_VERSION_0_9_8 \
- $(GLIB_CFLAGS) \
- $(DBUS_CFLAGS)
-
-GTKDOC_LIBS = \
- $(top_builddir)/libnm-util/libnm-util.la \
- $(GLIB_LIBS)
-
-
-
-# include common portion ...
-include $(top_srcdir)/gtk-doc.make
-
-EXTRA_DIST += version.xml.in meson.build
-
-CLEANFILES += \
- libnm-util-sections.txt \
- libnm-util-overrides.txt \
- html/* \
- tmpl/* \
- xml/*
-
diff --git a/docs/libnm-util/libnm-util-docs.sgml b/docs/libnm-util/libnm-util-docs.sgml
deleted file mode 100644
index 658178889..000000000
--- a/docs/libnm-util/libnm-util-docs.sgml
+++ /dev/null
@@ -1,96 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
- "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
-[
- <!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
- <!ENTITY version SYSTEM "version.xml">
-]>
-<book id="index">
- <bookinfo>
- <title>libnm-util Reference Manual</title>
- <releaseinfo>
- for libnm-util &version;
- The latest version of this documentation can be found on-line at
- <ulink url="https://developer.gnome.org/libnm-util/stable/">https://developer.gnome.org/libnm-util/stable/</ulink>.
- </releaseinfo>
-
- <copyright>
- <year>2012</year>
- <year>2013</year>
- <year>2014</year>
- <year>2015</year>
- <year>2016</year>
- <year>2017</year>
- <year>2018</year>
- <holder>The NetworkManager Authors</holder>
- </copyright>
-
- <legalnotice>
- <para>
- Permission is granted to copy, distribute and/or modify this
- document under the terms of the <citetitle>GNU Free
- Documentation License</citetitle>, Version 1.1 or any later
- version published by the Free Software Foundation with no
- Invariant Sections, no Front-Cover Texts, and no Back-Cover
- Texts. You may obtain a copy of the <citetitle>GNU Free
- Documentation License</citetitle> from the Free Software
- Foundation by visiting <ulink type="http"
- url="http://www.fsf.org">their Web site</ulink> or by writing
- to:
-
- <address>
- The Free Software Foundation, Inc.,
- <street>51 Franklin Street</street> - Fifth Floor,
- <city>Boston</city>, <state>MA</state> <postcode>02110-1301</postcode>,
- <country>USA</country>
- </address>
- </para>
- </legalnotice>
- </bookinfo>
-
- <chapter>
- <title>libnm-util API Reference</title>
- <xi:include href="xml/nm-connection.xml"/>
- <xi:include href="xml/nm-setting.xml"/>
- <xi:include href="xml/nm-setting-connection.xml"/>
- <xi:include href="xml/nm-setting-wired.xml"/>
- <xi:include href="xml/nm-setting-wireless.xml"/>
- <xi:include href="xml/nm-setting-wireless-security.xml"/>
- <xi:include href="xml/nm-setting-bluetooth.xml"/>
- <xi:include href="xml/nm-setting-serial.xml"/>
- <xi:include href="xml/nm-setting-cdma.xml"/>
- <xi:include href="xml/nm-setting-gsm.xml"/>
- <xi:include href="xml/nm-setting-wimax.xml"/>
- <xi:include href="xml/nm-setting-bond.xml"/>
- <xi:include href="xml/nm-setting-bridge.xml"/>
- <xi:include href="xml/nm-setting-bridge-port.xml"/>
- <xi:include href="xml/nm-setting-team.xml"/>
- <xi:include href="xml/nm-setting-team-port.xml"/>
- <xi:include href="xml/nm-setting-generic.xml"/>
- <xi:include href="xml/nm-setting-infiniband.xml"/>
- <xi:include href="xml/nm-setting-vlan.xml"/>
- <xi:include href="xml/nm-setting-olpc-mesh.xml"/>
- <xi:include href="xml/nm-setting-adsl.xml"/>
- <xi:include href="xml/nm-setting-dcb.xml"/>
- <xi:include href="xml/nm-setting-8021x.xml"/>
- <xi:include href="xml/nm-setting-ip4-config.xml"/>
- <xi:include href="xml/nm-setting-ip6-config.xml"/>
- <xi:include href="xml/nm-setting-ppp.xml"/>
- <xi:include href="xml/nm-setting-pppoe.xml"/>
- <xi:include href="xml/nm-setting-vpn.xml"/>
- <xi:include href="xml/nm-utils.xml"/>
- <xi:include href="xml/NetworkManager.xml"/>
- <xi:include href="xml/NetworkManagerVPN.xml"/>
-
- </chapter>
- <chapter id="object-tree">
- <title>Object Hierarchy</title>
- <xi:include href="xml/tree_index.sgml"/>
- </chapter>
- <index id="api-index-full">
- <title>API Index</title>
- <xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
- </index>
-
- <xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
-</book>
diff --git a/docs/libnm-util/meson.build b/docs/libnm-util/meson.build
deleted file mode 100644
index 1492103dc..000000000
--- a/docs/libnm-util/meson.build
+++ /dev/null
@@ -1,32 +0,0 @@
-doc_module = libnm_util_name
-
-private_headers = [
- 'crypto.h',
- 'nm-utils-private.h',
- 'nm-setting-private.h',
- 'nm-param-spec-specialized.h',
- 'nm-test-utils.h',
- 'nm-version.h',
-]
-
-configure_file(
- input: version_xml + '.in',
- output: version_xml,
- configuration: version_conf,
-)
-
-gnome.gtkdoc(
- doc_module,
- main_xml: doc_module + '-docs.sgml',
- src_dir: libnm_util_inc,
- dependencies: libnm_util_dep,
- scan_args: [
- '--rebuild-types',
- '--rebuild-sections',
- '--ignore-headers=' + ' '.join(private_headers),
- ],
- scanobjs_args: '--type-init-func="g_type_init();"',
- fixxref_args: '--html-dir=' + join_paths(nm_prefix, gnome.gtkdoc_html_dir(doc_module)),
- gobject_typesfile: doc_module + '.types',
- install: true,
-)
diff --git a/docs/libnm-util/version.xml.in b/docs/libnm-util/version.xml.in
deleted file mode 100644
index d78bda934..000000000
--- a/docs/libnm-util/version.xml.in
+++ /dev/null
@@ -1 +0,0 @@
-@VERSION@
diff --git a/docs/meson.build b/docs/meson.build
index 5c053165a..cc814b77e 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -6,11 +6,6 @@ version_xml = 'version.xml'
subdir('libnm')
subdir('api')
-if enable_libnm_glib
- subdir('libnm-util')
- subdir('libnm-glib')
-endif
-
test(
'check-docs',
find_program(join_paths(meson.source_root(), 'tools', 'check-docs.sh')),
diff --git a/libnm-core/nm-setting.c b/libnm-core/nm-setting.c
index 2e9081df2..db0f64644 100644
--- a/libnm-core/nm-setting.c
+++ b/libnm-core/nm-setting.c
@@ -2612,21 +2612,6 @@ static void
nm_setting_class_init (NMSettingClass *setting_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (setting_class);
- GModule *self_module;
- gpointer func;
-
- /* loading libnm and legacy libraries libnm-util/libnm-glib at the same
- * time is not supported. The reason is, that both libraries use the same
- * glib type names ("NMSetting"), and glib does not support namespacing
- * to allow for that.
- *
- * Arbitrarily, add a check here, see whether a known symbol from libnm-util
- * is present. If it is, it indicates that the process is borked and we
- * abort. */
- self_module = g_module_open (NULL, 0);
- if (g_module_symbol (self_module, "nm_util_get_private", &func))
- g_error ("libnm-util symbols detected; Mixing libnm with libnm-util/libnm-glib is not supported");
- g_module_close (self_module);
g_type_class_add_private (setting_class, sizeof (NMSettingPrivate));
diff --git a/libnm-glib/libnm-glib-test.c b/libnm-glib/libnm-glib-test.c
deleted file mode 100644
index 3b1866c58..000000000
--- a/libnm-glib/libnm-glib-test.c
+++ /dev/null
@@ -1,426 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * libnm_glib -- Access network status & information from glib applications
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Copyright (C) 2007 - 2008 Novell, Inc.
- * Copyright (C) 2007 - 2008 Red Hat, Inc.
- */
-
-#include "nm-default.h"
-
-#include <stdlib.h>
-#include <signal.h>
-#include <string.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include "nm-client.h"
-#include "nm-device.h"
-#include "nm-device-ethernet.h"
-#include "nm-device-wifi.h"
-#include "nm-device-generic.h"
-#include "nm-utils.h"
-#include "nm-active-connection.h"
-#include "nm-vpn-connection.h"
-#include "nm-setting-ip4-config.h"
-
-static gboolean
-test_wireless_enabled (NMClient *client)
-{
- gboolean wireless;
-
- wireless = nm_client_wireless_get_enabled (client);
- g_print ("Wireless enabled? %s\n", wireless ? "yes" : "no");
-
-// nm_client_wireless_set_enabled (client, !wireless);
-
- wireless = nm_client_wireless_hardware_get_enabled (client);
- g_print ("Wireless HW enabled? %s\n", wireless ? "yes" : "no");
-
-// nm_client_wireless_set_enabled (client, !wireless);
-
- return TRUE;
-}
-
-static gboolean
-test_get_state (NMClient *client)
-{
- guint state;
-
- state = nm_client_get_state (client);
- g_print ("Current state: %d\n", state);
-
- return TRUE;
-}
-
-static char *
-ip4_address_as_string (guint32 ip)
-{
- char buf[INET_ADDRSTRLEN+1];
- guint32 tmp_addr;
-
- memset (&buf, '\0', sizeof (buf));
- tmp_addr = ip;
-
- if (inet_ntop (AF_INET, &tmp_addr, buf, INET_ADDRSTRLEN)) {
- return g_strdup (buf);
- } else {
- g_warning ("%s: error converting IP4 address 0x%X",
- __func__, ntohl (tmp_addr));
- return NULL;
- }
-}
-
-static void
-dump_ip4_config (NMIP4Config *cfg)
-{
- char *tmp;
- const GArray *array;
- const GPtrArray *ptr_array;
- GSList *iter;
- int i;
-
- for (iter = (GSList *) nm_ip4_config_get_addresses (cfg); iter; iter = g_slist_next (iter)) {
- NMIP4Address *addr = iter->data;
- guint32 u;
-
- tmp = ip4_address_as_string (nm_ip4_address_get_address (addr));
- g_print ("IP4 address: %s\n", tmp);
- g_free (tmp);
-
- u = nm_ip4_address_get_prefix (addr);
- tmp = ip4_address_as_string (nm_utils_ip4_prefix_to_netmask (u));
- g_print ("IP4 prefix: %d (%s)\n", u, tmp);
- g_free (tmp);
-
- tmp = ip4_address_as_string (nm_ip4_address_get_gateway (addr));
- g_print ("IP4 gateway: %s\n\n", tmp);
- g_free (tmp);
- }
-
- array = nm_ip4_config_get_nameservers (cfg);
- if (array) {
- g_print ("IP4 DNS:\n");
- for (i = 0; i < array->len; i++) {
- tmp = ip4_address_as_string (g_array_index (array, guint32, i));
- g_print ("\t%s\n", tmp);
- g_free (tmp);
- }
- }
-
- ptr_array = nm_ip4_config_get_domains (cfg);
- if (ptr_array) {
- g_print ("IP4 domains:\n");
- for (i = 0; i < ptr_array->len; i++)
- g_print ("\t%s\n", (const char *) g_ptr_array_index (ptr_array, i));
- }
-
- array = nm_ip4_config_get_wins_servers (cfg);
- if (array) {
- g_print ("IP4 WINS:\n");
- for (i = 0; i < array->len; i++) {
- tmp = ip4_address_as_string (g_array_index (array, guint32, i));
- g_print ("\t%s\n", tmp);
- g_free (tmp);
- }
- }
-}
-
-static void
-print_one_dhcp4_option (gpointer key, gpointer data, gpointer user_data)
-{
- const char *option = (const char *) key;
- const char *value = (const char *) data;
-
- g_print (" %s: %s\n", option, value);
-}
-
-static void
-dump_dhcp4_config (NMDHCP4Config *config)
-{
- GHashTable *options = NULL;
-
- if (!config)
- return;
-
- g_print ("\nDHCP4 Options:\n");
- g_print ("-------------------------------------\n");
-
- g_object_get (G_OBJECT (config), NM_DHCP4_CONFIG_OPTIONS, &options, NULL);
- g_hash_table_foreach (options, print_one_dhcp4_option, NULL);
-}
-
-static void
-dump_access_point (NMAccessPoint *ap)
-{
- const GByteArray * ssid;
- const char * str;
-
- ssid = nm_access_point_get_ssid (ap);
- g_print ("\tSsid: %s\n",
- ssid ? nm_utils_escape_ssid (ssid->data, ssid->len) : "(none)");
-
- str = nm_access_point_get_bssid (ap);
- g_print ("\tMAC Address: %s\n", str);
-
- g_print ("\tFlags: 0x%X\n", nm_access_point_get_flags (ap));
- g_print ("\tWPA Flags: 0x%X\n", nm_access_point_get_wpa_flags (ap));
- g_print ("\tRSN Flags: 0x%X\n", nm_access_point_get_rsn_flags (ap));
- g_print ("\tFrequency: %u\n", nm_access_point_get_frequency (ap));
-
- g_print ("\tMode: %d\n", nm_access_point_get_mode (ap));
- g_print ("\tRate: %d\n", nm_access_point_get_max_bitrate (ap));
- g_print ("\tStrength: %d\n", nm_access_point_get_strength (ap));
-}
-
-static void
-dump_wireless (NMDeviceWifi *device)
-{
- const char *str;
- const GPtrArray *aps;
- int i;
-
- g_print ("Mode: %d\n", nm_device_wifi_get_mode (device));
- g_print ("Bitrate: %d\n", nm_device_wifi_get_bitrate (device));
-
- str = nm_device_wifi_get_hw_address (device);
- g_print ("MAC: %s\n", str);
-
- g_print ("AccessPoints:\n");
- aps = nm_device_wifi_get_access_points (device);
- for (i = 0; aps && (i < aps->len); i++) {
- dump_access_point (NM_ACCESS_POINT (g_ptr_array_index (aps, i)));
- g_print ("\n");
- }
-}
-
-static void
-dump_generic (NMDeviceGeneric *device)
-{
- g_print ("HW address: %s\n", nm_device_generic_get_hw_address (device));
-}
-
-static void
-dump_wired (NMDeviceEthernet *device)
-{
- const char *str;
-
- g_print ("Speed: %d\n", nm_device_ethernet_get_speed (device));
-
- str = nm_device_ethernet_get_hw_address (device);
- g_print ("MAC: %s\n", str);
-}
-
-static void
-dump_device (NMDevice *device)
-{
- const char *str;
- NMDeviceState state;
-
- str = nm_device_get_iface (device);
- g_print ("Interface: %s\n", str);
-
- str = nm_device_get_udi (device);
- g_print ("Udi: %s\n", str);
-
- str = nm_device_get_driver (device);
- g_print ("Driver: %s\n", str);
-
- str = nm_device_get_vendor (device);
- g_print ("Vendor: %s\n", str);
-
- str = nm_device_get_product (device);
- g_print ("Product: %s\n", str);
-
- state = nm_device_get_state (device);
- g_print ("State: %d\n", state);
-
- if (state == NM_DEVICE_STATE_ACTIVATED)
- dump_ip4_config (nm_device_get_ip4_config (device));
-
- if (NM_IS_DEVICE_ETHERNET (device))
- dump_wired (NM_DEVICE_ETHERNET (device));
- else if (NM_IS_DEVICE_WIFI (device))
- dump_wireless (NM_DEVICE_WIFI (device));
- else if (NM_IS_DEVICE_GENERIC (device))
- dump_generic (NM_DEVICE_GENERIC (device));
-
- dump_dhcp4_config (nm_device_get_dhcp4_config (device));
-}
-
-static gboolean
-test_devices (NMClient *client)
-{
- const GPtrArray *devices;
- int i;
-
- devices = nm_client_get_devices (client);
- g_print ("Got devices:\n");
- if (!devices) {
- g_print (" NONE\n");
- return TRUE;
- }
-
- for (i = 0; i < devices->len; i++) {
- NMDevice *device = g_ptr_array_index (devices, i);
- dump_device (device);
- g_print ("\n");
- }
-
- return TRUE;
-}
-
-static void
-active_connections_changed (NMClient *client, GParamSpec *pspec, gpointer user_data)
-{
- const GPtrArray *connections;
- int i, j;
-
- g_print ("Active connections changed:\n");
- connections = nm_client_get_active_connections (client);
- for (i = 0; connections && (i < connections->len); i++) {
- NMActiveConnection *connection;
- const GPtrArray *devices;
-
- connection = g_ptr_array_index (connections, i);
- g_print (" %s\n", nm_object_get_path (NM_OBJECT (connection)));
- devices = nm_active_connection_get_devices (connection);
- for (j = 0; devices && j < devices->len; j++)
- g_print (" %s\n", nm_device_get_udi (g_ptr_array_index (devices, j)));
- if (NM_IS_VPN_CONNECTION (connection))
- g_print (" VPN base connection: %s\n", nm_active_connection_get_specific_object (connection));
- }
-}
-
-static void
-show_active_connection_device (gpointer data, gpointer user_data)
-{
- NMDevice *device = NM_DEVICE (data);
-
- g_print (" %s\n", nm_device_get_udi (device));
-}
-
-static void
-test_get_active_connections (NMClient *client)
-{
- const GPtrArray *connections;
- int i;
-
- g_print ("Active connections:\n");
- connections = nm_client_get_active_connections (client);
- for (i = 0; connections && (i < connections->len); i++) {
- const GPtrArray *devices;
-
- g_print (" %s\n", nm_object_get_path (g_ptr_array_index (connections, i)));
- devices = nm_active_connection_get_devices (g_ptr_array_index (connections, i));
- if (devices)
- g_ptr_array_foreach ((GPtrArray *) devices, show_active_connection_device, NULL);
- }
-}
-
-static void
-device_state_changed (NMDevice *device, GParamSpec *pspec, gpointer user_data)
-{
- g_print ("Device state changed: %s %d\n",
- nm_device_get_iface (device),
- nm_device_get_state (device));
-}
-
-static void
-device_added_cb (NMClient *client, NMDevice *device, gpointer user_data)
-{
- g_print ("New device added\n");
- dump_device (device);
- g_signal_connect (G_OBJECT (device), "notify::state",
- (GCallback) device_state_changed, NULL);
-}
-
-static void
-device_removed_cb (NMClient *client, NMDevice *device, gpointer user_data)
-{
- g_print ("Device removed\n");
- dump_device (device);
-}
-
-static void
-manager_running (NMClient *client, GParamSpec *pspec, gpointer user_data)
-{
- if (nm_client_get_manager_running (client)) {
- g_print ("NM appeared\n");
- test_wireless_enabled (client);
- test_get_state (client);
- test_get_active_connections (client);
- test_devices (client);
- } else
- g_print ("NM disappeared\n");
-}
-
-static GMainLoop *loop = NULL;
-
-static void
-signal_handler (int signo)
-{
- if (signo == SIGINT || signo == SIGTERM) {
- g_message ("Caught signal %d, shutting down...", signo);
- g_main_loop_quit (loop);
- }
-}
-
-static void
-setup_signals (void)
-{
- struct sigaction action;
- sigset_t mask;
-
- sigemptyset (&mask);
- action.sa_handler = signal_handler;
- action.sa_mask = mask;
- action.sa_flags = 0;
- sigaction (SIGTERM, &action, NULL);
- sigaction (SIGINT, &action, NULL);
-}
-
-int
-main (int argc, char *argv[])
-{
- NMClient *client;
-
- client = nm_client_new ();
- if (!client) {
- exit (1);
- }
-
- g_signal_connect (client, "notify::" NM_CLIENT_MANAGER_RUNNING,
- G_CALLBACK (manager_running), NULL);
- g_signal_connect (client, "notify::" NM_CLIENT_ACTIVE_CONNECTIONS,
- G_CALLBACK (active_connections_changed), NULL);
- manager_running (client, NULL, NULL);
-
- g_signal_connect (client, "device-added",
- G_CALLBACK (device_added_cb), NULL);
- g_signal_connect (client, "device-removed",
- G_CALLBACK (device_removed_cb), NULL);
-
- loop = g_main_loop_new (NULL, FALSE);
- setup_signals ();
- g_main_loop_run (loop);
-
- g_object_unref (client);
-
- return 0;
-}
diff --git a/libnm-glib/libnm-glib-vpn.pc.in b/libnm-glib/libnm-glib-vpn.pc.in
deleted file mode 100644
index 046f5b072..000000000
--- a/libnm-glib/libnm-glib-vpn.pc.in
+++ /dev/null
@@ -1,13 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: libnm-glib-vpn
-Description: Convenience library for NetworkManager VPN plugins
-Version: @VERSION@
-Requires: NetworkManager >= @VERSION@ glib-2.0 dbus-glib-1
-Cflags: -I${includedir}/libnm-glib
-Libs: -L${libdir} -lnm-glib-vpn
-
-
diff --git a/libnm-glib/libnm-glib-vpn.ver b/libnm-glib/libnm-glib-vpn.ver
deleted file mode 100644
index b2e763b2a..000000000
--- a/libnm-glib/libnm-glib-vpn.ver
+++ /dev/null
@@ -1,29 +0,0 @@
-{
-global:
- nm_vpn_plugin_disconnect;
- nm_vpn_plugin_error_get_type;
- nm_vpn_plugin_error_quark;
- nm_vpn_plugin_failure;
- nm_vpn_plugin_get_connection;
- nm_vpn_plugin_get_state;
- nm_vpn_plugin_get_type;
- nm_vpn_plugin_secrets_required;
- nm_vpn_plugin_set_ip4_config;
- nm_vpn_plugin_set_login_banner;
- nm_vpn_plugin_set_state;
- nm_vpn_plugin_ui_interface_delete_connection;
- nm_vpn_plugin_ui_interface_export;
- nm_vpn_plugin_ui_interface_get_capabilities;
- nm_vpn_plugin_ui_interface_get_suggested_name;
- nm_vpn_plugin_ui_interface_get_type;
- nm_vpn_plugin_ui_interface_import;
- nm_vpn_plugin_ui_interface_ui_factory;
- nm_vpn_plugin_ui_widget_interface_get_type;
- nm_vpn_plugin_ui_widget_interface_get_widget;
- nm_vpn_plugin_ui_widget_interface_save_secrets;
- nm_vpn_plugin_ui_widget_interface_update_connection;
- nm_vpn_plugin_utils_get_secret_flags;
- nm_vpn_plugin_utils_read_vpn_details;
-local:
- *;
-};
diff --git a/libnm-glib/libnm-glib.pc.in b/libnm-glib/libnm-glib.pc.in
deleted file mode 100644
index 2b4e69967..000000000
--- a/libnm-glib/libnm-glib.pc.in
+++ /dev/null
@@ -1,13 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: libnm-glib
-Description: Convenience library for clients of NetworkManager
-Version: @VERSION@
-Requires: libnm-util >= @VERSION@ NetworkManager >= @VERSION@ gobject-2.0 dbus-glib-1
-Cflags: -I${includedir}/libnm-glib
-Libs: -L${libdir} -lnm-glib
-
-
diff --git a/libnm-glib/libnm-glib.ver b/libnm-glib/libnm-glib.ver
deleted file mode 100644
index bce31b0b7..000000000
--- a/libnm-glib/libnm-glib.ver
+++ /dev/null
@@ -1,309 +0,0 @@
-{
-global:
- libnm_glib_get_network_state;
- libnm_glib_init;
- libnm_glib_register_callback;
- libnm_glib_shutdown;
- libnm_glib_unregister_callback;
- nm_access_point_connection_valid;
- nm_access_point_filter_connections;
- nm_access_point_get_bssid;
- nm_access_point_get_flags;
- nm_access_point_get_frequency;
- nm_access_point_get_hw_address;
- nm_access_point_get_last_seen;
- nm_access_point_get_max_bitrate;
- nm_access_point_get_mode;
- nm_access_point_get_rsn_flags;
- nm_access_point_get_ssid;
- nm_access_point_get_strength;
- nm_access_point_get_type;
- nm_access_point_get_wpa_flags;
- nm_access_point_new;
- nm_active_connection_get_connection;
- nm_active_connection_get_connection_type;
- nm_active_connection_get_default6;
- nm_active_connection_get_default;
- nm_active_connection_get_devices;
- nm_active_connection_get_dhcp4_config;
- nm_active_connection_get_dhcp6_config;
- nm_active_connection_get_id;
- nm_active_connection_get_ip4_config;
- nm_active_connection_get_ip6_config;
- nm_active_connection_get_master;
- nm_active_connection_get_specific_object;
- nm_active_connection_get_state;
- nm_active_connection_get_type;
- nm_active_connection_get_uuid;
- nm_active_connection_get_vpn;
- nm_active_connection_new;
- nm_client_activate_connection;
- nm_client_add_and_activate_connection;
- nm_client_check_connectivity;
- nm_client_check_connectivity_async;
- nm_client_check_connectivity_finish;
- nm_client_deactivate_connection;
- nm_client_error_get_type;
- nm_client_error_quark;
- nm_client_get_activating_connection;
- nm_client_get_active_connections;
- nm_client_get_all_devices;
- nm_client_get_connectivity;
- nm_client_get_device_by_iface;
- nm_client_get_device_by_path;
- nm_client_get_devices;
- nm_client_get_logging;
- nm_client_get_manager_running;
- nm_client_get_permission_result;
- nm_client_get_primary_connection;
- nm_client_get_startup;
- nm_client_get_state;
- nm_client_get_type;
- nm_client_get_version;
- nm_client_networking_get_enabled;
- nm_client_networking_set_enabled;
- nm_client_new;
- nm_client_new_async;
- nm_client_new_finish;
- nm_client_permission_get_type;
- nm_client_permission_result_get_type;
- nm_client_set_logging;
- nm_client_sleep;
- nm_client_wimax_get_enabled;
- nm_client_wimax_hardware_get_enabled;
- nm_client_wimax_set_enabled;
- nm_client_wireless_get_enabled;
- nm_client_wireless_hardware_get_enabled;
- nm_client_wireless_set_enabled;
- nm_client_wwan_get_enabled;
- nm_client_wwan_hardware_get_enabled;
- nm_client_wwan_set_enabled;
- nm_device_adsl_error_get_type;
- nm_device_adsl_error_quark;
- nm_device_adsl_get_carrier;
- nm_device_adsl_get_type;
- nm_device_adsl_new;
- nm_device_bond_error_get_type;
- nm_device_bond_error_quark;
- nm_device_bond_get_carrier;
- nm_device_bond_get_hw_address;
- nm_device_bond_get_slaves;
- nm_device_bond_get_type;
- nm_device_bond_new;
- nm_device_bridge_error_get_type;
- nm_device_bridge_error_quark;
- nm_device_bridge_get_carrier;
- nm_device_bridge_get_hw_address;
- nm_device_bridge_get_slaves;
- nm_device_bridge_get_type;
- nm_device_bridge_new;
- nm_device_bt_error_get_type;
- nm_device_bt_error_quark;
- nm_device_bt_get_capabilities;
- nm_device_bt_get_hw_address;
- nm_device_bt_get_name;
- nm_device_bt_get_type;
- nm_device_bt_new;
- nm_device_connection_compatible;
- nm_device_connection_valid;
- nm_device_delete;
- nm_device_disambiguate_names;
- nm_device_disconnect;
- nm_device_error_get_type;
- nm_device_error_quark;
- nm_device_ethernet_error_get_type;
- nm_device_ethernet_error_quark;
- nm_device_ethernet_get_carrier;
- nm_device_ethernet_get_hw_address;
- nm_device_ethernet_get_permanent_hw_address;
- nm_device_ethernet_get_speed;
- nm_device_ethernet_get_type;
- nm_device_ethernet_new;
- nm_device_filter_connections;
- nm_device_generic_error_get_type;
- nm_device_generic_error_quark;
- nm_device_generic_get_hw_address;
- nm_device_generic_get_type;
- nm_device_generic_new;
- nm_device_get_active_connection;
- nm_device_get_autoconnect;
- nm_device_get_available_connections;
- nm_device_get_capabilities;
- nm_device_get_description;
- nm_device_get_device_type;
- nm_device_get_dhcp4_config;
- nm_device_get_dhcp6_config;
- nm_device_get_driver;
- nm_device_get_driver_version;
- nm_device_get_firmware_missing;
- nm_device_get_firmware_version;
- nm_device_get_hw_address;
- nm_device_get_iface;
- nm_device_get_ip4_config;
- nm_device_get_ip6_config;
- nm_device_get_ip_iface;
- nm_device_get_managed;
- nm_device_get_mtu;
- nm_device_get_physical_port_id;
- nm_device_get_product;
- nm_device_get_setting_type;
- nm_device_get_state;
- nm_device_get_state_reason;
- nm_device_get_type;
- nm_device_get_type_description;
- nm_device_get_udi;
- nm_device_get_vendor;
- nm_device_infiniband_error_get_type;
- nm_device_infiniband_error_quark;
- nm_device_infiniband_get_carrier;
- nm_device_infiniband_get_hw_address;
- nm_device_infiniband_get_type;
- nm_device_infiniband_new;
- nm_device_is_real;
- nm_device_is_software;
- nm_device_modem_error_get_type;
- nm_device_modem_error_quark;
- nm_device_modem_get_current_capabilities;
- nm_device_modem_get_modem_capabilities;
- nm_device_modem_get_type;
- nm_device_new;
- nm_device_olpc_mesh_error_get_type;
- nm_device_olpc_mesh_error_quark;
- nm_device_olpc_mesh_get_active_channel;
- nm_device_olpc_mesh_get_companion;
- nm_device_olpc_mesh_get_hw_address;
- nm_device_olpc_mesh_get_type;
- nm_device_olpc_mesh_new;
- nm_device_set_autoconnect;
- nm_device_set_managed;
- nm_device_team_error_get_type;
- nm_device_team_error_quark;
- nm_device_team_get_carrier;
- nm_device_team_get_hw_address;
- nm_device_team_get_slaves;
- nm_device_team_get_type;
- nm_device_team_new;
- nm_device_vlan_error_get_type;
- nm_device_vlan_error_quark;
- nm_device_vlan_get_carrier;
- nm_device_vlan_get_hw_address;
- nm_device_vlan_get_parent;
- nm_device_vlan_get_type;
- nm_device_vlan_get_vlan_id;
- nm_device_vlan_new;
- nm_device_wifi_error_get_type;
- nm_device_wifi_error_quark;
- nm_device_wifi_get_access_point_by_path;
- nm_device_wifi_get_access_points;
- nm_device_wifi_get_active_access_point;
- nm_device_wifi_get_bitrate;
- nm_device_wifi_get_capabilities;
- nm_device_wifi_get_hw_address;
- nm_device_wifi_get_mode;
- nm_device_wifi_get_permanent_hw_address;
- nm_device_wifi_get_type;
- nm_device_wifi_new;
- nm_device_wifi_request_scan_simple;
- nm_device_wimax_error_get_type;
- nm_device_wimax_error_quark;
- nm_device_wimax_get_active_nsp;
- nm_device_wimax_get_bsid;
- nm_device_wimax_get_center_frequency;
- nm_device_wimax_get_cinr;
- nm_device_wimax_get_hw_address;
- nm_device_wimax_get_nsp_by_path;
- nm_device_wimax_get_nsps;
- nm_device_wimax_get_rssi;
- nm_device_wimax_get_tx_power;
- nm_device_wimax_get_type;
- nm_device_wimax_new;
- nm_dhcp4_config_get_one_option;
- nm_dhcp4_config_get_options;
- nm_dhcp4_config_get_type;
- nm_dhcp4_config_new;
- nm_dhcp6_config_get_one_option;
- nm_dhcp6_config_get_options;
- nm_dhcp6_config_get_type;
- nm_dhcp6_config_new;
- nm_ip4_config_get_addresses;
- nm_ip4_config_get_domains;
- nm_ip4_config_get_gateway;
- nm_ip4_config_get_nameservers;
- nm_ip4_config_get_routes;
- nm_ip4_config_get_searches;
- nm_ip4_config_get_type;
- nm_ip4_config_get_wins_servers;
- nm_ip4_config_new;
- nm_ip6_address_array_get_type;
- nm_ip6_address_object_array_get_type;
- nm_ip6_config_get_addresses;
- nm_ip6_config_get_domains;
- nm_ip6_config_get_gateway;
- nm_ip6_config_get_nameserver;
- nm_ip6_config_get_nameservers;
- nm_ip6_config_get_num_nameservers;
- nm_ip6_config_get_routes;
- nm_ip6_config_get_searches;
- nm_ip6_config_get_type;
- nm_ip6_config_new;
- nm_ip6_route_object_array_get_type;
- nm_object_array_get_type;
- nm_object_error_get_type;
- nm_object_error_quark;
- nm_object_get_connection;
- nm_object_get_path;
- nm_object_get_type;
- nm_remote_connection_commit_changes;
- nm_remote_connection_commit_changes_unsaved;
- nm_remote_connection_delete;
- nm_remote_connection_error_get_type;
- nm_remote_connection_error_quark;
- nm_remote_connection_get_secrets;
- nm_remote_connection_get_type;
- nm_remote_connection_get_unsaved;
- nm_remote_connection_new;
- nm_remote_connection_save;
- nm_remote_settings_add_connection;
- nm_remote_settings_add_connection_unsaved;
- nm_remote_settings_error_get_type;
- nm_remote_settings_error_quark;
- nm_remote_settings_get_connection_by_id;
- nm_remote_settings_get_connection_by_path;
- nm_remote_settings_get_connection_by_uuid;
- nm_remote_settings_get_type;
- nm_remote_settings_list_connections;
- nm_remote_settings_load_connections;
- nm_remote_settings_new;
- nm_remote_settings_new_async;
- nm_remote_settings_new_finish;
- nm_remote_settings_reload_connections;
- nm_remote_settings_save_hostname;
- nm_secret_agent_capabilities_get_type;
- nm_secret_agent_delete_secrets;
- nm_secret_agent_error_get_type;
- nm_secret_agent_error_quark;
- nm_secret_agent_get_registered;
- nm_secret_agent_get_secrets;
- nm_secret_agent_get_secrets_flags_get_type;
- nm_secret_agent_get_type;
- nm_secret_agent_register;
- nm_secret_agent_save_secrets;
- nm_secret_agent_unregister;
- nm_ssid_get_type;
- nm_string_array_get_type;
- nm_uint_array_get_type;
- nm_vpn_connection_get_banner;
- nm_vpn_connection_get_type;
- nm_vpn_connection_get_vpn_state;
- nm_vpn_connection_new;
- nm_wimax_nsp_connection_valid;
- nm_wimax_nsp_filter_connections;
- nm_wimax_nsp_get_name;
- nm_wimax_nsp_get_network_type;
- nm_wimax_nsp_get_signal_quality;
- nm_wimax_nsp_get_type;
- nm_wimax_nsp_network_type_get_type;
- nm_wimax_nsp_new;
-local:
- *;
-};
diff --git a/libnm-glib/libnm_glib.c b/libnm-glib/libnm_glib.c
deleted file mode 100644
index 1e0725ca1..000000000
--- a/libnm-glib/libnm_glib.c
+++ /dev/null
@@ -1,580 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * libnm_glib -- Access network status & information from glib applications
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright (C) 2005 - 2008 Red Hat, Inc.
- * Copyright (C) 2005 - 2008 Novell, Inc.
- */
-
-#include "nm-default.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <dbus/dbus.h>
-#include <dbus/dbus-glib-lowlevel.h>
-
-#include "NetworkManager.h"
-#include "libnm_glib.h"
-
-#define DBUS_NO_SERVICE_ERROR "org.freedesktop.DBus.Error.ServiceDoesNotExist"
-
-struct libnm_glib_ctx
-{
- unsigned char check;
-
- GMainContext * g_main_ctx;
- GMainLoop * g_main_loop;
- DBusConnection * dbus_con;
- guint dbus_watcher;
- guint dbus_watch_interval;
-
- gboolean thread_done;
- gboolean thread_inited;
- GThread * thread;
-
- GSList * callbacks;
- GMutex * callbacks_lock;
- guint callback_id_last;
-
- libnm_glib_state nm_state;
-};
-
-typedef struct libnm_glib_callback
-{
- guint id;
- GMainContext * gmain_ctx;
- libnm_glib_ctx * libnm_glib_ctx;
- libnm_glib_callback_func func;
- gpointer user_data;
-} libnm_glib_callback;
-
-static void _libnm_glib_schedule_dbus_watcher (libnm_glib_ctx *ctx);
-static DBusConnection * _libnm_glib_dbus_init (gpointer *user_data, GMainContext *context);
-static void _libnm_glib_update_state (libnm_glib_ctx *ctx, NMState state);
-
-static void
-_libnm_glib_nm_state_cb (DBusPendingCall *pcall, void *user_data)
-{
- DBusMessage *reply;
- libnm_glib_ctx *ctx = (libnm_glib_ctx *) user_data;
- NMState nm_state;
-
- g_return_if_fail (pcall != NULL);
- g_return_if_fail (ctx != NULL);
-
- if (!(reply = dbus_pending_call_steal_reply (pcall)))
- goto out;
-
- if (dbus_message_get_type (reply) == DBUS_MESSAGE_TYPE_ERROR)
- {
- DBusError err;
-
- dbus_error_init (&err);
- dbus_set_error_from_message (&err, reply);
- fprintf (stderr, "%s: dbus returned an error.\n (%s) %s\n", __func__, err.name, err.message);
- dbus_error_free (&err);
- dbus_message_unref (reply);
- goto out;
- }
-
- if (dbus_message_get_args (reply, NULL, DBUS_TYPE_UINT32, &nm_state, DBUS_TYPE_INVALID))
- _libnm_glib_update_state (ctx, nm_state);
-
- dbus_message_unref (reply);
-
-out:
- dbus_pending_call_unref (pcall);
-}
-
-static void
-_libnm_glib_get_nm_state (libnm_glib_ctx *ctx)
-{
- DBusMessage *message;
- DBusPendingCall *pcall = NULL;
-
- g_return_if_fail (ctx != NULL);
-
- if ((message = dbus_message_new_method_call (NM_DBUS_SERVICE, NM_DBUS_PATH, NM_DBUS_INTERFACE, "state")))
- {
- dbus_connection_send_with_reply (ctx->dbus_con, message, &pcall, -1);
- if (pcall)
- dbus_pending_call_set_notify (pcall, _libnm_glib_nm_state_cb, ctx, NULL);
- dbus_message_unref (message);
- }
-}
-
-static gboolean
-_libnm_glib_callback_helper (gpointer user_data)
-{
- libnm_glib_callback *cb_data = (libnm_glib_callback *)user_data;
-
- g_return_val_if_fail (cb_data != NULL, FALSE);
- g_return_val_if_fail (cb_data->func != NULL, FALSE);
- g_return_val_if_fail (cb_data->libnm_glib_ctx != NULL, FALSE);
-
- (*(cb_data->func)) (cb_data->libnm_glib_ctx, cb_data->user_data);
-
- return FALSE;
-}
-
-static void
-_libnm_glib_schedule_single_callback (libnm_glib_ctx *ctx,
- libnm_glib_callback *callback)
-{
- GSource *source;
-
- g_return_if_fail (ctx != NULL);
- g_return_if_fail (callback != NULL);
-
- callback->libnm_glib_ctx = ctx;
-
- source = g_idle_source_new ();
- g_source_set_callback (source, _libnm_glib_callback_helper, callback, NULL);
- g_source_attach (source, callback->gmain_ctx);
- g_source_unref (source);
-}
-
-static void
-_libnm_glib_unschedule_single_callback (libnm_glib_ctx *ctx,
- libnm_glib_callback *callback)
-{
- GSource *source;
-
- g_return_if_fail (ctx != NULL);
- g_return_if_fail (callback != NULL);
-
- source = g_main_context_find_source_by_user_data (callback->gmain_ctx, callback);
- if (source)
- g_source_destroy (source);
-}
-
-static void
-_libnm_glib_call_callbacks (libnm_glib_ctx *ctx)
-{
- GSList *elem;
-
- g_return_if_fail (ctx != NULL);
-
- g_mutex_lock (ctx->callbacks_lock);
- for (elem = ctx->callbacks; elem; elem = g_slist_next (elem))
- {
- libnm_glib_callback *callback = (libnm_glib_callback *)(elem->data);
- if (callback)
- _libnm_glib_schedule_single_callback (ctx, callback);
- }
- g_mutex_unlock (ctx->callbacks_lock);
-}
-
-static void
-_libnm_glib_update_state (libnm_glib_ctx *ctx, NMState state)
-{
- libnm_glib_state old_state;
-
- g_return_if_fail (ctx != NULL);
-
- old_state = ctx->nm_state;
- switch (state) {
- case NM_STATE_CONNECTED_LOCAL:
- case NM_STATE_CONNECTED_SITE:
- case NM_STATE_CONNECTED_GLOBAL:
- ctx->nm_state = LIBNM_ACTIVE_NETWORK_CONNECTION;
- break;
- case NM_STATE_ASLEEP:
- case NM_STATE_CONNECTING:
- case NM_STATE_DISCONNECTED:
- case NM_STATE_DISCONNECTING:
- ctx->nm_state = LIBNM_NO_NETWORK_CONNECTION;
- break;
- case NM_STATE_UNKNOWN:
- default:
- ctx->nm_state = LIBNM_NO_NETWORKMANAGER;
- break;
- }
-
- if (old_state != ctx->nm_state)
- _libnm_glib_call_callbacks (ctx);
-}
-
-static DBusHandlerResult
-_libnm_glib_dbus_filter (DBusConnection *connection,
- DBusMessage *message,
- void *user_data)
-{
- libnm_glib_ctx *ctx = (libnm_glib_ctx *)user_data;
- gboolean handled = TRUE;
- DBusError error;
-
- g_return_val_if_fail (ctx != NULL, DBUS_HANDLER_RESULT_NOT_YET_HANDLED);
- g_return_val_if_fail (connection != NULL, DBUS_HANDLER_RESULT_NOT_YET_HANDLED);
- g_return_val_if_fail (message != NULL, DBUS_HANDLER_RESULT_NOT_YET_HANDLED);
-
- dbus_error_init (&error);
- if (dbus_message_is_signal (message, DBUS_INTERFACE_LOCAL, "Disconnected"))
- {
- /* Try to reactivate our connection to dbus on the next pass through the event loop */
- ctx->nm_state = LIBNM_NO_DBUS;
- dbus_connection_close (ctx->dbus_con);
- dbus_connection_unref (ctx->dbus_con);
- ctx->dbus_con = NULL;
- _libnm_glib_schedule_dbus_watcher (ctx);
- }
- else if (dbus_message_is_signal (message, DBUS_INTERFACE_DBUS, "NameOwnerChanged"))
- {
- /* New signal for dbus 0.23... */
- char *service;
- char *old_owner;
- char *new_owner;
-
- if ( dbus_message_get_args (message, &error,
- DBUS_TYPE_STRING, &service,
- DBUS_TYPE_STRING, &old_owner,
- DBUS_TYPE_STRING, &new_owner,
- DBUS_TYPE_INVALID))
- {
- if (strcmp (service, NM_DBUS_SERVICE) == 0)
- {
- gboolean old_owner_good = (old_owner && (strlen (old_owner) > 0));
- gboolean new_owner_good = (new_owner && (strlen (new_owner) > 0));
-
- if (!old_owner_good && new_owner_good) /* Equivalent to old ServiceCreated signal */
- _libnm_glib_get_nm_state (ctx);
- else if (old_owner_good && !new_owner_good) /* Equivalent to old ServiceDeleted signal */
- ctx->nm_state = LIBNM_NO_NETWORKMANAGER;
- }
- }
- }
- else if ( dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceNowActive")
- || dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceNoLongerActive")
- || dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DeviceActivating")
- || dbus_message_is_signal (message, NM_DBUS_INTERFACE, "DevicesChanged"))
- {
- _libnm_glib_get_nm_state (ctx);
- }
- else if (dbus_message_is_signal (message, NM_DBUS_INTERFACE, "StateChanged"))
- {
- NMState state = NM_STATE_UNKNOWN;
-
- dbus_message_get_args (message, &error, DBUS_TYPE_UINT32, &state, DBUS_TYPE_INVALID);
- _libnm_glib_update_state (ctx, state);
- }
- else
- handled = FALSE;
-
- if (dbus_error_is_set (&error))
- dbus_error_free (&error);
-
- return (handled ? DBUS_HANDLER_RESULT_HANDLED : DBUS_HANDLER_RESULT_NOT_YET_HANDLED);
-}
-
-/*
- * libnm_glib_dbus_init
- *
- * Initialize a connection to dbus and set up our callbacks.
- *
- */
-static DBusConnection *
-_libnm_glib_dbus_init (gpointer *user_data, GMainContext *context)
-{
- DBusConnection *connection = NULL;
- DBusError error;
-
- dbus_error_init (&error);
- connection = dbus_bus_get_private (DBUS_BUS_SYSTEM, &error);
- if (dbus_error_is_set (&error))
- {
- fprintf (stderr, "%s: error, %s raised:\n %s\n\n", __func__, error.name, error.message);
- dbus_error_free (&error);
- return (NULL);
- }
- if (!connection)
- return NULL;
-
- if (!dbus_connection_add_filter (connection, _libnm_glib_dbus_filter, user_data, NULL))
- return (NULL);
-
- dbus_connection_set_exit_on_disconnect (connection, FALSE);
- dbus_connection_setup_with_g_main (connection, context);
-
- dbus_error_init (&error);
- dbus_bus_add_match (connection,
- "type='signal',"
- "interface='" DBUS_INTERFACE_DBUS "',"
- "sender='" DBUS_SERVICE_DBUS "'",
- &error);
- if (dbus_error_is_set (&error))
- dbus_error_free (&error);
-
- dbus_error_init (&error);
- dbus_bus_add_match (connection,
- "type='signal',"
- "interface='" NM_DBUS_INTERFACE "',"
- "path='" NM_DBUS_PATH "',"
- "sender='" NM_DBUS_SERVICE "'",
- &error);
- if (dbus_error_is_set (&error))
- dbus_error_free (&error);
-
- return (connection);
-}
-
-/*
- * libnm_glib_dbus_watcher
- *
- * Repeatedly try to re-activate the connection to dbus.
- *
- */
-static gboolean
-_libnm_glib_dbus_watcher (gpointer user_data)
-{
- libnm_glib_ctx *ctx = (libnm_glib_ctx *)user_data;
-
- g_return_val_if_fail (ctx != NULL, FALSE);
-
- ctx->dbus_watcher = 0;
-
- if (!ctx->dbus_con)
- ctx->dbus_con = _libnm_glib_dbus_init ((gpointer)ctx, ctx->g_main_ctx);
-
- if (ctx->dbus_con)
- {
- /* Get NM's state right away after we reconnect */
- _libnm_glib_get_nm_state (ctx);
- ctx->dbus_watch_interval = 1000;
- }
- else
- {
- /* Wait 3 seconds longer each time we fail to reconnect to dbus,
- * with a maximum wait of one minute.
- */
- ctx->dbus_watch_interval = MIN(ctx->dbus_watch_interval + 3000, 60000);
-
- /* Reschule ourselves if we _still_ don't have a connection to dbus */
- _libnm_glib_schedule_dbus_watcher (ctx);
- }
-
- return FALSE;
-}
-
-/*
- * libnm_glib_schedule_dbus_watcher
- *
- * Schedule an idle handler in our main loop to repeatedly
- * attempt to re-activate the dbus connection until connected.
- *
- */
-static void
-_libnm_glib_schedule_dbus_watcher (libnm_glib_ctx *ctx)
-{
- g_return_if_fail (ctx != NULL);
-
- if (ctx->dbus_watcher == 0)
- {
- GSource *source = g_timeout_source_new (ctx->dbus_watch_interval);
- g_source_set_callback (source, _libnm_glib_dbus_watcher, (gpointer) ctx, NULL);
- ctx->dbus_watcher = g_source_attach (source, ctx->g_main_ctx);
- g_source_unref (source);
- }
-}
-
-/*
- * libnm_glib_dbus_worker
- *
- * Main thread for libnm
- *
- */
-static gpointer
-_libnm_glib_dbus_worker (gpointer user_data)
-{
- libnm_glib_ctx *ctx = (libnm_glib_ctx *)user_data;
-
- g_return_val_if_fail (ctx != NULL, NULL);
-
- /* If dbus isn't up yet, schedule an idle handler to check for dbus.
- * We also need a way to reconnect to dbus if the connection ever goes
- * down. Should probably be done by a timeout polling dbus_connection_is_connected()
- * or by getting connection status out of libdbus or something.
- */
- if (!(ctx->dbus_con = _libnm_glib_dbus_init ((gpointer) ctx, ctx->g_main_ctx)))
- _libnm_glib_schedule_dbus_watcher (ctx);
- else
- _libnm_glib_get_nm_state (ctx);
-
- ctx->thread_inited = TRUE;
- g_main_loop_run (ctx->g_main_loop);
- ctx->thread_done = TRUE;
-
- return NULL;
-}
-
-static void
-_libnm_glib_ctx_free (libnm_glib_ctx *ctx)
-{
- g_return_if_fail (ctx != NULL);
-
- if (ctx->check == 0xDD)
- {
- fprintf (stderr, "%s: context %p already freed!\n", __func__, ctx);
- return;
- }
-
- if (ctx->g_main_ctx)
- g_main_context_unref (ctx->g_main_ctx);
- if (ctx->g_main_loop)
- g_main_loop_unref (ctx->g_main_loop);
-
- if (ctx->dbus_con)
- {
- dbus_connection_close (ctx->dbus_con);
- dbus_connection_unref (ctx->dbus_con);
- ctx->dbus_con = NULL;
- }
-
- if (ctx->callbacks_lock)
- g_mutex_free (ctx->callbacks_lock);
-
- g_slist_free_full (ctx->callbacks, g_free);
-
- if (ctx->thread)
- g_thread_join (ctx->thread);
-
- memset (ctx, 0, sizeof (libnm_glib_ctx));
- memset (&(ctx->check), 0xDD, sizeof (ctx->check));
- g_free (ctx);
-}
-
-static libnm_glib_ctx *
-_libnm_glib_ctx_new (void)
-{
- libnm_glib_ctx *ctx = g_malloc0 (sizeof (libnm_glib_ctx));
-
- if (!(ctx->g_main_ctx = g_main_context_new ()))
- goto error;
- if (!(ctx->g_main_loop = g_main_loop_new (ctx->g_main_ctx, FALSE)))
- goto error;
- if (!(ctx->callbacks_lock = g_mutex_new ()))
- goto error;
- ctx->dbus_watch_interval = 1000;
-
- return ctx;
-
-error:
- _libnm_glib_ctx_free (ctx);
- return NULL;
-}
-
-libnm_glib_ctx *
-libnm_glib_init (void)
-{
- libnm_glib_ctx *ctx = NULL;
-
- if (!g_thread_supported ())
- g_thread_init (NULL);
- dbus_g_thread_init ();
-
- if (!(ctx = _libnm_glib_ctx_new ()))
- return NULL;
-
- ctx->thread = g_thread_create (_libnm_glib_dbus_worker, ctx, TRUE, NULL);
- if (!ctx->thread)
- goto error;
-
- /* Wait until initialization of the thread */
- while (!ctx->thread_inited)
- g_usleep (G_USEC_PER_SEC / 20);
-
- return ctx;
-
-error:
- _libnm_glib_ctx_free (ctx);
- return NULL;
-}
-
-void
-libnm_glib_shutdown (libnm_glib_ctx *ctx)
-{
- g_return_if_fail (ctx != NULL);
-
- g_main_loop_quit (ctx->g_main_loop);
- while (!ctx->thread_done)
- g_usleep (G_USEC_PER_SEC / 20);
-
- _libnm_glib_ctx_free (ctx);
-}
-
-libnm_glib_state
-libnm_glib_get_network_state (const libnm_glib_ctx *ctx)
-{
- if (!ctx)
- return LIBNM_INVALID_CONTEXT;
-
- return ctx->nm_state;
-}
-
-guint
-libnm_glib_register_callback (libnm_glib_ctx *ctx,
- libnm_glib_callback_func func,
- gpointer user_data,
- GMainContext *g_main_ctx)
-{
- libnm_glib_callback *callback = NULL;
-
- g_return_val_if_fail (ctx != NULL, 0);
- g_return_val_if_fail (func != NULL, 0);
-
- callback = g_malloc0 (sizeof (libnm_glib_callback));
-
- callback->id = ++ (ctx->callback_id_last);
- callback->func = func;
- callback->gmain_ctx = g_main_ctx;
- callback->libnm_glib_ctx = ctx;
- callback->user_data = user_data;
-
- g_mutex_lock (ctx->callbacks_lock);
- ctx->callbacks = g_slist_append (ctx->callbacks, callback);
- _libnm_glib_schedule_single_callback (ctx, callback);
- g_mutex_unlock (ctx->callbacks_lock);
-
- return (callback->id);
-}
-
-void
-libnm_glib_unregister_callback (libnm_glib_ctx *ctx,
- guint id)
-{
- GSList *elem;
-
- g_return_if_fail (ctx != NULL);
- g_return_if_fail (id > 0);
-
- g_mutex_lock (ctx->callbacks_lock);
- elem = ctx->callbacks;
- while (elem)
- {
- libnm_glib_callback *callback = (libnm_glib_callback *)(elem->data);
- if (callback && (callback->id == id))
- {
- _libnm_glib_unschedule_single_callback (ctx, callback);
- ctx->callbacks = g_slist_remove_link (ctx->callbacks, elem);
- break;
- }
-
- elem = g_slist_next (elem);
- }
- g_mutex_unlock (ctx->callbacks_lock);
-}
diff --git a/libnm-glib/libnm_glib.h b/libnm-glib/libnm_glib.h
deleted file mode 100644
index 4137a8ca4..000000000
--- a/libnm-glib/libnm_glib.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * libnm_glib -- Access network status & information from glib applications
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright (C) 2005 - 2008 Red Hat, Inc.
- * Copyright (C) 2005 - 2008 Novell, Inc.
- */
-
-#ifndef _LIB_NM_H_
-#define _LIB_NM_H_
-
-#ifndef NM_DISABLE_DEPRECATED
-
-#include <glib.h>
-
-G_BEGIN_DECLS
-
-typedef enum libnm_glib_state
-{
- LIBNM_NO_DBUS = 0,
- LIBNM_NO_NETWORKMANAGER,
- LIBNM_NO_NETWORK_CONNECTION,
- LIBNM_ACTIVE_NETWORK_CONNECTION,
- LIBNM_INVALID_CONTEXT
-} libnm_glib_state G_GNUC_DEPRECATED;
-
-typedef struct libnm_glib_ctx libnm_glib_ctx G_GNUC_DEPRECATED;
-
-typedef void (*libnm_glib_callback_func) (libnm_glib_ctx *libnm_ctx, gpointer user_data) G_GNUC_DEPRECATED;
-
-G_GNUC_DEPRECATED libnm_glib_ctx * libnm_glib_init (void);
-G_GNUC_DEPRECATED void libnm_glib_shutdown (libnm_glib_ctx *ctx);
-
-G_GNUC_DEPRECATED libnm_glib_state libnm_glib_get_network_state (const libnm_glib_ctx *ctx);
-
-G_GNUC_DEPRECATED guint libnm_glib_register_callback (libnm_glib_ctx *ctx, libnm_glib_callback_func func, gpointer user_data, GMainContext *g_main_ctx);
-G_GNUC_DEPRECATED void libnm_glib_unregister_callback (libnm_glib_ctx *ctx, guint id);
-
-G_END_DECLS
-
-#endif /* NM_DISABLE_DEPRECATED */
-
-#endif /* _LIB_NM_H_ */
diff --git a/libnm-glib/meson.build b/libnm-glib/meson.build
deleted file mode 100644
index 3882d59a9..000000000
--- a/libnm-glib/meson.build
+++ /dev/null
@@ -1,286 +0,0 @@
-libnm_glib_inc = include_directories('.')
-
-dbus_binding_tool = find_program('dbus-binding-tool')
-
-common_deps = [
- dbus_dep,
- dbus_glib_dep,
- shared_nm_utils_base_dep,
-]
-
-common_cflags = [
- '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_GLIB',
-]
-
-cflags = common_cflags + [
- '-DG_LOG_DOMAIN="@0@"'.format(libnm_glib_name),
-]
-
-vpn_headers = files(
- 'nm-vpn-plugin.h',
- 'nm-vpn-plugin-ui-interface.h',
- 'nm-vpn-plugin-utils.h',
-)
-
-headers = files(
- 'nm-access-point.h',
- 'nm-active-connection.h',
- 'nm-client.h',
- 'nm-device-adsl.h',
- 'nm-device-bond.h',
- 'nm-device-bridge.h',
- 'nm-device-bt.h',
- 'nm-device-ethernet.h',
- 'nm-device-generic.h',
- 'nm-device.h',
- 'nm-device-infiniband.h',
- 'nm-device-modem.h',
- 'nm-device-olpc-mesh.h',
- 'nm-device-team.h',
- 'nm-device-vlan.h',
- 'nm-device-wifi.h',
- 'nm-device-wimax.h',
- 'nm-dhcp4-config.h',
- 'nm-dhcp6-config.h',
- 'nm-ip4-config.h',
- 'nm-ip6-config.h',
- 'nm-object.h',
- 'nm-remote-connection.h',
- 'nm-remote-settings.h',
- 'nm-secret-agent.h',
- 'nm-types.h',
- 'nm-vpn-connection.h',
- 'nm-wimax-nsp.h',
-)
-
-deprecated_headers = files('libnm_glib.h')
-
-install_headers(
- headers + vpn_headers + deprecated_headers,
- subdir: libnm_glib_name,
-)
-
-libdeprecated_nm_glib = static_library(
- 'deprecated-nm-glib',
- sources: 'libnm_glib.c',
- include_directories: libnm_util_inc,
- dependencies: common_deps,
- c_args: cflags + [
- '-Wno-deprecated-declarations',
- '-Wno-deprecated',
- ],
-)
-
-sources = files(
- 'nm-vpn-plugin.c',
- 'nm-vpn-plugin-ui-interface.c',
- 'nm-vpn-plugin-utils.c',
-)
-
-glue = 'nm-vpn-plugin-glue.h'
-
-enum_types = 'nm-vpn-enum-types'
-
-libnm_glib_vpn_enum = gnome.mkenums(
- enum_types,
- sources: vpn_headers,
- identifier_prefix: nm_id_prefix,
- c_template: enum_types + '.c.template',
- h_template: enum_types + '.h.template',
- install_header: true,
- install_dir: libnm_glib_pkgincludedir,
-)
-
-linker_script = join_paths(meson.current_source_dir(), 'libnm-glib-vpn.ver')
-
-libnm_glib_vpn = shared_library(
- 'nm-glib-vpn',
- sources: files(
- 'nm-vpn-plugin.c',
- 'nm-vpn-plugin-ui-interface.c',
- 'nm-vpn-plugin-utils.c',
- ) + [
- custom_target(
- glue,
- input: ifaces_vpn_plugin_xml,
- output: glue,
- command: [dbus_binding_tool, '--prefix=nm_vpn_plugin', '--mode=glib-server', '--output=@OUTPUT@', '@INPUT@'],
- ),
- ] + libnm_glib_vpn_enum,
- version: libnm_glib_vpn_version,
- dependencies: common_deps + [libnm_util_dep],
- c_args: cflags,
- link_args: [
- '-Wl,--version-script,@0@'.format(linker_script),
- ],
- link_depends: linker_script,
- install: true,
-)
-
-libnm_glib_vpn_dep = declare_dependency(
- include_directories: libnm_glib_inc,
- link_with: libnm_glib_vpn,
-)
-
-pkg.generate(
- libraries: libnm_glib_vpn,
- version: nm_version,
- name: libnm_glib_vpn_name,
- description: 'Convenience library for NetworkManager VPN plugins',
- filebase: libnm_glib_vpn_name,
- subdirs: libnm_glib_name,
- requires: 'NetworkManager >= ' + nm_version + ' glib-2.0 dbus-glib-1',
- variables: 'exec_prefix=${prefix}',
-)
-
-libnm_glib_sources = files(
- 'nm-access-point.c',
- 'nm-active-connection.c',
- 'nm-client.c',
- 'nm-dbus-helpers.c',
- 'nm-device-adsl.c',
- 'nm-device-bond.c',
- 'nm-device-bridge.c',
- 'nm-device-bt.c',
- 'nm-device.c',
- 'nm-device-ethernet.c',
- 'nm-device-generic.c',
- 'nm-device-infiniband.c',
- 'nm-device-olpc-mesh.c',
- 'nm-device-modem.c',
- 'nm-device-team.c',
- 'nm-device-vlan.c',
- 'nm-device-wifi.c',
- 'nm-device-wimax.c',
- 'nm-dhcp4-config.c',
- 'nm-dhcp6-config.c',
- 'nm-ip4-config.c',
- 'nm-ip6-config.c',
- 'nm-object.c',
- 'nm-object-cache.c',
- 'nm-remote-connection.c',
- 'nm-remote-settings.c',
- 'nm-secret-agent.c',
- 'nm-types.c',
- 'nm-vpn-connection.c',
- 'nm-wimax-nsp.c',
-)
-
-glue = 'nm-secret-agent-glue.h'
-
-nm_secret_agent_glue = custom_target(
- glue,
- input: ifaces_secret_agent_xml,
- output: glue,
- command: [dbus_binding_tool, '--prefix=nm_secret_agent', '--mode=glib-server', '--output=@OUTPUT@', '@INPUT@'],
-)
-
-enum_types = 'nm-glib-enum-types'
-
-libnm_glib_enum = gnome.mkenums(
- enum_types,
- sources: headers,
- identifier_prefix: nm_id_prefix,
- c_template: enum_types + '.c.template',
- h_template: enum_types + '.h.template',
- install_header: true,
- install_dir: libnm_glib_pkgincludedir,
-)
-
-linker_script = join_paths(meson.current_source_dir(), 'libnm-glib.ver')
-
-libnm_glib = shared_library(
- 'nm-glib',
- sources: libnm_glib_sources + libnm_glib_enum + [nm_secret_agent_glue],
- version: libnm_glib_version,
- dependencies: common_deps + [
- libnm_util_dep,
- libudev_dep,
- shared_nm_utils_udev_dep,
- ],
- c_args: cflags,
- link_whole: libdeprecated_nm_glib,
- link_args: [
- '-Wl,--version-script,@0@'.format(linker_script),
- ],
- link_depends: linker_script,
- install: true,
-)
-
-libnm_glib_dep = declare_dependency(
- include_directories: libnm_glib_inc,
- link_with: libnm_glib,
-)
-
-pkg.generate(
- libraries: libnm_glib,
- version: nm_version,
- name: libnm_glib_name,
- description: 'Convenience library for clients of NetworkManager',
- filebase: libnm_glib_name,
- subdirs: libnm_glib_name,
- requires: 'libnm-util >= ' + nm_version + ' NetworkManager >= ' + nm_version + ' gobject-2.0 dbus-glib-1',
- variables: 'exec_prefix=${prefix}',
-)
-
-if enable_introspection
- gir_sources = libnm_glib_sources + headers + libnm_glib_enum
-
- libnm_glib_gir = gnome.generate_gir(
- libnm_glib,
- sources: gir_sources,
- dependencies: [
- dbus_glib_dep,
- libnm_glib_dep,
- libnm_util_gir_dep,
- ],
- nsversion: nm_gir_version,
- namespace: 'NMClient',
- identifier_prefix: nm_id_prefix,
- symbol_prefix: nm_id_prefix.to_lower(),
- export_packages: [libnm_glib_name, libnm_glib_vpn_name],
- includes: [
- 'DBusGLib-1.0',
- 'Gio-2.0',
- ],
- extra_args: cflags + [
- '--include-uninstalled=' + libnm_util_gir[0].full_path(),
- ],
- install: true,
- )
-endif
-
-name = libnm_glib_name + '-test'
-
-executable(
- name,
- name + '.c',
- dependencies: common_deps + [libnm_util_dep],
- c_args: cflags,
- link_with: libnm_glib,
-)
-
-test(
- 'check-local-exports-' + libnm_glib_name,
- check_exports,
- args: [libnm_glib.full_path(), linker_script],
-)
-
-if enable_tests
- subdir('tests')
-endif
-
-pkg.generate(
- version: nm_version,
- name: nm_name,
- description: 'System for maintaining active network connection',
- filebase: nm_name,
- subdirs: nm_name,
- requires: '',
- variables: [
- 'exec_prefix=${prefix}',
- 'libgnome_serverdir=' + nm_libexecdir,
- 'plugindir=' + nm_vpndir,
- 'configdir=' + nm_pkgconfdir,
- ],
-)
diff --git a/libnm-glib/nm-access-point.c b/libnm-glib/nm-access-point.c
deleted file mode 100644
index a0cacfde4..000000000
--- a/libnm-glib/nm-access-point.c
+++ /dev/null
@@ -1,720 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2007 - 2008 Novell, Inc.
- * Copyright 2007 - 2011 Red Hat, Inc.
- */
-
-#include "nm-default.h"
-
-#include <string.h>
-#include <netinet/ether.h>
-
-#include "nm-connection.h"
-#include "nm-setting-connection.h"
-#include "nm-setting-wireless.h"
-#include "nm-setting-wireless-security.h"
-#include "nm-utils.h"
-
-#include "nm-access-point.h"
-#include "NetworkManager.h"
-#include "nm-types-private.h"
-#include "nm-object-private.h"
-
-G_DEFINE_TYPE (NMAccessPoint, nm_access_point, NM_TYPE_OBJECT)
-
-#define NM_ACCESS_POINT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_ACCESS_POINT, NMAccessPointPrivate))
-
-typedef struct {
- DBusGProxy *proxy;
-
- NM80211ApFlags flags;
- NM80211ApSecurityFlags wpa_flags;
- NM80211ApSecurityFlags rsn_flags;
- GByteArray *ssid;
- guint32 frequency;
- char *bssid;
- NM80211Mode mode;
- guint32 max_bitrate;
- guint8 strength;
- int last_seen;
-} NMAccessPointPrivate;
-
-enum {
- PROP_0,
- PROP_FLAGS,
- PROP_WPA_FLAGS,
- PROP_RSN_FLAGS,
- PROP_SSID,
- PROP_FREQUENCY,
- PROP_HW_ADDRESS,
- PROP_MODE,
- PROP_MAX_BITRATE,
- PROP_STRENGTH,
- PROP_BSSID,
- PROP_LAST_SEEN,
-
- LAST_PROP
-};
-
-/**
- * nm_access_point_new:
- * @connection: the #DBusGConnection
- * @path: the DBusobject path of the access point
- *
- * Creates a new #NMAccessPoint.
- *
- * Returns: (transfer full): a new access point
- **/
-GObject *
-nm_access_point_new (DBusGConnection *connection, const char *path)
-{
- g_return_val_if_fail (connection != NULL, NULL);
- g_return_val_if_fail (path != NULL, NULL);
-
- return (GObject *) g_object_new (NM_TYPE_ACCESS_POINT,
- NM_OBJECT_DBUS_CONNECTION, connection,
- NM_OBJECT_DBUS_PATH, path,
- NULL);
-}
-
-/**
- * nm_access_point_get_flags:
- * @ap: a #NMAccessPoint
- *
- * Gets the flags of the access point.
- *
- * Returns: the flags
- **/
-NM80211ApFlags
-nm_access_point_get_flags (NMAccessPoint *ap)
-{
- g_return_val_if_fail (NM_IS_ACCESS_POINT (ap), NM_802_11_AP_FLAGS_NONE);
-
- _nm_object_ensure_inited (NM_OBJECT (ap));
- return NM_ACCESS_POINT_GET_PRIVATE (ap)->flags;
-}
-
-/**
- * nm_access_point_get_wpa_flags:
- * @ap: a #NMAccessPoint
- *
- * Gets the WPA (version 1) flags of the access point.
- *
- * Returns: the WPA flags
- **/
-NM80211ApSecurityFlags
-nm_access_point_get_wpa_flags (NMAccessPoint *ap)
-{
- g_return_val_if_fail (NM_IS_ACCESS_POINT (ap), NM_802_11_AP_SEC_NONE);
-
- _nm_object_ensure_inited (NM_OBJECT (ap));
- return NM_ACCESS_POINT_GET_PRIVATE (ap)->wpa_flags;
-}
-
-/**
- * nm_access_point_get_rsn_flags:
- * @ap: a #NMAccessPoint
- *
- * Gets the RSN (Robust Secure Network, ie WPA version 2) flags of the access
- * point.
- *
- * Returns: the RSN flags
- **/
-NM80211ApSecurityFlags
-nm_access_point_get_rsn_flags (NMAccessPoint *ap)
-{
- g_return_val_if_fail (NM_IS_ACCESS_POINT (ap), NM_802_11_AP_SEC_NONE);
-
- _nm_object_ensure_inited (NM_OBJECT (ap));
- return NM_ACCESS_POINT_GET_PRIVATE (ap)->rsn_flags;
-}
-
-/**
- * nm_access_point_get_ssid:
- * @ap: a #NMAccessPoint
- *
- * Gets the SSID of the access point.
- *
- * Returns: the #GByteArray containing the SSID. This is the internal copy used by the
- * access point, and must not be modified.
- **/
-const GByteArray *
-nm_access_point_get_ssid (NMAccessPoint *ap)
-{
- g_return_val_if_fail (NM_IS_ACCESS_POINT (ap), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (ap));
- return NM_ACCESS_POINT_GET_PRIVATE (ap)->ssid;
-}
-
-/**
- * nm_access_point_get_frequency:
- * @ap: a #NMAccessPoint
- *
- * Gets the frequency of the access point in MHz.
- *
- * Returns: the frequency in MHz
- **/
-guint32
-nm_access_point_get_frequency (NMAccessPoint *ap)
-{
- g_return_val_if_fail (NM_IS_ACCESS_POINT (ap), 0);
-
- _nm_object_ensure_inited (NM_OBJECT (ap));
- return NM_ACCESS_POINT_GET_PRIVATE (ap)->frequency;
-}
-
-/**
- * nm_access_point_get_bssid:
- * @ap: a #NMAccessPoint
- *
- * Gets the Basic Service Set ID (BSSID) of the Wi-Fi access point.
- *
- * Returns: the BSSID of the access point. This is an internal string and must
- * not be modified or freed.
- **/
-const char *
-nm_access_point_get_bssid (NMAccessPoint *ap)
-{
- g_return_val_if_fail (NM_IS_ACCESS_POINT (ap), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (ap));
- return NM_ACCESS_POINT_GET_PRIVATE (ap)->bssid;
-}
-
-/**
- * nm_access_point_get_hw_address:
- * @ap: a #NMAccessPoint
- *
- * Gets the hardware (MAC) address of the access point.
- *
- * Returns: the hardware address of the access point. This is the internal string used by the
- * access point and must not be modified.
- *
- * Deprecated: 0.9: Use nm_access_point_get_bssid() instead.
- **/
-const char *
-nm_access_point_get_hw_address (NMAccessPoint *ap)
-{
- return nm_access_point_get_bssid (ap);
-}
-
-/**
- * nm_access_point_get_mode:
- * @ap: a #NMAccessPoint
- *
- * Gets the mode of the access point.
- *
- * Returns: the mode
- **/
-NM80211Mode
-nm_access_point_get_mode (NMAccessPoint *ap)
-{
- g_return_val_if_fail (NM_IS_ACCESS_POINT (ap), 0);
-
- _nm_object_ensure_inited (NM_OBJECT (ap));
- return NM_ACCESS_POINT_GET_PRIVATE (ap)->mode;
-}
-
-/**
- * nm_access_point_get_max_bitrate:
- * @ap: a #NMAccessPoint
- *
- * Gets the maximum bit rate of the access point in kbit/s.
- *
- * Returns: the maximum bit rate (kbit/s)
- **/
-guint32
-nm_access_point_get_max_bitrate (NMAccessPoint *ap)
-{
- g_return_val_if_fail (NM_IS_ACCESS_POINT (ap), 0);
-
- _nm_object_ensure_inited (NM_OBJECT (ap));
- return NM_ACCESS_POINT_GET_PRIVATE (ap)->max_bitrate;
-}
-
-/**
- * nm_access_point_get_strength:
- * @ap: a #NMAccessPoint
- *
- * Gets the current signal strength of the access point as a percentage.
- *
- * Returns: the signal strength (0 to 100)
- **/
-guint8
-nm_access_point_get_strength (NMAccessPoint *ap)
-{
- g_return_val_if_fail (NM_IS_ACCESS_POINT (ap), 0);
-
- _nm_object_ensure_inited (NM_OBJECT (ap));
- return NM_ACCESS_POINT_GET_PRIVATE (ap)->strength;
-}
-
-/**
- * nm_access_point_get_last_seen:
- * @ap: a #NMAccessPoint
- *
- * Returns the timestamp (in CLOCK_BOOTTIME seconds) for the last time the
- * access point was found in scan results. A value of -1 means the access
- * point has not been found in a scan.
- *
- * Returns: the last seen time in seconds
- *
- * Since: 1.2
- **/
-int
-nm_access_point_get_last_seen (NMAccessPoint *ap)
-{
- g_return_val_if_fail (NM_IS_ACCESS_POINT (ap), -1);
-
- _nm_object_ensure_inited (NM_OBJECT (ap));
- return NM_ACCESS_POINT_GET_PRIVATE (ap)->last_seen;
-}
-
-/**
- * nm_access_point_connection_valid:
- * @ap: an #NMAccessPoint to validate @connection against
- * @connection: an #NMConnection to validate against @ap
- *
- * Validates a given connection against a given Wi-Fi access point to ensure that
- * the connection may be activated with that AP. The connection must match the
- * @ap's SSID, (if given) BSSID, and other attributes like security settings,
- * channel, band, etc.
- *
- * Returns: %TRUE if the connection may be activated with this Wi-Fi AP,
- * %FALSE if it cannot be.
- **/
-gboolean
-nm_access_point_connection_valid (NMAccessPoint *ap, NMConnection *connection)
-{
- NMSettingConnection *s_con;
- NMSettingWireless *s_wifi;
- NMSettingWirelessSecurity *s_wsec;
- const char *ctype, *ap_bssid_str;
- const GByteArray *setting_ssid;
- const GByteArray *ap_ssid;
- const GByteArray *setting_bssid;
- const char *setting_mode;
- NM80211Mode ap_mode;
- const char *setting_band;
- guint32 ap_freq, setting_chan, ap_chan;
-
- s_con = nm_connection_get_setting_connection (connection);
- if (!s_con)
- return FALSE;
-
- ctype = nm_setting_connection_get_connection_type (s_con);
- if (!ctype || !nm_streq (ctype, NM_SETTING_WIRELESS_SETTING_NAME))
- return FALSE;
-
- s_wifi = nm_connection_get_setting_wireless (connection);
- if (!s_wifi)
- return FALSE;
-
- /* SSID checks */
- ap_ssid = nm_access_point_get_ssid (ap);
- if (!ap_ssid)
- return FALSE;
- setting_ssid = nm_setting_wireless_get_ssid (s_wifi);
- if ( !setting_ssid
- || setting_ssid->len != ap_ssid->len
- || memcmp (setting_ssid->data, ap_ssid->data, ap_ssid->len) != 0)
- return FALSE;
-
- /* BSSID checks */
- ap_bssid_str = nm_access_point_get_bssid (ap);
- if (!ap_bssid_str)
- return FALSE;
- setting_bssid = nm_setting_wireless_get_bssid (s_wifi);
- if (setting_bssid) {
- struct ether_addr addr;
-
- g_return_val_if_fail (setting_bssid->len == ETH_ALEN, FALSE);
-
- if (!ether_aton_r (ap_bssid_str, &addr))
- return FALSE;
- if (memcmp (addr.ether_addr_octet, setting_bssid->data, ETH_ALEN) != 0)
- return FALSE;
- }
-
- /* Mode */
- ap_mode = nm_access_point_get_mode (ap);
- if (ap_mode == NM_802_11_MODE_UNKNOWN)
- return FALSE;
- setting_mode = nm_setting_wireless_get_mode (s_wifi);
- if (setting_mode && ap_mode) {
- if (!strcmp (setting_mode, "infrastructure") && (ap_mode != NM_802_11_MODE_INFRA))
- return FALSE;
- if (!strcmp (setting_mode, "adhoc") && (ap_mode != NM_802_11_MODE_ADHOC))
- return FALSE;
- /* Hotspot never matches against APs as it's a device-specific mode. */
- if (!strcmp (setting_mode, "ap"))
- return FALSE;
- }
-
- /* Band and Channel/Frequency */
- ap_freq = nm_access_point_get_frequency (ap);
- if (ap_freq) {
- setting_band = nm_setting_wireless_get_band (s_wifi);
- if (g_strcmp0 (setting_band, "a") == 0) {
- if (ap_freq < 4915 || ap_freq > 5825)
- return FALSE;
- } else if (g_strcmp0 (setting_band, "bg") == 0) {
- if (ap_freq < 2412 || ap_freq > 2484)
- return FALSE;
- }
-
- setting_chan = nm_setting_wireless_get_channel (s_wifi);
- if (setting_chan) {
- ap_chan = nm_utils_wifi_freq_to_channel (ap_freq);
- if (setting_chan != ap_chan)
- return FALSE;
- }
- }
-
- s_wsec = nm_connection_get_setting_wireless_security (connection);
- if (!nm_setting_wireless_ap_security_compatible (s_wifi,
- s_wsec,
- nm_access_point_get_flags (ap),
- nm_access_point_get_wpa_flags (ap),
- nm_access_point_get_rsn_flags (ap),
- ap_mode))
- return FALSE;
-
- return TRUE;
-}
-
-/**
- * nm_access_point_filter_connections:
- * @ap: an #NMAccessPoint to filter connections for
- * @connections: (element-type NMConnection): a list of
- * #NMConnection objects to filter
- *
- * Filters a given list of connections for a given #NMAccessPoint object and
- * return connections which may be activated with the access point. Any
- * returned connections will match the @ap's SSID and (if given) BSSID and
- * other attributes like security settings, channel, etc.
- *
- * To obtain the list of connections that are compatible with this access point,
- * use nm_remote_settings_list_connections() and then filter the returned list
- * for a given #NMDevice using nm_device_filter_connections() and finally
- * filter that list with this function.
- *
- * Returns: (transfer container) (element-type NMConnection): a
- * list of #NMConnection objects that could be activated with the given @ap.
- * The elements of the list are owned by their creator and should not be freed
- * by the caller, but the returned list itself is owned by the caller and should
- * be freed with g_slist_free() when it is no longer required.
- **/
-GSList *
-nm_access_point_filter_connections (NMAccessPoint *ap, const GSList *connections)
-{
- GSList *filtered = NULL;
- const GSList *iter;
-
- for (iter = connections; iter; iter = g_slist_next (iter)) {
- NMConnection *candidate = NM_CONNECTION (iter->data);
-
- if (nm_access_point_connection_valid (ap, candidate))
- filtered = g_slist_prepend (filtered, candidate);
- }
-
- return g_slist_reverse (filtered);
-}
-
-/*****************************************************************************/
-
-static void
-nm_access_point_init (NMAccessPoint *ap)
-{
- NM_ACCESS_POINT_GET_PRIVATE (ap)->last_seen = -1;
-}
-
-static void
-dispose (GObject *object)
-{
- NMAccessPointPrivate *priv = NM_ACCESS_POINT_GET_PRIVATE (object);
-
- g_clear_object (&priv->proxy);
-
- G_OBJECT_CLASS (nm_access_point_parent_class)->dispose (object);
-}
-
-static void
-finalize (GObject *object)
-{
- NMAccessPointPrivate *priv = NM_ACCESS_POINT_GET_PRIVATE (object);
-
- if (priv->ssid)
- g_byte_array_free (priv->ssid, TRUE);
-
- g_free (priv->bssid);
-
- G_OBJECT_CLASS (nm_access_point_parent_class)->finalize (object);
-}
-
-static void
-get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- NMAccessPoint *ap = NM_ACCESS_POINT (object);
-
- _nm_object_ensure_inited (NM_OBJECT (object));
-
- switch (prop_id) {
- case PROP_FLAGS:
- g_value_set_uint (value, nm_access_point_get_flags (ap));
- break;
- case PROP_WPA_FLAGS:
- g_value_set_uint (value, nm_access_point_get_wpa_flags (ap));
- break;
- case PROP_RSN_FLAGS:
- g_value_set_uint (value, nm_access_point_get_rsn_flags (ap));
- break;
- case PROP_SSID:
- g_value_set_boxed (value, nm_access_point_get_ssid (ap));
- break;
- case PROP_FREQUENCY:
- g_value_set_uint (value, nm_access_point_get_frequency (ap));
- break;
- case PROP_HW_ADDRESS:
- g_value_set_string (value, nm_access_point_get_bssid (ap));
- break;
- case PROP_BSSID:
- g_value_set_string (value, nm_access_point_get_bssid (ap));
- break;
- case PROP_MODE:
- g_value_set_uint (value, nm_access_point_get_mode (ap));
- break;
- case PROP_MAX_BITRATE:
- g_value_set_uint (value, nm_access_point_get_max_bitrate (ap));
- break;
- case PROP_STRENGTH:
- g_value_set_uchar (value, nm_access_point_get_strength (ap));
- break;
- case PROP_LAST_SEEN:
- g_value_set_int (value, nm_access_point_get_last_seen (ap));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static gboolean
-demarshal_ssid (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field)
-{
- if (!_nm_ssid_demarshal (value, (GByteArray **) field))
- return FALSE;
-
- _nm_object_queue_notify (object, NM_ACCESS_POINT_SSID);
- return TRUE;
-}
-
-static void
-register_properties (NMAccessPoint *ap)
-{
- NMAccessPointPrivate *priv = NM_ACCESS_POINT_GET_PRIVATE (ap);
- const NMPropertiesInfo property_info[] = {
- { NM_ACCESS_POINT_FLAGS, &priv->flags },
- { NM_ACCESS_POINT_WPA_FLAGS, &priv->wpa_flags },
- { NM_ACCESS_POINT_RSN_FLAGS, &priv->rsn_flags },
- { NM_ACCESS_POINT_SSID, &priv->ssid, demarshal_ssid },
- { NM_ACCESS_POINT_FREQUENCY, &priv->frequency },
- { NM_ACCESS_POINT_HW_ADDRESS, &priv->bssid },
- { NM_ACCESS_POINT_MODE, &priv->mode },
- { NM_ACCESS_POINT_MAX_BITRATE, &priv->max_bitrate },
- { NM_ACCESS_POINT_STRENGTH, &priv->strength },
- { NM_ACCESS_POINT_LAST_SEEN, &priv->last_seen },
- { NULL },
- };
-
- _nm_object_register_properties (NM_OBJECT (ap),
- priv->proxy,
- property_info);
-}
-
-static void
-constructed (GObject *object)
-{
- NMAccessPointPrivate *priv;
-
- G_OBJECT_CLASS (nm_access_point_parent_class)->constructed (object);
-
- priv = NM_ACCESS_POINT_GET_PRIVATE (object);
- priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_ACCESS_POINT);
- register_properties (NM_ACCESS_POINT (object));
-}
-
-static void
-nm_access_point_class_init (NMAccessPointClass *ap_class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (ap_class);
-
- g_type_class_add_private (ap_class, sizeof (NMAccessPointPrivate));
-
- /* virtual methods */
- object_class->constructed = constructed;
- object_class->get_property = get_property;
- object_class->dispose = dispose;
- object_class->finalize = finalize;
-
- /* properties */
-
- /**
- * NMAccessPoint:flags:
- *
- * The flags of the access point.
- **/
- g_object_class_install_property
- (object_class, PROP_FLAGS,
- g_param_spec_uint (NM_ACCESS_POINT_FLAGS, "", "",
- NM_802_11_AP_FLAGS_NONE,
- NM_802_11_AP_FLAGS_PRIVACY,
- NM_802_11_AP_FLAGS_NONE,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMAccessPoint:wpa-flags:
- *
- * The WPA flags of the access point.
- **/
- g_object_class_install_property
- (object_class, PROP_WPA_FLAGS,
- g_param_spec_uint (NM_ACCESS_POINT_WPA_FLAGS, "", "",
- 0, G_MAXUINT32, 0,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMAccessPoint:rsn-flags:
- *
- * The RSN flags of the access point.
- **/
- g_object_class_install_property
- (object_class, PROP_RSN_FLAGS,
- g_param_spec_uint (NM_ACCESS_POINT_RSN_FLAGS, "", "",
- 0, G_MAXUINT32, 0,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMAccessPoint:ssid:
- *
- * The SSID of the access point.
- **/
- g_object_class_install_property
- (object_class, PROP_SSID,
- g_param_spec_boxed (NM_ACCESS_POINT_SSID, "", "",
- NM_TYPE_SSID,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMAccessPoint:frequency:
- *
- * The frequency of the access point.
- **/
- g_object_class_install_property
- (object_class, PROP_FREQUENCY,
- g_param_spec_uint (NM_ACCESS_POINT_FREQUENCY, "", "",
- 0, 10000, 0,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMAccessPoint:bssid:
- *
- * The BSSID of the access point.
- **/
- g_object_class_install_property
- (object_class, PROP_BSSID,
- g_param_spec_string (NM_ACCESS_POINT_BSSID, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMAccessPoint:hw-address:
- *
- * The hardware address of the access point.
- **/
- g_object_class_install_property
- (object_class, PROP_HW_ADDRESS,
- g_param_spec_string (NM_ACCESS_POINT_HW_ADDRESS, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMAccessPoint:mode:
- *
- * The mode of the access point; either "infrastructure" (a central
- * coordinator of the wireless network allowing clients to connect) or
- * "ad-hoc" (a network with no central controller).
- **/
- g_object_class_install_property
- (object_class, PROP_MODE,
- g_param_spec_uint (NM_ACCESS_POINT_MODE, "", "",
- NM_802_11_MODE_ADHOC, NM_802_11_MODE_INFRA, NM_802_11_MODE_INFRA,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMAccessPoint:max-bitrate:
- *
- * The maximum bit rate of the access point in kbit/s.
- **/
- g_object_class_install_property
- (object_class, PROP_MAX_BITRATE,
- g_param_spec_uint (NM_ACCESS_POINT_MAX_BITRATE, "", "",
- 0, G_MAXUINT32, 0,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMAccessPoint:strength:
- *
- * The current signal strength of the access point.
- **/
- g_object_class_install_property
- (object_class, PROP_STRENGTH,
- g_param_spec_uchar (NM_ACCESS_POINT_STRENGTH, "", "",
- 0, G_MAXUINT8, 0,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMAccessPoint:last-seen:
- *
- * The timestamp (in CLOCK_BOOTTIME seconds) for the last time the
- * access point was found in scan results. A value of -1 means the
- * access point has not been found in a scan.
- *
- * Since: 1.2
- **/
- g_object_class_install_property
- (object_class, PROP_LAST_SEEN,
- g_param_spec_int (NM_ACCESS_POINT_LAST_SEEN, "", "",
- -1, G_MAXINT, -1,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-}
diff --git a/libnm-glib/nm-access-point.h b/libnm-glib/nm-access-point.h
deleted file mode 100644
index d25de5417..000000000
--- a/libnm-glib/nm-access-point.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2007 - 2008 Novell, Inc.
- * Copyright 2007 - 2011 Red Hat, Inc.
- */
-
-#ifndef NM_ACCESS_POINT_H
-#define NM_ACCESS_POINT_H
-
-#include <glib.h>
-#include <glib-object.h>
-#include "NetworkManager.h"
-#include "nm-connection.h"
-#include "nm-object.h"
-
-G_BEGIN_DECLS
-
-#define NM_TYPE_ACCESS_POINT (nm_access_point_get_type ())
-#define NM_ACCESS_POINT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_ACCESS_POINT, NMAccessPoint))
-#define NM_ACCESS_POINT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_ACCESS_POINT, NMAccessPointClass))
-#define NM_IS_ACCESS_POINT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_ACCESS_POINT))
-#define NM_IS_ACCESS_POINT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_ACCESS_POINT))
-#define NM_ACCESS_POINT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_ACCESS_POINT, NMAccessPointClass))
-
-#define NM_ACCESS_POINT_FLAGS "flags"
-#define NM_ACCESS_POINT_WPA_FLAGS "wpa-flags"
-#define NM_ACCESS_POINT_RSN_FLAGS "rsn-flags"
-#define NM_ACCESS_POINT_SSID "ssid"
-#define NM_ACCESS_POINT_BSSID "bssid"
-#define NM_ACCESS_POINT_FREQUENCY "frequency"
-#define NM_ACCESS_POINT_MODE "mode"
-#define NM_ACCESS_POINT_MAX_BITRATE "max-bitrate"
-#define NM_ACCESS_POINT_STRENGTH "strength"
-#define NM_ACCESS_POINT_LAST_SEEN "last-seen"
-
-/* DEPRECATED */
-#define NM_ACCESS_POINT_HW_ADDRESS "hw-address"
-
-typedef struct {
- NMObject parent;
-} NMAccessPoint;
-
-typedef struct {
- NMObjectClass parent;
-
- /* Padding for future expansion */
- void (*_reserved1) (void);
- void (*_reserved2) (void);
- void (*_reserved3) (void);
- void (*_reserved4) (void);
- void (*_reserved5) (void);
- void (*_reserved6) (void);
-} NMAccessPointClass;
-
-GType nm_access_point_get_type (void);
-
-GObject *nm_access_point_new (DBusGConnection *connection, const char *path);
-
-NM80211ApFlags nm_access_point_get_flags (NMAccessPoint *ap);
-NM80211ApSecurityFlags nm_access_point_get_wpa_flags (NMAccessPoint *ap);
-NM80211ApSecurityFlags nm_access_point_get_rsn_flags (NMAccessPoint *ap);
-const GByteArray * nm_access_point_get_ssid (NMAccessPoint *ap);
-const char * nm_access_point_get_bssid (NMAccessPoint *ap);
-guint32 nm_access_point_get_frequency (NMAccessPoint *ap);
-NM80211Mode nm_access_point_get_mode (NMAccessPoint *ap);
-guint32 nm_access_point_get_max_bitrate (NMAccessPoint *ap);
-guint8 nm_access_point_get_strength (NMAccessPoint *ap);
-NM_AVAILABLE_IN_1_2
-int nm_access_point_get_last_seen (NMAccessPoint *ap);
-
-GSList * nm_access_point_filter_connections (NMAccessPoint *ap,
- const GSList *connections);
-
-gboolean nm_access_point_connection_valid (NMAccessPoint *ap,
- NMConnection *connection);
-
-/* DEPRECATED */
-NM_DEPRECATED_IN_0_9_10
-const char * nm_access_point_get_hw_address (NMAccessPoint *ap);
-
-G_END_DECLS
-
-#endif /* NM_ACCESS_POINT_H */
diff --git a/libnm-glib/nm-active-connection.c b/libnm-glib/nm-active-connection.c
deleted file mode 100644
index a8150755a..000000000
--- a/libnm-glib/nm-active-connection.c
+++ /dev/null
@@ -1,851 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2007 - 2014 Red Hat, Inc.
- * Copyright 2008 Novell, Inc.
- */
-
-#include "nm-default.h"
-
-#include <string.h>
-
-#include "NetworkManager.h"
-#include "nm-active-connection.h"
-#include "nm-object-private.h"
-#include "nm-types-private.h"
-#include "nm-device.h"
-#include "nm-device-private.h"
-#include "nm-connection.h"
-#include "nm-vpn-connection.h"
-#include "nm-dbus-helpers-private.h"
-
-static GType _nm_active_connection_type_for_path (DBusGConnection *connection,
- const char *path);
-static void _nm_active_connection_type_for_path_async (DBusGConnection *connection,
- const char *path,
- NMObjectTypeCallbackFunc callback,
- gpointer user_data);
-
-G_DEFINE_TYPE_WITH_CODE (NMActiveConnection, nm_active_connection, NM_TYPE_OBJECT,
- _nm_object_register_type_func (g_define_type_id,
- _nm_active_connection_type_for_path,
- _nm_active_connection_type_for_path_async);
- )
-
-#define NM_ACTIVE_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_ACTIVE_CONNECTION, NMActiveConnectionPrivate))
-
-typedef struct {
- DBusGProxy *proxy;
-
- char *connection;
- char *id;
- char *uuid;
- char *type;
- char *specific_object;
- GPtrArray *devices;
- NMActiveConnectionState state;
- gboolean is_default;
- NMIP4Config *ip4_config;
- NMDHCP4Config *dhcp4_config;
- gboolean is_default6;
- NMIP6Config *ip6_config;
- NMDHCP6Config *dhcp6_config;
- gboolean is_vpn;
- char *master;
-} NMActiveConnectionPrivate;
-
-enum {
- PROP_0,
- PROP_CONNECTION,
- PROP_ID,
- PROP_UUID,
- PROP_TYPE,
- PROP_SPECIFIC_OBJECT,
- PROP_DEVICES,
- PROP_STATE,
- PROP_DEFAULT,
- PROP_IP4_CONFIG,
- PROP_DHCP4_CONFIG,
- PROP_DEFAULT6,
- PROP_IP6_CONFIG,
- PROP_DHCP6_CONFIG,
- PROP_VPN,
- PROP_MASTER,
-
- LAST_PROP
-};
-
-/**
- * nm_active_connection_new:
- * @connection: the #DBusGConnection
- * @path: the DBus object path of the device
- *
- * Creates a new #NMActiveConnection.
- *
- * Returns: (transfer full): a new active connection
- **/
-GObject *
-nm_active_connection_new (DBusGConnection *connection, const char *path)
-{
- g_return_val_if_fail (connection != NULL, NULL);
- g_return_val_if_fail (path != NULL, NULL);
-
- return g_object_new (NM_TYPE_ACTIVE_CONNECTION,
- NM_OBJECT_DBUS_CONNECTION, connection,
- NM_OBJECT_DBUS_PATH, path,
- NULL);
-}
-
-static GType
-_nm_active_connection_type_for_path (DBusGConnection *connection,
- const char *path)
-{
- DBusGProxy *proxy;
- GError *error = NULL;
- GValue value = G_VALUE_INIT;
- GType type;
-
- proxy = _nm_dbus_new_proxy_for_connection (connection, path, DBUS_INTERFACE_PROPERTIES);
- if (!proxy) {
- g_warning ("%s: couldn't create D-Bus object proxy.", __func__);
- return G_TYPE_INVALID;
- }
-
- /* Have to create an NMVPNConnection if it's a VPN connection, otherwise
- * a plain NMActiveConnection.
- */
- if (dbus_g_proxy_call (proxy,
- "Get", &error,
- G_TYPE_STRING, NM_DBUS_INTERFACE_ACTIVE_CONNECTION,
- G_TYPE_STRING, "Vpn",
- G_TYPE_INVALID,
- G_TYPE_VALUE, &value, G_TYPE_INVALID)) {
- if (g_value_get_boolean (&value))
- type = NM_TYPE_VPN_CONNECTION;
- else
- type = NM_TYPE_ACTIVE_CONNECTION;
- } else {
- g_warning ("Error in getting active connection 'Vpn' property: %s",
- error->message);
- g_error_free (error);
- type = G_TYPE_INVALID;
- }
-
- g_object_unref (proxy);
- return type;
-}
-
-typedef struct {
- DBusGConnection *connection;
- NMObjectTypeCallbackFunc callback;
- gpointer user_data;
-} NMActiveConnectionAsyncData;
-
-static void
-async_got_type (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data)
-{
- NMActiveConnectionAsyncData *async_data = user_data;
- GValue value = G_VALUE_INIT;
- const char *path = dbus_g_proxy_get_path (proxy);
- GError *error = NULL;
- GType type;
-
- if (dbus_g_proxy_end_call (proxy, call, &error,
- G_TYPE_VALUE, &value,
- G_TYPE_INVALID)) {
- if (g_value_get_boolean (&value))
- type = NM_TYPE_VPN_CONNECTION;
- else
- type = NM_TYPE_ACTIVE_CONNECTION;
- } else {
- g_warning ("%s: could not read properties for %s: %s", __func__, path, error->message);
- type = G_TYPE_INVALID;
- }
-
- async_data->callback (type, async_data->user_data);
-
- g_object_unref (proxy);
- g_slice_free (NMActiveConnectionAsyncData, async_data);
-}
-
-static void
-_nm_active_connection_type_for_path_async (DBusGConnection *connection,
- const char *path,
- NMObjectTypeCallbackFunc callback,
- gpointer user_data)
-{
- NMActiveConnectionAsyncData *async_data;
- DBusGProxy *proxy;
-
- async_data = g_slice_new (NMActiveConnectionAsyncData);
- async_data->connection = connection;
- async_data->callback = callback;
- async_data->user_data = user_data;
-
- proxy = _nm_dbus_new_proxy_for_connection (connection, path, DBUS_INTERFACE_PROPERTIES);
- dbus_g_proxy_begin_call (proxy, "Get",
- async_got_type, async_data, NULL,
- G_TYPE_STRING, NM_DBUS_INTERFACE_ACTIVE_CONNECTION,
- G_TYPE_STRING, "Vpn",
- G_TYPE_INVALID);
-}
-
-/**
- * nm_active_connection_get_connection:
- * @connection: a #NMActiveConnection
- *
- * Gets the #NMConnection's DBus object path. This is often used with
- * nm_remote_settings_get_connection_by_path() to retrieve the
- * #NMRemoteConnection object that describes the connection.
- *
- * Returns: the object path of the #NMConnection which this #NMActiveConnection
- * is an active instance of. This is the internal string used by the
- * connection, and must not be modified.
- **/
-const char *
-nm_active_connection_get_connection (NMActiveConnection *connection)
-{
- g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (connection));
- return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->connection;
-}
-
-/**
- * nm_active_connection_get_id:
- * @connection: a #NMActiveConnection
- *
- * Gets the #NMConnection's ID.
- *
- * Returns: the ID of the #NMConnection that backs the #NMActiveConnection.
- * This is the internal string used by the connection, and must not be modified.
- *
- * Since: 0.9.10
- **/
-const char *
-nm_active_connection_get_id (NMActiveConnection *connection)
-{
- g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (connection));
- return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->id;
-}
-
-/**
- * nm_active_connection_get_uuid:
- * @connection: a #NMActiveConnection
- *
- * Gets the #NMConnection's UUID.
- *
- * Returns: the UUID of the #NMConnection that backs the #NMActiveConnection.
- * This is the internal string used by the connection, and must not be modified.
- **/
-const char *
-nm_active_connection_get_uuid (NMActiveConnection *connection)
-{
- g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (connection));
- return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->uuid;
-}
-
-/**
- * nm_active_connection_get_connection_type:
- * @connection: a #NMActiveConnection
- *
- * Gets the #NMConnection's type.
- *
- * Returns: the type of the #NMConnection that backs the #NMActiveConnection.
- * This is the internal string used by the connection, and must not be modified.
- *
- * Since: 0.9.10
- **/
-const char *
-nm_active_connection_get_connection_type (NMActiveConnection *connection)
-{
- g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (connection));
- return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->type;
-}
-
-/**
- * nm_active_connection_get_specific_object:
- * @connection: a #NMActiveConnection
- *
- * Gets the "specific object" used at the activation.
- *
- * Returns: the specific object's DBus path. This is the internal string used by the
- * connection, and must not be modified.
- **/
-const char *
-nm_active_connection_get_specific_object (NMActiveConnection *connection)
-{
- g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (connection));
- return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->specific_object;
-}
-
-/**
- * nm_active_connection_get_devices:
- * @connection: a #NMActiveConnection
- *
- * Gets the #NMDevices used for the active connections.
- *
- * Returns: (element-type NMDevice): the #GPtrArray containing #NMDevices.
- * This is the internal copy used by the connection, and must not be modified.
- **/
-const GPtrArray *
-nm_active_connection_get_devices (NMActiveConnection *connection)
-{
- g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (connection));
- return handle_ptr_array_return (NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->devices);
-}
-
-/**
- * nm_active_connection_get_state:
- * @connection: a #NMActiveConnection
- *
- * Gets the active connection's state.
- *
- * Returns: the state
- **/
-NMActiveConnectionState
-nm_active_connection_get_state (NMActiveConnection *connection)
-{
- g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NM_ACTIVE_CONNECTION_STATE_UNKNOWN);
-
- _nm_object_ensure_inited (NM_OBJECT (connection));
- return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->state;
-}
-
-/**
- * nm_active_connection_get_default:
- * @connection: a #NMActiveConnection
- *
- * Whether the active connection is the default IPv4 one (that is, is used for
- * the default IPv4 route and DNS information).
- *
- * Returns: %TRUE if the active connection is the default IPv4 connection
- **/
-gboolean
-nm_active_connection_get_default (NMActiveConnection *connection)
-{
- g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), FALSE);
-
- _nm_object_ensure_inited (NM_OBJECT (connection));
- return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->is_default;
-}
-
-/**
- * nm_active_connection_get_ip4_config:
- * @connection: an #NMActiveConnection
- *
- * Gets the current #NMIP4Config associated with the #NMActiveConnection.
- *
- * Returns: (transfer none): the #NMIP4Config, or %NULL if the
- * connection is not in the %NM_ACTIVE_CONNECTION_STATE_ACTIVATED
- * state.
- *
- * Since: 0.9.10
- **/
-NMIP4Config *
-nm_active_connection_get_ip4_config (NMActiveConnection *connection)
-{
- g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (connection));
- return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->ip4_config;
-}
-
-/**
- * nm_active_connection_get_dhcp4_config:
- * @connection: an #NMActiveConnection
- *
- * Gets the current #NMDHCP4Config (if any) associated with the
- * #NMActiveConnection.
- *
- * Returns: (transfer none): the #NMDHCP4Config, or %NULL if the
- * connection does not use DHCP, or is not in the
- * %NM_ACTIVE_CONNECTION_STATE_ACTIVATED state.
- *
- * Since: 0.9.10
- **/
-NMDHCP4Config *
-nm_active_connection_get_dhcp4_config (NMActiveConnection *connection)
-{
- g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (connection));
- return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->dhcp4_config;
-}
-
-/**
- * nm_active_connection_get_default6:
- * @connection: a #NMActiveConnection
- *
- * Whether the active connection is the default IPv6 one (that is, is used for
- * the default IPv6 route and DNS information).
- *
- * Returns: %TRUE if the active connection is the default IPv6 connection
- **/
-gboolean
-nm_active_connection_get_default6 (NMActiveConnection *connection)
-{
- g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), FALSE);
-
- _nm_object_ensure_inited (NM_OBJECT (connection));
- return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->is_default6;
-}
-
-/**
- * nm_active_connection_get_ip6_config:
- * @connection: an #NMActiveConnection
- *
- * Gets the current #NMIP6Config associated with the #NMActiveConnection.
- *
- * Returns: (transfer none): the #NMIP6Config, or %NULL if the
- * connection is not in the %NM_ACTIVE_CONNECTION_STATE_ACTIVATED
- * state.
- *
- * Since: 0.9.10
- **/
-NMIP6Config *
-nm_active_connection_get_ip6_config (NMActiveConnection *connection)
-{
- g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (connection));
- return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->ip6_config;
-}
-
-/**
- * nm_active_connection_get_dhcp6_config:
- * @connection: an #NMActiveConnection
- *
- * Gets the current #NMDHCP6Config (if any) associated with the
- * #NMActiveConnection.
- *
- * Returns: (transfer none): the #NMDHCP6Config, or %NULL if the
- * connection does not use DHCPv6, or is not in the
- * %NM_ACTIVE_CONNECTION_STATE_ACTIVATED state.
- *
- * Since: 0.9.10
- **/
-NMDHCP6Config *
-nm_active_connection_get_dhcp6_config (NMActiveConnection *connection)
-{
- g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (connection));
- return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->dhcp6_config;
-}
-
-/**
- * nm_active_connection_get_vpn:
- * @connection: a #NMActiveConnection
- *
- * Whether the active connection is a VPN connection.
- *
- * Returns: %TRUE if the active connection is a VPN connection
- *
- * Since: 0.9.10
- **/
-gboolean
-nm_active_connection_get_vpn (NMActiveConnection *connection)
-{
- g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), FALSE);
-
- _nm_object_ensure_inited (NM_OBJECT (connection));
- return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->is_vpn;
-}
-
-/**
- * nm_active_connection_get_master:
- * @connection: a #NMActiveConnection
- *
- * Gets the path to the master #NMDevice of the connection.
- *
- * Returns: the path of the master #NMDevice of the #NMActiveConnection.
- * This is the internal string used by the connection, and must not be modified.
- **/
-const char *
-nm_active_connection_get_master (NMActiveConnection *connection)
-{
- g_return_val_if_fail (NM_IS_ACTIVE_CONNECTION (connection), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (connection));
- return NM_ACTIVE_CONNECTION_GET_PRIVATE (connection)->master;
-}
-
-static void
-nm_active_connection_init (NMActiveConnection *ap)
-{
-}
-
-static void
-dispose (GObject *object)
-{
- NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (object);
-
- if (priv->devices) {
- g_ptr_array_set_free_func (priv->devices, g_object_unref);
- g_ptr_array_free (priv->devices, TRUE);
- priv->devices = NULL;
- }
-
- g_clear_object (&priv->ip4_config);
- g_clear_object (&priv->dhcp4_config);
- g_clear_object (&priv->ip6_config);
- g_clear_object (&priv->dhcp6_config);
-
- g_clear_object (&priv->proxy);
-
- G_OBJECT_CLASS (nm_active_connection_parent_class)->dispose (object);
-}
-
-static void
-finalize (GObject *object)
-{
- NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (object);
-
- g_free (priv->connection);
- g_free (priv->id);
- g_free (priv->uuid);
- g_free (priv->type);
- g_free (priv->specific_object);
- g_free (priv->master);
-
- G_OBJECT_CLASS (nm_active_connection_parent_class)->finalize (object);
-}
-
-static void
-get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- NMActiveConnection *self = NM_ACTIVE_CONNECTION (object);
-
- _nm_object_ensure_inited (NM_OBJECT (object));
-
- switch (prop_id) {
- case PROP_CONNECTION:
- g_value_set_string (value, nm_active_connection_get_connection (self));
- break;
- case PROP_ID:
- g_value_set_string (value, nm_active_connection_get_id (self));
- break;
- case PROP_UUID:
- g_value_set_string (value, nm_active_connection_get_uuid (self));
- break;
- case PROP_TYPE:
- g_value_set_string (value, nm_active_connection_get_connection_type (self));
- break;
- case PROP_SPECIFIC_OBJECT:
- g_value_set_boxed (value, nm_active_connection_get_specific_object (self));
- break;
- case PROP_DEVICES:
- g_value_set_boxed (value, nm_active_connection_get_devices (self));
- break;
- case PROP_STATE:
- g_value_set_uint (value, nm_active_connection_get_state (self));
- break;
- case PROP_DEFAULT:
- g_value_set_boolean (value, nm_active_connection_get_default (self));
- break;
- case PROP_IP4_CONFIG:
- g_value_set_object (value, nm_active_connection_get_ip4_config (self));
- break;
- case PROP_DHCP4_CONFIG:
- g_value_set_object (value, nm_active_connection_get_dhcp4_config (self));
- break;
- case PROP_DEFAULT6:
- g_value_set_boolean (value, nm_active_connection_get_default6 (self));
- break;
- case PROP_IP6_CONFIG:
- g_value_set_object (value, nm_active_connection_get_ip6_config (self));
- break;
- case PROP_DHCP6_CONFIG:
- g_value_set_object (value, nm_active_connection_get_dhcp6_config (self));
- break;
- case PROP_VPN:
- g_value_set_boolean (value, nm_active_connection_get_vpn (self));
- break;
- case PROP_MASTER:
- g_value_set_string (value, nm_active_connection_get_master (self));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-register_properties (NMActiveConnection *connection)
-{
- NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (connection);
- const NMPropertiesInfo property_info[] = {
- { NM_ACTIVE_CONNECTION_CONNECTION, &priv->connection },
- { NM_ACTIVE_CONNECTION_ID, &priv->id },
- { NM_ACTIVE_CONNECTION_UUID, &priv->uuid },
- { NM_ACTIVE_CONNECTION_TYPE, &priv->type },
- { NM_ACTIVE_CONNECTION_SPECIFIC_OBJECT, &priv->specific_object },
- { NM_ACTIVE_CONNECTION_DEVICES, &priv->devices, NULL, NM_TYPE_DEVICE },
- { NM_ACTIVE_CONNECTION_STATE, &priv->state },
- { NM_ACTIVE_CONNECTION_DEFAULT, &priv->is_default },
- { NM_ACTIVE_CONNECTION_IP4_CONFIG, &priv->ip4_config, NULL, NM_TYPE_IP4_CONFIG },
- { NM_ACTIVE_CONNECTION_DHCP4_CONFIG, &priv->dhcp4_config, NULL, NM_TYPE_DHCP4_CONFIG },
- { NM_ACTIVE_CONNECTION_DEFAULT6, &priv->is_default6 },
- { NM_ACTIVE_CONNECTION_IP6_CONFIG, &priv->ip6_config, NULL, NM_TYPE_IP6_CONFIG },
- { NM_ACTIVE_CONNECTION_DHCP6_CONFIG, &priv->dhcp6_config, NULL, NM_TYPE_DHCP6_CONFIG },
- { NM_ACTIVE_CONNECTION_VPN, &priv->is_vpn },
- { NM_ACTIVE_CONNECTION_MASTER, &priv->master },
-
- { NULL },
- };
-
- _nm_object_register_properties (NM_OBJECT (connection),
- priv->proxy,
- property_info);
-}
-
-static void
-constructed (GObject *object)
-{
- NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (object);
-
- G_OBJECT_CLASS (nm_active_connection_parent_class)->constructed (object);
-
- priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_ACTIVE_CONNECTION);
- register_properties (NM_ACTIVE_CONNECTION (object));
-}
-
-static void
-nm_active_connection_class_init (NMActiveConnectionClass *ap_class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (ap_class);
-
- g_type_class_add_private (ap_class, sizeof (NMActiveConnectionPrivate));
-
- /* virtual methods */
- object_class->constructed = constructed;
- object_class->get_property = get_property;
- object_class->dispose = dispose;
- object_class->finalize = finalize;
-
- /* properties */
-
- /**
- * NMActiveConnection:connection:
- *
- * The connection's path of the active connection.
- **/
- g_object_class_install_property
- (object_class, PROP_CONNECTION,
- g_param_spec_string (NM_ACTIVE_CONNECTION_CONNECTION, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMActiveConnection:id:
- *
- * The active connection's ID
- *
- * Since: 0.9.10
- **/
- g_object_class_install_property
- (object_class, PROP_ID,
- g_param_spec_string (NM_ACTIVE_CONNECTION_ID, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMActiveConnection:uuid:
- *
- * The active connection's UUID
- **/
- g_object_class_install_property
- (object_class, PROP_UUID,
- g_param_spec_string (NM_ACTIVE_CONNECTION_UUID, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMActiveConnection:type:
- *
- * The active connection's type
- *
- * Since: 0.9.10
- **/
- g_object_class_install_property
- (object_class, PROP_TYPE,
- g_param_spec_string (NM_ACTIVE_CONNECTION_TYPE, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMActiveConnection:specific-object:
- *
- * The specific object's path of the active connection.
- **/
- g_object_class_install_property
- (object_class, PROP_SPECIFIC_OBJECT,
- g_param_spec_string (NM_ACTIVE_CONNECTION_SPECIFIC_OBJECT, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMActiveConnection:device:
- *
- * The devices (#NMDevice) of the active connection.
- **/
- g_object_class_install_property
- (object_class, PROP_DEVICES,
- g_param_spec_boxed (NM_ACTIVE_CONNECTION_DEVICES, "", "",
- NM_TYPE_OBJECT_ARRAY,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMActiveConnection:state:
- *
- * The state of the active connection.
- **/
- g_object_class_install_property
- (object_class, PROP_STATE,
- g_param_spec_uint (NM_ACTIVE_CONNECTION_STATE, "", "",
- NM_ACTIVE_CONNECTION_STATE_UNKNOWN,
- NM_ACTIVE_CONNECTION_STATE_DEACTIVATING,
- NM_ACTIVE_CONNECTION_STATE_UNKNOWN,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMActiveConnection:default:
- *
- * Whether the active connection is the default IPv4 one.
- **/
- g_object_class_install_property
- (object_class, PROP_DEFAULT,
- g_param_spec_boolean (NM_ACTIVE_CONNECTION_DEFAULT, "", "",
- FALSE,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMActiveConnection:ip4-config:
- *
- * The #NMIP4Config of the connection.
- *
- * Since: 0.9.10
- **/
- g_object_class_install_property
- (object_class, PROP_IP4_CONFIG,
- g_param_spec_object (NM_ACTIVE_CONNECTION_IP4_CONFIG, "", "",
- NM_TYPE_IP4_CONFIG,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMActiveConnection:dhcp4-config:
- *
- * The #NMDHCP4Config of the connection.
- *
- * Since: 0.9.10
- **/
- g_object_class_install_property
- (object_class, PROP_DHCP4_CONFIG,
- g_param_spec_object (NM_ACTIVE_CONNECTION_DHCP4_CONFIG, "", "",
- NM_TYPE_DHCP4_CONFIG,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMActiveConnection:default6:
- *
- * Whether the active connection is the default IPv6 one.
- **/
- g_object_class_install_property
- (object_class, PROP_DEFAULT6,
- g_param_spec_boolean (NM_ACTIVE_CONNECTION_DEFAULT6, "", "",
- FALSE,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMActiveConnection:ip6-config:
- *
- * The #NMIP6Config of the connection.
- *
- * Since: 0.9.10
- **/
- g_object_class_install_property
- (object_class, PROP_IP6_CONFIG,
- g_param_spec_object (NM_ACTIVE_CONNECTION_IP6_CONFIG, "", "",
- NM_TYPE_IP6_CONFIG,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMActiveConnection:dhcp6-config:
- *
- * The #NMDHCP6Config of the connection.
- *
- * Since: 0.9.10
- **/
- g_object_class_install_property
- (object_class, PROP_DHCP6_CONFIG,
- g_param_spec_object (NM_ACTIVE_CONNECTION_DHCP6_CONFIG, "", "",
- NM_TYPE_DHCP6_CONFIG,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMActiveConnection:vpn:
- *
- * Whether the active connection is a VPN connection.
- *
- * Since: 0.9.10
- **/
- g_object_class_install_property
- (object_class, PROP_VPN,
- g_param_spec_boolean (NM_ACTIVE_CONNECTION_VPN, "", "",
- FALSE,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMActiveConnection:master:
- *
- * The path of the master device if one exists.
- **/
- g_object_class_install_property
- (object_class, PROP_MASTER,
- g_param_spec_string (NM_ACTIVE_CONNECTION_MASTER, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-}
diff --git a/libnm-glib/nm-active-connection.h b/libnm-glib/nm-active-connection.h
deleted file mode 100644
index cdf02a94e..000000000
--- a/libnm-glib/nm-active-connection.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2007 - 2014 Red Hat, Inc.
- * Copyright 2008 Novell, Inc.
- */
-
-#ifndef NM_ACTIVE_CONNECTION_H
-#define NM_ACTIVE_CONNECTION_H
-
-#include <glib.h>
-#include <glib-object.h>
-#include "nm-object.h"
-#include "nm-connection.h"
-#include "NetworkManager.h"
-#include "nm-ip4-config.h"
-#include "nm-dhcp4-config.h"
-#include "nm-ip6-config.h"
-#include "nm-dhcp6-config.h"
-
-G_BEGIN_DECLS
-
-#define NM_TYPE_ACTIVE_CONNECTION (nm_active_connection_get_type ())
-#define NM_ACTIVE_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_ACTIVE_CONNECTION, NMActiveConnection))
-#define NM_ACTIVE_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_ACTIVE_CONNECTION, NMActiveConnectionClass))
-#define NM_IS_ACTIVE_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_ACTIVE_CONNECTION))
-#define NM_IS_ACTIVE_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_ACTIVE_CONNECTION))
-#define NM_ACTIVE_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_ACTIVE_CONNECTION, NMActiveConnectionClass))
-
-#define NM_ACTIVE_CONNECTION_CONNECTION "connection"
-#define NM_ACTIVE_CONNECTION_ID "id"
-#define NM_ACTIVE_CONNECTION_UUID "uuid"
-#define NM_ACTIVE_CONNECTION_TYPE "type"
-#define NM_ACTIVE_CONNECTION_SPECIFIC_OBJECT "specific-object"
-#define NM_ACTIVE_CONNECTION_DEVICES "devices"
-#define NM_ACTIVE_CONNECTION_STATE "state"
-#define NM_ACTIVE_CONNECTION_DEFAULT "default"
-#define NM_ACTIVE_CONNECTION_IP4_CONFIG "ip4-config"
-#define NM_ACTIVE_CONNECTION_DHCP4_CONFIG "dhcp4-config"
-#define NM_ACTIVE_CONNECTION_DEFAULT6 "default6"
-#define NM_ACTIVE_CONNECTION_IP6_CONFIG "ip6-config"
-#define NM_ACTIVE_CONNECTION_DHCP6_CONFIG "dhcp6-config"
-#define NM_ACTIVE_CONNECTION_VPN "vpn"
-#define NM_ACTIVE_CONNECTION_MASTER "master"
-
-typedef struct {
- NMObject parent;
-} NMActiveConnection;
-
-typedef struct {
- NMObjectClass parent;
-
- /* Padding for future expansion */
- void (*_reserved1) (void);
- void (*_reserved2) (void);
- void (*_reserved3) (void);
- void (*_reserved4) (void);
- void (*_reserved5) (void);
- void (*_reserved6) (void);
-} NMActiveConnectionClass;
-
-GType nm_active_connection_get_type (void);
-
-GObject *nm_active_connection_new (DBusGConnection *connection, const char *path);
-
-const char * nm_active_connection_get_connection (NMActiveConnection *connection);
-NM_AVAILABLE_IN_0_9_10
-const char * nm_active_connection_get_id (NMActiveConnection *connection);
-const char * nm_active_connection_get_uuid (NMActiveConnection *connection);
-NM_AVAILABLE_IN_0_9_10
-const char * nm_active_connection_get_connection_type (NMActiveConnection *connection);
-const char * nm_active_connection_get_specific_object (NMActiveConnection *connection);
-const GPtrArray *nm_active_connection_get_devices (NMActiveConnection *connection);
-NMActiveConnectionState nm_active_connection_get_state (NMActiveConnection *connection);
-const char * nm_active_connection_get_master (NMActiveConnection *connection);
-gboolean nm_active_connection_get_default (NMActiveConnection *connection);
-NM_AVAILABLE_IN_0_9_10
-NMIP4Config * nm_active_connection_get_ip4_config (NMActiveConnection *connection);
-NM_AVAILABLE_IN_0_9_10
-NMDHCP4Config *nm_active_connection_get_dhcp4_config (NMActiveConnection *connection);
-gboolean nm_active_connection_get_default6 (NMActiveConnection *connection);
-NM_AVAILABLE_IN_0_9_10
-NMIP6Config * nm_active_connection_get_ip6_config (NMActiveConnection *connection);
-NM_AVAILABLE_IN_0_9_10
-NMDHCP6Config *nm_active_connection_get_dhcp6_config (NMActiveConnection *connection);
-NM_AVAILABLE_IN_0_9_10
-gboolean nm_active_connection_get_vpn (NMActiveConnection *connection);
-
-G_END_DECLS
-
-#endif /* NM_ACTIVE_CONNECTION_H */
diff --git a/libnm-glib/nm-client.c b/libnm-glib/nm-client.c
deleted file mode 100644
index 16fee7141..000000000
--- a/libnm-glib/nm-client.c
+++ /dev/null
@@ -1,2514 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2007 - 2008 Novell, Inc.
- * Copyright 2007 - 2013 Red Hat, Inc.
- */
-
-#include "nm-default.h"
-
-#include "nm-client.h"
-
-#include <dbus/dbus-glib.h>
-#include <string.h>
-
-#include "nm-utils.h"
-#include "nm-common-macros.h"
-
-#include "nm-device-ethernet.h"
-#include "nm-device-wifi.h"
-#include "nm-device-private.h"
-#include "nm-types-private.h"
-#include "nm-object-private.h"
-#include "nm-active-connection.h"
-#include "nm-vpn-connection.h"
-#include "nm-object-cache.h"
-#include "nm-dbus-glib-types.h"
-
-void _nm_device_wifi_set_wireless_enabled (NMDeviceWifi *device, gboolean enabled);
-
-static void nm_client_initable_iface_init (GInitableIface *iface);
-static void nm_client_async_initable_iface_init (GAsyncInitableIface *iface);
-static GInitableIface *nm_client_parent_initable_iface;
-static GAsyncInitableIface *nm_client_parent_async_initable_iface;
-
-G_DEFINE_TYPE_WITH_CODE (NMClient, nm_client, NM_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, nm_client_initable_iface_init);
- G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE, nm_client_async_initable_iface_init);
- )
-
-#define NM_CLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_CLIENT, NMClientPrivate))
-
-typedef struct {
- DBusGProxy *client_proxy;
- DBusGProxy *bus_proxy;
- gboolean manager_running;
- char *version;
- NMState state;
- gboolean startup;
- GPtrArray *devices;
- GPtrArray *all_devices;
- GPtrArray *active_connections;
- NMConnectivityState connectivity;
- NMActiveConnection *primary_connection;
- NMActiveConnection *activating_connection;
-
- DBusGProxyCall *perm_call;
- GHashTable *permissions;
-
- /* Activations waiting for their NMActiveConnection
- * to appear and then their callback to be called.
- */
- GSList *pending_activations;
-
- gboolean networking_enabled;
- gboolean wireless_enabled;
- gboolean wireless_hw_enabled;
-
- gboolean wwan_enabled;
- gboolean wwan_hw_enabled;
-
- gboolean wimax_enabled;
- gboolean wimax_hw_enabled;
-} NMClientPrivate;
-
-enum {
- PROP_0,
- PROP_VERSION,
- PROP_STATE,
- PROP_STARTUP,
- PROP_MANAGER_RUNNING,
- PROP_NETWORKING_ENABLED,
- PROP_WIRELESS_ENABLED,
- PROP_WIRELESS_HARDWARE_ENABLED,
- PROP_WWAN_ENABLED,
- PROP_WWAN_HARDWARE_ENABLED,
- PROP_WIMAX_ENABLED,
- PROP_WIMAX_HARDWARE_ENABLED,
- PROP_ACTIVE_CONNECTIONS,
- PROP_CONNECTIVITY,
- PROP_PRIMARY_CONNECTION,
- PROP_ACTIVATING_CONNECTION,
- PROP_DEVICES,
- PROP_ALL_DEVICES,
-
- LAST_PROP
-};
-
-enum {
- DEVICE_ADDED,
- DEVICE_REMOVED,
- ANY_DEVICE_ADDED,
- ANY_DEVICE_REMOVED,
- PERMISSION_CHANGED,
-
- LAST_SIGNAL
-};
-
-static guint signals[LAST_SIGNAL] = { 0 };
-
-static void proxy_name_owner_changed (DBusGProxy *proxy,
- const char *name,
- const char *old_owner,
- const char *new_owner,
- gpointer user_data);
-
-/*****************************************************************************/
-
-/**
- * nm_client_error_quark:
- *
- * Registers an error quark for #NMClient if necessary.
- *
- * Returns: the error quark used for #NMClient errors.
- *
- * Since: 0.9.10
- **/
-GQuark
-nm_client_error_quark (void)
-{
- static GQuark quark;
-
- if (G_UNLIKELY (!quark))
- quark = g_quark_from_static_string ("nm-client-error-quark");
- return quark;
-}
-
-/*****************************************************************************/
-
-static void
-nm_client_init (NMClient *client)
-{
- NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (client);
-
- priv->state = NM_STATE_UNKNOWN;
-
- priv->permissions = g_hash_table_new (NULL, NULL);
-}
-
-static void
-poke_wireless_devices_with_rf_status (NMClient *client)
-{
- NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (client);
- int i;
-
- for (i = 0; priv->all_devices && (i < priv->all_devices->len); i++) {
- NMDevice *device = g_ptr_array_index (priv->all_devices, i);
-
- if (NM_IS_DEVICE_WIFI (device))
- _nm_device_wifi_set_wireless_enabled (NM_DEVICE_WIFI (device), priv->wireless_enabled);
- }
-}
-
-static void
-wireless_enabled_cb (GObject *object, GParamSpec *pspec, gpointer user_data)
-{
- poke_wireless_devices_with_rf_status (NM_CLIENT (object));
-}
-
-static void
-register_properties (NMClient *client)
-{
- NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (client);
- const NMPropertiesInfo property_info[] = {
- { NM_CLIENT_VERSION, &priv->version },
- { NM_CLIENT_STATE, &priv->state },
- { NM_CLIENT_STARTUP, &priv->startup },
- { NM_CLIENT_NETWORKING_ENABLED, &priv->networking_enabled },
- { NM_CLIENT_WIRELESS_ENABLED, &priv->wireless_enabled },
- { NM_CLIENT_WIRELESS_HARDWARE_ENABLED, &priv->wireless_hw_enabled },
- { NM_CLIENT_WWAN_ENABLED, &priv->wwan_enabled },
- { NM_CLIENT_WWAN_HARDWARE_ENABLED, &priv->wwan_hw_enabled },
- { NM_CLIENT_WIMAX_ENABLED, &priv->wimax_enabled },
- { NM_CLIENT_WIMAX_HARDWARE_ENABLED, &priv->wimax_hw_enabled },
- { NM_CLIENT_ACTIVE_CONNECTIONS, &priv->active_connections, NULL, NM_TYPE_ACTIVE_CONNECTION },
- { NM_CLIENT_CONNECTIVITY, &priv->connectivity },
- { NM_CLIENT_PRIMARY_CONNECTION, &priv->primary_connection, NULL, NM_TYPE_ACTIVE_CONNECTION },
- { NM_CLIENT_ACTIVATING_CONNECTION, &priv->activating_connection, NULL, NM_TYPE_ACTIVE_CONNECTION },
- { NM_CLIENT_DEVICES, &priv->devices, NULL, NM_TYPE_DEVICE, "device" },
- { NM_CLIENT_ALL_DEVICES, &priv->all_devices, NULL, NM_TYPE_DEVICE, "any-device" },
- { NULL },
- };
-
- _nm_object_register_properties (NM_OBJECT (client),
- priv->client_proxy,
- property_info);
-}
-
-static NMClientPermission
-nm_permission_to_client (const char *nm)
-{
- if (!strcmp (nm, NM_AUTH_PERMISSION_ENABLE_DISABLE_NETWORK))
- return NM_CLIENT_PERMISSION_ENABLE_DISABLE_NETWORK;
- else if (!strcmp (nm, NM_AUTH_PERMISSION_ENABLE_DISABLE_WIFI))
- return NM_CLIENT_PERMISSION_ENABLE_DISABLE_WIFI;
- else if (!strcmp (nm, NM_AUTH_PERMISSION_ENABLE_DISABLE_WWAN))
- return NM_CLIENT_PERMISSION_ENABLE_DISABLE_WWAN;
- else if (!strcmp (nm, NM_AUTH_PERMISSION_ENABLE_DISABLE_WIMAX))
- return NM_CLIENT_PERMISSION_ENABLE_DISABLE_WIMAX;
- else if (!strcmp (nm, NM_AUTH_PERMISSION_SLEEP_WAKE))
- return NM_CLIENT_PERMISSION_SLEEP_WAKE;
- else if (!strcmp (nm, NM_AUTH_PERMISSION_NETWORK_CONTROL))
- return NM_CLIENT_PERMISSION_NETWORK_CONTROL;
- else if (!strcmp (nm, NM_AUTH_PERMISSION_WIFI_SHARE_PROTECTED))
- return NM_CLIENT_PERMISSION_WIFI_SHARE_PROTECTED;
- else if (!strcmp (nm, NM_AUTH_PERMISSION_WIFI_SHARE_OPEN))
- return NM_CLIENT_PERMISSION_WIFI_SHARE_OPEN;
- else if (!strcmp (nm, NM_AUTH_PERMISSION_SETTINGS_MODIFY_SYSTEM))
- return NM_CLIENT_PERMISSION_SETTINGS_MODIFY_SYSTEM;
- else if (!strcmp (nm, NM_AUTH_PERMISSION_SETTINGS_MODIFY_OWN))
- return NM_CLIENT_PERMISSION_SETTINGS_MODIFY_OWN;
- else if (!strcmp (nm, NM_AUTH_PERMISSION_SETTINGS_MODIFY_HOSTNAME))
- return NM_CLIENT_PERMISSION_SETTINGS_MODIFY_HOSTNAME;
- else if (!strcmp (nm, NM_AUTH_PERMISSION_SETTINGS_MODIFY_GLOBAL_DNS))
- return NM_CLIENT_PERMISSION_SETTINGS_MODIFY_GLOBAL_DNS;
- else if (!strcmp (nm, NM_AUTH_PERMISSION_RELOAD))
- return NM_CLIENT_PERMISSION_RELOAD;
- else if (!strcmp (nm, NM_AUTH_PERMISSION_CHECKPOINT_ROLLBACK))
- return NM_CLIENT_PERMISSION_CHECKPOINT_ROLLBACK;
- else if (!strcmp (nm, NM_AUTH_PERMISSION_ENABLE_DISABLE_STATISTICS))
- return NM_CLIENT_PERMISSION_ENABLE_DISABLE_STATISTICS;
-
- return NM_CLIENT_PERMISSION_NONE;
-}
-
-static NMClientPermissionResult
-nm_permission_result_to_client (const char *nm)
-{
- if (!strcmp (nm, "yes"))
- return NM_CLIENT_PERMISSION_RESULT_YES;
- else if (!strcmp (nm, "no"))
- return NM_CLIENT_PERMISSION_RESULT_NO;
- else if (!strcmp (nm, "auth"))
- return NM_CLIENT_PERMISSION_RESULT_AUTH;
- return NM_CLIENT_PERMISSION_RESULT_UNKNOWN;
-}
-
-static void
-update_permissions (NMClient *self, GHashTable *permissions)
-{
- NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (self);
- GHashTableIter iter;
- gpointer key, value;
- NMClientPermission perm;
- NMClientPermissionResult perm_result;
- GList *keys, *keys_iter;
-
- /* get list of old permissions for change notification */
- keys = g_hash_table_get_keys (priv->permissions);
- g_hash_table_remove_all (priv->permissions);
-
- if (permissions) {
- /* Process new permissions */
- g_hash_table_iter_init (&iter, permissions);
- while (g_hash_table_iter_next (&iter, &key, &value)) {
- perm = nm_permission_to_client ((const char *) key);
- perm_result = nm_permission_result_to_client ((const char *) value);
- if (perm) {
- g_hash_table_insert (priv->permissions,
- GUINT_TO_POINTER (perm),
- GUINT_TO_POINTER (perm_result));
-
- /* Remove this permission from the list of previous permissions
- * we'll be sending NM_CLIENT_PERMISSION_RESULT_UNKNOWN for
- * in the change signal since it is still a known permission.
- */
- keys = g_list_remove (keys, GUINT_TO_POINTER (perm));
- }
- }
- }
-
- /* Signal changes in all updated permissions */
- g_hash_table_iter_init (&iter, priv->permissions);
- while (g_hash_table_iter_next (&iter, &key, &value)) {
- g_signal_emit (self, signals[PERMISSION_CHANGED], 0,
- GPOINTER_TO_UINT (key),
- GPOINTER_TO_UINT (value));
- }
-
- /* And signal changes in all permissions that used to be valid but for
- * some reason weren't received in the last request (if any).
- */
- for (keys_iter = keys; keys_iter; keys_iter = g_list_next (keys_iter)) {
- g_signal_emit (self, signals[PERMISSION_CHANGED], 0,
- GPOINTER_TO_UINT (keys_iter->data),
- NM_CLIENT_PERMISSION_RESULT_UNKNOWN);
- }
- g_list_free (keys);
-}
-
-static gboolean
-get_permissions_sync (NMClient *self, GError **error)
-{
- gboolean success;
- gs_unref_hashtable GHashTable *permissions = NULL;
-
- success = dbus_g_proxy_call_with_timeout (NM_CLIENT_GET_PRIVATE (self)->client_proxy,
- "GetPermissions", 3000, error,
- G_TYPE_INVALID,
- DBUS_TYPE_G_MAP_OF_STRING, &permissions, G_TYPE_INVALID);
- update_permissions (self, success ? permissions : NULL);
- return success;
-}
-
-static void
-get_permissions_reply (DBusGProxy *proxy,
- DBusGProxyCall *call,
- gpointer user_data)
-{
- NMClient *self = NM_CLIENT (user_data);
- gs_unref_hashtable GHashTable *permissions = NULL;
- gs_free_error GError *error = NULL;
-
- dbus_g_proxy_end_call (proxy, call, &error,
- DBUS_TYPE_G_MAP_OF_STRING, &permissions,
- G_TYPE_INVALID);
- NM_CLIENT_GET_PRIVATE (self)->perm_call = NULL;
- update_permissions (NM_CLIENT (user_data), error ? NULL : permissions);
-}
-
-static void
-client_recheck_permissions (DBusGProxy *proxy, gpointer user_data)
-{
- NMClient *self = NM_CLIENT (user_data);
- NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (self);
-
- if (!priv->perm_call) {
- priv->perm_call = dbus_g_proxy_begin_call (NM_CLIENT_GET_PRIVATE (self)->client_proxy, "GetPermissions",
- get_permissions_reply, self, NULL,
- G_TYPE_INVALID);
- }
-}
-
-/**
- * nm_client_get_devices:
- * @client: a #NMClient
- *
- * Gets all the known network devices. Use nm_device_get_type() or the
- * <literal>NM_IS_DEVICE_XXXX</literal> functions to determine what kind of
- * device member of the returned array is, and then you may use device-specific
- * methods such as nm_device_ethernet_get_hw_address().
- *
- * Returns: (transfer none) (element-type NMDevice): a #GPtrArray
- * containing all the #NMDevices. The returned array is owned by the
- * #NMClient object and should not be modified.
- **/
-const GPtrArray *
-nm_client_get_devices (NMClient *client)
-{
- g_return_val_if_fail (NM_IS_CLIENT (client), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (client));
-
- return handle_ptr_array_return (NM_CLIENT_GET_PRIVATE (client)->devices);
-}
-
-/**
- * nm_client_get_all_devices:
- * @client: a #NMClient
- *
- * Gets both real devices and device placeholders (eg, software devices which
- * do not currently exist, but could be created automatically by NetworkManager
- * if one of their NMDevice::ActivatableConnections was activated). Use
- * nm_device_is_real() to determine whether each device is a real device or
- * a placeholder.
- *
- * Use nm_device_get_type() or the NM_IS_DEVICE_XXXX() functions to determine
- * what kind of device each member of the returned array is, and then you may
- * use device-specific methods such as nm_device_ethernet_get_hw_address().
- *
- * Returns: (transfer none) (element-type NMDevice): a #GPtrArray
- * containing all the #NMDevices. The returned array is owned by the
- * #NMClient object and should not be modified.
- *
- * Since: 1.2
- **/
-const GPtrArray *
-nm_client_get_all_devices (NMClient *client)
-{
- g_return_val_if_fail (NM_IS_CLIENT (client), NULL);
-
- return NM_CLIENT_GET_PRIVATE (client)->all_devices;
-}
-
-/**
- * nm_client_get_device_by_path:
- * @client: a #NMClient
- * @object_path: the object path to search for
- *
- * Gets a #NMDevice from a #NMClient.
- *
- * Returns: (transfer none): the #NMDevice for the given @object_path or %NULL if none is found.
- **/
-NMDevice *
-nm_client_get_device_by_path (NMClient *client, const char *object_path)
-{
- const GPtrArray *devices;
- int i;
- NMDevice *device = NULL;
-
- g_return_val_if_fail (NM_IS_CLIENT (client), NULL);
- g_return_val_if_fail (object_path, NULL);
-
- devices = nm_client_get_devices (client);
- if (!devices)
- return NULL;
-
- for (i = 0; i < devices->len; i++) {
- NMDevice *candidate = g_ptr_array_index (devices, i);
- if (!strcmp (nm_object_get_path (NM_OBJECT (candidate)), object_path)) {
- device = candidate;
- break;
- }
- }
-
- return device;
-}
-
-/**
- * nm_client_get_device_by_iface:
- * @client: a #NMClient
- * @iface: the interface name to search for
- *
- * Gets a #NMDevice from a #NMClient.
- *
- * Returns: (transfer none): the #NMDevice for the given @iface or %NULL if none is found.
- **/
-NMDevice *
-nm_client_get_device_by_iface (NMClient *client, const char *iface)
-{
- const GPtrArray *devices;
- int i;
- NMDevice *device = NULL;
-
- g_return_val_if_fail (NM_IS_CLIENT (client), NULL);
- g_return_val_if_fail (iface, NULL);
-
- devices = nm_client_get_devices (client);
- if (!devices)
- return NULL;
-
- for (i = 0; i < devices->len; i++) {
- NMDevice *candidate = g_ptr_array_index (devices, i);
- if (!strcmp (nm_device_get_iface (candidate), iface)) {
- device = candidate;
- break;
- }
- }
-
- return device;
-}
-
-typedef struct {
- NMClient *client;
- NMClientActivateFn act_fn;
- NMClientAddActivateFn add_act_fn;
- char *active_path;
- char *new_connection_path;
- guint idle_id;
- gpointer user_data;
-} ActivateInfo;
-
-static void
-activate_info_free (ActivateInfo *info)
-{
- if (info->idle_id)
- g_source_remove (info->idle_id);
- g_free (info->active_path);
- g_free (info->new_connection_path);
- memset (info, 0, sizeof (*info));
- g_slice_free (ActivateInfo, info);
-}
-
-static void
-activate_info_complete (ActivateInfo *info,
- NMActiveConnection *active,
- GError *error)
-{
- NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (info->client);
-
- if (info->act_fn)
- info->act_fn (info->client, error ? NULL : active, error, info->user_data);
- else if (info->add_act_fn) {
- info->add_act_fn (info->client,
- error ? NULL : active,
- error ? NULL : info->new_connection_path,
- error,
- info->user_data);
- } else if (error)
- g_warning ("Device activation failed: %s", error->message);
-
- priv->pending_activations = g_slist_remove (priv->pending_activations, info);
-}
-
-static void
-recheck_pending_activations (NMClient *self, const char *failed_path, GError *error)
-{
- NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (self);
- GSList *iter, *next;
- const GPtrArray *active_connections;
- gboolean found_in_active = FALSE;
- gboolean found_in_pending = FALSE;
- ActivateInfo *ainfo = NULL;
- int i;
-
- active_connections = nm_client_get_active_connections (self);
-
- /* For each pending activation, look for a active connection that has
- * the pending activation's object path, and call pending connection's
- * callback.
- * If the connection to activate doesn't make it to active_connections,
- * due to an error, we have to call the callback for failed_path.
- */
- for (iter = priv->pending_activations; iter; iter = next) {
- ActivateInfo *info = iter->data;
-
- next = g_slist_next (iter);
-
- if (!found_in_pending && failed_path && g_strcmp0 (failed_path, info->active_path) == 0) {
- found_in_pending = TRUE;
- ainfo = info;
- }
-
- for (i = 0; active_connections && i < active_connections->len; i++) {
- NMActiveConnection *active = g_ptr_array_index (active_connections, i);
- const char *active_path = nm_object_get_path (NM_OBJECT (active));
-
- if (!found_in_active && failed_path && g_strcmp0 (failed_path, active_path) == 0)
- found_in_active = TRUE;
-
- if (g_strcmp0 (info->active_path, active_path) == 0) {
- /* Call the pending activation's callback and it all up */
- activate_info_complete (info, active, NULL);
- activate_info_free (info);
- break;
- }
- }
- }
-
- if (!found_in_active && found_in_pending) {
- /* A newly activated connection failed due to some immediate error
- * and disappeared from active connection list. Make sure the
- * callback gets called.
- */
- activate_info_complete (ainfo, NULL, error);
- activate_info_free (ainfo);
- }
-}
-
-static void
-activate_cb (DBusGProxy *proxy,
- DBusGProxyCall *call,
- gpointer user_data)
-{
- ActivateInfo *info = user_data;
- char *path;
- GError *error = NULL;
-
- dbus_g_proxy_end_call (proxy, call, &error,
- DBUS_TYPE_G_OBJECT_PATH, &path,
- G_TYPE_INVALID);
- if (error) {
- activate_info_complete (info, NULL, error);
- activate_info_free (info);
- g_clear_error (&error);
- } else {
- info->active_path = path;
- recheck_pending_activations (info->client, NULL, NULL);
- }
-}
-
-static gboolean
-activate_nm_not_running (gpointer user_data)
-{
- ActivateInfo *info = user_data;
- GError *error;
-
- info->idle_id = 0;
-
- error = g_error_new_literal (NM_CLIENT_ERROR,
- NM_CLIENT_ERROR_MANAGER_NOT_RUNNING,
- "NetworkManager is not running");
- activate_info_complete (info, NULL, error);
- activate_info_free (info);
- g_clear_error (&error);
- return FALSE;
-}
-
-/**
- * nm_client_activate_connection:
- * @client: a #NMClient
- * @connection: (allow-none): an #NMConnection
- * @device: (allow-none): the #NMDevice
- * @specific_object: (allow-none): the object path of a connection-type-specific
- * object this activation should use. This parameter is currently ignored for
- * wired and mobile broadband connections, and the value of %NULL should be used
- * (ie, no specific object). For Wi-Fi or WiMAX connections, pass the object
- * path of a #NMAccessPoint or #NMWimaxNsp owned by @device, which you can
- * get using nm_object_get_path(), and which will be used to complete the
- * details of the newly added connection.
- * @callback: (scope async) (allow-none): the function to call when the call is done
- * @user_data: (closure): user data to pass to the callback function
- *
- * Starts a connection to a particular network using the configuration settings
- * from @connection and the network device @device. Certain connection types
- * also take a "specific object" which is the object path of a connection-
- * specific object, like an #NMAccessPoint for Wi-Fi connections, or an
- * #NMWimaxNsp for WiMAX connections, to which you wish to connect. If the
- * specific object is not given, NetworkManager can, in some cases, automatically
- * determine which network to connect to given the settings in @connection.
- *
- * If @connection is not given for a device-based activation, NetworkManager
- * picks the best available connection for the device and activates it.
- *
- * Note that the callback is invoked when NetworkManager has started activating
- * the new connection, not when it finishes. You can used the returned
- * #NMActiveConnection object (in particular, #NMActiveConnection:state) to
- * track the activation to its completion.
- **/
-void
-nm_client_activate_connection (NMClient *client,
- NMConnection *connection,
- NMDevice *device,
- const char *specific_object,
- NMClientActivateFn callback,
- gpointer user_data)
-{
- NMClientPrivate *priv;
- ActivateInfo *info;
-
- g_return_if_fail (NM_IS_CLIENT (client));
- if (device)
- g_return_if_fail (NM_IS_DEVICE (device));
- if (connection)
- g_return_if_fail (NM_IS_CONNECTION (connection));
-
- info = g_slice_new0 (ActivateInfo);
- info->act_fn = callback;
- info->user_data = user_data;
- info->client = client;
-
- priv = NM_CLIENT_GET_PRIVATE (client);
- priv->pending_activations = g_slist_prepend (priv->pending_activations, info);
-
- if (priv->manager_running == FALSE) {
- info->idle_id = g_idle_add (activate_nm_not_running, info);
- return;
- }
-
- dbus_g_proxy_begin_call (priv->client_proxy, "ActivateConnection",
- activate_cb, info, NULL,
- DBUS_TYPE_G_OBJECT_PATH, connection ? nm_connection_get_path (connection) : "/",
- DBUS_TYPE_G_OBJECT_PATH, device ? nm_object_get_path (NM_OBJECT (device)) : "/",
- DBUS_TYPE_G_OBJECT_PATH, specific_object ?: "/",
- G_TYPE_INVALID);
-}
-
-static void
-add_activate_cb (DBusGProxy *proxy,
- DBusGProxyCall *call,
- gpointer user_data)
-{
- ActivateInfo *info = user_data;
- char *connection_path;
- char *active_path;
- GError *error = NULL;
-
- dbus_g_proxy_end_call (proxy, call, &error,
- DBUS_TYPE_G_OBJECT_PATH, &connection_path,
- DBUS_TYPE_G_OBJECT_PATH, &active_path,
- G_TYPE_INVALID);
- if (error) {
- activate_info_complete (info, NULL, error);
- activate_info_free (info);
- } else {
- info->new_connection_path = connection_path;
- info->active_path = active_path;
- recheck_pending_activations (info->client, NULL, NULL);
- }
-}
-
-/**
- * nm_client_add_and_activate_connection:
- * @client: a #NMClient
- * @partial: (allow-none): an #NMConnection to add; the connection may be
- * partially filled (or even %NULL) and will be completed by NetworkManager
- * using the given @device and @specific_object before being added
- * @device: the #NMDevice
- * @specific_object: (allow-none): the object path of a connection-type-specific
- * object this activation should use. This parameter is currently ignored for
- * wired and mobile broadband connections, and the value of %NULL should be used
- * (ie, no specific object). For Wi-Fi or WiMAX connections, pass the object
- * path of a #NMAccessPoint or #NMWimaxNsp owned by @device, which you can
- * get using nm_object_get_path(), and which will be used to complete the
- * details of the newly added connection.
- * @callback: (scope async) (allow-none): the function to call when the call is done
- * @user_data: (closure): user data to pass to the callback function
- *
- * Adds a new connection using the given details (if any) as a template,
- * automatically filling in missing settings with the capabilities of the
- * given device and specific object. The new connection is then activated.
- * Cannot be used for VPN connections at this time.
- *
- * Note that the callback is invoked when NetworkManager has started activating
- * the new connection, not when it finishes. You can used the returned
- * #NMActiveConnection object (in particular, #NMActiveConnection:state) to
- * track the activation to its completion.
- **/
-void
-nm_client_add_and_activate_connection (NMClient *client,
- NMConnection *partial,
- NMDevice *device,
- const char *specific_object,
- NMClientAddActivateFn callback,
- gpointer user_data)
-{
- NMClientPrivate *priv;
- ActivateInfo *info;
- GHashTable *hash = NULL;
-
- g_return_if_fail (NM_IS_CLIENT (client));
- g_return_if_fail (NM_IS_DEVICE (device));
-
- info = g_slice_new0 (ActivateInfo);
- info->add_act_fn = callback;
- info->user_data = user_data;
- info->client = client;
-
- if (partial)
- hash = nm_connection_to_hash (partial, NM_SETTING_HASH_FLAG_ALL);
- if (!hash)
- hash = g_hash_table_new (g_str_hash, g_str_equal);
-
- priv = NM_CLIENT_GET_PRIVATE (client);
- priv->pending_activations = g_slist_prepend (priv->pending_activations, info);
-
- if (priv->manager_running) {
- dbus_g_proxy_begin_call (priv->client_proxy, "AddAndActivateConnection",
- add_activate_cb, info, NULL,
- DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT, hash,
- DBUS_TYPE_G_OBJECT_PATH, nm_object_get_path (NM_OBJECT (device)),
- DBUS_TYPE_G_OBJECT_PATH, specific_object ?: "/",
- G_TYPE_INVALID);
- } else
- info->idle_id = g_idle_add (activate_nm_not_running, info);
-
- g_hash_table_unref (hash);
-}
-
-static void
-active_connections_changed_cb (GObject *object, GParamSpec *pspec, gpointer user_data)
-{
- recheck_pending_activations (NM_CLIENT (object), NULL, NULL);
-}
-
-static void
-object_creation_failed_cb (GObject *object, GError *error, char *failed_path)
-{
- if (error)
- recheck_pending_activations (NM_CLIENT (object), failed_path, error);
-}
-
-/**
- * nm_client_deactivate_connection:
- * @client: a #NMClient
- * @active: the #NMActiveConnection to deactivate
- *
- * Deactivates an active #NMActiveConnection.
- **/
-void
-nm_client_deactivate_connection (NMClient *client, NMActiveConnection *active)
-{
- NMClientPrivate *priv;
- const char *path;
- GError *error = NULL;
-
- g_return_if_fail (NM_IS_CLIENT (client));
- g_return_if_fail (NM_IS_ACTIVE_CONNECTION (active));
-
- priv = NM_CLIENT_GET_PRIVATE (client);
- if (!priv->manager_running)
- return;
-
- path = nm_object_get_path (NM_OBJECT (active));
- if (!dbus_g_proxy_call (priv->client_proxy, "DeactivateConnection", &error,
- DBUS_TYPE_G_OBJECT_PATH, path,
- G_TYPE_INVALID,
- G_TYPE_INVALID)) {
- g_warning ("Could not deactivate connection '%s': %s",
- path, NM_G_ERROR_MSG (error));
- g_clear_error (&error);
- }
-}
-
-/**
- * nm_client_get_active_connections:
- * @client: a #NMClient
- *
- * Gets the active connections.
- *
- * Returns: (transfer none) (element-type NMActiveConnection): a #GPtrArray
- * containing all the active #NMActiveConnections.
- * The returned array is owned by the client and should not be modified.
- **/
-const GPtrArray *
-nm_client_get_active_connections (NMClient *client)
-{
- NMClientPrivate *priv;
-
- g_return_val_if_fail (NM_IS_CLIENT (client), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (client));
-
- priv = NM_CLIENT_GET_PRIVATE (client);
- if (!priv->manager_running)
- return NULL;
-
- return handle_ptr_array_return (priv->active_connections);
-}
-
-/**
- * nm_client_wireless_get_enabled:
- * @client: a #NMClient
- *
- * Determines whether the wireless is enabled.
- *
- * Returns: %TRUE if wireless is enabled
- **/
-gboolean
-nm_client_wireless_get_enabled (NMClient *client)
-{
- g_return_val_if_fail (NM_IS_CLIENT (client), FALSE);
-
- _nm_object_ensure_inited (NM_OBJECT (client));
- return NM_CLIENT_GET_PRIVATE (client)->wireless_enabled;
-}
-
-/**
- * nm_client_wireless_set_enabled:
- * @client: a #NMClient
- * @enabled: %TRUE to enable wireless
- *
- * Enables or disables wireless devices.
- **/
-void
-nm_client_wireless_set_enabled (NMClient *client, gboolean enabled)
-{
- GValue value = G_VALUE_INIT;
-
- g_return_if_fail (NM_IS_CLIENT (client));
-
- if (!NM_CLIENT_GET_PRIVATE (client)->manager_running)
- return;
-
- g_value_init (&value, G_TYPE_BOOLEAN);
- g_value_set_boolean (&value, enabled);
-
- _nm_object_set_property (NM_OBJECT (client),
- NM_DBUS_INTERFACE,
- "WirelessEnabled",
- &value);
-}
-
-/**
- * nm_client_wireless_hardware_get_enabled:
- * @client: a #NMClient
- *
- * Determines whether the wireless hardware is enabled.
- *
- * Returns: %TRUE if the wireless hardware is enabled
- **/
-gboolean
-nm_client_wireless_hardware_get_enabled (NMClient *client)
-{
- g_return_val_if_fail (NM_IS_CLIENT (client), FALSE);
-
- _nm_object_ensure_inited (NM_OBJECT (client));
- return NM_CLIENT_GET_PRIVATE (client)->wireless_hw_enabled;
-}
-
-/**
- * nm_client_wwan_get_enabled:
- * @client: a #NMClient
- *
- * Determines whether WWAN is enabled.
- *
- * Returns: %TRUE if WWAN is enabled
- **/
-gboolean
-nm_client_wwan_get_enabled (NMClient *client)
-{
- g_return_val_if_fail (NM_IS_CLIENT (client), FALSE);
-
- _nm_object_ensure_inited (NM_OBJECT (client));
- return NM_CLIENT_GET_PRIVATE (client)->wwan_enabled;
-}
-
-/**
- * nm_client_wwan_set_enabled:
- * @client: a #NMClient
- * @enabled: %TRUE to enable WWAN
- *
- * Enables or disables WWAN devices.
- **/
-void
-nm_client_wwan_set_enabled (NMClient *client, gboolean enabled)
-{
- GValue value = G_VALUE_INIT;
-
- g_return_if_fail (NM_IS_CLIENT (client));
-
- if (!NM_CLIENT_GET_PRIVATE (client)->manager_running)
- return;
-
- g_value_init (&value, G_TYPE_BOOLEAN);
- g_value_set_boolean (&value, enabled);
-
- _nm_object_set_property (NM_OBJECT (client),
- NM_DBUS_INTERFACE,
- "WwanEnabled",
- &value);
-}
-
-/**
- * nm_client_wwan_hardware_get_enabled:
- * @client: a #NMClient
- *
- * Determines whether the WWAN hardware is enabled.
- *
- * Returns: %TRUE if the WWAN hardware is enabled
- **/
-gboolean
-nm_client_wwan_hardware_get_enabled (NMClient *client)
-{
- g_return_val_if_fail (NM_IS_CLIENT (client), FALSE);
-
- _nm_object_ensure_inited (NM_OBJECT (client));
- return NM_CLIENT_GET_PRIVATE (client)->wwan_hw_enabled;
-}
-
-/**
- * nm_client_wimax_get_enabled:
- * @client: a #NMClient
- *
- * Determines whether WiMAX is enabled.
- *
- * Returns: %TRUE if WiMAX is enabled
- **/
-gboolean
-nm_client_wimax_get_enabled (NMClient *client)
-{
- g_return_val_if_fail (NM_IS_CLIENT (client), FALSE);
-
- _nm_object_ensure_inited (NM_OBJECT (client));
- return NM_CLIENT_GET_PRIVATE (client)->wimax_enabled;
-}
-
-/**
- * nm_client_wimax_set_enabled:
- * @client: a #NMClient
- * @enabled: %TRUE to enable WiMAX
- *
- * Enables or disables WiMAX devices.
- **/
-void
-nm_client_wimax_set_enabled (NMClient *client, gboolean enabled)
-{
- GValue value = G_VALUE_INIT;
-
- g_return_if_fail (NM_IS_CLIENT (client));
-
- if (!NM_CLIENT_GET_PRIVATE (client)->manager_running)
- return;
-
- g_value_init (&value, G_TYPE_BOOLEAN);
- g_value_set_boolean (&value, enabled);
-
- _nm_object_set_property (NM_OBJECT (client),
- NM_DBUS_INTERFACE,
- "WimaxEnabled",
- &value);
-}
-
-/**
- * nm_client_wimax_hardware_get_enabled:
- * @client: a #NMClient
- *
- * Determines whether the WiMAX hardware is enabled.
- *
- * Returns: %TRUE if the WiMAX hardware is enabled
- **/
-gboolean
-nm_client_wimax_hardware_get_enabled (NMClient *client)
-{
- g_return_val_if_fail (NM_IS_CLIENT (client), FALSE);
-
- _nm_object_ensure_inited (NM_OBJECT (client));
- return NM_CLIENT_GET_PRIVATE (client)->wimax_hw_enabled;
-}
-
-/**
- * nm_client_get_version:
- * @client: a #NMClient
- *
- * Gets NetworkManager version.
- *
- * Returns: string with the version
- **/
-const char *
-nm_client_get_version (NMClient *client)
-{
- NMClientPrivate *priv;
-
- g_return_val_if_fail (NM_IS_CLIENT (client), NULL);
-
- priv = NM_CLIENT_GET_PRIVATE (client);
-
- _nm_object_ensure_inited (NM_OBJECT (client));
-
- return priv->manager_running ? priv->version : NULL;
-}
-
-/**
- * nm_client_get_state:
- * @client: a #NMClient
- *
- * Gets the current daemon state.
- *
- * Returns: the current %NMState
- **/
-NMState
-nm_client_get_state (NMClient *client)
-{
- g_return_val_if_fail (NM_IS_CLIENT (client), NM_STATE_UNKNOWN);
-
- _nm_object_ensure_inited (NM_OBJECT (client));
-
- return NM_CLIENT_GET_PRIVATE (client)->state;
-}
-
-/**
- * nm_client_get_startup:
- * @client: a #NMClient
- *
- * Tests whether the daemon is still in the process of activating
- * connections at startup.
- *
- * Returns: whether the daemon is still starting up
- *
- * Since: 0.9.10
- **/
-gboolean
-nm_client_get_startup (NMClient *client)
-{
- g_return_val_if_fail (NM_IS_CLIENT (client), NM_STATE_UNKNOWN);
-
- _nm_object_ensure_inited (NM_OBJECT (client));
-
- return NM_CLIENT_GET_PRIVATE (client)->startup;
-}
-
-/**
- * nm_client_networking_get_enabled:
- * @client: a #NMClient
- *
- * Whether networking is enabled or disabled.
- *
- * Returns: %TRUE if networking is enabled, %FALSE if networking is disabled
- **/
-gboolean
-nm_client_networking_get_enabled (NMClient *client)
-{
- g_return_val_if_fail (NM_IS_CLIENT (client), FALSE);
-
- _nm_object_ensure_inited (NM_OBJECT (client));
- return NM_CLIENT_GET_PRIVATE (client)->networking_enabled;
-}
-
-/**
- * nm_client_networking_set_enabled:
- * @client: a #NMClient
- * @enabled: %TRUE to set networking enabled, %FALSE to set networking disabled
- *
- * Enables or disables networking. When networking is disabled, all controlled
- * interfaces are disconnected and deactivated. When networking is enabled,
- * all controlled interfaces are available for activation.
- **/
-void
-nm_client_networking_set_enabled (NMClient *client, gboolean enable)
-{
- GError *err = NULL;
-
- g_return_if_fail (NM_IS_CLIENT (client));
-
- if (!NM_CLIENT_GET_PRIVATE (client)->manager_running)
- return;
-
- if (!dbus_g_proxy_call (NM_CLIENT_GET_PRIVATE (client)->client_proxy, "Enable", &err,
- G_TYPE_BOOLEAN, enable,
- G_TYPE_INVALID,
- G_TYPE_INVALID)) {
- g_warning ("Error enabling/disabling networking: %s",
- err ? err->message : "(unknown)");
- g_clear_error (&err);
- }
-}
-
-/**
- * nm_client_sleep:
- * @client: a #NMClient
- * @sleep_: %TRUE to put the daemon to sleep
- *
- * Deprecated; use nm_client_networking_set_enabled() instead.
- **/
-void
-nm_client_sleep (NMClient *client, gboolean sleep_)
-{
- nm_client_networking_set_enabled (client, !sleep_);
-}
-
-/**
- * nm_client_get_manager_running:
- * @client: a #NMClient
- *
- * Determines whether the daemon is running.
- *
- * Returns: %TRUE if the daemon is running
- **/
-gboolean
-nm_client_get_manager_running (NMClient *client)
-{
- g_return_val_if_fail (NM_IS_CLIENT (client), FALSE);
-
- return NM_CLIENT_GET_PRIVATE (client)->manager_running;
-}
-
-/**
- * nm_client_get_permission_result:
- * @client: a #NMClient
- * @permission: the permission for which to return the result, one of #NMClientPermission
- *
- * Requests the result of a specific permission, which indicates whether the
- * client can or cannot perform the action the permission represents
- *
- * Returns: the permission's result, one of #NMClientPermissionResult
- **/
-NMClientPermissionResult
-nm_client_get_permission_result (NMClient *client, NMClientPermission permission)
-{
- gpointer result;
-
- g_return_val_if_fail (NM_IS_CLIENT (client), NM_CLIENT_PERMISSION_RESULT_UNKNOWN);
-
- result = g_hash_table_lookup (NM_CLIENT_GET_PRIVATE (client)->permissions,
- GUINT_TO_POINTER (permission));
- return GPOINTER_TO_UINT (result);
-}
-
-/**
- * nm_client_get_logging:
- * @client: a #NMClient
- * @level: (allow-none): return location for logging level string
- * @domains: (allow-none): return location for log domains string. The string is
- * a list of domains separated by ","
- * @error: (allow-none): return location for a #GError, or %NULL
- *
- * Gets NetworkManager current logging level and domains.
- *
- * Returns: %TRUE on success, %FALSE otherwise
- *
- * Since: 0.9.8
- **/
-gboolean
-nm_client_get_logging (NMClient *client, char **level, char **domains, GError **error)
-{
- NMClientPrivate *priv;
-
- g_return_val_if_fail (NM_IS_CLIENT (client), FALSE);
- g_return_val_if_fail (level == NULL || *level == NULL, FALSE);
- g_return_val_if_fail (domains == NULL || *domains == NULL, FALSE);
- g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
-
- priv = NM_CLIENT_GET_PRIVATE (client);
- if (!priv->manager_running) {
- g_set_error_literal (error,
- NM_CLIENT_ERROR,
- NM_CLIENT_ERROR_MANAGER_NOT_RUNNING,
- "NetworkManager is not running");
- return FALSE;
- }
-
- if (!level && !domains)
- return TRUE;
-
- return dbus_g_proxy_call (priv->client_proxy, "GetLogging", error,
- G_TYPE_INVALID,
- G_TYPE_STRING, level,
- G_TYPE_STRING, domains,
- G_TYPE_INVALID);
-}
-
-/**
- * nm_client_set_logging:
- * @client: a #NMClient
- * @level: (allow-none): logging level to set (%NULL or an empty string for no change)
- * @domains: (allow-none): logging domains to set. The string should be a list of log
- * domains separated by ",". (%NULL or an empty string for no change)
- * @error: (allow-none): return location for a #GError, or %NULL
- *
- * Sets NetworkManager logging level and/or domains.
- *
- * Returns: %TRUE on success, %FALSE otherwise
- *
- * Since: 0.9.8
- **/
-gboolean
-nm_client_set_logging (NMClient *client, const char *level, const char *domains, GError **error)
-{
- NMClientPrivate *priv;
-
- g_return_val_if_fail (NM_IS_CLIENT (client), FALSE);
- g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
-
- priv = NM_CLIENT_GET_PRIVATE (client);
- if (!priv->manager_running) {
- g_set_error_literal (error,
- NM_CLIENT_ERROR,
- NM_CLIENT_ERROR_MANAGER_NOT_RUNNING,
- "NetworkManager is not running");
- return FALSE;
- }
-
- if (!level && !domains)
- return TRUE;
-
- return dbus_g_proxy_call (priv->client_proxy, "SetLogging", error,
- G_TYPE_STRING, level ?: "",
- G_TYPE_STRING, domains ?: "",
- G_TYPE_INVALID,
- G_TYPE_INVALID);
-}
-
-/**
- * nm_client_get_primary_connection:
- * @client: an #NMClient
- *
- * Gets the #NMActiveConnection corresponding to the primary active
- * network device.
- *
- * In particular, when there is no VPN active, or the VPN does not
- * have the default route, this returns the active connection that has
- * the default route. If there is a VPN active with the default route,
- * then this function returns the active connection that contains the
- * route to the VPN endpoint.
- *
- * If there is no default route, or the default route is over a
- * non-NetworkManager-recognized device, this will return %NULL.
- *
- * Returns: (transfer none): the appropriate #NMActiveConnection, if
- * any
- *
- * Since: 0.9.8.6
- */
-NMActiveConnection *
-nm_client_get_primary_connection (NMClient *client)
-{
- g_return_val_if_fail (NM_IS_CLIENT (client), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (client));
- return NM_CLIENT_GET_PRIVATE (client)->primary_connection;
-}
-
-/**
- * nm_client_get_activating_connection:
- * @client: an #NMClient
- *
- * Gets the #NMActiveConnection corresponding to a
- * currently-activating connection that is expected to become the new
- * #NMClient:primary-connection upon successful activation.
- *
- * Returns: (transfer none): the appropriate #NMActiveConnection, if
- * any.
- *
- * Since: 0.9.8.6
- */
-NMActiveConnection *
-nm_client_get_activating_connection (NMClient *client)
-{
- g_return_val_if_fail (NM_IS_CLIENT (client), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (client));
- return NM_CLIENT_GET_PRIVATE (client)->activating_connection;
-}
-
-/*****************************************************************************/
-
-static void
-free_devices (NMClient *client, gboolean in_dispose)
-{
- NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (client);
- gs_unref_ptrarray GPtrArray *real_devices = NULL;
- gs_unref_ptrarray GPtrArray *all_devices = NULL;
- GPtrArray *devices = NULL;
- guint i, j;
-
- real_devices = priv->devices;
- all_devices = priv->all_devices;
-
- if (in_dispose) {
- priv->devices = NULL;
- priv->all_devices = NULL;
- } else {
- priv->devices = g_ptr_array_new ();
- priv->all_devices = g_ptr_array_new ();
- }
-
- if (all_devices && all_devices->len > 0)
- devices = all_devices;
- else if (real_devices && real_devices->len > 0)
- devices = real_devices;
-
- if (real_devices && devices != real_devices) {
- for (i = 0; i < real_devices->len; i++) {
- NMDevice *d = real_devices->pdata[i];
-
- if (all_devices) {
- for (j = 0; j < all_devices->len; j++) {
- if (d == all_devices->pdata[j])
- goto next;
- }
- }
- if (!in_dispose)
- g_signal_emit (client, signals[DEVICE_REMOVED], 0, d);
-next:
- g_object_unref (d);
- }
- }
- if (devices) {
- for (i = 0; i < devices->len; i++) {
- NMDevice *d = devices->pdata[i];
-
- if (!in_dispose)
- g_signal_emit (client, signals[DEVICE_REMOVED], 0, d);
- g_object_unref (d);
- }
- }
-}
-
-static void
-free_active_connections (NMClient *client, gboolean emit_signals)
-{
- NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (client);
- GPtrArray *active_connections;
- NMActiveConnection *active_connection;
- int i;
-
- if (!priv->active_connections)
- return;
-
- active_connections = priv->active_connections;
- priv->active_connections = NULL;
- for (i = 0; i < active_connections->len; i++) {
- active_connection = active_connections->pdata[i];
- /* Break circular refs */
- g_object_run_dispose (G_OBJECT (active_connection));
- g_object_unref (active_connection);
- }
- g_ptr_array_free (active_connections, TRUE);
-
- if (emit_signals)
- g_object_notify (G_OBJECT (client), NM_CLIENT_ACTIVE_CONNECTIONS);
-}
-
-static void
-updated_properties (GObject *object, GAsyncResult *result, gpointer user_data)
-{
- NMClient *client = NM_CLIENT (user_data);
- GError *error = NULL;
-
- if (!_nm_object_reload_properties_finish (NM_OBJECT (object), result, &error)) {
- g_warning ("%s: error reading NMClient properties: %s", __func__, error->message);
- g_error_free (error);
- }
-
- _nm_object_queue_notify (NM_OBJECT (client), NM_CLIENT_MANAGER_RUNNING);
-}
-
-static void
-proxy_name_owner_changed (DBusGProxy *proxy,
- const char *name,
- const char *old_owner,
- const char *new_owner,
- gpointer user_data)
-{
- NMClient *client = NM_CLIENT (user_data);
- NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (client);
- gboolean old_good = (old_owner && strlen (old_owner));
- gboolean new_good = (new_owner && strlen (new_owner));
- gboolean new_running = FALSE;
-
- if (!name || strcmp (name, NM_DBUS_SERVICE))
- return;
-
- if (!old_good && new_good)
- new_running = TRUE;
- else if (old_good && !new_good)
- new_running = FALSE;
-
- if (new_running == priv->manager_running)
- return;
-
- priv->manager_running = new_running;
- if (!priv->manager_running) {
- priv->state = NM_STATE_UNKNOWN;
- priv->startup = FALSE;
- _nm_object_queue_notify (NM_OBJECT (client), NM_CLIENT_MANAGER_RUNNING);
- _nm_object_suppress_property_updates (NM_OBJECT (client), TRUE);
- poke_wireless_devices_with_rf_status (client);
- free_devices (client, FALSE);
- free_active_connections (client, TRUE);
- update_permissions (client, NULL);
- priv->wireless_enabled = FALSE;
- priv->wireless_hw_enabled = FALSE;
- priv->wwan_enabled = FALSE;
- priv->wwan_hw_enabled = FALSE;
- priv->wimax_enabled = FALSE;
- priv->wimax_hw_enabled = FALSE;
- g_free (priv->version);
- priv->version = NULL;
-
- /* Clear object cache to ensure bad refcounting by clients doesn't
- * keep objects in the cache.
- */
- _nm_object_cache_clear ();
- } else {
- _nm_object_suppress_property_updates (NM_OBJECT (client), FALSE);
- _nm_object_reload_properties_async (NM_OBJECT (client), updated_properties, client);
- client_recheck_permissions (priv->client_proxy, client);
- }
-}
-
-/**
- * nm_client_get_connectivity:
- * @client: an #NMClient
- *
- * Gets the current network connectivity state. Contrast
- * nm_client_check_connectivity() and
- * nm_client_check_connectivity_async(), which re-check the
- * connectivity state first before returning any information.
- *
- * Returns: the current connectivity state
- * Since: 0.9.8.6
- */
-NMConnectivityState
-nm_client_get_connectivity (NMClient *client)
-{
- NMClientPrivate *priv;
-
- g_return_val_if_fail (NM_IS_CLIENT (client), NM_CONNECTIVITY_UNKNOWN);
- priv = NM_CLIENT_GET_PRIVATE (client);
-
- _nm_object_ensure_inited (NM_OBJECT (client));
-
- return priv->connectivity;
-}
-
-/**
- * nm_client_check_connectivity:
- * @client: an #NMClient
- * @cancellable: a #GCancellable
- * @error: return location for a #GError
- *
- * Updates the network connectivity state and returns the (new)
- * current state. Contrast nm_client_get_connectivity(), which returns
- * the most recent known state without re-checking.
- *
- * This is a blocking call; use nm_client_check_connectivity_async()
- * if you do not want to block.
- *
- * Returns: the (new) current connectivity state
- * Since: 0.9.8.6
- */
-NMConnectivityState
-nm_client_check_connectivity (NMClient *client,
- GCancellable *cancellable,
- GError **error)
-{
- NMClientPrivate *priv;
- NMConnectivityState connectivity;
-
- g_return_val_if_fail (NM_IS_CLIENT (client), NM_CONNECTIVITY_UNKNOWN);
- priv = NM_CLIENT_GET_PRIVATE (client);
-
- if (!dbus_g_proxy_call (priv->client_proxy, "CheckConnectivity", error,
- G_TYPE_INVALID,
- G_TYPE_UINT, &connectivity,
- G_TYPE_INVALID))
- connectivity = NM_CONNECTIVITY_UNKNOWN;
-
- return connectivity;
-}
-
-typedef struct {
- NMClient *client;
- DBusGProxyCall *call;
- GCancellable *cancellable;
- guint cancelled_id;
- NMConnectivityState connectivity;
-} CheckConnectivityData;
-
-static void
-check_connectivity_data_free (CheckConnectivityData *ccd)
-{
- if (ccd->cancellable) {
- if (ccd->cancelled_id)
- g_signal_handler_disconnect (ccd->cancellable, ccd->cancelled_id);
- g_object_unref (ccd->cancellable);
- }
-
- g_slice_free (CheckConnectivityData, ccd);
-}
-
-static void
-check_connectivity_cb (DBusGProxy *proxy,
- DBusGProxyCall *call,
- gpointer user_data)
-{
- GSimpleAsyncResult *simple = user_data;
- CheckConnectivityData *ccd = g_simple_async_result_get_op_res_gpointer (simple);
- GError *error = NULL;
-
- if (ccd->cancellable) {
- g_signal_handler_disconnect (ccd->cancellable, ccd->cancelled_id);
- ccd->cancelled_id = 0;
- }
-
- if (!dbus_g_proxy_end_call (proxy, call, &error,
- G_TYPE_UINT, &ccd->connectivity,
- G_TYPE_INVALID))
- g_simple_async_result_take_error (simple, error);
-
- g_simple_async_result_complete (simple);
- g_object_unref (simple);
-}
-
-static void
-check_connectivity_cancelled_cb (GCancellable *cancellable,
- gpointer user_data)
-{
- GSimpleAsyncResult *simple = user_data;
- CheckConnectivityData *ccd = g_simple_async_result_get_op_res_gpointer (simple);
-
- g_signal_handler_disconnect (cancellable, ccd->cancelled_id);
- ccd->cancelled_id = 0;
-
- dbus_g_proxy_cancel_call (NM_CLIENT_GET_PRIVATE (ccd->client)->client_proxy, ccd->call);
- g_simple_async_result_complete_in_idle (simple);
-}
-
-/**
- * nm_client_check_connectivity_async:
- * @client: an #NMClient
- * @cancellable: a #GCancellable
- * @callback: callback to call with the result
- * @user_data: data for @callback.
- *
- * Asynchronously updates the network connectivity state and invokes
- * @callback when complete. Contrast nm_client_get_connectivity(),
- * which (immediately) returns the most recent known state without
- * re-checking, and nm_client_check_connectivity(), which blocks.
- *
- * Since: 0.9.8.6
- */
-void
-nm_client_check_connectivity_async (NMClient *client,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- NMClientPrivate *priv;
- GSimpleAsyncResult *simple;
- CheckConnectivityData *ccd;
-
- g_return_if_fail (NM_IS_CLIENT (client));
- priv = NM_CLIENT_GET_PRIVATE (client);
-
- ccd = g_slice_new0 (CheckConnectivityData);
- ccd->client = client;
-
- simple = g_simple_async_result_new (G_OBJECT (client), callback, user_data,
- nm_client_check_connectivity_async);
- if (cancellable)
- g_simple_async_result_set_check_cancellable (simple, cancellable);
- g_simple_async_result_set_op_res_gpointer (simple, ccd, (GDestroyNotify) check_connectivity_data_free);
-
- if (cancellable) {
- ccd->cancellable = g_object_ref (cancellable);
- ccd->cancelled_id = g_signal_connect (cancellable, "cancelled",
- G_CALLBACK (check_connectivity_cancelled_cb),
- simple);
- g_simple_async_result_set_check_cancellable (simple, cancellable);
- }
-
- ccd->call = dbus_g_proxy_begin_call (priv->client_proxy, "CheckConnectivity",
- check_connectivity_cb, simple, NULL,
- G_TYPE_INVALID);
-}
-
-/**
- * nm_client_check_connectivity_finish:
- * @client: an #NMClient
- * @result: the #GAsyncResult
- * @error: return location for a #GError
- *
- * Retrieves the result of an nm_client_check_connectivity_async()
- * call.
- *
- * Returns: the (new) current connectivity state
- * Since: 0.9.8.6
- */
-NMConnectivityState
-nm_client_check_connectivity_finish (NMClient *client,
- GAsyncResult *result,
- GError **error)
-{
- GSimpleAsyncResult *simple;
- CheckConnectivityData *ccd;
-
- g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (client), nm_client_check_connectivity_async), NM_CONNECTIVITY_UNKNOWN);
-
- simple = G_SIMPLE_ASYNC_RESULT (result);
- ccd = g_simple_async_result_get_op_res_gpointer (simple);
-
- if (g_simple_async_result_propagate_error (simple, error))
- return NM_CONNECTIVITY_UNKNOWN;
-
- return ccd->connectivity;
-}
-
-/*****************************************************************************/
-
-/**
- * nm_client_new:
- *
- * Creates a new #NMClient.
- *
- * Note that this will do blocking D-Bus calls to initialize the
- * client. You can use nm_client_new_async() if you want to avoid
- * that.
- *
- * NOTE: #NMClient provides information about devices and a mechanism to
- * control them. To access and modify network configuration data, use the
- * #NMRemoteSettings object.
- *
- * Returns: a new #NMClient or NULL on an error
- **/
-NMClient *
-nm_client_new (void)
-{
- NMClient *client;
-
- client = g_object_new (NM_TYPE_CLIENT, NM_OBJECT_DBUS_PATH, NM_DBUS_PATH, NULL);
-
- /* NMObject's constructor() can fail on a D-Bus connection error. So we can
- * get NULL here instead of a valid NMClient object.
- */
- if (client)
- _nm_object_ensure_inited (NM_OBJECT (client));
-
- return client;
-}
-
-static void
-client_inited (GObject *source, GAsyncResult *result, gpointer user_data)
-{
- GSimpleAsyncResult *simple = user_data;
- GError *error = NULL;
-
- if (!g_async_initable_init_finish (G_ASYNC_INITABLE (source), result, &error))
- g_simple_async_result_take_error (simple, error);
- else
- g_simple_async_result_set_op_res_gpointer (simple, source, g_object_unref);
- g_simple_async_result_complete (simple);
- g_object_unref (simple);
-}
-
-/**
- * nm_client_new_async:
- * @cancellable: a #GCancellable, or %NULL
- * @callback: callback to call when the client is created
- * @user_data: data for @callback
- *
- * Creates a new #NMClient and begins asynchronously initializing it.
- * @callback will be called when it is done; use
- * nm_client_new_finish() to get the result. Note that on an error,
- * the callback can be invoked with two first parameters as NULL.
- *
- * NOTE: #NMClient provides information about devices and a mechanism to
- * control them. To access and modify network configuration data, use the
- * #NMRemoteSettings object.
- **/
-void
-nm_client_new_async (GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- NMClient *client;
- GSimpleAsyncResult *simple;
-
- client = g_object_new (NM_TYPE_CLIENT, NM_OBJECT_DBUS_PATH, NM_DBUS_PATH, NULL);
- /* When client is NULL, do no continue with initialization and run callback
- * directly with result == NULL indicating NMClient creation failure.
- */
- if (!client) {
- callback (NULL, NULL, user_data);
- return;
- }
-
- simple = g_simple_async_result_new (NULL, callback, user_data, nm_client_new_async);
- if (cancellable)
- g_simple_async_result_set_check_cancellable (simple, cancellable);
- g_async_initable_init_async (G_ASYNC_INITABLE (client), G_PRIORITY_DEFAULT,
- cancellable, client_inited, simple);
-}
-
-/**
- * nm_client_new_finish:
- * @result: a #GAsyncResult
- * @error: location for a #GError, or %NULL
- *
- * Gets the result of an nm_client_new_async() call.
- *
- * Returns: a new #NMClient, or %NULL on error
- **/
-NMClient *
-nm_client_new_finish (GAsyncResult *result, GError **error)
-{
- GSimpleAsyncResult *simple;
-
- g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
-
- if (!result) {
- g_set_error_literal (error,
- NM_CLIENT_ERROR,
- NM_CLIENT_ERROR_UNKNOWN,
- "NMClient initialization failed (or you passed NULL 'result' by mistake)");
- return NULL;
- }
-
- g_return_val_if_fail (g_simple_async_result_is_valid (result, NULL, nm_client_new_async), NULL);
-
- simple = G_SIMPLE_ASYNC_RESULT (result);
- if (g_simple_async_result_propagate_error (simple, error))
- return NULL;
- else
- return g_object_ref (g_simple_async_result_get_op_res_gpointer (simple));
-}
-
-/*
- * constructor() shouldn't be overridden in most cases, rather constructed()
- * method is preferred and more useful.
- * But, this serves as a workaround for bindings (use) calling the constructor()
- * directly instead of nm_client_new() function, and neither providing
- * construction properties. So, we fill "dbus-path" here if it was not specified
- * (was set to default value (NULL)).
- *
- * It allows this python code:
- * from gi.repository import NMClient
- * nmclient = NMClient.Client()
- * print nmclient.get_active_connections()
- *
- * instead of proper
- * nmclient = NMClient.Client().new()
- *
- * Note:
- * A nice overview of GObject construction is here:
- * http://blogs.gnome.org/desrt/2012/02/26/a-gentle-introduction-to-gobject-construction
- * It is much better explanation than the official docs
- * http://developer.gnome.org/gobject/unstable/chapter-gobject.html#gobject-instantiation
- */
-static GObject*
-constructor (GType type,
- guint n_construct_params,
- GObjectConstructParam *construct_params)
-{
- GObject *object;
- guint i;
- const char *dbus_path;
-
- for (i = 0; i < n_construct_params; i++) {
- if (strcmp (construct_params[i].pspec->name, NM_OBJECT_DBUS_PATH) == 0) {
- dbus_path = g_value_get_string (construct_params[i].value);
- if (dbus_path == NULL) {
- g_value_set_static_string (construct_params[i].value, NM_DBUS_PATH);
- } else {
- if (!g_variant_is_object_path (dbus_path)) {
- g_warning ("Passed D-Bus object path '%s' is invalid; using default '%s' instead",
- dbus_path, NM_DBUS_PATH);
- g_value_set_static_string (construct_params[i].value, NM_DBUS_PATH);
- }
- }
- break;
- }
- }
-
- object = G_OBJECT_CLASS (nm_client_parent_class)->constructor (type,
- n_construct_params,
- construct_params);
-
- return object;
-}
-
-static void
-constructed (GObject *object)
-{
- NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (object);
- GError *error = NULL;
-
- if (!nm_utils_init (&error)) {
- g_warning ("Couldn't initialize nm-utils/crypto system: %s",
- error->message);
- g_clear_error (&error);
- }
-
- G_OBJECT_CLASS (nm_client_parent_class)->constructed (object);
-
- priv->client_proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE);
-
- register_properties (NM_CLIENT (object));
-
- /* Permissions */
- dbus_g_proxy_add_signal (priv->client_proxy, "CheckPermissions", G_TYPE_INVALID);
- dbus_g_proxy_connect_signal (priv->client_proxy,
- "CheckPermissions",
- G_CALLBACK (client_recheck_permissions),
- object,
- NULL);
-
- priv->bus_proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (NM_OBJECT (object)),
- DBUS_SERVICE_DBUS,
- DBUS_PATH_DBUS,
- DBUS_INTERFACE_DBUS);
- g_assert (priv->bus_proxy);
-
- dbus_g_proxy_add_signal (priv->bus_proxy, "NameOwnerChanged",
- G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
- G_TYPE_INVALID);
- dbus_g_proxy_connect_signal (priv->bus_proxy,
- "NameOwnerChanged",
- G_CALLBACK (proxy_name_owner_changed),
- object, NULL);
-
- g_signal_connect (object, "notify::" NM_CLIENT_WIRELESS_ENABLED,
- G_CALLBACK (wireless_enabled_cb), NULL);
-
- g_signal_connect (object, "notify::" NM_CLIENT_ACTIVE_CONNECTIONS,
- G_CALLBACK (active_connections_changed_cb), NULL);
-
- g_signal_connect (object, "object-creation-failed",
- G_CALLBACK (object_creation_failed_cb), NULL);
-}
-
-static gboolean
-init_sync (GInitable *initable, GCancellable *cancellable, GError **error)
-{
- NMClient *client = NM_CLIENT (initable);
- NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (client);
-
- if (!nm_client_parent_initable_iface->init (initable, cancellable, error))
- return FALSE;
-
- if (!dbus_g_proxy_call (priv->bus_proxy,
- "NameHasOwner", error,
- G_TYPE_STRING, NM_DBUS_SERVICE,
- G_TYPE_INVALID,
- G_TYPE_BOOLEAN, &priv->manager_running,
- G_TYPE_INVALID))
- return FALSE;
-
- if (priv->manager_running && !get_permissions_sync (client, error))
- return FALSE;
-
- return TRUE;
-}
-
-typedef struct {
- NMClient *client;
- GSimpleAsyncResult *result;
- gboolean properties_pending;
- gboolean permissions_pending;
-} NMClientInitData;
-
-static void
-init_async_complete (NMClientInitData *init_data)
-{
- if (init_data->properties_pending || init_data->permissions_pending)
- return;
-
- g_simple_async_result_complete (init_data->result);
- g_object_unref (init_data->result);
- g_slice_free (NMClientInitData, init_data);
-}
-
-static void
-init_async_got_permissions (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data)
-{
- NMClientInitData *init_data = user_data;
- gs_unref_hashtable GHashTable *permissions = NULL;
- gs_free_error GError *error = NULL;
-
- dbus_g_proxy_end_call (proxy, call, &error,
- DBUS_TYPE_G_MAP_OF_STRING, &permissions,
- G_TYPE_INVALID);
- update_permissions (init_data->client, error ? NULL : permissions);
-
- init_data->permissions_pending = FALSE;
- init_async_complete (init_data);
-}
-
-static void
-init_async_got_properties (GObject *source, GAsyncResult *result, gpointer user_data)
-{
- NMClientInitData *init_data = user_data;
- GError *error = NULL;
-
- if (!nm_client_parent_async_initable_iface->init_finish (G_ASYNC_INITABLE (source), result, &error))
- g_simple_async_result_take_error (init_data->result, error);
-
- init_data->properties_pending = FALSE;
- init_async_complete (init_data);
-}
-
-static void
-finish_init (NMClientInitData *init_data)
-{
- NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (init_data->client);
-
- nm_client_parent_async_initable_iface->init_async (G_ASYNC_INITABLE (init_data->client),
- G_PRIORITY_DEFAULT, NULL, /* FIXME cancellable */
- init_async_got_properties, init_data);
- init_data->properties_pending = TRUE;
-
- dbus_g_proxy_begin_call (priv->client_proxy, "GetPermissions",
- init_async_got_permissions, init_data, NULL,
- G_TYPE_INVALID);
- init_data->permissions_pending = TRUE;
-}
-
-static void
-init_async_got_manager_running (DBusGProxy *proxy, DBusGProxyCall *call,
- gpointer user_data)
-{
- NMClientInitData *init_data = user_data;
- NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (init_data->client);
- GError *error = NULL;
-
- if (!dbus_g_proxy_end_call (proxy, call, &error,
- G_TYPE_BOOLEAN, &priv->manager_running,
- G_TYPE_INVALID)) {
- g_simple_async_result_take_error (init_data->result, error);
- init_async_complete (init_data);
- return;
- }
-
- if (!priv->manager_running) {
- init_async_complete (init_data);
- return;
- }
-
- finish_init (init_data);
-}
-
-static void
-init_async (GAsyncInitable *initable, int io_priority,
- GCancellable *cancellable, GAsyncReadyCallback callback,
- gpointer user_data)
-{
- NMClientInitData *init_data;
- NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (initable);
-
- init_data = g_slice_new0 (NMClientInitData);
- init_data->client = NM_CLIENT (initable);
- init_data->result = g_simple_async_result_new (G_OBJECT (initable), callback,
- user_data, init_async);
- if (cancellable)
- g_simple_async_result_set_check_cancellable (init_data->result, cancellable);
- g_simple_async_result_set_op_res_gboolean (init_data->result, TRUE);
-
- /* Check if NM is running */
- dbus_g_proxy_begin_call (priv->bus_proxy, "NameHasOwner",
- init_async_got_manager_running,
- init_data, NULL,
- G_TYPE_STRING, NM_DBUS_SERVICE,
- G_TYPE_INVALID);
-}
-
-static gboolean
-init_finish (GAsyncInitable *initable, GAsyncResult *result, GError **error)
-{
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
-
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
- else
- return TRUE;
-}
-
-static void
-dispose (GObject *object)
-{
- NMClient *client = NM_CLIENT (object);
- NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (object);
-
- if (priv->perm_call) {
- dbus_g_proxy_cancel_call (priv->client_proxy, priv->perm_call);
- priv->perm_call = NULL;
- }
-
- g_clear_object (&priv->client_proxy);
- g_clear_object (&priv->bus_proxy);
-
- free_devices (client, TRUE);
- free_active_connections (client, FALSE);
- g_clear_object (&priv->primary_connection);
- g_clear_object (&priv->activating_connection);
-
- g_slist_free_full (priv->pending_activations, (GDestroyNotify) activate_info_free);
- priv->pending_activations = NULL;
-
- g_hash_table_destroy (priv->permissions);
- priv->permissions = NULL;
-
- G_OBJECT_CLASS (nm_client_parent_class)->dispose (object);
-}
-
-static void
-finalize (GObject *object)
-{
- NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (object);
-
- g_free (priv->version);
-
- G_OBJECT_CLASS (nm_client_parent_class)->finalize (object);
-}
-
-static void
-set_property (GObject *object, guint prop_id,
- const GValue *value, GParamSpec *pspec)
-{
- NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (object);
- gboolean b;
-
- switch (prop_id) {
- case PROP_NETWORKING_ENABLED:
- b = g_value_get_boolean (value);
- if (priv->networking_enabled != b) {
- nm_client_networking_set_enabled (NM_CLIENT (object), b);
- /* Let the property value flip when we get the change signal from NM */
- }
- break;
- case PROP_WIRELESS_ENABLED:
- b = g_value_get_boolean (value);
- if (priv->wireless_enabled != b) {
- nm_client_wireless_set_enabled (NM_CLIENT (object), b);
- /* Let the property value flip when we get the change signal from NM */
- }
- break;
- case PROP_WWAN_ENABLED:
- b = g_value_get_boolean (value);
- if (priv->wwan_enabled != b) {
- nm_client_wwan_set_enabled (NM_CLIENT (object), b);
- /* Let the property value flip when we get the change signal from NM */
- }
- break;
- case PROP_WIMAX_ENABLED:
- b = g_value_get_boolean (value);
- if (priv->wimax_enabled != b) {
- nm_client_wimax_set_enabled (NM_CLIENT (object), b);
- /* Let the property value flip when we get the change signal from NM */
- }
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- NMClient *self = NM_CLIENT (object);
- NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (self);
-
- _nm_object_ensure_inited (NM_OBJECT (object));
-
- switch (prop_id) {
- case PROP_VERSION:
- g_value_set_string (value, nm_client_get_version (self));
- break;
- case PROP_STATE:
- g_value_set_uint (value, nm_client_get_state (self));
- break;
- case PROP_STARTUP:
- g_value_set_boolean (value, nm_client_get_startup (self));
- break;
- case PROP_MANAGER_RUNNING:
- g_value_set_boolean (value, priv->manager_running);
- break;
- case PROP_NETWORKING_ENABLED:
- g_value_set_boolean (value, nm_client_networking_get_enabled (self));
- break;
- case PROP_WIRELESS_ENABLED:
- g_value_set_boolean (value, priv->wireless_enabled);
- break;
- case PROP_WIRELESS_HARDWARE_ENABLED:
- g_value_set_boolean (value, priv->wireless_hw_enabled);
- break;
- case PROP_WWAN_ENABLED:
- g_value_set_boolean (value, priv->wwan_enabled);
- break;
- case PROP_WWAN_HARDWARE_ENABLED:
- g_value_set_boolean (value, priv->wwan_hw_enabled);
- break;
- case PROP_WIMAX_ENABLED:
- g_value_set_boolean (value, priv->wimax_enabled);
- break;
- case PROP_WIMAX_HARDWARE_ENABLED:
- g_value_set_boolean (value, priv->wimax_hw_enabled);
- break;
- case PROP_ACTIVE_CONNECTIONS:
- g_value_set_boxed (value, nm_client_get_active_connections (self));
- break;
- case PROP_CONNECTIVITY:
- g_value_set_uint (value, priv->connectivity);
- break;
- case PROP_PRIMARY_CONNECTION:
- g_value_set_object (value, priv->primary_connection);
- break;
- case PROP_ACTIVATING_CONNECTION:
- g_value_set_object (value, priv->activating_connection);
- break;
- case PROP_DEVICES:
- g_value_set_boxed (value, nm_client_get_devices (self));
- break;
- case PROP_ALL_DEVICES:
- g_value_set_boxed (value, nm_client_get_all_devices (self));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-nm_client_class_init (NMClientClass *client_class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (client_class);
-
- g_type_class_add_private (client_class, sizeof (NMClientPrivate));
-
- /* virtual methods */
- object_class->constructor = constructor;
- object_class->constructed = constructed;
- object_class->set_property = set_property;
- object_class->get_property = get_property;
- object_class->dispose = dispose;
- object_class->finalize = finalize;
-
- /* properties */
-
- /**
- * NMClient:version:
- *
- * The NetworkManager version.
- **/
- g_object_class_install_property
- (object_class, PROP_VERSION,
- g_param_spec_string (NM_CLIENT_VERSION, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMClient:state:
- *
- * The current daemon state.
- **/
- g_object_class_install_property
- (object_class, PROP_STATE,
- g_param_spec_uint (NM_CLIENT_STATE, "", "",
- NM_STATE_UNKNOWN, NM_STATE_CONNECTED_GLOBAL, NM_STATE_UNKNOWN,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMClient:startup:
- *
- * Whether the daemon is still starting up.
- *
- * Since: 0.9.10
- **/
- g_object_class_install_property
- (object_class, PROP_STARTUP,
- g_param_spec_boolean (NM_CLIENT_STARTUP, "", "",
- FALSE,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMClient:manager-running:
- *
- * Whether the daemon is running.
- **/
- g_object_class_install_property
- (object_class, PROP_MANAGER_RUNNING,
- g_param_spec_boolean (NM_CLIENT_MANAGER_RUNNING, "", "",
- FALSE,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMClient:networking-enabled:
- *
- * Whether networking is enabled.
- **/
- g_object_class_install_property
- (object_class, PROP_NETWORKING_ENABLED,
- g_param_spec_boolean (NM_CLIENT_NETWORKING_ENABLED, "", "",
- TRUE,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMClient:wireless-enabled:
- *
- * Whether wireless is enabled.
- **/
- g_object_class_install_property
- (object_class, PROP_WIRELESS_ENABLED,
- g_param_spec_boolean (NM_CLIENT_WIRELESS_ENABLED, "", "",
- FALSE,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMClient:wireless-hardware-enabled:
- *
- * Whether the wireless hardware is enabled.
- **/
- g_object_class_install_property
- (object_class, PROP_WIRELESS_HARDWARE_ENABLED,
- g_param_spec_boolean (NM_CLIENT_WIRELESS_HARDWARE_ENABLED, "", "",
- TRUE,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMClient:wwan-enabled:
- *
- * Whether WWAN functionality is enabled.
- **/
- g_object_class_install_property
- (object_class, PROP_WWAN_ENABLED,
- g_param_spec_boolean (NM_CLIENT_WWAN_ENABLED, "", "",
- FALSE,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMClient:wwan-hardware-enabled:
- *
- * Whether the WWAN hardware is enabled.
- **/
- g_object_class_install_property
- (object_class, PROP_WWAN_HARDWARE_ENABLED,
- g_param_spec_boolean (NM_CLIENT_WWAN_HARDWARE_ENABLED, "", "",
- FALSE,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMClient:wimax-enabled:
- *
- * Whether WiMAX functionality is enabled.
- **/
- g_object_class_install_property
- (object_class, PROP_WIMAX_ENABLED,
- g_param_spec_boolean (NM_CLIENT_WIMAX_ENABLED, "", "",
- FALSE,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMClient:wimax-hardware-enabled:
- *
- * Whether the WiMAX hardware is enabled.
- **/
- g_object_class_install_property
- (object_class, PROP_WIMAX_HARDWARE_ENABLED,
- g_param_spec_boolean (NM_CLIENT_WIMAX_HARDWARE_ENABLED, "", "",
- FALSE,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMClient:active-connections: (type GPtrArray):
- *
- * The active connections.
- **/
- g_object_class_install_property
- (object_class, PROP_ACTIVE_CONNECTIONS,
- g_param_spec_boxed (NM_CLIENT_ACTIVE_CONNECTIONS, "", "",
- NM_TYPE_OBJECT_ARRAY,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMClient:connectivity:
- *
- * The network connectivity state.
- *
- * Since: 0.9.8.6
- */
- g_object_class_install_property
- (object_class, PROP_CONNECTIVITY,
- g_param_spec_uint (NM_CLIENT_CONNECTIVITY, "", "",
- NM_CONNECTIVITY_UNKNOWN, NM_CONNECTIVITY_FULL, NM_CONNECTIVITY_UNKNOWN,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMClient:primary-connection:
- *
- * The #NMActiveConnection of the device with the default route;
- * see nm_client_get_primary_connection() for more details.
- *
- * Since: 0.9.8.6
- **/
- g_object_class_install_property
- (object_class, PROP_PRIMARY_CONNECTION,
- g_param_spec_object (NM_CLIENT_PRIMARY_CONNECTION, "", "",
- NM_TYPE_ACTIVE_CONNECTION,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMClient:activating-connection:
- *
- * The #NMActiveConnection of the activating connection that is
- * likely to become the new #NMClient:primary-connection.
- *
- * Since: 0.9.8.6
- **/
- g_object_class_install_property
- (object_class, PROP_ACTIVATING_CONNECTION,
- g_param_spec_object (NM_CLIENT_ACTIVATING_CONNECTION, "", "",
- NM_TYPE_ACTIVE_CONNECTION,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMClient:devices:
- *
- * List of real network devices. Does not include placeholder devices.
- *
- * Since: 0.9.10
- **/
- g_object_class_install_property
- (object_class, PROP_DEVICES,
- g_param_spec_boxed (NM_CLIENT_DEVICES, "", "",
- NM_TYPE_OBJECT_ARRAY,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMClient:all-devices:
- *
- * List of both real devices and device placeholders.
- *
- * Since: 1.2
- **/
- g_object_class_install_property
- (object_class, PROP_ALL_DEVICES,
- g_param_spec_boxed (NM_CLIENT_ALL_DEVICES, "", "",
- NM_TYPE_OBJECT_ARRAY,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /* signals */
-
- /**
- * NMClient::device-added:
- * @client: the client that received the signal
- * @device: (type NMDevice): the new device
- *
- * Notifies that a #NMDevice is added. This signal is not emitted for
- * placeholder devices.
- **/
- signals[DEVICE_ADDED] =
- g_signal_new ("device-added",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (NMClientClass, device_added),
- NULL, NULL, NULL,
- G_TYPE_NONE, 1,
- G_TYPE_OBJECT);
-
- /**
- * NMClient::device-removed:
- * @client: the client that received the signal
- * @device: (type NMDevice): the removed device
- *
- * Notifies that a #NMDevice is removed. This signal is not emitted for
- * placeholder devices.
- **/
- signals[DEVICE_REMOVED] =
- g_signal_new ("device-removed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (NMClientClass, device_removed),
- NULL, NULL, NULL,
- G_TYPE_NONE, 1,
- G_TYPE_OBJECT);
-
- /**
- * NMClient::any-device-added:
- * @client: the client that received the signal
- * @device: (type NMDevice): the new device
- *
- * Notifies that a #NMDevice is added. This signal is emitted for both
- * regular devices and placeholder devices.
- **/
- signals[ANY_DEVICE_ADDED] =
- g_signal_new ("any-device-added",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- 0, NULL, NULL, NULL,
- G_TYPE_NONE, 1,
- G_TYPE_OBJECT);
-
- /**
- * NMClient::any-device-removed:
- * @client: the client that received the signal
- * @device: (type NMDevice): the removed device
- *
- * Notifies that a #NMDevice is removed. This signal is emitted for both
- * regular devices and placeholder devices.
- **/
- signals[ANY_DEVICE_REMOVED] =
- g_signal_new ("any-device-removed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- 0, NULL, NULL, NULL,
- G_TYPE_NONE, 1,
- G_TYPE_OBJECT);
-
- /**
- * NMClient::permission-changed:
- * @client: the client that received the signal
- * @permission: a permission from #NMClientPermission
- * @result: the permission's result, one of #NMClientPermissionResult
- *
- * Notifies that a permission has changed
- **/
- signals[PERMISSION_CHANGED] =
- g_signal_new ("permission-changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- 0, NULL, NULL, NULL,
- G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT);
-}
-
-static void
-nm_client_initable_iface_init (GInitableIface *iface)
-{
- nm_client_parent_initable_iface = g_type_interface_peek_parent (iface);
-
- iface->init = init_sync;
-}
-
-static void
-nm_client_async_initable_iface_init (GAsyncInitableIface *iface)
-{
- nm_client_parent_async_initable_iface = g_type_interface_peek_parent (iface);
-
- iface->init_async = init_async;
- iface->init_finish = init_finish;
-}
diff --git a/libnm-glib/nm-client.h b/libnm-glib/nm-client.h
deleted file mode 100644
index fbbc3d92f..000000000
--- a/libnm-glib/nm-client.h
+++ /dev/null
@@ -1,269 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2007 - 2008 Novell, Inc.
- * Copyright 2007 - 2012 Red Hat, Inc.
- */
-
-#ifndef NM_CLIENT_H
-#define NM_CLIENT_H
-
-#include <glib.h>
-#include <glib-object.h>
-#include <gio/gio.h>
-#include <dbus/dbus-glib.h>
-#include "NetworkManager.h"
-#include "nm-object.h"
-#include "nm-device.h"
-#include "nm-active-connection.h"
-#include "nm-vpn-connection.h"
-
-G_BEGIN_DECLS
-
-#define NM_TYPE_CLIENT (nm_client_get_type ())
-#define NM_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_CLIENT, NMClient))
-#define NM_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_CLIENT, NMClientClass))
-#define NM_IS_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_CLIENT))
-#define NM_IS_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_CLIENT))
-#define NM_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_CLIENT, NMClientClass))
-
-#define NM_CLIENT_VERSION "version"
-#define NM_CLIENT_STATE "state"
-#define NM_CLIENT_STARTUP "startup"
-#define NM_CLIENT_MANAGER_RUNNING "manager-running"
-#define NM_CLIENT_NETWORKING_ENABLED "networking-enabled"
-#define NM_CLIENT_WIRELESS_ENABLED "wireless-enabled"
-#define NM_CLIENT_WIRELESS_HARDWARE_ENABLED "wireless-hardware-enabled"
-#define NM_CLIENT_WWAN_ENABLED "wwan-enabled"
-#define NM_CLIENT_WWAN_HARDWARE_ENABLED "wwan-hardware-enabled"
-#define NM_CLIENT_WIMAX_ENABLED "wimax-enabled"
-#define NM_CLIENT_WIMAX_HARDWARE_ENABLED "wimax-hardware-enabled"
-#define NM_CLIENT_ACTIVE_CONNECTIONS "active-connections"
-#define NM_CLIENT_CONNECTIVITY "connectivity"
-#define NM_CLIENT_PRIMARY_CONNECTION "primary-connection"
-#define NM_CLIENT_ACTIVATING_CONNECTION "activating-connection"
-#define NM_CLIENT_DEVICES "devices"
-#define NM_CLIENT_ALL_DEVICES "all-devices"
-
-/**
- * NMClientPermission:
- * @NM_CLIENT_PERMISSION_NONE: unknown or no permission
- * @NM_CLIENT_PERMISSION_ENABLE_DISABLE_NETWORK: controls whether networking
- * can be globally enabled or disabled
- * @NM_CLIENT_PERMISSION_ENABLE_DISABLE_WIFI: controls whether Wi-Fi can be
- * globally enabled or disabled
- * @NM_CLIENT_PERMISSION_ENABLE_DISABLE_WWAN: controls whether WWAN (3G) can be
- * globally enabled or disabled
- * @NM_CLIENT_PERMISSION_ENABLE_DISABLE_WIMAX: controls whether WiMAX can be
- * globally enabled or disabled
- * @NM_CLIENT_PERMISSION_SLEEP_WAKE: controls whether the client can ask
- * NetworkManager to sleep and wake
- * @NM_CLIENT_PERMISSION_NETWORK_CONTROL: controls whether networking connections
- * can be started, stopped, and changed
- * @NM_CLIENT_PERMISSION_WIFI_SHARE_PROTECTED: controls whether a password
- * protected Wi-Fi hotspot can be created
- * @NM_CLIENT_PERMISSION_WIFI_SHARE_OPEN: controls whether an open Wi-Fi hotspot
- * can be created
- * @NM_CLIENT_PERMISSION_SETTINGS_MODIFY_SYSTEM: controls whether connections
- * that are available to all users can be modified
- * @NM_CLIENT_PERMISSION_SETTINGS_MODIFY_OWN: controls whether connections
- * owned by the current user can be modified
- * @NM_CLIENT_PERMISSION_SETTINGS_MODIFY_HOSTNAME: controls whether the
- * persistent hostname can be changed
- * @NM_CLIENT_PERMISSION_SETTINGS_MODIFY_GLOBAL_DNS: modify persistent global
- * DNS configuration
- * @NM_CLIENT_PERMISSION_RELOAD: controls access to Reload.
- * persistent hostname can be changed
- * @NM_CLIENT_PERMISSION_CHECKPOINT_ROLLBACK: permission to create checkpoints.
- * @NM_CLIENT_PERMISSION_ENABLE_DISABLE_STATISTICS: controls whether device
- * statistics can be globally enabled or disabled
- * @NM_CLIENT_PERMISSION_LAST: a reserved boundary value
- *
- * #NMClientPermission values indicate various permissions that NetworkManager
- * clients can obtain to perform certain tasks on behalf of the current user.
- **/
-typedef enum {
- NM_CLIENT_PERMISSION_NONE = 0,
- NM_CLIENT_PERMISSION_ENABLE_DISABLE_NETWORK = 1,
- NM_CLIENT_PERMISSION_ENABLE_DISABLE_WIFI = 2,
- NM_CLIENT_PERMISSION_ENABLE_DISABLE_WWAN = 3,
- NM_CLIENT_PERMISSION_ENABLE_DISABLE_WIMAX = 4,
- NM_CLIENT_PERMISSION_SLEEP_WAKE = 5,
- NM_CLIENT_PERMISSION_NETWORK_CONTROL = 6,
- NM_CLIENT_PERMISSION_WIFI_SHARE_PROTECTED = 7,
- NM_CLIENT_PERMISSION_WIFI_SHARE_OPEN = 8,
- NM_CLIENT_PERMISSION_SETTINGS_MODIFY_SYSTEM = 9,
- NM_CLIENT_PERMISSION_SETTINGS_MODIFY_OWN = 10,
- NM_CLIENT_PERMISSION_SETTINGS_MODIFY_HOSTNAME = 11,
- NM_CLIENT_PERMISSION_SETTINGS_MODIFY_GLOBAL_DNS = 12,
- NM_CLIENT_PERMISSION_RELOAD = 13,
- NM_CLIENT_PERMISSION_CHECKPOINT_ROLLBACK = 14,
- NM_CLIENT_PERMISSION_ENABLE_DISABLE_STATISTICS = 15,
-
- NM_CLIENT_PERMISSION_LAST = 15,
-} NMClientPermission;
-
-/**
- * NMClientPermissionResult:
- * @NM_CLIENT_PERMISSION_RESULT_UNKNOWN: unknown or no authorization
- * @NM_CLIENT_PERMISSION_RESULT_YES: the permission is available
- * @NM_CLIENT_PERMISSION_RESULT_AUTH: authorization is necessary before the
- * permission is available
- * @NM_CLIENT_PERMISSION_RESULT_NO: permission to perform the operation is
- * denied by system policy
- *
- * #NMClientPermissionResult values indicate what authorizations and permissions
- * the user requires to obtain a given #NMClientPermission
- **/
-typedef enum {
- NM_CLIENT_PERMISSION_RESULT_UNKNOWN = 0,
- NM_CLIENT_PERMISSION_RESULT_YES,
- NM_CLIENT_PERMISSION_RESULT_AUTH,
- NM_CLIENT_PERMISSION_RESULT_NO
-} NMClientPermissionResult;
-
-/**
- * NMClientError:
- * @NM_CLIENT_ERROR_UNKNOWN: unknown or unclassified error
- * @NM_CLIENT_ERROR_MANAGER_NOT_RUNNING: an operation that requires NetworkManager
- * failed because NetworkManager is not running
- *
- * Describes errors that may result from operations involving a #NMClient.
- **/
-typedef enum {
- NM_CLIENT_ERROR_UNKNOWN = 0, /*< nick=UnknownError >*/
- NM_CLIENT_ERROR_MANAGER_NOT_RUNNING, /*< nick=ManagerNotRunning >*/
-} NMClientError;
-
-#define NM_CLIENT_ERROR nm_client_error_quark ()
-NM_AVAILABLE_IN_0_9_10
-GQuark nm_client_error_quark (void);
-
-typedef struct {
- NMObject parent;
-} NMClient;
-
-typedef struct {
- NMObjectClass parent;
-
- /* Signals */
- void (*device_added) (NMClient *client, NMDevice *device);
- void (*device_removed) (NMClient *client, NMDevice *device);
- void (*permission_changed) (NMClient *client,
- NMClientPermission permission,
- NMClientPermissionResult result);
-
- /* Padding for future expansion */
- void (*_reserved1) (void);
- void (*_reserved2) (void);
- void (*_reserved3) (void);
- void (*_reserved4) (void);
- void (*_reserved5) (void);
- void (*_reserved6) (void);
-} NMClientClass;
-
-GType nm_client_get_type (void);
-
-NMClient *nm_client_new (void);
-
-void nm_client_new_async (GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-NMClient *nm_client_new_finish (GAsyncResult *result,
- GError **error);
-
-const GPtrArray *nm_client_get_devices (NMClient *client);
-NM_AVAILABLE_IN_1_2
-const GPtrArray *nm_client_get_all_devices(NMClient *client);
-NMDevice *nm_client_get_device_by_path (NMClient *client, const char *object_path);
-NMDevice *nm_client_get_device_by_iface (NMClient *client, const char *iface);
-
-typedef void (*NMClientActivateFn) (NMClient *client,
- NMActiveConnection *active_connection,
- GError *error,
- gpointer user_data);
-
-void nm_client_activate_connection (NMClient *client,
- NMConnection *connection,
- NMDevice *device,
- const char *specific_object,
- NMClientActivateFn callback,
- gpointer user_data);
-
-typedef void (*NMClientAddActivateFn) (NMClient *client,
- NMActiveConnection *connection,
- const char *new_connection_path,
- GError *error,
- gpointer user_data);
-
-void nm_client_add_and_activate_connection (NMClient *client,
- NMConnection *partial,
- NMDevice *device,
- const char *specific_object,
- NMClientAddActivateFn callback,
- gpointer user_data);
-
-void nm_client_deactivate_connection (NMClient *client, NMActiveConnection *active);
-
-gboolean nm_client_networking_get_enabled (NMClient *client);
-void nm_client_networking_set_enabled (NMClient *client, gboolean enabled);
-
-gboolean nm_client_wireless_get_enabled (NMClient *client);
-void nm_client_wireless_set_enabled (NMClient *client, gboolean enabled);
-gboolean nm_client_wireless_hardware_get_enabled (NMClient *client);
-
-gboolean nm_client_wwan_get_enabled (NMClient *client);
-void nm_client_wwan_set_enabled (NMClient *client, gboolean enabled);
-gboolean nm_client_wwan_hardware_get_enabled (NMClient *client);
-
-gboolean nm_client_wimax_get_enabled (NMClient *client);
-void nm_client_wimax_set_enabled (NMClient *client, gboolean enabled);
-gboolean nm_client_wimax_hardware_get_enabled (NMClient *client);
-
-const char *nm_client_get_version (NMClient *client);
-NMState nm_client_get_state (NMClient *client);
-NM_AVAILABLE_IN_0_9_10
-gboolean nm_client_get_startup (NMClient *client);
-gboolean nm_client_get_manager_running (NMClient *client);
-const GPtrArray *nm_client_get_active_connections (NMClient *client);
-void nm_client_sleep (NMClient *client, gboolean sleep_);
-
-NMClientPermissionResult nm_client_get_permission_result (NMClient *client,
- NMClientPermission permission);
-
-gboolean nm_client_get_logging (NMClient *client, char **level, char **domains, GError **error);
-gboolean nm_client_set_logging (NMClient *client, const char *level, const char *domains, GError **error);
-
-NMConnectivityState nm_client_get_connectivity (NMClient *client);
-
-NMConnectivityState nm_client_check_connectivity (NMClient *client,
- GCancellable *cancellable,
- GError **error);
-void nm_client_check_connectivity_async (NMClient *client,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-NMConnectivityState nm_client_check_connectivity_finish (NMClient *client,
- GAsyncResult *result,
- GError **error);
-
-NMActiveConnection *nm_client_get_primary_connection (NMClient *client);
-NMActiveConnection *nm_client_get_activating_connection (NMClient *client);
-
-G_END_DECLS
-
-#endif /* NM_CLIENT_H */
diff --git a/libnm-glib/nm-dbus-helpers-private.h b/libnm-glib/nm-dbus-helpers-private.h
deleted file mode 100644
index 1d98e77d9..000000000
--- a/libnm-glib/nm-dbus-helpers-private.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2013 Red Hat, Inc.
- */
-
-#ifndef NM_DBUS_HELPERS_PRIVATE_H
-#define NM_DBUS_HELPERS_PRIVATE_H
-
-#include <dbus/dbus.h>
-#include <dbus/dbus-glib-lowlevel.h>
-
-DBusGConnection *_nm_dbus_new_connection (GError **error);
-
-DBusGProxy * _nm_dbus_new_proxy_for_connection (DBusGConnection *connection,
- const char *path,
- const char *interface);
-
-#endif /* NM_DBUS_HELPERS_PRIVATE_H */
diff --git a/libnm-glib/nm-dbus-helpers.c b/libnm-glib/nm-dbus-helpers.c
deleted file mode 100644
index 539dabb97..000000000
--- a/libnm-glib/nm-dbus-helpers.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2013 Red Hat, Inc.
- */
-
-#include "nm-default.h"
-
-#include <string.h>
-#include <dbus/dbus.h>
-#include <dbus/dbus-glib-lowlevel.h>
-
-#include "nm-dbus-helpers-private.h"
-#include "NetworkManager.h"
-
-DBusGConnection *
-_nm_dbus_new_connection (GError **error)
-{
- DBusGConnection *connection = NULL;
-
- if (connection == NULL)
- connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, error);
-
- return connection;
-}
-
-DBusGProxy *
-_nm_dbus_new_proxy_for_connection (DBusGConnection *connection,
- const char *path,
- const char *interface)
-{
- return dbus_g_proxy_new_for_name (connection, NM_DBUS_SERVICE, path, interface);
-}
diff --git a/libnm-glib/nm-device-adsl.c b/libnm-glib/nm-device-adsl.c
deleted file mode 100644
index 30f6c4ec1..000000000
--- a/libnm-glib/nm-device-adsl.c
+++ /dev/null
@@ -1,245 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * author: Pantelis Koukousoulas <pktoss@gmail.com>
- * Copyright 2009 - 2011 Red Hat, Inc.
- */
-
-#include "nm-default.h"
-
-#include "nm-device-adsl.h"
-
-#include <string.h>
-
-#include "nm-device-private.h"
-#include "nm-object-private.h"
-
-#include "nm-setting-adsl.h"
-
-G_DEFINE_TYPE (NMDeviceAdsl, nm_device_adsl, NM_TYPE_DEVICE)
-
-#define NM_DEVICE_ADSL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_ADSL, NMDeviceAdslPrivate))
-
-typedef struct {
- DBusGProxy *proxy;
-
- gboolean carrier;
-
- gboolean disposed;
-} NMDeviceAdslPrivate;
-
-enum {
- PROP_0,
- PROP_CARRIER,
- LAST_PROP
-};
-
-/**
- * nm_device_adsl_error_quark:
- *
- * Registers an error quark for #NMDeviceAdsl if necessary.
- *
- * Returns: the error quark used for #NMDeviceAdsl errors.
- **/
-GQuark
-nm_device_adsl_error_quark (void)
-{
- static GQuark quark = 0;
-
- if (G_UNLIKELY (quark == 0))
- quark = g_quark_from_static_string ("nm-device-adsl-error-quark");
- return quark;
-}
-
-/**
- * nm_device_adsl_new:
- * @connection: the #DBusGConnection
- * @path: the DBus object path of the device
- *
- * Creates a new #NMDeviceAdsl.
- *
- * Returns: (transfer full): a new device
- **/
-GObject *
-nm_device_adsl_new (DBusGConnection *connection, const char *path)
-{
- GObject *device;
-
- g_return_val_if_fail (connection != NULL, NULL);
- g_return_val_if_fail (path != NULL, NULL);
-
- device = g_object_new (NM_TYPE_DEVICE_ADSL,
- NM_OBJECT_DBUS_CONNECTION, connection,
- NM_OBJECT_DBUS_PATH, path,
- NULL);
- _nm_object_ensure_inited (NM_OBJECT (device));
- return device;
-}
-
-/**
- * nm_device_adsl_get_carrier:
- * @device: a #NMDeviceAdsl
- *
- * Whether the device has carrier.
- *
- * Returns: %TRUE if the device has carrier
- **/
-gboolean
-nm_device_adsl_get_carrier (NMDeviceAdsl *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_ADSL (device), FALSE);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_ADSL_GET_PRIVATE (device)->carrier;
-}
-
-static gboolean
-connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
-{
- NMSettingConnection *s_con;
- NMSettingAdsl *s_adsl;
- const char *ctype;
-
- s_con = nm_connection_get_setting_connection (connection);
- g_assert (s_con);
-
- ctype = nm_setting_connection_get_connection_type (s_con);
- if (strcmp (ctype, NM_SETTING_ADSL_SETTING_NAME) != 0) {
- g_set_error (error, NM_DEVICE_ADSL_ERROR, NM_DEVICE_ADSL_ERROR_NOT_ADSL_CONNECTION,
- "The connection was not an ADSL connection.");
- return FALSE;
- }
-
- s_adsl = nm_connection_get_setting_adsl (connection);
- if (!s_adsl) {
- g_set_error (error, NM_DEVICE_ADSL_ERROR, NM_DEVICE_ADSL_ERROR_INVALID_ADSL_CONNECTION,
- "The connection was not a valid ADSL connection.");
- return FALSE;
- }
-
- return NM_DEVICE_CLASS (nm_device_adsl_parent_class)->connection_compatible (device, connection, error);
-}
-
-static GType
-get_setting_type (NMDevice *device)
-{
- return NM_TYPE_SETTING_ADSL;
-}
-
-/*****************************************************************************/
-
-static void
-nm_device_adsl_init (NMDeviceAdsl *device)
-{
- _nm_device_set_device_type (NM_DEVICE (device), NM_DEVICE_TYPE_ADSL);
-}
-
-static void
-register_properties (NMDeviceAdsl *device)
-{
- NMDeviceAdslPrivate *priv = NM_DEVICE_ADSL_GET_PRIVATE (device);
- const NMPropertiesInfo property_info[] = {
- { NM_DEVICE_ADSL_CARRIER, &priv->carrier },
- { NULL },
- };
-
- _nm_object_register_properties (NM_OBJECT (device),
- priv->proxy,
- property_info);
-}
-
-static void
-constructed (GObject *object)
-{
- NMDeviceAdslPrivate *priv = NM_DEVICE_ADSL_GET_PRIVATE (object);
-
- G_OBJECT_CLASS (nm_device_adsl_parent_class)->constructed (object);
-
- priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE_ADSL);
- register_properties (NM_DEVICE_ADSL (object));
-}
-
-static void
-dispose (GObject *object)
-{
- NMDeviceAdslPrivate *priv = NM_DEVICE_ADSL_GET_PRIVATE (object);
-
- if (priv->disposed) {
- G_OBJECT_CLASS (nm_device_adsl_parent_class)->dispose (object);
- return;
- }
-
- priv->disposed = TRUE;
-
- g_object_unref (priv->proxy);
-
- G_OBJECT_CLASS (nm_device_adsl_parent_class)->dispose (object);
-}
-
-static void
-finalize (GObject *object)
-{
- G_OBJECT_CLASS (nm_device_adsl_parent_class)->finalize (object);
-}
-
-static void
-get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- NMDeviceAdsl *device = NM_DEVICE_ADSL (object);
-
- switch (prop_id) {
- case PROP_CARRIER:
- g_value_set_boolean (value, nm_device_adsl_get_carrier (device));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-nm_device_adsl_class_init (NMDeviceAdslClass *adsl_class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (adsl_class);
- NMDeviceClass *device_class = NM_DEVICE_CLASS (adsl_class);
-
- g_type_class_add_private (object_class, sizeof (NMDeviceAdslPrivate));
-
- /* virtual methods */
- object_class->constructed = constructed;
- object_class->dispose = dispose;
- object_class->finalize = finalize;
- object_class->get_property = get_property;
- device_class->connection_compatible = connection_compatible;
- device_class->get_setting_type = get_setting_type;
-
- /* properties */
- /**
- * NMDeviceAdsl:carrier:
- *
- * Whether the device has carrier.
- **/
- g_object_class_install_property
- (object_class, PROP_CARRIER,
- g_param_spec_boolean (NM_DEVICE_ADSL_CARRIER, "", "",
- FALSE,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-}
diff --git a/libnm-glib/nm-device-adsl.h b/libnm-glib/nm-device-adsl.h
deleted file mode 100644
index 35d2731a2..000000000
--- a/libnm-glib/nm-device-adsl.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2011 Pantelis Koukousoulas <pktoss@gmail.com>
- */
-
-#ifndef NM_DEVICE_ADSL_H
-#define NM_DEVICE_ADSL_H
-
-#include "nm-device.h"
-
-G_BEGIN_DECLS
-
-#define NM_TYPE_DEVICE_ADSL (nm_device_adsl_get_type ())
-#define NM_DEVICE_ADSL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_ADSL, NMDeviceAdsl))
-#define NM_DEVICE_ADSL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_ADSL, NMDeviceAdslClass))
-#define NM_IS_DEVICE_ADSL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_ADSL))
-#define NM_IS_DEVICE_ADSL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_ADSL))
-#define NM_DEVICE_ADSL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_ADSL, NMDeviceAdslClass))
-
-/**
- * NMDeviceAdslError:
- * @NM_DEVICE_ADSL_ERROR_UNKNOWN: unknown or unclassified error
- * @NM_DEVICE_ADSL_ERROR_NOT_ADSL_CONNECTION: the connection was not of ADSL type
- * @NM_DEVICE_ADSL_ERROR_INVALID_ADSL_CONNECTION: the ADSL connection was invalid
- */
-typedef enum {
- NM_DEVICE_ADSL_ERROR_UNKNOWN = 0, /*< nick=UnknownError >*/
- NM_DEVICE_ADSL_ERROR_NOT_ADSL_CONNECTION, /*< nick=NotAdslConnection >*/
- NM_DEVICE_ADSL_ERROR_INVALID_ADSL_CONNECTION, /*< nick=InvalidAdslConnection >*/
-} NMDeviceAdslError;
-
-#define NM_DEVICE_ADSL_ERROR nm_device_adsl_error_quark ()
-GQuark nm_device_adsl_error_quark (void);
-
-#define NM_DEVICE_ADSL_CARRIER "carrier"
-
-typedef struct {
- NMDevice parent;
-} NMDeviceAdsl;
-
-typedef struct {
- NMDeviceClass parent;
-
- /* Padding for future expansion */
- void (*_reserved1) (void);
- void (*_reserved2) (void);
- void (*_reserved3) (void);
- void (*_reserved4) (void);
- void (*_reserved5) (void);
- void (*_reserved6) (void);
-} NMDeviceAdslClass;
-
-GType nm_device_adsl_get_type (void);
-
-GObject *nm_device_adsl_new (DBusGConnection *connection, const char *path);
-gboolean nm_device_adsl_get_carrier (NMDeviceAdsl *device);
-
-G_END_DECLS
-
-#endif /* NM_DEVICE_ADSL_H */
diff --git a/libnm-glib/nm-device-bond.c b/libnm-glib/nm-device-bond.c
deleted file mode 100644
index a4f0f5014..000000000
--- a/libnm-glib/nm-device-bond.c
+++ /dev/null
@@ -1,346 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2012 Red Hat, Inc.
- */
-
-#include "nm-default.h"
-
-#include <string.h>
-#include <netinet/ether.h>
-
-#include "nm-setting-connection.h"
-#include "nm-setting-bond.h"
-#include "nm-utils.h"
-
-#include "nm-device-bond.h"
-#include "nm-device-private.h"
-#include "nm-object-private.h"
-#include "nm-types.h"
-
-G_DEFINE_TYPE (NMDeviceBond, nm_device_bond, NM_TYPE_DEVICE)
-
-#define NM_DEVICE_BOND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_BOND, NMDeviceBondPrivate))
-
-typedef struct {
- DBusGProxy *proxy;
-
- char *hw_address;
- gboolean carrier;
- GPtrArray *slaves;
-} NMDeviceBondPrivate;
-
-enum {
- PROP_0,
- PROP_HW_ADDRESS,
- PROP_CARRIER,
- PROP_SLAVES,
-
- LAST_PROP
-};
-
-/**
- * nm_device_bond_error_quark:
- *
- * Registers an error quark for #NMDeviceBond if necessary.
- *
- * Returns: the error quark used for #NMDeviceBond errors.
- **/
-GQuark
-nm_device_bond_error_quark (void)
-{
- static GQuark quark = 0;
-
- if (G_UNLIKELY (quark == 0))
- quark = g_quark_from_static_string ("nm-device-bond-error-quark");
- return quark;
-}
-
-/**
- * nm_device_bond_new:
- * @connection: the #DBusGConnection
- * @path: the DBus object path of the device
- *
- * Creates a new #NMDeviceBond.
- *
- * Returns: (transfer full): a new device
- **/
-GObject *
-nm_device_bond_new (DBusGConnection *connection, const char *path)
-{
- GObject *device;
-
- g_return_val_if_fail (connection != NULL, NULL);
- g_return_val_if_fail (path != NULL, NULL);
-
- device = g_object_new (NM_TYPE_DEVICE_BOND,
- NM_OBJECT_DBUS_CONNECTION, connection,
- NM_OBJECT_DBUS_PATH, path,
- NULL);
- _nm_object_ensure_inited (NM_OBJECT (device));
- return device;
-}
-
-/**
- * nm_device_bond_get_hw_address:
- * @device: a #NMDeviceBond
- *
- * Gets the hardware (MAC) address of the #NMDeviceBond
- *
- * Returns: the hardware address. This is the internal string used by the
- * device, and must not be modified.
- **/
-const char *
-nm_device_bond_get_hw_address (NMDeviceBond *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_BOND (device), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_BOND_GET_PRIVATE (device)->hw_address;
-}
-
-/**
- * nm_device_bond_get_carrier:
- * @device: a #NMDeviceBond
- *
- * Whether the device has carrier.
- *
- * Returns: %TRUE if the device has carrier
- **/
-gboolean
-nm_device_bond_get_carrier (NMDeviceBond *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_BOND (device), FALSE);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_BOND_GET_PRIVATE (device)->carrier;
-}
-
-/**
- * nm_device_bond_get_slaves:
- * @device: a #NMDeviceBond
- *
- * Gets the devices currently enslaved to @device.
- *
- * Returns: (element-type NMDevice): the #GPtrArray containing
- * #NMDevices that are slaves of @device. This is the internal
- * copy used by the device, and must not be modified.
- *
- * Since: 0.9.6.4
- **/
-const GPtrArray *
-nm_device_bond_get_slaves (NMDeviceBond *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_BOND (device), FALSE);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return handle_ptr_array_return (NM_DEVICE_BOND_GET_PRIVATE (device)->slaves);
-}
-
-static gboolean
-connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
-{
- NMSettingConnection *s_con;
- NMSettingBond *s_bond;
- const char *ctype, *dev_iface_name, *bond_iface_name;
-
- s_con = nm_connection_get_setting_connection (connection);
- g_assert (s_con);
-
- ctype = nm_setting_connection_get_connection_type (s_con);
- if (strcmp (ctype, NM_SETTING_BOND_SETTING_NAME) != 0) {
- g_set_error (error, NM_DEVICE_BOND_ERROR, NM_DEVICE_BOND_ERROR_NOT_BOND_CONNECTION,
- "The connection was not a bond connection.");
- return FALSE;
- }
-
- s_bond = nm_connection_get_setting_bond (connection);
- if (!s_bond) {
- g_set_error (error, NM_DEVICE_BOND_ERROR, NM_DEVICE_BOND_ERROR_INVALID_BOND_CONNECTION,
- "The connection was not a valid bond connection.");
- return FALSE;
- }
-
- dev_iface_name = nm_device_get_iface (device);
- bond_iface_name = nm_setting_bond_get_interface_name (s_bond);
- if (g_strcmp0 (dev_iface_name, bond_iface_name) != 0) {
- g_set_error (error, NM_DEVICE_BOND_ERROR, NM_DEVICE_BOND_ERROR_INTERFACE_MISMATCH,
- "The interfaces of the device and the connection didn't match.");
- return FALSE;
- }
-
- /* FIXME: check slaves? */
-
- return NM_DEVICE_CLASS (nm_device_bond_parent_class)->connection_compatible (device, connection, error);
-}
-
-static GType
-get_setting_type (NMDevice *device)
-{
- return NM_TYPE_SETTING_BOND;
-}
-
-static const char *
-get_hw_address (NMDevice *device)
-{
- return nm_device_bond_get_hw_address (NM_DEVICE_BOND (device));
-}
-
-/*****************************************************************************/
-
-static void
-nm_device_bond_init (NMDeviceBond *device)
-{
- _nm_device_set_device_type (NM_DEVICE (device), NM_DEVICE_TYPE_BOND);
-}
-
-static void
-register_properties (NMDeviceBond *device)
-{
- NMDeviceBondPrivate *priv = NM_DEVICE_BOND_GET_PRIVATE (device);
- const NMPropertiesInfo property_info[] = {
- { NM_DEVICE_BOND_HW_ADDRESS, &priv->hw_address },
- { NM_DEVICE_BOND_CARRIER, &priv->carrier },
- { NM_DEVICE_BOND_SLAVES, &priv->slaves, NULL, NM_TYPE_DEVICE },
- { NULL },
- };
-
- _nm_object_register_properties (NM_OBJECT (device),
- priv->proxy,
- property_info);
-}
-
-static void
-constructed (GObject *object)
-{
- NMDeviceBondPrivate *priv = NM_DEVICE_BOND_GET_PRIVATE (object);
-
- G_OBJECT_CLASS (nm_device_bond_parent_class)->constructed (object);
-
- priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE_BOND);
- register_properties (NM_DEVICE_BOND (object));
-}
-
-static void
-dispose (GObject *object)
-{
- NMDeviceBondPrivate *priv = NM_DEVICE_BOND_GET_PRIVATE (object);
-
- g_clear_object (&priv->proxy);
-
- if (priv->slaves) {
- g_ptr_array_set_free_func (priv->slaves, g_object_unref);
- g_ptr_array_free (priv->slaves, TRUE);
- priv->slaves = NULL;
- }
-
- G_OBJECT_CLASS (nm_device_bond_parent_class)->dispose (object);
-}
-
-static void
-finalize (GObject *object)
-{
- NMDeviceBondPrivate *priv = NM_DEVICE_BOND_GET_PRIVATE (object);
-
- g_free (priv->hw_address);
-
- G_OBJECT_CLASS (nm_device_bond_parent_class)->finalize (object);
-}
-
-static void
-get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- NMDeviceBond *device = NM_DEVICE_BOND (object);
-
- _nm_object_ensure_inited (NM_OBJECT (object));
-
- switch (prop_id) {
- case PROP_HW_ADDRESS:
- g_value_set_string (value, nm_device_bond_get_hw_address (device));
- break;
- case PROP_CARRIER:
- g_value_set_boolean (value, nm_device_bond_get_carrier (device));
- break;
- case PROP_SLAVES:
- g_value_set_boxed (value, nm_device_bond_get_slaves (device));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-nm_device_bond_class_init (NMDeviceBondClass *bond_class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (bond_class);
- NMDeviceClass *device_class = NM_DEVICE_CLASS (bond_class);
-
- g_type_class_add_private (bond_class, sizeof (NMDeviceBondPrivate));
-
- /* virtual methods */
- object_class->constructed = constructed;
- object_class->dispose = dispose;
- object_class->finalize = finalize;
- object_class->get_property = get_property;
- device_class->connection_compatible = connection_compatible;
- device_class->get_setting_type = get_setting_type;
- device_class->get_hw_address = get_hw_address;
-
- /* properties */
-
- /**
- * NMDeviceBond:hw-address:
- *
- * The hardware (MAC) address of the device.
- **/
- g_object_class_install_property
- (object_class, PROP_HW_ADDRESS,
- g_param_spec_string (NM_DEVICE_BOND_HW_ADDRESS, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceBond:carrier:
- *
- * Whether the device has carrier.
- **/
- g_object_class_install_property
- (object_class, PROP_CARRIER,
- g_param_spec_boolean (NM_DEVICE_BOND_CARRIER, "", "",
- FALSE,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceBond:slaves:
- *
- * The devices (#NMDevice) enslaved to the bond device.
- *
- * Since: 0.9.8
- **/
- g_object_class_install_property
- (object_class, PROP_SLAVES,
- g_param_spec_boxed (NM_DEVICE_BOND_SLAVES, "", "",
- NM_TYPE_OBJECT_ARRAY,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-}
diff --git a/libnm-glib/nm-device-bond.h b/libnm-glib/nm-device-bond.h
deleted file mode 100644
index cd1a60271..000000000
--- a/libnm-glib/nm-device-bond.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2012 Red Hat, Inc.
- */
-
-#ifndef NM_DEVICE_BOND_H
-#define NM_DEVICE_BOND_H
-
-#include "nm-device.h"
-
-G_BEGIN_DECLS
-
-#define NM_TYPE_DEVICE_BOND (nm_device_bond_get_type ())
-#define NM_DEVICE_BOND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_BOND, NMDeviceBond))
-#define NM_DEVICE_BOND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_BOND, NMDeviceBondClass))
-#define NM_IS_DEVICE_BOND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_BOND))
-#define NM_IS_DEVICE_BOND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_BOND))
-#define NM_DEVICE_BOND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_BOND, NMDeviceBondClass))
-
-/**
- * NMDeviceBondError:
- * @NM_DEVICE_BOND_ERROR_UNKNOWN: unknown or unclassified error
- * @NM_DEVICE_BOND_ERROR_NOT_BOND_CONNECTION: the connection was not of bond type
- * @NM_DEVICE_BOND_ERROR_INVALID_BOND_CONNECTION: the bond connection was invalid
- * @NM_DEVICE_BOND_ERROR_INTERFACE_MISMATCH: the interfaces of the connection and the device mismatched
- */
-typedef enum {
- NM_DEVICE_BOND_ERROR_UNKNOWN = 0, /*< nick=UnknownError >*/
- NM_DEVICE_BOND_ERROR_NOT_BOND_CONNECTION, /*< nick=NotBondConnection >*/
- NM_DEVICE_BOND_ERROR_INVALID_BOND_CONNECTION, /*< nick=InvalidBondConnection >*/
- NM_DEVICE_BOND_ERROR_INTERFACE_MISMATCH, /*< nick=InterfaceMismatch >*/
-} NMDeviceBondError;
-
-#define NM_DEVICE_BOND_ERROR nm_device_bond_error_quark ()
-GQuark nm_device_bond_error_quark (void);
-
-#define NM_DEVICE_BOND_HW_ADDRESS "hw-address"
-#define NM_DEVICE_BOND_CARRIER "carrier"
-#define NM_DEVICE_BOND_SLAVES "slaves"
-
-typedef struct {
- NMDevice parent;
-} NMDeviceBond;
-
-typedef struct {
- NMDeviceClass parent;
-
- /* Padding for future expansion */
- void (*_reserved1) (void);
- void (*_reserved2) (void);
- void (*_reserved3) (void);
- void (*_reserved4) (void);
- void (*_reserved5) (void);
- void (*_reserved6) (void);
-} NMDeviceBondClass;
-
-GType nm_device_bond_get_type (void);
-
-GObject *nm_device_bond_new (DBusGConnection *connection, const char *path);
-
-const char *nm_device_bond_get_hw_address (NMDeviceBond *device);
-gboolean nm_device_bond_get_carrier (NMDeviceBond *device);
-const GPtrArray *nm_device_bond_get_slaves (NMDeviceBond *device);
-
-G_END_DECLS
-
-#endif /* NM_DEVICE_BOND_H */
diff --git a/libnm-glib/nm-device-bridge.c b/libnm-glib/nm-device-bridge.c
deleted file mode 100644
index d5a2bbbcc..000000000
--- a/libnm-glib/nm-device-bridge.c
+++ /dev/null
@@ -1,358 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2012 Red Hat, Inc.
- */
-
-#include "nm-default.h"
-
-#include <string.h>
-#include <netinet/ether.h>
-
-#include "nm-setting-connection.h"
-#include "nm-setting-bridge.h"
-#include "nm-utils.h"
-
-#include "nm-device-bridge.h"
-#include "nm-device-private.h"
-#include "nm-object-private.h"
-#include "nm-types.h"
-
-G_DEFINE_TYPE (NMDeviceBridge, nm_device_bridge, NM_TYPE_DEVICE)
-
-#define NM_DEVICE_BRIDGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_BRIDGE, NMDeviceBridgePrivate))
-
-typedef struct {
- DBusGProxy *proxy;
-
- char *hw_address;
- gboolean carrier;
- GPtrArray *slaves;
-} NMDeviceBridgePrivate;
-
-enum {
- PROP_0,
- PROP_HW_ADDRESS,
- PROP_CARRIER,
- PROP_SLAVES,
-
- LAST_PROP
-};
-
-/**
- * nm_device_bridge_error_quark:
- *
- * Registers an error quark for #NMDeviceBridge if necessary.
- *
- * Returns: the error quark used for #NMDeviceBridge errors.
- *
- * Since: 0.9.8
- **/
-GQuark
-nm_device_bridge_error_quark (void)
-{
- static GQuark quark = 0;
-
- if (G_UNLIKELY (quark == 0))
- quark = g_quark_from_static_string ("nm-device-bridge-error-quark");
- return quark;
-}
-
-/**
- * nm_device_bridge_new:
- * @connection: the #DBusGConnection
- * @path: the DBus object path of the device
- *
- * Creates a new #NMDeviceBridge.
- *
- * Returns: (transfer full): a new device
- *
- * Since: 0.9.8
- **/
-GObject *
-nm_device_bridge_new (DBusGConnection *connection, const char *path)
-{
- GObject *device;
-
- g_return_val_if_fail (connection != NULL, NULL);
- g_return_val_if_fail (path != NULL, NULL);
-
- device = g_object_new (NM_TYPE_DEVICE_BRIDGE,
- NM_OBJECT_DBUS_CONNECTION, connection,
- NM_OBJECT_DBUS_PATH, path,
- NULL);
- _nm_object_ensure_inited (NM_OBJECT (device));
- return device;
-}
-
-/**
- * nm_device_bridge_get_hw_address:
- * @device: a #NMDeviceBridge
- *
- * Gets the hardware (MAC) address of the #NMDeviceBridge
- *
- * Returns: the hardware address. This is the internal string used by the
- * device, and must not be modified.
- *
- * Since: 0.9.8
- **/
-const char *
-nm_device_bridge_get_hw_address (NMDeviceBridge *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_BRIDGE (device), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_BRIDGE_GET_PRIVATE (device)->hw_address;
-}
-
-/**
- * nm_device_bridge_get_carrier:
- * @device: a #NMDeviceBridge
- *
- * Whether the device has carrier.
- *
- * Returns: %TRUE if the device has carrier
- *
- * Since: 0.9.8
- **/
-gboolean
-nm_device_bridge_get_carrier (NMDeviceBridge *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_BRIDGE (device), FALSE);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_BRIDGE_GET_PRIVATE (device)->carrier;
-}
-
-/**
- * nm_device_bridge_get_slaves:
- * @device: a #NMDeviceBridge
- *
- * Gets the devices currently enslaved to @device.
- *
- * Returns: (element-type NMDevice): the #GPtrArray containing
- * #NMDevices that are slaves of @device. This is the internal
- * copy used by the device, and must not be modified.
- *
- * Since: 0.9.8
- **/
-const GPtrArray *
-nm_device_bridge_get_slaves (NMDeviceBridge *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_BRIDGE (device), FALSE);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return handle_ptr_array_return (NM_DEVICE_BRIDGE_GET_PRIVATE (device)->slaves);
-}
-
-static gboolean
-connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
-{
- NMSettingConnection *s_con;
- NMSettingBridge *s_bridge;
- const char *ctype, *dev_iface_name, *bridge_iface_name;
-
- s_con = nm_connection_get_setting_connection (connection);
- g_assert (s_con);
-
- ctype = nm_setting_connection_get_connection_type (s_con);
- if (strcmp (ctype, NM_SETTING_BRIDGE_SETTING_NAME) != 0) {
- g_set_error (error, NM_DEVICE_BRIDGE_ERROR, NM_DEVICE_BRIDGE_ERROR_NOT_BRIDGE_CONNECTION,
- "The connection was not a bridge connection.");
- return FALSE;
- }
-
- s_bridge = nm_connection_get_setting_bridge (connection);
- if (!s_bridge) {
- g_set_error (error, NM_DEVICE_BRIDGE_ERROR, NM_DEVICE_BRIDGE_ERROR_INVALID_BRIDGE_CONNECTION,
- "The connection was not a valid bridge connection.");
- return FALSE;
- }
-
- dev_iface_name = nm_device_get_iface (device);
- bridge_iface_name = nm_setting_bridge_get_interface_name (s_bridge);
- if (g_strcmp0 (dev_iface_name, bridge_iface_name) != 0) {
- g_set_error (error, NM_DEVICE_BRIDGE_ERROR, NM_DEVICE_BRIDGE_ERROR_INTERFACE_MISMATCH,
- "The interfaces of the device and the connection didn't match.");
- return FALSE;
- }
-
- /* FIXME: check ports? */
-
- return NM_DEVICE_CLASS (nm_device_bridge_parent_class)->connection_compatible (device, connection, error);
-}
-
-static GType
-get_setting_type (NMDevice *device)
-{
- return NM_TYPE_SETTING_BRIDGE;
-}
-
-static const char *
-get_hw_address (NMDevice *device)
-{
- return nm_device_bridge_get_hw_address (NM_DEVICE_BRIDGE (device));
-}
-
-/*****************************************************************************/
-
-static void
-nm_device_bridge_init (NMDeviceBridge *device)
-{
- _nm_device_set_device_type (NM_DEVICE (device), NM_DEVICE_TYPE_BRIDGE);
-}
-
-static void
-register_properties (NMDeviceBridge *device)
-{
- NMDeviceBridgePrivate *priv = NM_DEVICE_BRIDGE_GET_PRIVATE (device);
- const NMPropertiesInfo property_info[] = {
- { NM_DEVICE_BRIDGE_HW_ADDRESS, &priv->hw_address },
- { NM_DEVICE_BRIDGE_CARRIER, &priv->carrier },
- { NM_DEVICE_BRIDGE_SLAVES, &priv->slaves, NULL, NM_TYPE_DEVICE },
- { NULL },
- };
-
- _nm_object_register_properties (NM_OBJECT (device),
- priv->proxy,
- property_info);
-}
-
-static void
-constructed (GObject *object)
-{
- NMDeviceBridgePrivate *priv = NM_DEVICE_BRIDGE_GET_PRIVATE (object);
-
- G_OBJECT_CLASS (nm_device_bridge_parent_class)->constructed (object);
-
- priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE_BRIDGE);
- register_properties (NM_DEVICE_BRIDGE (object));
-}
-
-static void
-dispose (GObject *object)
-{
- NMDeviceBridgePrivate *priv = NM_DEVICE_BRIDGE_GET_PRIVATE (object);
-
- g_clear_object (&priv->proxy);
-
- if (priv->slaves) {
- g_ptr_array_set_free_func (priv->slaves, g_object_unref);
- g_ptr_array_free (priv->slaves, TRUE);
- priv->slaves = NULL;
- }
-
- G_OBJECT_CLASS (nm_device_bridge_parent_class)->dispose (object);
-}
-
-static void
-finalize (GObject *object)
-{
- NMDeviceBridgePrivate *priv = NM_DEVICE_BRIDGE_GET_PRIVATE (object);
-
- g_free (priv->hw_address);
-
- G_OBJECT_CLASS (nm_device_bridge_parent_class)->finalize (object);
-}
-
-static void
-get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- NMDeviceBridge *device = NM_DEVICE_BRIDGE (object);
-
- _nm_object_ensure_inited (NM_OBJECT (object));
-
- switch (prop_id) {
- case PROP_HW_ADDRESS:
- g_value_set_string (value, nm_device_bridge_get_hw_address (device));
- break;
- case PROP_CARRIER:
- g_value_set_boolean (value, nm_device_bridge_get_carrier (device));
- break;
- case PROP_SLAVES:
- g_value_set_boxed (value, nm_device_bridge_get_slaves (device));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-nm_device_bridge_class_init (NMDeviceBridgeClass *bridge_class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (bridge_class);
- NMDeviceClass *device_class = NM_DEVICE_CLASS (bridge_class);
-
- g_type_class_add_private (bridge_class, sizeof (NMDeviceBridgePrivate));
-
- /* virtual methods */
- object_class->constructed = constructed;
- object_class->dispose = dispose;
- object_class->finalize = finalize;
- object_class->get_property = get_property;
- device_class->connection_compatible = connection_compatible;
- device_class->get_setting_type = get_setting_type;
- device_class->get_hw_address = get_hw_address;
-
- /* properties */
-
- /**
- * NMDeviceBridge:hw-address:
- *
- * The hardware (MAC) address of the device.
- *
- * Since: 0.9.8
- **/
- g_object_class_install_property
- (object_class, PROP_HW_ADDRESS,
- g_param_spec_string (NM_DEVICE_BRIDGE_HW_ADDRESS, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceBridge:carrier:
- *
- * Whether the device has carrier.
- *
- * Since: 0.9.8
- **/
- g_object_class_install_property
- (object_class, PROP_CARRIER,
- g_param_spec_boolean (NM_DEVICE_BRIDGE_CARRIER, "", "",
- FALSE,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceBridge:slaves:
- *
- * The devices (#NMDevice) enslaved to the bridge device.
- *
- * Since: 0.9.8
- **/
- g_object_class_install_property
- (object_class, PROP_SLAVES,
- g_param_spec_boxed (NM_DEVICE_BRIDGE_SLAVES, "", "",
- NM_TYPE_OBJECT_ARRAY,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-}
diff --git a/libnm-glib/nm-device-bridge.h b/libnm-glib/nm-device-bridge.h
deleted file mode 100644
index 2eaf475d8..000000000
--- a/libnm-glib/nm-device-bridge.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2012 Red Hat, Inc.
- */
-
-#ifndef NM_DEVICE_BRIDGE_H
-#define NM_DEVICE_BRIDGE_H
-
-#include "nm-device.h"
-
-G_BEGIN_DECLS
-
-#define NM_TYPE_DEVICE_BRIDGE (nm_device_bridge_get_type ())
-#define NM_DEVICE_BRIDGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_BRIDGE, NMDeviceBridge))
-#define NM_DEVICE_BRIDGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_BRIDGE, NMDeviceBridgeClass))
-#define NM_IS_DEVICE_BRIDGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_BRIDGE))
-#define NM_IS_DEVICE_BRIDGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_BRIDGE))
-#define NM_DEVICE_BRIDGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_BRIDGE, NMDeviceBridgeClass))
-
-/**
- * NMDeviceBridgeError:
- * @NM_DEVICE_BRIDGE_ERROR_UNKNOWN: unknown or unclassified error
- * @NM_DEVICE_BRIDGE_ERROR_NOT_BRIDGE_CONNECTION: the connection was not of bridge type
- * @NM_DEVICE_BRIDGE_ERROR_INVALID_BRIDGE_CONNECTION: the bridge connection was invalid
- * @NM_DEVICE_BRIDGE_ERROR_INTERFACE_MISMATCH: the interfaces of the connection and the device mismatched
- *
- * Since: 0.9.8
- */
-typedef enum {
- NM_DEVICE_BRIDGE_ERROR_UNKNOWN = 0, /*< nick=UnknownError >*/
- NM_DEVICE_BRIDGE_ERROR_NOT_BRIDGE_CONNECTION, /*< nick=NotBridgeConnection >*/
- NM_DEVICE_BRIDGE_ERROR_INVALID_BRIDGE_CONNECTION, /*< nick=InvalidBridgeConnection >*/
- NM_DEVICE_BRIDGE_ERROR_INTERFACE_MISMATCH, /*< nick=InterfaceMismatch >*/
-} NMDeviceBridgeError;
-
-#define NM_DEVICE_BRIDGE_ERROR nm_device_bridge_error_quark ()
-GQuark nm_device_bridge_error_quark (void);
-
-#define NM_DEVICE_BRIDGE_HW_ADDRESS "hw-address"
-#define NM_DEVICE_BRIDGE_CARRIER "carrier"
-#define NM_DEVICE_BRIDGE_SLAVES "slaves"
-
-typedef struct {
- NMDevice parent;
-} NMDeviceBridge;
-
-typedef struct {
- NMDeviceClass parent;
-
- /* Padding for future expansion */
- void (*_reserved1) (void);
- void (*_reserved2) (void);
- void (*_reserved3) (void);
- void (*_reserved4) (void);
- void (*_reserved5) (void);
- void (*_reserved6) (void);
-} NMDeviceBridgeClass;
-
-GType nm_device_bridge_get_type (void);
-
-GObject * nm_device_bridge_new (DBusGConnection *connection, const char *path);
-
-const char *nm_device_bridge_get_hw_address (NMDeviceBridge *device);
-gboolean nm_device_bridge_get_carrier (NMDeviceBridge *device);
-const GPtrArray *nm_device_bridge_get_slaves (NMDeviceBridge *device);
-
-G_END_DECLS
-
-#endif /* NM_DEVICE_BRIDGE_H */
diff --git a/libnm-glib/nm-device-bt.c b/libnm-glib/nm-device-bt.c
deleted file mode 100644
index 5cf55c576..000000000
--- a/libnm-glib/nm-device-bt.c
+++ /dev/null
@@ -1,372 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2007 - 2008 Novell, Inc.
- * Copyright 2007 - 2012 Red Hat, Inc.
- */
-
-#include "nm-default.h"
-
-#include <string.h>
-#include <netinet/ether.h>
-
-#include "nm-setting-connection.h"
-#include "nm-setting-bluetooth.h"
-
-#include "nm-device-bt.h"
-#include "nm-device-private.h"
-#include "nm-object-private.h"
-
-G_DEFINE_TYPE (NMDeviceBt, nm_device_bt, NM_TYPE_DEVICE)
-
-#define NM_DEVICE_BT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_BT, NMDeviceBtPrivate))
-
-typedef struct {
- DBusGProxy *proxy;
-
- char *hw_address;
- char *name;
- guint32 bt_capabilities;
-} NMDeviceBtPrivate;
-
-enum {
- PROP_0,
- PROP_HW_ADDRESS,
- PROP_NAME,
- PROP_BT_CAPABILITIES,
-
- LAST_PROP
-};
-
-/**
- * nm_device_bt_error_quark:
- *
- * Registers an error quark for #NMDeviceBt if necessary.
- *
- * Returns: the error quark used for #NMDeviceBt errors.
- **/
-GQuark
-nm_device_bt_error_quark (void)
-{
- static GQuark quark = 0;
-
- if (G_UNLIKELY (quark == 0))
- quark = g_quark_from_static_string ("nm-device-bt-error-quark");
- return quark;
-}
-
-/**
- * nm_device_bt_new:
- * @connection: the #DBusGConnection
- * @path: the DBus object path of the device
- *
- * Creates a new #NMDeviceBt.
- *
- * Returns: (transfer full): a new device
- **/
-GObject *
-nm_device_bt_new (DBusGConnection *connection, const char *path)
-{
- g_return_val_if_fail (connection != NULL, NULL);
- g_return_val_if_fail (path != NULL, NULL);
-
- return g_object_new (NM_TYPE_DEVICE_BT,
- NM_OBJECT_DBUS_CONNECTION, connection,
- NM_OBJECT_DBUS_PATH, path,
- NULL);
-}
-
-/**
- * nm_device_bt_get_hw_address:
- * @device: a #NMDeviceBt
- *
- * Gets the hardware (MAC) address of the #NMDeviceBt
- *
- * Returns: the hardware address. This is the internal string used by the
- * device, and must not be modified.
- **/
-const char *
-nm_device_bt_get_hw_address (NMDeviceBt *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_BT (device), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_BT_GET_PRIVATE (device)->hw_address;
-}
-
-/**
- * nm_device_bt_get_name:
- * @device: a #NMDeviceBt
- *
- * Gets the name of the #NMDeviceBt.
- *
- * Returns: the name of the device
- **/
-const char *
-nm_device_bt_get_name (NMDeviceBt *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_BT (device), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_BT_GET_PRIVATE (device)->name;
-}
-
-/**
- * nm_device_bt_get_capabilities:
- * @device: a #NMDeviceBt
- *
- * Returns the Bluetooth device's usable capabilities.
- *
- * Returns: a combination of #NMBluetoothCapabilities
- **/
-NMBluetoothCapabilities
-nm_device_bt_get_capabilities (NMDeviceBt *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_BT (device), NM_BT_CAPABILITY_NONE);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_BT_GET_PRIVATE (device)->bt_capabilities;
-}
-
-static NMBluetoothCapabilities
-get_connection_bt_type (NMConnection *connection)
-{
- NMSettingBluetooth *s_bt;
- const char *bt_type;
-
- s_bt = nm_connection_get_setting_bluetooth (connection);
- if (!s_bt)
- return NM_BT_CAPABILITY_NONE;
-
- bt_type = nm_setting_bluetooth_get_connection_type (s_bt);
- g_assert (bt_type);
-
- if (!strcmp (bt_type, NM_SETTING_BLUETOOTH_TYPE_DUN))
- return NM_BT_CAPABILITY_DUN;
- else if (!strcmp (bt_type, NM_SETTING_BLUETOOTH_TYPE_PANU))
- return NM_BT_CAPABILITY_NAP;
-
- return NM_BT_CAPABILITY_NONE;
-}
-
-static gboolean
-connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
-{
- NMSettingConnection *s_con;
- NMSettingBluetooth *s_bt;
- const char *ctype;
- const GByteArray *mac;
- const char *hw_str;
- struct ether_addr *hw_mac;
- NMBluetoothCapabilities dev_caps;
- NMBluetoothCapabilities bt_type;
-
- s_con = nm_connection_get_setting_connection (connection);
- g_assert (s_con);
-
- ctype = nm_setting_connection_get_connection_type (s_con);
- if (strcmp (ctype, NM_SETTING_BLUETOOTH_SETTING_NAME) != 0) {
- g_set_error (error, NM_DEVICE_BT_ERROR, NM_DEVICE_BT_ERROR_NOT_BT_CONNECTION,
- "The connection was not a Bluetooth connection.");
- return FALSE;
- }
-
- s_bt = nm_connection_get_setting_bluetooth (connection);
- if (!s_bt) {
- g_set_error (error, NM_DEVICE_BT_ERROR, NM_DEVICE_BT_ERROR_INVALID_BT_CONNECTION,
- "The connection was not a valid Bluetooth connection.");
- return FALSE;
- }
-
- /* Check BT address */
- hw_str = nm_device_bt_get_hw_address (NM_DEVICE_BT (device));
- if (hw_str) {
- hw_mac = ether_aton (hw_str);
- if (!hw_mac) {
- g_set_error (error, NM_DEVICE_BT_ERROR, NM_DEVICE_BT_ERROR_INVALID_DEVICE_MAC,
- "Invalid device MAC address.");
- return FALSE;
- }
- mac = nm_setting_bluetooth_get_bdaddr (s_bt);
- if (mac && hw_mac && memcmp (mac->data, hw_mac->ether_addr_octet, ETH_ALEN)) {
- g_set_error (error, NM_DEVICE_BT_ERROR, NM_DEVICE_BT_ERROR_MAC_MISMATCH,
- "The MACs of the device and the connection didn't match.");
- return FALSE;
- }
- }
-
- dev_caps = nm_device_bt_get_capabilities (NM_DEVICE_BT (device));
- bt_type = get_connection_bt_type (connection);
- if (!(bt_type & dev_caps)) {
- g_set_error (error, NM_DEVICE_BT_ERROR, NM_DEVICE_BT_ERROR_MISSING_DEVICE_CAPS,
- "The device missed BT capabilities required by the connection.");
- return FALSE;
- }
-
- return NM_DEVICE_CLASS (nm_device_bt_parent_class)->connection_compatible (device, connection, error);
-}
-
-static GType
-get_setting_type (NMDevice *device)
-{
- return NM_TYPE_SETTING_BLUETOOTH;
-}
-
-static const char *
-get_hw_address (NMDevice *device)
-{
- return nm_device_bt_get_hw_address (NM_DEVICE_BT (device));
-}
-
-/*****************************************************************************/
-
-static void
-nm_device_bt_init (NMDeviceBt *device)
-{
- _nm_device_set_device_type (NM_DEVICE (device), NM_DEVICE_TYPE_BT);
-}
-
-static void
-register_properties (NMDeviceBt *device)
-{
- NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (device);
- const NMPropertiesInfo property_info[] = {
- { NM_DEVICE_BT_HW_ADDRESS, &priv->hw_address },
- { NM_DEVICE_BT_NAME, &priv->name },
- { NM_DEVICE_BT_CAPABILITIES, &priv->bt_capabilities },
- { NULL },
- };
-
- _nm_object_register_properties (NM_OBJECT (device),
- priv->proxy,
- property_info);
-}
-
-static void
-constructed (GObject *object)
-{
- NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (object);
-
- G_OBJECT_CLASS (nm_device_bt_parent_class)->constructed (object);
-
- priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE_BLUETOOTH);
- register_properties (NM_DEVICE_BT (object));
-}
-
-static void
-dispose (GObject *object)
-{
- NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (object);
-
- g_clear_object (&priv->proxy);
-
- G_OBJECT_CLASS (nm_device_bt_parent_class)->dispose (object);
-}
-
-static void
-finalize (GObject *object)
-{
- NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (object);
-
- g_free (priv->hw_address);
- g_free (priv->name);
-
- G_OBJECT_CLASS (nm_device_bt_parent_class)->finalize (object);
-}
-
-static void
-get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- NMDeviceBt *device = NM_DEVICE_BT (object);
-
- _nm_object_ensure_inited (NM_OBJECT (object));
-
- switch (prop_id) {
- case PROP_HW_ADDRESS:
- g_value_set_string (value, nm_device_bt_get_hw_address (device));
- break;
- case PROP_NAME:
- g_value_set_string (value, nm_device_bt_get_name (device));
- break;
- case PROP_BT_CAPABILITIES:
- g_value_set_uint (value, nm_device_bt_get_capabilities (device));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-nm_device_bt_class_init (NMDeviceBtClass *bt_class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (bt_class);
- NMDeviceClass *device_class = NM_DEVICE_CLASS (bt_class);
-
- g_type_class_add_private (bt_class, sizeof (NMDeviceBtPrivate));
-
- /* virtual methods */
- object_class->constructed = constructed;
- object_class->dispose = dispose;
- object_class->finalize = finalize;
- object_class->get_property = get_property;
- device_class->connection_compatible = connection_compatible;
- device_class->get_setting_type = get_setting_type;
- device_class->get_hw_address = get_hw_address;
-
- /* properties */
-
- /**
- * NMDeviceBt:hw-address:
- *
- * The hardware (MAC) address of the device.
- **/
- g_object_class_install_property
- (object_class, PROP_HW_ADDRESS,
- g_param_spec_string (NM_DEVICE_BT_HW_ADDRESS, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceBt:name:
- *
- * The name of the bluetooth device.
- **/
- g_object_class_install_property
- (object_class, PROP_NAME,
- g_param_spec_string (NM_DEVICE_BT_NAME, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceBt:bt-capabilities:
- *
- * The device's bluetooth capabilities, a combination of #NMBluetoothCapabilities.
- **/
- g_object_class_install_property
- (object_class, PROP_BT_CAPABILITIES,
- g_param_spec_uint (NM_DEVICE_BT_CAPABILITIES, "", "",
- NM_BT_CAPABILITY_NONE, G_MAXUINT32, NM_BT_CAPABILITY_NONE,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
-}
diff --git a/libnm-glib/nm-device-bt.h b/libnm-glib/nm-device-bt.h
deleted file mode 100644
index 51dc86e39..000000000
--- a/libnm-glib/nm-device-bt.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2008 - 2012 Red Hat, Inc.
- * Copyright 2008 Novell, Inc.
- */
-
-#ifndef NM_DEVICE_BT_H
-#define NM_DEVICE_BT_H
-
-#include "NetworkManager.h"
-#include "nm-device.h"
-
-G_BEGIN_DECLS
-
-#define NM_TYPE_DEVICE_BT (nm_device_bt_get_type ())
-#define NM_DEVICE_BT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_BT, NMDeviceBt))
-#define NM_DEVICE_BT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_BT, NMDeviceBtClass))
-#define NM_IS_DEVICE_BT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_BT))
-#define NM_IS_DEVICE_BT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_BT))
-#define NM_DEVICE_BT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_BT, NMDeviceBtClass))
-
-/**
- * NMDeviceBtError:
- * @NM_DEVICE_BT_ERROR_UNKNOWN: unknown or unclassified error
- * @NM_DEVICE_BT_ERROR_NOT_BT_CONNECTION: the connection was not of bluetooth type
- * @NM_DEVICE_BT_ERROR_INVALID_BT_CONNECTION: the bluetooth connection was invalid
- * @NM_DEVICE_BT_ERROR_INVALID_DEVICE_MAC: the device's MAC was invalid
- * @NM_DEVICE_BT_ERROR_MAC_MISMATCH: the MACs of the connection and the device mismatched
- * @NM_DEVICE_BT_ERROR_MISSING_DEVICE_CAPS: the device missed required capabilities
- */
-typedef enum {
- NM_DEVICE_BT_ERROR_UNKNOWN = 0, /*< nick=UnknownError >*/
- NM_DEVICE_BT_ERROR_NOT_BT_CONNECTION, /*< nick=NotBtConnection >*/
- NM_DEVICE_BT_ERROR_INVALID_BT_CONNECTION, /*< nick=InvalidBtConnection >*/
- NM_DEVICE_BT_ERROR_INVALID_DEVICE_MAC, /*< nick=InvalidDeviceMac >*/
- NM_DEVICE_BT_ERROR_MAC_MISMATCH, /*< nick=MacMismatch >*/
- NM_DEVICE_BT_ERROR_MISSING_DEVICE_CAPS, /*< nick=MissingDeviceCaps >*/
-} NMDeviceBtError;
-
-#define NM_DEVICE_BT_ERROR nm_device_bt_error_quark ()
-GQuark nm_device_bt_error_quark (void);
-
-#define NM_DEVICE_BT_HW_ADDRESS "hw-address"
-#define NM_DEVICE_BT_NAME "name"
-#define NM_DEVICE_BT_CAPABILITIES "bt-capabilities"
-
-typedef struct {
- NMDevice parent;
-} NMDeviceBt;
-
-typedef struct {
- NMDeviceClass parent;
-
- /* Padding for future expansion */
- void (*_reserved1) (void);
- void (*_reserved2) (void);
- void (*_reserved3) (void);
- void (*_reserved4) (void);
- void (*_reserved5) (void);
- void (*_reserved6) (void);
-} NMDeviceBtClass;
-
-GType nm_device_bt_get_type (void);
-
-GObject *nm_device_bt_new (DBusGConnection *connection, const char *path);
-
-const char *nm_device_bt_get_hw_address (NMDeviceBt *device);
-
-const char *nm_device_bt_get_name (NMDeviceBt *device);
-
-NMBluetoothCapabilities nm_device_bt_get_capabilities (NMDeviceBt *device);
-
-G_END_DECLS
-
-#endif /* NM_DEVICE_BT_H */
diff --git a/libnm-glib/nm-device-ethernet.c b/libnm-glib/nm-device-ethernet.c
deleted file mode 100644
index df677b292..000000000
--- a/libnm-glib/nm-device-ethernet.c
+++ /dev/null
@@ -1,391 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2007 - 2008 Novell, Inc.
- * Copyright 2007 - 2012 Red Hat, Inc.
- */
-
-#include "nm-default.h"
-
-#include <string.h>
-#include <netinet/ether.h>
-
-#include "nm-setting-connection.h"
-#include "nm-setting-wired.h"
-#include "nm-setting-pppoe.h"
-
-#include "nm-device-ethernet.h"
-#include "nm-device-private.h"
-#include "nm-object-private.h"
-
-G_DEFINE_TYPE (NMDeviceEthernet, nm_device_ethernet, NM_TYPE_DEVICE)
-
-#define NM_DEVICE_ETHERNET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_ETHERNET, NMDeviceEthernetPrivate))
-
-typedef struct {
- DBusGProxy *proxy;
-
- char *hw_address;
- char *perm_hw_address;
- guint32 speed;
- gboolean carrier;
-} NMDeviceEthernetPrivate;
-
-enum {
- PROP_0,
- PROP_HW_ADDRESS,
- PROP_PERM_HW_ADDRESS,
- PROP_SPEED,
- PROP_CARRIER,
-
- LAST_PROP
-};
-
-/**
- * nm_device_ethernet_error_quark:
- *
- * Registers an error quark for #NMDeviceEthernet if necessary.
- *
- * Returns: the error quark used for #NMDeviceEthernet errors.
- **/
-GQuark
-nm_device_ethernet_error_quark (void)
-{
- static GQuark quark = 0;
-
- if (G_UNLIKELY (quark == 0))
- quark = g_quark_from_static_string ("nm-device-ethernet-error-quark");
- return quark;
-}
-
-/**
- * nm_device_ethernet_new:
- * @connection: the #DBusGConnection
- * @path: the DBus object path of the device
- *
- * Creates a new #NMDeviceEthernet.
- *
- * Returns: (transfer full): a new device
- **/
-GObject *
-nm_device_ethernet_new (DBusGConnection *connection, const char *path)
-{
- GObject *device;
-
- g_return_val_if_fail (connection != NULL, NULL);
- g_return_val_if_fail (path != NULL, NULL);
-
- device = g_object_new (NM_TYPE_DEVICE_ETHERNET,
- NM_OBJECT_DBUS_CONNECTION, connection,
- NM_OBJECT_DBUS_PATH, path,
- NULL);
- _nm_object_ensure_inited (NM_OBJECT (device));
- return device;
-}
-
-/**
- * nm_device_ethernet_get_hw_address:
- * @device: a #NMDeviceEthernet
- *
- * Gets the active hardware (MAC) address of the #NMDeviceEthernet
- *
- * Returns: the active hardware address. This is the internal string used by the
- * device, and must not be modified.
- **/
-const char *
-nm_device_ethernet_get_hw_address (NMDeviceEthernet *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_ETHERNET (device), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_ETHERNET_GET_PRIVATE (device)->hw_address;
-}
-
-/**
- * nm_device_ethernet_get_permanent_hw_address:
- * @device: a #NMDeviceEthernet
- *
- * Gets the permanent hardware (MAC) address of the #NMDeviceEthernet
- *
- * Returns: the permanent hardware address. This is the internal string used by the
- * device, and must not be modified.
- **/
-const char *
-nm_device_ethernet_get_permanent_hw_address (NMDeviceEthernet *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_ETHERNET (device), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_ETHERNET_GET_PRIVATE (device)->perm_hw_address;
-}
-
-/**
- * nm_device_ethernet_get_speed:
- * @device: a #NMDeviceEthernet
- *
- * Gets the speed of the #NMDeviceEthernet in Mbit/s.
- *
- * Returns: the speed of the device in Mbit/s
- **/
-guint32
-nm_device_ethernet_get_speed (NMDeviceEthernet *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_ETHERNET (device), 0);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_ETHERNET_GET_PRIVATE (device)->speed;
-}
-
-/**
- * nm_device_ethernet_get_carrier:
- * @device: a #NMDeviceEthernet
- *
- * Whether the device has carrier.
- *
- * Returns: %TRUE if the device has carrier
- **/
-gboolean
-nm_device_ethernet_get_carrier (NMDeviceEthernet *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_ETHERNET (device), FALSE);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_ETHERNET_GET_PRIVATE (device)->carrier;
-}
-
-static gboolean
-connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
-{
- NMSettingConnection *s_con;
- NMSettingWired *s_wired;
- const char *ctype;
- gboolean is_pppoe = FALSE;
-
- s_con = nm_connection_get_setting_connection (connection);
- g_assert (s_con);
-
- ctype = nm_setting_connection_get_connection_type (s_con);
- if (!strcmp (ctype, NM_SETTING_PPPOE_SETTING_NAME))
- is_pppoe = TRUE;
- else if (strcmp (ctype, NM_SETTING_WIRED_SETTING_NAME) != 0) {
- g_set_error (error, NM_DEVICE_ETHERNET_ERROR, NM_DEVICE_ETHERNET_ERROR_NOT_ETHERNET_CONNECTION,
- "The connection was not a wired or PPPoE connection.");
- return FALSE;
- }
-
- s_wired = nm_connection_get_setting_wired (connection);
- /* Wired setting optional for PPPoE */
- if (!is_pppoe && !s_wired) {
- g_set_error (error, NM_DEVICE_ETHERNET_ERROR, NM_DEVICE_ETHERNET_ERROR_INVALID_ETHERNET_CONNECTION,
- "The connection was not a valid Ethernet connection.");
- return FALSE;
- }
-
- if (s_wired) {
- const GByteArray *mac;
- const char *perm_str;
- struct ether_addr *perm_mac;
-
- /* FIXME: filter using s390 subchannels when they are exported over the bus */
-
- /* Check MAC address */
- perm_str = nm_device_ethernet_get_permanent_hw_address (NM_DEVICE_ETHERNET (device));
- if (perm_str) {
- perm_mac = ether_aton (perm_str);
- if (!perm_mac) {
- g_set_error (error, NM_DEVICE_ETHERNET_ERROR, NM_DEVICE_ETHERNET_ERROR_INVALID_DEVICE_MAC,
- "Invalid device MAC address.");
- return FALSE;
- }
- mac = nm_setting_wired_get_mac_address (s_wired);
- if (mac && perm_mac && memcmp (mac->data, perm_mac->ether_addr_octet, ETH_ALEN)) {
- g_set_error (error, NM_DEVICE_ETHERNET_ERROR, NM_DEVICE_ETHERNET_ERROR_MAC_MISMATCH,
- "The MACs of the device and the connection didn't match.");
- return FALSE;
- }
- }
- }
-
- return NM_DEVICE_CLASS (nm_device_ethernet_parent_class)->connection_compatible (device, connection, error);
-}
-
-static GType
-get_setting_type (NMDevice *device)
-{
- return NM_TYPE_SETTING_WIRED;
-}
-
-static const char *
-get_hw_address (NMDevice *device)
-{
- return nm_device_ethernet_get_hw_address (NM_DEVICE_ETHERNET (device));
-}
-
-/*****************************************************************************/
-
-static void
-nm_device_ethernet_init (NMDeviceEthernet *device)
-{
- _nm_device_set_device_type (NM_DEVICE (device), NM_DEVICE_TYPE_ETHERNET);
-}
-
-static void
-register_properties (NMDeviceEthernet *device)
-{
- NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device);
- const NMPropertiesInfo property_info[] = {
- { NM_DEVICE_ETHERNET_HW_ADDRESS, &priv->hw_address },
- { NM_DEVICE_ETHERNET_PERMANENT_HW_ADDRESS, &priv->perm_hw_address },
- { NM_DEVICE_ETHERNET_SPEED, &priv->speed },
- { NM_DEVICE_ETHERNET_CARRIER, &priv->carrier },
- { NULL },
- };
-
- _nm_object_register_properties (NM_OBJECT (device),
- priv->proxy,
- property_info);
-}
-
-static void
-constructed (GObject *object)
-{
- NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (object);
-
- G_OBJECT_CLASS (nm_device_ethernet_parent_class)->constructed (object);
-
- priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE_WIRED);
- register_properties (NM_DEVICE_ETHERNET (object));
-}
-
-static void
-dispose (GObject *object)
-{
- NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (object);
-
- g_clear_object (&priv->proxy);
-
- G_OBJECT_CLASS (nm_device_ethernet_parent_class)->dispose (object);
-}
-
-static void
-finalize (GObject *object)
-{
- NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (object);
-
- g_free (priv->hw_address);
- g_free (priv->perm_hw_address);
-
- G_OBJECT_CLASS (nm_device_ethernet_parent_class)->finalize (object);
-}
-
-static void
-get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- NMDeviceEthernet *device = NM_DEVICE_ETHERNET (object);
-
- _nm_object_ensure_inited (NM_OBJECT (object));
-
- switch (prop_id) {
- case PROP_HW_ADDRESS:
- g_value_set_string (value, nm_device_ethernet_get_hw_address (device));
- break;
- case PROP_PERM_HW_ADDRESS:
- g_value_set_string (value, nm_device_ethernet_get_permanent_hw_address (device));
- break;
- case PROP_SPEED:
- g_value_set_uint (value, nm_device_ethernet_get_speed (device));
- break;
- case PROP_CARRIER:
- g_value_set_boolean (value, nm_device_ethernet_get_carrier (device));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-nm_device_ethernet_class_init (NMDeviceEthernetClass *eth_class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (eth_class);
- NMDeviceClass *device_class = NM_DEVICE_CLASS (eth_class);
-
- g_type_class_add_private (eth_class, sizeof (NMDeviceEthernetPrivate));
-
- /* virtual methods */
- object_class->constructed = constructed;
- object_class->dispose = dispose;
- object_class->finalize = finalize;
- object_class->get_property = get_property;
- device_class->connection_compatible = connection_compatible;
- device_class->get_setting_type = get_setting_type;
- device_class->get_hw_address = get_hw_address;
-
- /* properties */
-
- /**
- * NMDeviceEthernet:hw-address:
- *
- * The active hardware (MAC) address of the device.
- **/
- g_object_class_install_property
- (object_class, PROP_HW_ADDRESS,
- g_param_spec_string (NM_DEVICE_ETHERNET_HW_ADDRESS, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceEthernet:perm-hw-address:
- *
- * The permanent hardware (MAC) address of the device.
- **/
- g_object_class_install_property
- (object_class, PROP_PERM_HW_ADDRESS,
- g_param_spec_string (NM_DEVICE_ETHERNET_PERMANENT_HW_ADDRESS, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceEthernet:speed:
- *
- * The speed of the device.
- **/
- g_object_class_install_property
- (object_class, PROP_SPEED,
- g_param_spec_uint (NM_DEVICE_ETHERNET_SPEED, "", "",
- 0, G_MAXUINT32, 0,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceEthernet:carrier:
- *
- * Whether the device has carrier.
- **/
- g_object_class_install_property
- (object_class, PROP_CARRIER,
- g_param_spec_boolean (NM_DEVICE_ETHERNET_CARRIER, "", "",
- FALSE,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
-}
diff --git a/libnm-glib/nm-device-ethernet.h b/libnm-glib/nm-device-ethernet.h
deleted file mode 100644
index be289cdfc..000000000
--- a/libnm-glib/nm-device-ethernet.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2007 - 2008 Novell, Inc.
- * Copyright 2007 - 2012 Red Hat, Inc.
- */
-
-#ifndef NM_DEVICE_ETHERNET_H
-#define NM_DEVICE_ETHERNET_H
-
-#include "nm-device.h"
-
-G_BEGIN_DECLS
-
-#define NM_TYPE_DEVICE_ETHERNET (nm_device_ethernet_get_type ())
-#define NM_DEVICE_ETHERNET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_ETHERNET, NMDeviceEthernet))
-#define NM_DEVICE_ETHERNET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_ETHERNET, NMDeviceEthernetClass))
-#define NM_IS_DEVICE_ETHERNET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_ETHERNET))
-#define NM_IS_DEVICE_ETHERNET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_ETHERNET))
-#define NM_DEVICE_ETHERNET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_ETHERNET, NMDeviceEthernetClass))
-
-/**
- * NMDeviceEthernetError:
- * @NM_DEVICE_ETHERNET_ERROR_UNKNOWN: unknown or unclassified error
- * @NM_DEVICE_ETHERNET_ERROR_NOT_ETHERNET_CONNECTION: the connection was not of Ethernet or PPPoE type
- * @NM_DEVICE_ETHERNET_ERROR_INVALID_ETHERNET_CONNECTION: the Ethernet connection was invalid
- * @NM_DEVICE_ETHERNET_ERROR_INVALID_DEVICE_MAC: the device's MAC was invalid
- * @NM_DEVICE_ETHERNET_ERROR_MAC_MISMATCH: the MACs of the connection and the device mismatched
- */
-typedef enum {
- NM_DEVICE_ETHERNET_ERROR_UNKNOWN = 0, /*< nick=UnknownError >*/
- NM_DEVICE_ETHERNET_ERROR_NOT_ETHERNET_CONNECTION, /*< nick=NotEthernetConnection >*/
- NM_DEVICE_ETHERNET_ERROR_INVALID_ETHERNET_CONNECTION, /*< nick=InvalidEthernetConnection >*/
- NM_DEVICE_ETHERNET_ERROR_INVALID_DEVICE_MAC, /*< nick=InvalidDeviceMac >*/
- NM_DEVICE_ETHERNET_ERROR_MAC_MISMATCH, /*< nick=MacMismatch >*/
-} NMDeviceEthernetError;
-
-#define NM_DEVICE_ETHERNET_ERROR nm_device_ethernet_error_quark ()
-GQuark nm_device_ethernet_error_quark (void);
-
-#define NM_DEVICE_ETHERNET_HW_ADDRESS "hw-address"
-#define NM_DEVICE_ETHERNET_PERMANENT_HW_ADDRESS "perm-hw-address"
-#define NM_DEVICE_ETHERNET_SPEED "speed"
-#define NM_DEVICE_ETHERNET_CARRIER "carrier"
-
-typedef struct {
- NMDevice parent;
-} NMDeviceEthernet;
-
-typedef struct {
- NMDeviceClass parent;
-
- /* Padding for future expansion */
- void (*_reserved1) (void);
- void (*_reserved2) (void);
- void (*_reserved3) (void);
- void (*_reserved4) (void);
- void (*_reserved5) (void);
- void (*_reserved6) (void);
-} NMDeviceEthernetClass;
-
-GType nm_device_ethernet_get_type (void);
-
-GObject *nm_device_ethernet_new (DBusGConnection *connection, const char *path);
-
-const char * nm_device_ethernet_get_hw_address (NMDeviceEthernet *device);
-const char * nm_device_ethernet_get_permanent_hw_address (NMDeviceEthernet *device);
-guint32 nm_device_ethernet_get_speed (NMDeviceEthernet *device);
-gboolean nm_device_ethernet_get_carrier (NMDeviceEthernet *device);
-
-G_END_DECLS
-
-#endif /* NM_DEVICE_ETHERNET_H */
diff --git a/libnm-glib/nm-device-generic.c b/libnm-glib/nm-device-generic.c
deleted file mode 100644
index 206174fb1..000000000
--- a/libnm-glib/nm-device-generic.c
+++ /dev/null
@@ -1,310 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2013 Red Hat, Inc.
- */
-
-#include "nm-default.h"
-
-#include <string.h>
-
-#include "nm-device-generic.h"
-#include "nm-device-private.h"
-#include "nm-object-private.h"
-#include "nm-setting-generic.h"
-
-G_DEFINE_TYPE (NMDeviceGeneric, nm_device_generic, NM_TYPE_DEVICE)
-
-#define NM_DEVICE_GENERIC_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_GENERIC, NMDeviceGenericPrivate))
-
-typedef struct {
- DBusGProxy *proxy;
-
- char *hw_address;
- char *type_description;
-} NMDeviceGenericPrivate;
-
-enum {
- PROP_0,
- PROP_HW_ADDRESS,
- PROP_TYPE_DESCRIPTION,
-
- LAST_PROP
-};
-
-/**
- * nm_device_generic_error_quark:
- *
- * Registers an error quark for #NMDeviceGeneric if necessary.
- *
- * Returns: the error quark used for #NMDeviceGeneric errors.
- *
- * Since: 0.9.10
- **/
-GQuark
-nm_device_generic_error_quark (void)
-{
- static GQuark quark = 0;
-
- if (G_UNLIKELY (quark == 0))
- quark = g_quark_from_static_string ("nm-device-generic-error-quark");
- return quark;
-}
-
-/**
- * nm_device_generic_new:
- * @connection: the #DBusGConnection
- * @path: the DBus object path of the device
- *
- * Creates a new #NMDeviceGeneric.
- *
- * Returns: (transfer full): a new device
- *
- * Since: 0.9.10
- **/
-GObject *
-nm_device_generic_new (DBusGConnection *connection, const char *path)
-{
- GObject *device;
-
- g_return_val_if_fail (connection != NULL, NULL);
- g_return_val_if_fail (path != NULL, NULL);
-
- device = g_object_new (NM_TYPE_DEVICE_GENERIC,
- NM_OBJECT_DBUS_CONNECTION, connection,
- NM_OBJECT_DBUS_PATH, path,
- NULL);
- _nm_object_ensure_inited (NM_OBJECT (device));
- return device;
-}
-
-/**
- * nm_device_generic_get_hw_address:
- * @device: a #NMDeviceGeneric
- *
- * Gets the hardware address of the #NMDeviceGeneric
- *
- * Returns: the hardware address. This is the internal string used by the
- * device, and must not be modified.
- *
- * Since: 0.9.10
- **/
-const char *
-nm_device_generic_get_hw_address (NMDeviceGeneric *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_GENERIC (device), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_GENERIC_GET_PRIVATE (device)->hw_address;
-}
-
-/*****************************************************************************/
-
-static const char *
-get_type_description (NMDevice *device)
-{
- NMDeviceGenericPrivate *priv = NM_DEVICE_GENERIC_GET_PRIVATE (device);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return priv->type_description;
-}
-
-static const char *
-get_hw_address (NMDevice *device)
-{
- return nm_device_generic_get_hw_address (NM_DEVICE_GENERIC (device));
-}
-
-static gboolean
-connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
-{
- NMSettingConnection *s_con;
- const char *ctype, *iface_name;
-
- s_con = nm_connection_get_setting_connection (connection);
- g_assert (s_con);
-
- ctype = nm_setting_connection_get_connection_type (s_con);
- if (strcmp (ctype, NM_SETTING_GENERIC_SETTING_NAME) != 0) {
- g_set_error (error, NM_DEVICE_GENERIC_ERROR, NM_DEVICE_GENERIC_ERROR_NOT_GENERIC_CONNECTION,
- "The connection was not a generic connection.");
- return FALSE;
- }
-
- iface_name = nm_setting_connection_get_interface_name (s_con);
- if (!iface_name) {
- g_set_error (error, NM_DEVICE_GENERIC_ERROR, NM_DEVICE_GENERIC_ERROR_MISSING_INTERFACE_NAME,
- "The connection did not specify an interface name.");
- return FALSE;
- }
-
- return NM_DEVICE_CLASS (nm_device_generic_parent_class)->connection_compatible (device, connection, error);
-}
-
-static GType
-get_setting_type (NMDevice *device)
-{
- return NM_TYPE_SETTING_GENERIC;
-}
-
-/*****************************************************************************/
-
-static void
-nm_device_generic_init (NMDeviceGeneric *device)
-{
- _nm_device_set_device_type (NM_DEVICE (device), NM_DEVICE_TYPE_GENERIC);
-}
-
-static void
-register_properties (NMDeviceGeneric *device)
-{
- NMDeviceGenericPrivate *priv = NM_DEVICE_GENERIC_GET_PRIVATE (device);
- const NMPropertiesInfo property_info[] = {
- { NM_DEVICE_GENERIC_HW_ADDRESS, &priv->hw_address },
- { NM_DEVICE_GENERIC_TYPE_DESCRIPTION, &priv->type_description },
- { NULL },
- };
-
- _nm_object_register_properties (NM_OBJECT (device),
- priv->proxy,
- property_info);
-}
-
-static const char *
-_device_type_to_interface (NMDeviceType type)
-{
- switch (type) {
- case NM_DEVICE_TYPE_GENERIC:
- return NM_DBUS_INTERFACE_DEVICE_GENERIC;
- case NM_DEVICE_TYPE_TUN:
- return NM_DBUS_INTERFACE_DEVICE_TUN;
- default:
- return NULL;
- }
-}
-
-static void
-constructed (GObject *object)
-{
- NMDeviceGenericPrivate *priv = NM_DEVICE_GENERIC_GET_PRIVATE (object);
- NMDeviceType type;
- DBusGConnection *connection;
- const char *path, *interface;
-
- G_OBJECT_CLASS (nm_device_generic_parent_class)->constructed (object);
-
- g_object_get (object,
- NM_OBJECT_DBUS_CONNECTION, &connection,
- NM_OBJECT_DBUS_PATH, &path,
- NULL);
-
- type = _nm_device_type_for_path (connection, path);
- interface = _device_type_to_interface (type);
-
- if (interface) {
- priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, interface);
- register_properties (NM_DEVICE_GENERIC (object));
- }
-}
-
-static void
-dispose (GObject *object)
-{
- NMDeviceGenericPrivate *priv = NM_DEVICE_GENERIC_GET_PRIVATE (object);
-
- g_clear_object (&priv->proxy);
-
- G_OBJECT_CLASS (nm_device_generic_parent_class)->dispose (object);
-}
-
-static void
-finalize (GObject *object)
-{
- NMDeviceGenericPrivate *priv = NM_DEVICE_GENERIC_GET_PRIVATE (object);
-
- g_free (priv->hw_address);
- g_free (priv->type_description);
-
- G_OBJECT_CLASS (nm_device_generic_parent_class)->finalize (object);
-}
-
-static void
-get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- NMDeviceGenericPrivate *priv = NM_DEVICE_GENERIC_GET_PRIVATE (object);
-
- _nm_object_ensure_inited (NM_OBJECT (object));
-
- switch (prop_id) {
- case PROP_HW_ADDRESS:
- g_value_set_string (value, priv->hw_address);
- break;
- case PROP_TYPE_DESCRIPTION:
- g_value_set_string (value, priv->type_description);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-nm_device_generic_class_init (NMDeviceGenericClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- NMDeviceClass *device_class = NM_DEVICE_CLASS (klass);
-
- g_type_class_add_private (klass, sizeof (NMDeviceGenericPrivate));
-
- object_class->constructed = constructed;
- object_class->dispose = dispose;
- object_class->finalize = finalize;
- object_class->get_property = get_property;
-
- device_class->get_type_description = get_type_description;
- device_class->get_hw_address = get_hw_address;
- device_class->connection_compatible = connection_compatible;
- device_class->get_setting_type = get_setting_type;
-
- /**
- * NMDeviceGeneric:hw-address:
- *
- * The hardware address of the device.
- **/
- g_object_class_install_property
- (object_class, PROP_HW_ADDRESS,
- g_param_spec_string (NM_DEVICE_GENERIC_HW_ADDRESS, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceGeneric:type-description:
- *
- * A description of the specific type of device this is, or %NULL
- * if not known.
- **/
- g_object_class_install_property
- (object_class, PROP_TYPE_DESCRIPTION,
- g_param_spec_string (NM_DEVICE_GENERIC_TYPE_DESCRIPTION, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-}
diff --git a/libnm-glib/nm-device-generic.h b/libnm-glib/nm-device-generic.h
deleted file mode 100644
index 5bff1e3f5..000000000
--- a/libnm-glib/nm-device-generic.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2013 Red Hat, Inc.
- */
-
-#ifndef NM_DEVICE_GENERIC_H
-#define NM_DEVICE_GENERIC_H
-
-#include "nm-device.h"
-
-G_BEGIN_DECLS
-
-#define NM_TYPE_DEVICE_GENERIC (nm_device_generic_get_type ())
-#define NM_DEVICE_GENERIC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_GENERIC, NMDeviceGeneric))
-#define NM_DEVICE_GENERIC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_GENERIC, NMDeviceGenericClass))
-#define NM_IS_DEVICE_GENERIC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_GENERIC))
-#define NM_IS_DEVICE_GENERIC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_GENERIC))
-#define NM_DEVICE_GENERIC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_GENERIC, NMDeviceGenericClass))
-
-/**
- * NMDeviceGenericError:
- * @NM_DEVICE_GENERIC_ERROR_UNKNOWN: unknown or unclassified error
- * @NM_DEVICE_GENERIC_ERROR_NOT_GENERIC_CONNECTION: the connection was not of generic type
- * @NM_DEVICE_GENERIC_ERROR_MISSING_INTERFACE_NAME: the connection did not specify the interface name
- */
-typedef enum {
- NM_DEVICE_GENERIC_ERROR_UNKNOWN = 0, /*< nick=UnknownError >*/
- NM_DEVICE_GENERIC_ERROR_NOT_GENERIC_CONNECTION, /*< nick=NotGenericConnection >*/
- NM_DEVICE_GENERIC_ERROR_MISSING_INTERFACE_NAME, /*< nick=MissingInterfaceName >*/
-} NMDeviceGenericError;
-
-#define NM_DEVICE_GENERIC_ERROR nm_device_generic_error_quark ()
-GQuark nm_device_generic_error_quark (void);
-
-#define NM_DEVICE_GENERIC_HW_ADDRESS "hw-address"
-#define NM_DEVICE_GENERIC_TYPE_DESCRIPTION "type-description"
-
-typedef struct {
- NMDevice parent;
-} NMDeviceGeneric;
-
-typedef struct {
- NMDeviceClass parent;
-
- /* Padding for future expansion */
- void (*_reserved1) (void);
- void (*_reserved2) (void);
- void (*_reserved3) (void);
- void (*_reserved4) (void);
- void (*_reserved5) (void);
- void (*_reserved6) (void);
-} NMDeviceGenericClass;
-
-NM_AVAILABLE_IN_0_9_10
-GType nm_device_generic_get_type (void);
-
-NM_AVAILABLE_IN_0_9_10
-GObject *nm_device_generic_new (DBusGConnection *connection, const char *path);
-
-const char *nm_device_generic_get_hw_address (NMDeviceGeneric *device);
-
-G_END_DECLS
-
-#endif /* NM_DEVICE_GENERIC_H */
diff --git a/libnm-glib/nm-device-infiniband.c b/libnm-glib/nm-device-infiniband.c
deleted file mode 100644
index 5c4a8c8b9..000000000
--- a/libnm-glib/nm-device-infiniband.c
+++ /dev/null
@@ -1,310 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2011 - 2012 Red Hat, Inc.
- */
-
-#include "nm-default.h"
-
-#include <string.h>
-#include <linux/if_infiniband.h>
-#include <netinet/ether.h>
-
-#include "nm-setting-connection.h"
-#include "nm-setting-infiniband.h"
-#include "nm-utils.h"
-
-#include "nm-device-infiniband.h"
-#include "nm-device-private.h"
-#include "nm-object-private.h"
-
-G_DEFINE_TYPE (NMDeviceInfiniband, nm_device_infiniband, NM_TYPE_DEVICE)
-
-#define NM_DEVICE_INFINIBAND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_INFINIBAND, NMDeviceInfinibandPrivate))
-
-typedef struct {
- DBusGProxy *proxy;
-
- char *hw_address;
- gboolean carrier;
-} NMDeviceInfinibandPrivate;
-
-enum {
- PROP_0,
- PROP_HW_ADDRESS,
- PROP_CARRIER,
-
- LAST_PROP
-};
-
-/**
- * nm_device_infiniband_error_quark:
- *
- * Registers an error quark for #NMDeviceInfiniband if necessary.
- *
- * Returns: the error quark used for #NMDeviceInfiniband errors.
- **/
-GQuark
-nm_device_infiniband_error_quark (void)
-{
- static GQuark quark = 0;
-
- if (G_UNLIKELY (quark == 0))
- quark = g_quark_from_static_string ("nm-device-infiniband-error-quark");
- return quark;
-}
-
-/**
- * nm_device_infiniband_new:
- * @connection: the #DBusGConnection
- * @path: the DBus object path of the device
- *
- * Creates a new #NMDeviceInfiniband.
- *
- * Returns: (transfer full): a new device
- **/
-GObject *
-nm_device_infiniband_new (DBusGConnection *connection, const char *path)
-{
- GObject *device;
-
- g_return_val_if_fail (connection != NULL, NULL);
- g_return_val_if_fail (path != NULL, NULL);
-
- device = g_object_new (NM_TYPE_DEVICE_INFINIBAND,
- NM_OBJECT_DBUS_CONNECTION, connection,
- NM_OBJECT_DBUS_PATH, path,
- NULL);
- _nm_object_ensure_inited (NM_OBJECT (device));
- return device;
-}
-
-/**
- * nm_device_infiniband_get_hw_address:
- * @device: a #NMDeviceInfiniband
- *
- * Gets the hardware (MAC) address of the #NMDeviceInfiniband
- *
- * Returns: the hardware address. This is the internal string used by the
- * device, and must not be modified.
- **/
-const char *
-nm_device_infiniband_get_hw_address (NMDeviceInfiniband *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_INFINIBAND (device), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_INFINIBAND_GET_PRIVATE (device)->hw_address;
-}
-
-/**
- * nm_device_infiniband_get_carrier:
- * @device: a #NMDeviceInfiniband
- *
- * Whether the device has carrier.
- *
- * Returns: %TRUE if the device has carrier
- **/
-gboolean
-nm_device_infiniband_get_carrier (NMDeviceInfiniband *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_INFINIBAND (device), FALSE);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_INFINIBAND_GET_PRIVATE (device)->carrier;
-}
-
-static gboolean
-connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
-{
- NMSettingConnection *s_con;
- NMSettingInfiniband *s_infiniband;
- const char *ctype, *hwaddr_str;
- const GByteArray *mac;
- guint8 *hwaddr, hwaddr_buf[INFINIBAND_ALEN];
-
- s_con = nm_connection_get_setting_connection (connection);
- g_assert (s_con);
-
- ctype = nm_setting_connection_get_connection_type (s_con);
- if (strcmp (ctype, NM_SETTING_INFINIBAND_SETTING_NAME) != 0) {
- g_set_error (error, NM_DEVICE_INFINIBAND_ERROR, NM_DEVICE_INFINIBAND_ERROR_NOT_INFINIBAND_CONNECTION,
- "The connection was not a InfiniBand connection.");
- return FALSE;
- }
-
- s_infiniband = nm_connection_get_setting_infiniband (connection);
- if (!s_infiniband) {
- g_set_error (error, NM_DEVICE_INFINIBAND_ERROR, NM_DEVICE_INFINIBAND_ERROR_INVALID_INFINIBAND_CONNECTION,
- "The connection was not a valid InfiniBand connection.");
- return FALSE;
- }
-
- hwaddr_str = nm_device_infiniband_get_hw_address (NM_DEVICE_INFINIBAND (device));
- if (hwaddr_str) {
- hwaddr = nm_utils_hwaddr_aton (hwaddr_str, ARPHRD_INFINIBAND, hwaddr_buf);
- if (!hwaddr) {
- g_set_error (error, NM_DEVICE_INFINIBAND_ERROR, NM_DEVICE_INFINIBAND_ERROR_INVALID_DEVICE_MAC,
- "Invalid device MAC address.");
- return FALSE;
- }
- mac = nm_setting_infiniband_get_mac_address (s_infiniband);
-
- /* We only match against the last 8 bytes */
- if (mac && hwaddr && memcmp (mac->data + INFINIBAND_ALEN - 8, hwaddr + INFINIBAND_ALEN - 8, 8)) {
- g_set_error (error, NM_DEVICE_INFINIBAND_ERROR, NM_DEVICE_INFINIBAND_ERROR_MAC_MISMATCH,
- "The MACs of the device and the connection didn't match.");
- return FALSE;
- }
- }
-
- return NM_DEVICE_CLASS (nm_device_infiniband_parent_class)->connection_compatible (device, connection, error);
-}
-
-static GType
-get_setting_type (NMDevice *device)
-{
- return NM_TYPE_SETTING_INFINIBAND;
-}
-
-static const char *
-get_hw_address (NMDevice *device)
-{
- return nm_device_infiniband_get_hw_address (NM_DEVICE_INFINIBAND (device));
-}
-
-/*****************************************************************************/
-
-static void
-nm_device_infiniband_init (NMDeviceInfiniband *device)
-{
- _nm_device_set_device_type (NM_DEVICE (device), NM_DEVICE_TYPE_INFINIBAND);
-}
-
-static void
-register_properties (NMDeviceInfiniband *device)
-{
- NMDeviceInfinibandPrivate *priv = NM_DEVICE_INFINIBAND_GET_PRIVATE (device);
- const NMPropertiesInfo property_info[] = {
- { NM_DEVICE_INFINIBAND_HW_ADDRESS, &priv->hw_address },
- { NM_DEVICE_INFINIBAND_CARRIER, &priv->carrier },
- { NULL },
- };
-
- _nm_object_register_properties (NM_OBJECT (device),
- priv->proxy,
- property_info);
-}
-
-static void
-constructed (GObject *object)
-{
- NMDeviceInfinibandPrivate *priv = NM_DEVICE_INFINIBAND_GET_PRIVATE (object);
-
- G_OBJECT_CLASS (nm_device_infiniband_parent_class)->constructed (object);
-
- priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE_INFINIBAND);
- register_properties (NM_DEVICE_INFINIBAND (object));
-}
-
-static void
-dispose (GObject *object)
-{
- NMDeviceInfinibandPrivate *priv = NM_DEVICE_INFINIBAND_GET_PRIVATE (object);
-
- g_clear_object (&priv->proxy);
-
- G_OBJECT_CLASS (nm_device_infiniband_parent_class)->dispose (object);
-}
-
-static void
-finalize (GObject *object)
-{
- NMDeviceInfinibandPrivate *priv = NM_DEVICE_INFINIBAND_GET_PRIVATE (object);
-
- g_free (priv->hw_address);
-
- G_OBJECT_CLASS (nm_device_infiniband_parent_class)->finalize (object);
-}
-
-static void
-get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- NMDeviceInfiniband *device = NM_DEVICE_INFINIBAND (object);
-
- _nm_object_ensure_inited (NM_OBJECT (object));
-
- switch (prop_id) {
- case PROP_HW_ADDRESS:
- g_value_set_string (value, nm_device_infiniband_get_hw_address (device));
- break;
- case PROP_CARRIER:
- g_value_set_boolean (value, nm_device_infiniband_get_carrier (device));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-nm_device_infiniband_class_init (NMDeviceInfinibandClass *ib_class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (ib_class);
- NMDeviceClass *device_class = NM_DEVICE_CLASS (ib_class);
-
- g_type_class_add_private (ib_class, sizeof (NMDeviceInfinibandPrivate));
-
- /* virtual methods */
- object_class->constructed = constructed;
- object_class->dispose = dispose;
- object_class->finalize = finalize;
- object_class->get_property = get_property;
- device_class->connection_compatible = connection_compatible;
- device_class->get_setting_type = get_setting_type;
- device_class->get_hw_address = get_hw_address;
-
- /* properties */
-
- /**
- * NMDeviceInfiniband:hw-address:
- *
- * The hardware (MAC) address of the device.
- **/
- g_object_class_install_property
- (object_class, PROP_HW_ADDRESS,
- g_param_spec_string (NM_DEVICE_INFINIBAND_HW_ADDRESS, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceInfiniband:carrier:
- *
- * Whether the device has carrier.
- **/
- g_object_class_install_property
- (object_class, PROP_CARRIER,
- g_param_spec_boolean (NM_DEVICE_INFINIBAND_CARRIER, "", "",
- FALSE,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
-}
diff --git a/libnm-glib/nm-device-infiniband.h b/libnm-glib/nm-device-infiniband.h
deleted file mode 100644
index ba587d93b..000000000
--- a/libnm-glib/nm-device-infiniband.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2011 - 2012 Red Hat, Inc.
- */
-
-#ifndef NM_DEVICE_INFINIBAND_H
-#define NM_DEVICE_INFINIBAND_H
-
-#include "nm-device.h"
-
-G_BEGIN_DECLS
-
-#define NM_TYPE_DEVICE_INFINIBAND (nm_device_infiniband_get_type ())
-#define NM_DEVICE_INFINIBAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_INFINIBAND, NMDeviceInfiniband))
-#define NM_DEVICE_INFINIBAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_INFINIBAND, NMDeviceInfinibandClass))
-#define NM_IS_DEVICE_INFINIBAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_INFINIBAND))
-#define NM_IS_DEVICE_INFINIBAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_INFINIBAND))
-#define NM_DEVICE_INFINIBAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_INFINIBAND, NMDeviceInfinibandClass))
-
-/**
- * NMDeviceInfinibandError:
- * @NM_DEVICE_INFINIBAND_ERROR_UNKNOWN: unknown or unclassified error
- * @NM_DEVICE_INFINIBAND_ERROR_NOT_INFINIBAND_CONNECTION: the connection was not of InfiniBand type
- * @NM_DEVICE_INFINIBAND_ERROR_INVALID_INFINIBAND_CONNECTION: the InfiniBand connection was invalid
- * @NM_DEVICE_INFINIBAND_ERROR_INVALID_DEVICE_MAC: the device's MAC was invalid
- * @NM_DEVICE_INFINIBAND_ERROR_MAC_MISMATCH: the MACs of the connection and the device mismatched
- */
-typedef enum {
- NM_DEVICE_INFINIBAND_ERROR_UNKNOWN = 0, /*< nick=UnknownError >*/
- NM_DEVICE_INFINIBAND_ERROR_NOT_INFINIBAND_CONNECTION, /*< nick=NotInfinibandConnection >*/
- NM_DEVICE_INFINIBAND_ERROR_INVALID_INFINIBAND_CONNECTION, /*< nick=InvalidInfinibandConnection >*/
- NM_DEVICE_INFINIBAND_ERROR_INVALID_DEVICE_MAC, /*< nick=InvalidDeviceMac >*/
- NM_DEVICE_INFINIBAND_ERROR_MAC_MISMATCH, /*< nick=MacMismatch >*/
-} NMDeviceInfinibandError;
-
-#define NM_DEVICE_INFINIBAND_ERROR nm_device_infiniband_error_quark ()
-GQuark nm_device_infiniband_error_quark (void);
-
-#define NM_DEVICE_INFINIBAND_HW_ADDRESS "hw-address"
-#define NM_DEVICE_INFINIBAND_CARRIER "carrier"
-
-typedef struct {
- NMDevice parent;
-} NMDeviceInfiniband;
-
-typedef struct {
- NMDeviceClass parent;
-
- /* Padding for future expansion */
- void (*_reserved1) (void);
- void (*_reserved2) (void);
- void (*_reserved3) (void);
- void (*_reserved4) (void);
- void (*_reserved5) (void);
- void (*_reserved6) (void);
-} NMDeviceInfinibandClass;
-
-GType nm_device_infiniband_get_type (void);
-
-GObject *nm_device_infiniband_new (DBusGConnection *connection, const char *path);
-
-const char * nm_device_infiniband_get_hw_address (NMDeviceInfiniband *device);
-gboolean nm_device_infiniband_get_carrier (NMDeviceInfiniband *device);
-
-G_END_DECLS
-
-#endif /* NM_DEVICE_INFINIBAND_H */
diff --git a/libnm-glib/nm-device-modem.c b/libnm-glib/nm-device-modem.c
deleted file mode 100644
index d4c156178..000000000
--- a/libnm-glib/nm-device-modem.c
+++ /dev/null
@@ -1,290 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2011 - 2012 Red Hat, Inc.
- * Copyright 2008 Novell, Inc.
- */
-
-#include "nm-default.h"
-
-#include <string.h>
-
-#include "nm-setting-connection.h"
-#include "nm-setting-gsm.h"
-#include "nm-setting-cdma.h"
-
-#include "nm-device-modem.h"
-#include "nm-device-private.h"
-#include "nm-object-private.h"
-
-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))
-
-typedef struct {
- DBusGProxy *proxy;
-
- NMDeviceModemCapabilities caps;
- NMDeviceModemCapabilities current_caps;
-} NMDeviceModemPrivate;
-
-enum {
- PROP_0,
- PROP_MODEM_CAPS,
- PROP_CURRENT_CAPS,
- LAST_PROP
-};
-
-/**
- * nm_device_modem_error_quark:
- *
- * Registers an error quark for #NMDeviceModem if necessary.
- *
- * Returns: the error quark used for #NMDeviceModem errors.
- **/
-GQuark
-nm_device_modem_error_quark (void)
-{
- static GQuark quark = 0;
-
- if (G_UNLIKELY (quark == 0))
- quark = g_quark_from_static_string ("nm-device-modem-error-quark");
- return quark;
-}
-
-/**
- * nm_device_modem_get_modem_capabilities:
- * @self: a #NMDeviceModem
- *
- * Returns a bitfield of the generic access technology families the modem
- * supports. Not all capabilities are available concurrently however; some
- * may require a firmware reload or reinitialization.
- *
- * Returns: the generic access technology families the modem supports
- **/
-NMDeviceModemCapabilities
-nm_device_modem_get_modem_capabilities (NMDeviceModem *self)
-{
- g_return_val_if_fail (NM_IS_DEVICE_MODEM (self), NM_DEVICE_MODEM_CAPABILITY_NONE);
-
- _nm_object_ensure_inited (NM_OBJECT (self));
- return NM_DEVICE_MODEM_GET_PRIVATE (self)->caps;
-}
-
-/**
- * nm_device_modem_get_current_capabilities:
- * @self: a #NMDeviceModem
- *
- * Returns a bitfield of the generic access technology families the modem
- * supports without a firmware reload or reinitialization. This value
- * represents the network types the modem can immediately connect to.
- *
- * Returns: the generic access technology families the modem supports without
- * a firmware reload or other reinitialization
- **/
-NMDeviceModemCapabilities
-nm_device_modem_get_current_capabilities (NMDeviceModem *self)
-{
- g_return_val_if_fail (NM_IS_DEVICE_MODEM (self), NM_DEVICE_MODEM_CAPABILITY_NONE);
-
- _nm_object_ensure_inited (NM_OBJECT (self));
- return NM_DEVICE_MODEM_GET_PRIVATE (self)->current_caps;
-}
-
-static const char *
-get_type_description (NMDevice *device)
-{
- NMDeviceModemCapabilities caps;
-
- caps = nm_device_modem_get_current_capabilities (NM_DEVICE_MODEM (device));
- if (caps & NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS)
- return "gsm";
- else if (caps & NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO)
- return "cdma";
- else
- return NULL;
-}
-
-#define MODEM_CAPS_3GPP(caps) (caps & (NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS | \
- NM_DEVICE_MODEM_CAPABILITY_LTE))
-
-#define MODEM_CAPS_3GPP2(caps) (caps & (NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO))
-
-static gboolean
-connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
-{
- NMSettingConnection *s_con;
- NMSettingGsm *s_gsm;
- NMSettingCdma *s_cdma;
- const char *ctype;
- NMDeviceModemCapabilities current_caps;
-
- s_con = nm_connection_get_setting_connection (connection);
- g_assert (s_con);
-
- ctype = nm_setting_connection_get_connection_type (s_con);
- if ( strcmp (ctype, NM_SETTING_GSM_SETTING_NAME) != 0
- && strcmp (ctype, NM_SETTING_CDMA_SETTING_NAME) != 0) {
- g_set_error (error, NM_DEVICE_MODEM_ERROR, NM_DEVICE_MODEM_ERROR_NOT_MODEM_CONNECTION,
- "The connection was not a modem connection.");
- return FALSE;
- }
-
- s_gsm = nm_connection_get_setting_gsm (connection);
- s_cdma = nm_connection_get_setting_cdma (connection);
- if (!s_cdma && !s_gsm) {
- g_set_error (error, NM_DEVICE_MODEM_ERROR, NM_DEVICE_MODEM_ERROR_INVALID_MODEM_CONNECTION,
- "The connection was not a valid modem connection.");
- return FALSE;
- }
-
- current_caps = nm_device_modem_get_current_capabilities (NM_DEVICE_MODEM (device));
- if (!(s_gsm && MODEM_CAPS_3GPP (current_caps)) && !(s_cdma && MODEM_CAPS_3GPP2 (current_caps))) {
- g_set_error (error, NM_DEVICE_MODEM_ERROR, NM_DEVICE_MODEM_ERROR_MISSING_DEVICE_CAPS,
- "The device missed capabilities required by the GSM/CDMA connection.");
- return FALSE;
- }
-
- return NM_DEVICE_CLASS (nm_device_modem_parent_class)->connection_compatible (device, connection, error);
-}
-
-static GType
-get_setting_type (NMDevice *device)
-{
- NMDeviceModemCapabilities caps;
-
- caps = nm_device_modem_get_current_capabilities (NM_DEVICE_MODEM (device));
- if (caps & (NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS | NM_DEVICE_MODEM_CAPABILITY_LTE))
- return NM_TYPE_SETTING_GSM;
- else if (caps & NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO)
- return NM_TYPE_SETTING_CDMA;
- else
- return G_TYPE_INVALID;
-}
-
-/*****************************************************************************/
-
-static void
-nm_device_modem_init (NMDeviceModem *device)
-{
- _nm_device_set_device_type (NM_DEVICE (device), NM_DEVICE_TYPE_MODEM);
-}
-
-static void
-register_properties (NMDeviceModem *device)
-{
- NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (device);
- const NMPropertiesInfo property_info[] = {
- { NM_DEVICE_MODEM_MODEM_CAPABILITIES, &priv->caps },
- { NM_DEVICE_MODEM_CURRENT_CAPABILITIES, &priv->current_caps },
- { NULL },
- };
-
- _nm_object_register_properties (NM_OBJECT (device),
- priv->proxy,
- property_info);
-}
-
-static void
-constructed (GObject *object)
-{
- NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (object);
-
- G_OBJECT_CLASS (nm_device_modem_parent_class)->constructed (object);
-
- priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE_MODEM);
- register_properties (NM_DEVICE_MODEM (object));
-}
-
-static void
-get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- NMDeviceModem *self = NM_DEVICE_MODEM (object);
-
- _nm_object_ensure_inited (NM_OBJECT (object));
-
- switch (prop_id) {
- case PROP_MODEM_CAPS:
- g_value_set_uint (value, nm_device_modem_get_modem_capabilities (self));
- break;
- case PROP_CURRENT_CAPS:
- g_value_set_uint (value, nm_device_modem_get_current_capabilities (self));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-dispose (GObject *object)
-{
- NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (object);
-
- g_clear_object (&priv->proxy);
-
- G_OBJECT_CLASS (nm_device_modem_parent_class)->dispose (object);
-}
-
-static void
-nm_device_modem_class_init (NMDeviceModemClass *modem_class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (modem_class);
- NMDeviceClass *device_class = NM_DEVICE_CLASS (modem_class);
-
- g_type_class_add_private (modem_class, sizeof (NMDeviceModemPrivate));
-
- /* virtual methods */
- object_class->constructed = constructed;
- object_class->get_property = get_property;
- object_class->dispose = dispose;
-
- device_class->get_type_description = get_type_description;
- device_class->connection_compatible = connection_compatible;
- device_class->get_setting_type = get_setting_type;
-
- /**
- * NMDeviceModem:modem-capabilities:
- *
- * The generic family of access technologies the modem supports. Not all
- * capabilities are available at the same time however; some modems require
- * a firmware reload or other reinitialization to switch between eg
- * CDMA/EVDO and GSM/UMTS.
- **/
- g_object_class_install_property
- (object_class, PROP_MODEM_CAPS,
- g_param_spec_uint (NM_DEVICE_MODEM_MODEM_CAPABILITIES, "", "",
- 0, G_MAXUINT32, 0,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceModem:current-capabilities:
- *
- * The generic family of access technologies the modem currently supports
- * without a firmware reload or reinitialization.
- **/
- g_object_class_install_property
- (object_class, PROP_CURRENT_CAPS,
- g_param_spec_uint (NM_DEVICE_MODEM_CURRENT_CAPABILITIES, "", "",
- 0, G_MAXUINT32, 0,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-}
diff --git a/libnm-glib/nm-device-modem.h b/libnm-glib/nm-device-modem.h
deleted file mode 100644
index 226cd0469..000000000
--- a/libnm-glib/nm-device-modem.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2011 - 2012 Red Hat, Inc.
- * Copyright 2008 Novell, Inc.
- */
-
-#ifndef NM_DEVICE_MODEM_H
-#define NM_DEVICE_MODEM_H
-
-#include "nm-device.h"
-
-G_BEGIN_DECLS
-
-#define NM_TYPE_DEVICE_MODEM (nm_device_modem_get_type ())
-#define NM_DEVICE_MODEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_MODEM, NMDeviceModem))
-#define NM_DEVICE_MODEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_MODEM, NMDeviceModemClass))
-#define NM_IS_DEVICE_MODEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_MODEM))
-#define NM_IS_DEVICE_MODEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_MODEM))
-#define NM_DEVICE_MODEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_MODEM, NMDeviceModemClass))
-
-/**
- * NMDeviceModemError:
- * @NM_DEVICE_MODEM_ERROR_UNKNOWN: unknown or unclassified error
- * @NM_DEVICE_MODEM_ERROR_NOT_MODEM_CONNECTION: the connection was not of modem type
- * @NM_DEVICE_MODEM_ERROR_INVALID_MODEM_CONNECTION: the modem connection was invalid
- * @NM_DEVICE_MODEM_ERROR_MISSING_DEVICE_CAPS: the device missed required capabilities
- */
-typedef enum {
- NM_DEVICE_MODEM_ERROR_UNKNOWN = 0, /*< nick=UnknownError >*/
- NM_DEVICE_MODEM_ERROR_NOT_MODEM_CONNECTION, /*< nick=NotModemConnection >*/
- NM_DEVICE_MODEM_ERROR_INVALID_MODEM_CONNECTION, /*< nick=InvalidModemConnection >*/
- NM_DEVICE_MODEM_ERROR_MISSING_DEVICE_CAPS, /*< nick=MissingDeviceCaps >*/
-} NMDeviceModemError;
-
-#define NM_DEVICE_MODEM_ERROR nm_device_modem_error_quark ()
-GQuark nm_device_modem_error_quark (void);
-
-#define NM_DEVICE_MODEM_MODEM_CAPABILITIES "modem-capabilities"
-#define NM_DEVICE_MODEM_CURRENT_CAPABILITIES "current-capabilities"
-
-typedef struct {
- NMDevice parent;
-} NMDeviceModem;
-
-typedef struct {
- NMDeviceClass parent;
-
- /* Padding for future expansion */
- void (*_reserved1) (void);
- void (*_reserved2) (void);
- void (*_reserved3) (void);
- void (*_reserved4) (void);
- void (*_reserved5) (void);
- void (*_reserved6) (void);
-} NMDeviceModemClass;
-
-GType nm_device_modem_get_type (void);
-
-NMDeviceModemCapabilities nm_device_modem_get_modem_capabilities (NMDeviceModem *self);
-NMDeviceModemCapabilities nm_device_modem_get_current_capabilities (NMDeviceModem *self);
-
-G_END_DECLS
-
-#endif /* NM_DEVICE_MODEM_H */
diff --git a/libnm-glib/nm-device-olpc-mesh.c b/libnm-glib/nm-device-olpc-mesh.c
deleted file mode 100644
index df4fb4655..000000000
--- a/libnm-glib/nm-device-olpc-mesh.c
+++ /dev/null
@@ -1,325 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2012 Red Hat, Inc.
- */
-
-#include "nm-default.h"
-
-#include <string.h>
-
-#include "nm-setting-connection.h"
-#include "nm-setting-olpc-mesh.h"
-
-#include "nm-device-olpc-mesh.h"
-#include "nm-device-private.h"
-#include "nm-object-private.h"
-#include "nm-device-wifi.h"
-
-G_DEFINE_TYPE (NMDeviceOlpcMesh, nm_device_olpc_mesh, NM_TYPE_DEVICE)
-
-#define NM_DEVICE_OLPC_MESH_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_OLPC_MESH, NMDeviceOlpcMeshPrivate))
-
-typedef struct {
- DBusGProxy *proxy;
-
- char *hw_address;
- NMDeviceWifi *companion;
- guint32 active_channel;
-} NMDeviceOlpcMeshPrivate;
-
-enum {
- PROP_0,
- PROP_HW_ADDRESS,
- PROP_COMPANION,
- PROP_ACTIVE_CHANNEL,
-
- LAST_PROP
-};
-
-/**
- * nm_device_olpc_mesh_error_quark:
- *
- * Registers an error quark for #NMDeviceOlpcMesh if necessary.
- *
- * Returns: the error quark used for #NMDeviceOlpcMesh errors.
- **/
-GQuark
-nm_device_olpc_mesh_error_quark (void)
-{
- static GQuark quark = 0;
-
- if (G_UNLIKELY (quark == 0))
- quark = g_quark_from_static_string ("nm-device-olpc-mesh-error-quark");
- return quark;
-}
-
-/**
- * nm_device_olpc_mesh_new:
- * @connection: the #DBusGConnection
- * @path: the DBus object path of the device
- *
- * Creates a new #NMDeviceOlpcMesh.
- *
- * Returns: (transfer full): a new OlpcMesh device
- **/
-GObject *
-nm_device_olpc_mesh_new (DBusGConnection *connection, const char *path)
-{
- GObject *device;
-
- g_return_val_if_fail (connection != NULL, NULL);
- g_return_val_if_fail (path != NULL, NULL);
-
- device = g_object_new (NM_TYPE_DEVICE_OLPC_MESH,
- NM_OBJECT_DBUS_CONNECTION, connection,
- NM_OBJECT_DBUS_PATH, path,
- NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return device;
-}
-
-/**
- * nm_device_olpc_mesh_get_hw_address:
- * @device: a #NMDeviceOlpcMesh
- *
- * Gets the hardware (MAC) address of the #NMDeviceOlpcMesh
- *
- * Returns: the hardware address. This is the internal string used by the
- * device, and must not be modified.
- **/
-const char *
-nm_device_olpc_mesh_get_hw_address (NMDeviceOlpcMesh *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_OLPC_MESH (device), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_OLPC_MESH_GET_PRIVATE (device)->hw_address;
-}
-
-/**
- * nm_device_olpc_mesh_get_companion:
- * @device: a #NMDeviceOlpcMesh
- *
- * Gets the companion device of the #NMDeviceOlpcMesh.
- *
- * Returns: (transfer none): the companion of the device of %NULL
- **/
-NMDeviceWifi *
-nm_device_olpc_mesh_get_companion (NMDeviceOlpcMesh *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_OLPC_MESH (device), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_OLPC_MESH_GET_PRIVATE (device)->companion;
-}
-
-/**
- * nm_device_olpc_mesh_get_active_channel:
- * @device: a #NMDeviceOlpcMesh
- *
- * Returns the active channel of the #NMDeviceOlpcMesh device.
- *
- * Returns: active channel of the device
- **/
-guint32
-nm_device_olpc_mesh_get_active_channel (NMDeviceOlpcMesh *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_OLPC_MESH (device), 0);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_OLPC_MESH_GET_PRIVATE (device)->active_channel;
-}
-
-static const char *
-get_hw_address (NMDevice *device)
-{
- return nm_device_olpc_mesh_get_hw_address (NM_DEVICE_OLPC_MESH (device));
-}
-
-static gboolean
-connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
-{
- NMSettingConnection *s_con;
- NMSettingOlpcMesh *s_olpc_mesh;
- const char *ctype;
-
- s_con = nm_connection_get_setting_connection (connection);
- g_assert (s_con);
-
- ctype = nm_setting_connection_get_connection_type (s_con);
- if (strcmp (ctype, NM_SETTING_OLPC_MESH_SETTING_NAME) != 0) {
- g_set_error (error, NM_DEVICE_OLPC_MESH_ERROR, NM_DEVICE_OLPC_MESH_ERROR_NOT_OLPC_MESH_CONNECTION,
- "The connection was not a Olpc Mesh connection.");
- return FALSE;
- }
-
- s_olpc_mesh = nm_connection_get_setting_olpc_mesh (connection);
- if (!s_olpc_mesh) {
- g_set_error (error, NM_DEVICE_OLPC_MESH_ERROR, NM_DEVICE_OLPC_MESH_ERROR_INVALID_OLPC_MESH_CONNECTION,
- "The connection was not a valid Olpc Mesh connection.");
- return FALSE;
- }
-
- return NM_DEVICE_CLASS (nm_device_olpc_mesh_parent_class)->connection_compatible (device, connection, error);
-}
-
-static GType
-get_setting_type (NMDevice *device)
-{
- return NM_TYPE_SETTING_OLPC_MESH;
-}
-
-/*****************************************************************************/
-
-static void
-nm_device_olpc_mesh_init (NMDeviceOlpcMesh *device)
-{
- _nm_device_set_device_type (NM_DEVICE (device), NM_DEVICE_TYPE_OLPC_MESH);
-}
-
-static void
-register_properties (NMDeviceOlpcMesh *device)
-{
- NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (device);
- const NMPropertiesInfo property_info[] = {
- { NM_DEVICE_OLPC_MESH_HW_ADDRESS, &priv->hw_address },
- { NM_DEVICE_OLPC_MESH_COMPANION, &priv->companion, NULL, NM_TYPE_DEVICE_WIFI },
- { NM_DEVICE_OLPC_MESH_ACTIVE_CHANNEL, &priv->active_channel },
- { NULL },
- };
-
- _nm_object_register_properties (NM_OBJECT (device),
- priv->proxy,
- property_info);
-}
-
-static void
-constructed (GObject *object)
-{
- NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (object);
-
- G_OBJECT_CLASS (nm_device_olpc_mesh_parent_class)->constructed (object);
-
- priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE_OLPC_MESH);
- register_properties (NM_DEVICE_OLPC_MESH (object));
-}
-
-static void
-dispose (GObject *object)
-{
- NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (object);
-
- g_clear_object (&priv->companion);
- g_clear_object (&priv->proxy);
-
- G_OBJECT_CLASS (nm_device_olpc_mesh_parent_class)->dispose (object);
-}
-
-static void
-finalize (GObject *object)
-{
- NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (object);
-
- g_free (priv->hw_address);
-
- G_OBJECT_CLASS (nm_device_olpc_mesh_parent_class)->finalize (object);
-}
-
-static void
-get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- NMDeviceOlpcMesh *device = NM_DEVICE_OLPC_MESH (object);
-
- _nm_object_ensure_inited (NM_OBJECT (object));
-
- switch (prop_id) {
- case PROP_HW_ADDRESS:
- g_value_set_string (value, nm_device_olpc_mesh_get_hw_address (device));
- break;
- case PROP_COMPANION:
- g_value_set_object (value, nm_device_olpc_mesh_get_companion (device));
- break;
- case PROP_ACTIVE_CHANNEL:
- g_value_set_uint (value, nm_device_olpc_mesh_get_active_channel (device));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-nm_device_olpc_mesh_class_init (NMDeviceOlpcMeshClass *olpc_mesh_class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (olpc_mesh_class);
- NMDeviceClass *device_class = NM_DEVICE_CLASS (olpc_mesh_class);
-
- g_type_class_add_private (olpc_mesh_class, sizeof (NMDeviceOlpcMeshPrivate));
-
- /* virtual methods */
- object_class->constructed = constructed;
- object_class->dispose = dispose;
- object_class->finalize = finalize;
- object_class->get_property = get_property;
- device_class->connection_compatible = connection_compatible;
- device_class->get_setting_type = get_setting_type;
- device_class->get_hw_address = get_hw_address;
-
- /* properties */
-
- /**
- * NMDeviceOlpcMesh:hw-address:
- *
- * The hardware (MAC) address of the device.
- **/
- g_object_class_install_property
- (object_class, PROP_HW_ADDRESS,
- g_param_spec_string (NM_DEVICE_OLPC_MESH_HW_ADDRESS, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceOlpcMesh:companion:
- *
- * The companion device.
- **/
- g_object_class_install_property
- (object_class, PROP_COMPANION,
- g_param_spec_object (NM_DEVICE_OLPC_MESH_COMPANION, "", "",
- NM_TYPE_DEVICE_WIFI,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceOlpcMesh:active-channel:
- *
- * The device's active channel.
- **/
- g_object_class_install_property
- (object_class, PROP_ACTIVE_CHANNEL,
- g_param_spec_uint (NM_DEVICE_OLPC_MESH_ACTIVE_CHANNEL, "", "",
- 0, G_MAXUINT32, 0,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
-}
diff --git a/libnm-glib/nm-device-olpc-mesh.h b/libnm-glib/nm-device-olpc-mesh.h
deleted file mode 100644
index fcef83bcd..000000000
--- a/libnm-glib/nm-device-olpc-mesh.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2012 Red Hat, Inc.
- */
-
-#ifndef NM_DEVICE_OLPC_MESH_H
-#define NM_DEVICE_OLPC_MESH_H
-
-#include "nm-device.h"
-#include "nm-device-wifi.h"
-
-G_BEGIN_DECLS
-
-#define NM_TYPE_DEVICE_OLPC_MESH (nm_device_olpc_mesh_get_type ())
-#define NM_DEVICE_OLPC_MESH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_OLPC_MESH, NMDeviceOlpcMesh))
-#define NM_DEVICE_OLPC_MESH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_OLPC_MESH, NMDeviceOlpcMeshClass))
-#define NM_IS_DEVICE_OLPC_MESH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_OLPC_MESH))
-#define NM_IS_DEVICE_OLPC_MESH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_OLPC_MESH))
-#define NM_DEVICE_OLPC_MESH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_OLPC_MESH, NMDeviceOlpcMeshClass))
-
-/**
- * NMDeviceOlpcMeshError:
- * @NM_DEVICE_OLPC_MESH_ERROR_UNKNOWN: unknown or unclassified error
- * @NM_DEVICE_OLPC_MESH_ERROR_NOT_OLPC_MESH_CONNECTION: the connection was not of Olpc Mesh type
- * @NM_DEVICE_OLPC_MESH_ERROR_INVALID_OLPC_MESH_CONNECTION: the Olpc Mesh connection was invalid
- */
-typedef enum {
- NM_DEVICE_OLPC_MESH_ERROR_UNKNOWN = 0, /*< nick=UnknownError >*/
- NM_DEVICE_OLPC_MESH_ERROR_NOT_OLPC_MESH_CONNECTION, /*< nick=NotOlpcMeshConnection >*/
- NM_DEVICE_OLPC_MESH_ERROR_INVALID_OLPC_MESH_CONNECTION, /*< nick=InvalidOlpcMeshConnection >*/
-} NMDeviceOlpcMeshError;
-
-#define NM_DEVICE_OLPC_MESH_ERROR nm_device_olpc_mesh_error_quark ()
-GQuark nm_device_olpc_mesh_error_quark (void);
-
-#define NM_DEVICE_OLPC_MESH_HW_ADDRESS "hw-address"
-#define NM_DEVICE_OLPC_MESH_COMPANION "companion"
-#define NM_DEVICE_OLPC_MESH_ACTIVE_CHANNEL "active-channel"
-
-typedef struct {
- NMDevice parent;
-} NMDeviceOlpcMesh;
-
-typedef struct {
- NMDeviceClass parent;
-
- /* Padding for future expansion */
- void (*_reserved1) (void);
- void (*_reserved2) (void);
- void (*_reserved3) (void);
- void (*_reserved4) (void);
- void (*_reserved5) (void);
- void (*_reserved6) (void);
-} NMDeviceOlpcMeshClass;
-
-GType nm_device_olpc_mesh_get_type (void);
-
-GObject *nm_device_olpc_mesh_new (DBusGConnection *connection, const char *path);
-
-const char *nm_device_olpc_mesh_get_hw_address (NMDeviceOlpcMesh *device);
-NMDeviceWifi *nm_device_olpc_mesh_get_companion (NMDeviceOlpcMesh *device);
-guint32 nm_device_olpc_mesh_get_active_channel (NMDeviceOlpcMesh *device);
-
-G_END_DECLS
-
-#endif /* NM_DEVICE_OLPC_MESH_H */
diff --git a/libnm-glib/nm-device-private.h b/libnm-glib/nm-device-private.h
deleted file mode 100644
index 1a29c97d7..000000000
--- a/libnm-glib/nm-device-private.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2007 - 2012 Red Hat, Inc.
- */
-
-#ifndef NM_DEVICE_PRIVATE_H
-#define NM_DEVICE_PRIVATE_H
-
-void _nm_device_set_device_type (NMDevice *device, NMDeviceType dtype);
-NMDeviceType _nm_device_type_for_path (DBusGConnection *connection, const char *path);
-
-#endif /* NM_DEVICE_PRIVATE_H */
diff --git a/libnm-glib/nm-device-team.c b/libnm-glib/nm-device-team.c
deleted file mode 100644
index 2a12a7328..000000000
--- a/libnm-glib/nm-device-team.c
+++ /dev/null
@@ -1,352 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2013 Jiri Pirko <jiri@resnulli.us>
- */
-
-#include "nm-default.h"
-
-#include <string.h>
-#include <netinet/ether.h>
-
-#include "nm-setting-connection.h"
-#include "nm-setting-team.h"
-#include "nm-utils.h"
-
-#include "nm-device-team.h"
-#include "nm-device-private.h"
-#include "nm-object-private.h"
-#include "nm-types.h"
-
-G_DEFINE_TYPE (NMDeviceTeam, nm_device_team, NM_TYPE_DEVICE)
-
-#define NM_DEVICE_TEAM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_TEAM, NMDeviceTeamPrivate))
-
-typedef struct {
- DBusGProxy *proxy;
-
- char *hw_address;
- gboolean carrier;
- GPtrArray *slaves;
-} NMDeviceTeamPrivate;
-
-enum {
- PROP_0,
- PROP_HW_ADDRESS,
- PROP_CARRIER,
- PROP_SLAVES,
-
- LAST_PROP
-};
-
-/**
- * nm_device_team_error_quark:
- *
- * Registers an error quark for #NMDeviceTeam if necessary.
- *
- * Returns: the error quark used for #NMDeviceTeam errors.
- *
- * Since: 0.9.10
- **/
-GQuark
-nm_device_team_error_quark (void)
-{
- static GQuark quark = 0;
-
- if (G_UNLIKELY (quark == 0))
- quark = g_quark_from_static_string ("nm-device-team-error-quark");
- return quark;
-}
-
-/**
- * nm_device_team_new:
- * @connection: the #DBusGConnection
- * @path: the DBus object path of the device
- *
- * Creates a new #NMDeviceTeam.
- *
- * Returns: (transfer full): a new device
- *
- * Since: 0.9.10
- **/
-GObject *
-nm_device_team_new (DBusGConnection *connection, const char *path)
-{
- GObject *device;
-
- g_return_val_if_fail (connection != NULL, NULL);
- g_return_val_if_fail (path != NULL, NULL);
-
- device = g_object_new (NM_TYPE_DEVICE_TEAM,
- NM_OBJECT_DBUS_CONNECTION, connection,
- NM_OBJECT_DBUS_PATH, path,
- NULL);
- _nm_object_ensure_inited (NM_OBJECT (device));
- return device;
-}
-
-/**
- * nm_device_team_get_hw_address:
- * @device: a #NMDeviceTeam
- *
- * Gets the hardware (MAC) address of the #NMDeviceTeam
- *
- * Returns: the hardware address. This is the internal string used by the
- * device, and must not be modified.
- *
- * Since: 0.9.10
- **/
-const char *
-nm_device_team_get_hw_address (NMDeviceTeam *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_TEAM (device), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_TEAM_GET_PRIVATE (device)->hw_address;
-}
-
-/**
- * nm_device_team_get_carrier:
- * @device: a #NMDeviceTeam
- *
- * Whether the device has carrier.
- *
- * Returns: %TRUE if the device has carrier
- *
- * Since: 0.9.10
- **/
-gboolean
-nm_device_team_get_carrier (NMDeviceTeam *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_TEAM (device), FALSE);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_TEAM_GET_PRIVATE (device)->carrier;
-}
-
-/**
- * nm_device_team_get_slaves:
- * @device: a #NMDeviceTeam
- *
- * Gets the devices currently enslaved to @device.
- *
- * Returns: (element-type NMDevice): the #GPtrArray containing
- * #NMDevices that are slaves of @device. This is the internal
- * copy used by the device, and must not be modified.
- *
- * Since: 0.9.10
- **/
-const GPtrArray *
-nm_device_team_get_slaves (NMDeviceTeam *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_TEAM (device), FALSE);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return handle_ptr_array_return (NM_DEVICE_TEAM_GET_PRIVATE (device)->slaves);
-}
-
-static const char *
-get_hw_address (NMDevice *device)
-{
- return nm_device_team_get_hw_address (NM_DEVICE_TEAM (device));
-}
-
-static gboolean
-connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
-{
- NMSettingConnection *s_con;
- NMSettingTeam *s_team;
- const char *ctype, *dev_iface_name, *team_iface_name;
-
- s_con = nm_connection_get_setting_connection (connection);
- g_assert (s_con);
-
- ctype = nm_setting_connection_get_connection_type (s_con);
- if (strcmp (ctype, NM_SETTING_TEAM_SETTING_NAME) != 0) {
- g_set_error (error, NM_DEVICE_TEAM_ERROR, NM_DEVICE_TEAM_ERROR_NOT_TEAM_CONNECTION,
- "The connection was not a team connection.");
- return FALSE;
- }
-
- s_team = nm_connection_get_setting_team (connection);
- if (!s_team) {
- g_set_error (error, NM_DEVICE_TEAM_ERROR, NM_DEVICE_TEAM_ERROR_INVALID_TEAM_CONNECTION,
- "The connection was not a valid team connection.");
- return FALSE;
- }
-
- dev_iface_name = nm_device_get_iface (device);
- team_iface_name = nm_setting_team_get_interface_name (s_team);
- if (g_strcmp0 (dev_iface_name, team_iface_name) != 0) {
- g_set_error (error, NM_DEVICE_TEAM_ERROR, NM_DEVICE_TEAM_ERROR_INTERFACE_MISMATCH,
- "The interfaces of the device and the connection didn't match.");
- return FALSE;
- }
-
- /* FIXME: check slaves? */
-
- return NM_DEVICE_CLASS (nm_device_team_parent_class)->connection_compatible (device, connection, error);
-}
-
-static GType
-get_setting_type (NMDevice *device)
-{
- return NM_TYPE_SETTING_TEAM;
-}
-
-/*****************************************************************************/
-
-static void
-nm_device_team_init (NMDeviceTeam *device)
-{
- _nm_device_set_device_type (NM_DEVICE (device), NM_DEVICE_TYPE_TEAM);
-}
-
-static void
-register_properties (NMDeviceTeam *device)
-{
- NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE (device);
- const NMPropertiesInfo property_info[] = {
- { NM_DEVICE_TEAM_HW_ADDRESS, &priv->hw_address },
- { NM_DEVICE_TEAM_CARRIER, &priv->carrier },
- { NM_DEVICE_TEAM_SLAVES, &priv->slaves, NULL, NM_TYPE_DEVICE },
- { NULL },
- };
-
- _nm_object_register_properties (NM_OBJECT (device),
- priv->proxy,
- property_info);
-}
-
-static void
-constructed (GObject *object)
-{
- NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE (object);
-
- G_OBJECT_CLASS (nm_device_team_parent_class)->constructed (object);
-
- priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE_TEAM);
- register_properties (NM_DEVICE_TEAM (object));
-}
-
-static void
-dispose (GObject *object)
-{
- NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE (object);
-
- g_clear_object (&priv->proxy);
-
- if (priv->slaves) {
- g_ptr_array_set_free_func (priv->slaves, g_object_unref);
- g_ptr_array_free (priv->slaves, TRUE);
- priv->slaves = NULL;
- }
-
- G_OBJECT_CLASS (nm_device_team_parent_class)->dispose (object);
-}
-
-static void
-finalize (GObject *object)
-{
- NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE (object);
-
- g_free (priv->hw_address);
-
- G_OBJECT_CLASS (nm_device_team_parent_class)->finalize (object);
-}
-
-static void
-get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- NMDeviceTeam *device = NM_DEVICE_TEAM (object);
-
- _nm_object_ensure_inited (NM_OBJECT (object));
-
- switch (prop_id) {
- case PROP_HW_ADDRESS:
- g_value_set_string (value, nm_device_team_get_hw_address (device));
- break;
- case PROP_CARRIER:
- g_value_set_boolean (value, nm_device_team_get_carrier (device));
- break;
- case PROP_SLAVES:
- g_value_set_boxed (value, nm_device_team_get_slaves (device));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-nm_device_team_class_init (NMDeviceTeamClass *team_class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (team_class);
- NMDeviceClass *device_class = NM_DEVICE_CLASS (team_class);
-
- g_type_class_add_private (team_class, sizeof (NMDeviceTeamPrivate));
-
- /* virtual methods */
- object_class->constructed = constructed;
- object_class->dispose = dispose;
- object_class->finalize = finalize;
- object_class->get_property = get_property;
- device_class->connection_compatible = connection_compatible;
- device_class->get_setting_type = get_setting_type;
- device_class->get_hw_address = get_hw_address;
-
- /* properties */
-
- /**
- * NMDeviceTeam:hw-address:
- *
- * The hardware (MAC) address of the device.
- **/
- g_object_class_install_property
- (object_class, PROP_HW_ADDRESS,
- g_param_spec_string (NM_DEVICE_TEAM_HW_ADDRESS, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceTeam:carrier:
- *
- * Whether the device has carrier.
- **/
- g_object_class_install_property
- (object_class, PROP_CARRIER,
- g_param_spec_boolean (NM_DEVICE_TEAM_CARRIER, "", "",
- FALSE,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceTeam:slaves:
- *
- * The devices (#NMDevice) enslaved to the team device.
- **/
- g_object_class_install_property
- (object_class, PROP_SLAVES,
- g_param_spec_boxed (NM_DEVICE_TEAM_SLAVES, "", "",
- NM_TYPE_OBJECT_ARRAY,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-}
diff --git a/libnm-glib/nm-device-team.h b/libnm-glib/nm-device-team.h
deleted file mode 100644
index 46e910bad..000000000
--- a/libnm-glib/nm-device-team.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2013 Jiri Pirko <jiri@resnulli.us>
- */
-
-#ifndef NM_DEVICE_TEAM_H
-#define NM_DEVICE_TEAM_H
-
-#include "nm-device.h"
-
-G_BEGIN_DECLS
-
-#define NM_TYPE_DEVICE_TEAM (nm_device_team_get_type ())
-#define NM_DEVICE_TEAM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_TEAM, NMDeviceTeam))
-#define NM_DEVICE_TEAM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_TEAM, NMDeviceTeamClass))
-#define NM_IS_DEVICE_TEAM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_TEAM))
-#define NM_IS_DEVICE_TEAM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_TEAM))
-#define NM_DEVICE_TEAM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_TEAM, NMDeviceTeamClass))
-
-/**
- * NMDeviceTeamError:
- * @NM_DEVICE_TEAM_ERROR_UNKNOWN: unknown or unclassified error
- * @NM_DEVICE_TEAM_ERROR_NOT_TEAM_CONNECTION: the connection was not of team type
- * @NM_DEVICE_TEAM_ERROR_INVALID_TEAM_CONNECTION: the team connection was invalid
- * @NM_DEVICE_TEAM_ERROR_INTERFACE_MISMATCH: the interfaces of the connection and the device mismatched
- */
-typedef enum {
- NM_DEVICE_TEAM_ERROR_UNKNOWN = 0, /*< nick=UnknownError >*/
- NM_DEVICE_TEAM_ERROR_NOT_TEAM_CONNECTION, /*< nick=NotTeamConnection >*/
- NM_DEVICE_TEAM_ERROR_INVALID_TEAM_CONNECTION, /*< nick=InvalidTeamConnection >*/
- NM_DEVICE_TEAM_ERROR_INTERFACE_MISMATCH, /*< nick=InterfaceMismatch >*/
-} NMDeviceTeamError;
-
-#define NM_DEVICE_TEAM_ERROR nm_device_team_error_quark ()
-NM_AVAILABLE_IN_0_9_10
-GQuark nm_device_team_error_quark (void);
-
-#define NM_DEVICE_TEAM_HW_ADDRESS "hw-address"
-#define NM_DEVICE_TEAM_CARRIER "carrier"
-#define NM_DEVICE_TEAM_SLAVES "slaves"
-
-typedef struct {
- NMDevice parent;
-} NMDeviceTeam;
-
-typedef struct {
- NMDeviceClass parent;
-
- /* Padding for future expansion */
- void (*_reserved1) (void);
- void (*_reserved2) (void);
- void (*_reserved3) (void);
- void (*_reserved4) (void);
- void (*_reserved5) (void);
- void (*_reserved6) (void);
-} NMDeviceTeamClass;
-
-NM_AVAILABLE_IN_0_9_10
-GType nm_device_team_get_type (void);
-
-NM_AVAILABLE_IN_0_9_10
-GObject *nm_device_team_new (DBusGConnection *connection, const char *path);
-
-const char *nm_device_team_get_hw_address (NMDeviceTeam *device);
-gboolean nm_device_team_get_carrier (NMDeviceTeam *device);
-const GPtrArray *nm_device_team_get_slaves (NMDeviceTeam *device);
-
-G_END_DECLS
-
-#endif /* NM_DEVICE_TEAM_H */
diff --git a/libnm-glib/nm-device-vlan.c b/libnm-glib/nm-device-vlan.c
deleted file mode 100644
index 3f40ec567..000000000
--- a/libnm-glib/nm-device-vlan.c
+++ /dev/null
@@ -1,390 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2012 Red Hat, Inc.
- */
-
-#include "nm-default.h"
-
-#include <string.h>
-#include <netinet/ether.h>
-
-#include "nm-setting-connection.h"
-#include "nm-setting-vlan.h"
-#include "nm-utils.h"
-
-#include "nm-device-vlan.h"
-#include "nm-device-private.h"
-#include "nm-object-private.h"
-
-G_DEFINE_TYPE (NMDeviceVlan, nm_device_vlan, NM_TYPE_DEVICE)
-
-#define NM_DEVICE_VLAN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_VLAN, NMDeviceVlanPrivate))
-
-typedef struct {
- DBusGProxy *proxy;
-
- char *hw_address;
- gboolean carrier;
- NMDevice *parent;
- guint vlan_id;
-} NMDeviceVlanPrivate;
-
-enum {
- PROP_0,
- PROP_HW_ADDRESS,
- PROP_CARRIER,
- PROP_PARENT,
- PROP_VLAN_ID,
-
- LAST_PROP
-};
-
-/**
- * nm_device_vlan_error_quark:
- *
- * Registers an error quark for #NMDeviceVlan if necessary.
- *
- * Returns: the error quark used for #NMDeviceVlan errors.
- **/
-GQuark
-nm_device_vlan_error_quark (void)
-{
- static GQuark quark = 0;
-
- if (G_UNLIKELY (quark == 0))
- quark = g_quark_from_static_string ("nm-device-vlan-error-quark");
- return quark;
-}
-
-/**
- * nm_device_vlan_new:
- * @connection: the #DBusGConnection
- * @path: the DBus object path of the device
- *
- * Creates a new #NMDeviceVlan.
- *
- * Returns: (transfer full): a new device
- **/
-GObject *
-nm_device_vlan_new (DBusGConnection *connection, const char *path)
-{
- GObject *device;
-
- g_return_val_if_fail (connection != NULL, NULL);
- g_return_val_if_fail (path != NULL, NULL);
-
- device = g_object_new (NM_TYPE_DEVICE_VLAN,
- NM_OBJECT_DBUS_CONNECTION, connection,
- NM_OBJECT_DBUS_PATH, path,
- NULL);
- _nm_object_ensure_inited (NM_OBJECT (device));
- return device;
-}
-
-/**
- * nm_device_vlan_get_hw_address:
- * @device: a #NMDeviceVlan
- *
- * Gets the hardware (MAC) address of the #NMDeviceVlan
- *
- * Returns: the hardware address. This is the internal string used by the
- * device, and must not be modified.
- **/
-const char *
-nm_device_vlan_get_hw_address (NMDeviceVlan *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_VLAN (device), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_VLAN_GET_PRIVATE (device)->hw_address;
-}
-
-/**
- * nm_device_vlan_get_carrier:
- * @device: a #NMDeviceVlan
- *
- * Whether the device has carrier.
- *
- * Returns: %TRUE if the device has carrier
- **/
-gboolean
-nm_device_vlan_get_carrier (NMDeviceVlan *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_VLAN (device), FALSE);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_VLAN_GET_PRIVATE (device)->carrier;
-}
-
-/**
- * nm_device_vlan_get_parent:
- * @device: a #NMDeviceVlan
- *
- * Returns: (transfer none): the device's parent device
- *
- * Since: 1.0
- **/
-NMDevice *
-nm_device_vlan_get_parent (NMDeviceVlan *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_VLAN (device), FALSE);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_VLAN_GET_PRIVATE (device)->parent;
-}
-
-/**
- * nm_device_vlan_get_vlan_id:
- * @device: a #NMDeviceVlan
- *
- * Returns: the device's VLAN ID
- **/
-guint
-nm_device_vlan_get_vlan_id (NMDeviceVlan *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_VLAN (device), FALSE);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_VLAN_GET_PRIVATE (device)->vlan_id;
-}
-
-static gboolean
-connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
-{
- NMSettingConnection *s_con;
- NMSettingVlan *s_vlan;
- NMSettingWired *s_wired;
- const char *ctype, *dev_iface_name, *vlan_iface_name;
- const GByteArray *mac_address;
- char *mac_address_str;
-
- s_con = nm_connection_get_setting_connection (connection);
- g_assert (s_con);
-
- ctype = nm_setting_connection_get_connection_type (s_con);
- if (strcmp (ctype, NM_SETTING_VLAN_SETTING_NAME) != 0) {
- g_set_error (error, NM_DEVICE_VLAN_ERROR, NM_DEVICE_VLAN_ERROR_NOT_VLAN_CONNECTION,
- "The connection was not a VLAN connection.");
- return FALSE;
- }
-
- s_vlan = nm_connection_get_setting_vlan (connection);
- if (!s_vlan) {
- g_set_error (error, NM_DEVICE_VLAN_ERROR, NM_DEVICE_VLAN_ERROR_INVALID_VLAN_CONNECTION,
- "The connection was not a valid VLAN connection.");
- return FALSE;
- }
-
- if (nm_setting_vlan_get_id (s_vlan) != nm_device_vlan_get_vlan_id (NM_DEVICE_VLAN (device))) {
- g_set_error (error, NM_DEVICE_VLAN_ERROR, NM_DEVICE_VLAN_ERROR_ID_MISMATCH,
- "The VLAN identifiers of the device and the connection didn't match.");
- return FALSE;
- }
-
- dev_iface_name = nm_device_get_iface (device);
- vlan_iface_name = nm_setting_vlan_get_interface_name (s_vlan);
- if (vlan_iface_name && g_strcmp0 (dev_iface_name, vlan_iface_name) != 0) {
- g_set_error (error, NM_DEVICE_VLAN_ERROR, NM_DEVICE_VLAN_ERROR_INTERFACE_MISMATCH,
- "The interfaces of the device and the connection didn't match.");
- return FALSE;
- }
-
- s_wired = nm_connection_get_setting_wired (connection);
- if (s_wired)
- mac_address = nm_setting_wired_get_mac_address (s_wired);
- else
- mac_address = NULL;
- if (mac_address) {
- mac_address_str = nm_utils_hwaddr_ntoa_len (mac_address->data, mac_address->len);
- if (!g_strcmp0 (mac_address_str, NM_DEVICE_VLAN_GET_PRIVATE (device)->hw_address)) {
- g_set_error (error, NM_DEVICE_VLAN_ERROR, NM_DEVICE_VLAN_ERROR_MAC_MISMATCH,
- "The hardware address of the device and the connection didn't match.");
- }
- g_free (mac_address_str);
- }
-
- return NM_DEVICE_CLASS (nm_device_vlan_parent_class)->connection_compatible (device, connection, error);
-}
-
-static GType
-get_setting_type (NMDevice *device)
-{
- return NM_TYPE_SETTING_VLAN;
-}
-
-static const char *
-get_hw_address (NMDevice *device)
-{
- return nm_device_vlan_get_hw_address (NM_DEVICE_VLAN (device));
-}
-
-/*****************************************************************************/
-
-static void
-nm_device_vlan_init (NMDeviceVlan *device)
-{
- _nm_device_set_device_type (NM_DEVICE (device), NM_DEVICE_TYPE_VLAN);
-}
-
-static void
-register_properties (NMDeviceVlan *device)
-{
- NMDeviceVlanPrivate *priv = NM_DEVICE_VLAN_GET_PRIVATE (device);
- const NMPropertiesInfo property_info[] = {
- { NM_DEVICE_VLAN_HW_ADDRESS, &priv->hw_address },
- { NM_DEVICE_VLAN_CARRIER, &priv->carrier },
- { NM_DEVICE_VLAN_PARENT, &priv->parent, NULL, NM_TYPE_DEVICE },
- { NM_DEVICE_VLAN_VLAN_ID, &priv->vlan_id },
- { NULL },
- };
-
- _nm_object_register_properties (NM_OBJECT (device),
- priv->proxy,
- property_info);
-}
-
-static void
-constructed (GObject *object)
-{
- NMDeviceVlanPrivate *priv = NM_DEVICE_VLAN_GET_PRIVATE (object);
-
- G_OBJECT_CLASS (nm_device_vlan_parent_class)->constructed (object);
-
- priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE_VLAN);
- register_properties (NM_DEVICE_VLAN (object));
-}
-
-static void
-dispose (GObject *object)
-{
- NMDeviceVlanPrivate *priv = NM_DEVICE_VLAN_GET_PRIVATE (object);
-
- g_clear_object (&priv->parent);
- g_clear_object (&priv->proxy);
-
- G_OBJECT_CLASS (nm_device_vlan_parent_class)->dispose (object);
-}
-
-static void
-finalize (GObject *object)
-{
- NMDeviceVlanPrivate *priv = NM_DEVICE_VLAN_GET_PRIVATE (object);
-
- g_free (priv->hw_address);
-
- G_OBJECT_CLASS (nm_device_vlan_parent_class)->finalize (object);
-}
-
-static void
-get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- NMDeviceVlan *device = NM_DEVICE_VLAN (object);
-
- _nm_object_ensure_inited (NM_OBJECT (object));
-
- switch (prop_id) {
- case PROP_HW_ADDRESS:
- g_value_set_string (value, nm_device_vlan_get_hw_address (device));
- break;
- case PROP_CARRIER:
- g_value_set_boolean (value, nm_device_vlan_get_carrier (device));
- break;
- case PROP_PARENT:
- g_value_set_object (value, nm_device_vlan_get_parent (device));
- break;
- case PROP_VLAN_ID:
- g_value_set_uint (value, nm_device_vlan_get_vlan_id (device));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-nm_device_vlan_class_init (NMDeviceVlanClass *vlan_class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (vlan_class);
- NMDeviceClass *device_class = NM_DEVICE_CLASS (vlan_class);
-
- g_type_class_add_private (vlan_class, sizeof (NMDeviceVlanPrivate));
-
- /* virtual methods */
- object_class->constructed = constructed;
- object_class->dispose = dispose;
- object_class->finalize = finalize;
- object_class->get_property = get_property;
- device_class->connection_compatible = connection_compatible;
- device_class->get_setting_type = get_setting_type;
- device_class->get_hw_address = get_hw_address;
-
- /* properties */
-
- /**
- * NMDeviceVlan:hw-address:
- *
- * The hardware (MAC) address of the device.
- **/
- g_object_class_install_property
- (object_class, PROP_HW_ADDRESS,
- g_param_spec_string (NM_DEVICE_VLAN_HW_ADDRESS, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceVlan:carrier:
- *
- * Whether the device has carrier.
- **/
- g_object_class_install_property
- (object_class, PROP_CARRIER,
- g_param_spec_boolean (NM_DEVICE_VLAN_CARRIER, "", "",
- FALSE,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceVlan:parent:
- *
- * The devices's parent device.
- *
- * Since: 1.0
- **/
- g_object_class_install_property
- (object_class, PROP_PARENT,
- g_param_spec_object (NM_DEVICE_VLAN_PARENT, "", "",
- NM_TYPE_DEVICE,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceVlan:vlan-id:
- *
- * The device's VLAN ID.
- **/
- g_object_class_install_property
- (object_class, PROP_VLAN_ID,
- g_param_spec_uint (NM_DEVICE_VLAN_VLAN_ID, "", "",
- 0, 4095, 0,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-}
diff --git a/libnm-glib/nm-device-vlan.h b/libnm-glib/nm-device-vlan.h
deleted file mode 100644
index 107cfea88..000000000
--- a/libnm-glib/nm-device-vlan.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2012 - 2014 Red Hat, Inc.
- */
-
-#ifndef NM_DEVICE_VLAN_H
-#define NM_DEVICE_VLAN_H
-
-#include "nm-device.h"
-
-G_BEGIN_DECLS
-
-#define NM_TYPE_DEVICE_VLAN (nm_device_vlan_get_type ())
-#define NM_DEVICE_VLAN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_VLAN, NMDeviceVlan))
-#define NM_DEVICE_VLAN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_VLAN, NMDeviceVlanClass))
-#define NM_IS_DEVICE_VLAN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_VLAN))
-#define NM_IS_DEVICE_VLAN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_VLAN))
-#define NM_DEVICE_VLAN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_VLAN, NMDeviceVlanClass))
-
-/**
- * NMDeviceVlanError:
- * @NM_DEVICE_VLAN_ERROR_UNKNOWN: unknown or unclassified error
- * @NM_DEVICE_VLAN_ERROR_NOT_VLAN_CONNECTION: the connection was not of VLAN type
- * @NM_DEVICE_VLAN_ERROR_INVALID_VLAN_CONNECTION: the VLAN connection was invalid
- * @NM_DEVICE_VLAN_ERROR_ID_MISMATCH: the VLAN identifiers of the connection and the device mismatched
- * @NM_DEVICE_VLAN_ERROR_INTERFACE_MISMATCH: the interfaces of the connection and the device mismatched
- * @NM_DEVICE_VLAN_ERROR_MAC_MISMATCH: the MACs of the connection and the device mismatched
- */
-typedef enum {
- NM_DEVICE_VLAN_ERROR_UNKNOWN = 0, /*< nick=UnknownError >*/
- NM_DEVICE_VLAN_ERROR_NOT_VLAN_CONNECTION, /*< nick=NotVlanConnection >*/
- NM_DEVICE_VLAN_ERROR_INVALID_VLAN_CONNECTION, /*< nick=InvalidVlanConnection >*/
- NM_DEVICE_VLAN_ERROR_ID_MISMATCH, /*< nick=IdMismatch >*/
- NM_DEVICE_VLAN_ERROR_INTERFACE_MISMATCH, /*< nick=InterfaceMismatch >*/
- NM_DEVICE_VLAN_ERROR_MAC_MISMATCH, /*< nick=MacMismatch >*/
-} NMDeviceVlanError;
-
-#define NM_DEVICE_VLAN_ERROR nm_device_vlan_error_quark ()
-GQuark nm_device_vlan_error_quark (void);
-
-#define NM_DEVICE_VLAN_HW_ADDRESS "hw-address"
-#define NM_DEVICE_VLAN_CARRIER "carrier"
-#define NM_DEVICE_VLAN_PARENT "parent"
-#define NM_DEVICE_VLAN_VLAN_ID "vlan-id"
-
-typedef struct {
- NMDevice parent;
-} NMDeviceVlan;
-
-typedef struct {
- NMDeviceClass parent;
-
- /* Padding for future expansion */
- void (*_reserved1) (void);
- void (*_reserved2) (void);
- void (*_reserved3) (void);
- void (*_reserved4) (void);
- void (*_reserved5) (void);
- void (*_reserved6) (void);
-} NMDeviceVlanClass;
-
-GType nm_device_vlan_get_type (void);
-
-GObject *nm_device_vlan_new (DBusGConnection *connection, const char *path);
-
-const char * nm_device_vlan_get_hw_address (NMDeviceVlan *device);
-gboolean nm_device_vlan_get_carrier (NMDeviceVlan *device);
-NM_AVAILABLE_IN_1_0
-NMDevice * nm_device_vlan_get_parent (NMDeviceVlan *device);
-guint nm_device_vlan_get_vlan_id (NMDeviceVlan *device);
-
-G_END_DECLS
-
-#endif /* NM_DEVICE_VLAN_H */
diff --git a/libnm-glib/nm-device-wifi.c b/libnm-glib/nm-device-wifi.c
deleted file mode 100644
index 08e5b90c1..000000000
--- a/libnm-glib/nm-device-wifi.c
+++ /dev/null
@@ -1,837 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2007 - 2008 Novell, Inc.
- * Copyright 2007 - 2012 Red Hat, Inc.
- */
-
-#include "nm-default.h"
-
-#include <string.h>
-#include <netinet/ether.h>
-
-#include "nm-setting-connection.h"
-#include "nm-setting-wireless.h"
-#include "nm-setting-wireless-security.h"
-
-#include "nm-device-wifi.h"
-#include "nm-device-private.h"
-#include "nm-object-private.h"
-#include "nm-object-cache.h"
-#include "nm-dbus-glib-types.h"
-#include "nm-types-private.h"
-
-G_DEFINE_TYPE (NMDeviceWifi, nm_device_wifi, NM_TYPE_DEVICE)
-
-#define NM_DEVICE_WIFI_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_WIFI, NMDeviceWifiPrivate))
-
-void _nm_device_wifi_set_wireless_enabled (NMDeviceWifi *device, gboolean enabled);
-
-typedef struct {
- NMDeviceWifi *device;
- NMDeviceWifiRequestScanFn callback;
- gpointer user_data;
-} RequestScanInfo;
-
-typedef struct {
- DBusGProxy *proxy;
-
- char *hw_address;
- char *perm_hw_address;
- NM80211Mode mode;
- guint32 rate;
- NMAccessPoint *active_ap;
- NMDeviceWifiCapabilities wireless_caps;
- GPtrArray *aps;
-
- DBusGProxyCall *scan_call;
- RequestScanInfo *scan_info;
-} NMDeviceWifiPrivate;
-
-enum {
- PROP_0,
- PROP_HW_ADDRESS,
- PROP_PERM_HW_ADDRESS,
- PROP_MODE,
- PROP_BITRATE,
- PROP_ACTIVE_ACCESS_POINT,
- PROP_WIRELESS_CAPABILITIES,
- PROP_ACCESS_POINTS,
-
- LAST_PROP
-};
-
-enum {
- ACCESS_POINT_ADDED,
- ACCESS_POINT_REMOVED,
-
- LAST_SIGNAL
-};
-static guint signals[LAST_SIGNAL] = { 0 };
-
-/**
- * nm_device_wifi_error_quark:
- *
- * Registers an error quark for #NMDeviceWifi if necessary.
- *
- * Returns: the error quark used for #NMDeviceWifi errors.
- **/
-GQuark
-nm_device_wifi_error_quark (void)
-{
- static GQuark quark = 0;
-
- if (G_UNLIKELY (quark == 0))
- quark = g_quark_from_static_string ("nm-device-wifi-error-quark");
- return quark;
-}
-
-/**
- * nm_device_wifi_new:
- * @connection: the #DBusGConnection
- * @path: the DBus object path of the device
- *
- * Creates a new #NMDeviceWifi.
- *
- * Returns: (transfer full): a new Wi-Fi device
- **/
-GObject *
-nm_device_wifi_new (DBusGConnection *connection, const char *path)
-{
- GObject *device;
-
- g_return_val_if_fail (connection != NULL, NULL);
- g_return_val_if_fail (path != NULL, NULL);
-
- device = g_object_new (NM_TYPE_DEVICE_WIFI,
- NM_OBJECT_DBUS_CONNECTION, connection,
- NM_OBJECT_DBUS_PATH, path,
- NULL);
- _nm_object_ensure_inited (NM_OBJECT (device));
- return device;
-}
-
-/**
- * nm_device_wifi_get_hw_address:
- * @device: a #NMDeviceWifi
- *
- * Gets the actual hardware (MAC) address of the #NMDeviceWifi
- *
- * Returns: the actual hardware address. This is the internal string used by the
- * device, and must not be modified.
- **/
-const char *
-nm_device_wifi_get_hw_address (NMDeviceWifi *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_WIFI_GET_PRIVATE (device)->hw_address;
-}
-
-/**
- * nm_device_wifi_get_permanent_hw_address:
- * @device: a #NMDeviceWifi
- *
- * Gets the permanent hardware (MAC) address of the #NMDeviceWifi
- *
- * Returns: the permanent hardware address. This is the internal string used by the
- * device, and must not be modified.
- **/
-const char *
-nm_device_wifi_get_permanent_hw_address (NMDeviceWifi *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_WIFI_GET_PRIVATE (device)->perm_hw_address;
-}
-
-/**
- * nm_device_wifi_get_mode:
- * @device: a #NMDeviceWifi
- *
- * Gets the #NMDeviceWifi mode.
- *
- * Returns: the mode
- **/
-NM80211Mode
-nm_device_wifi_get_mode (NMDeviceWifi *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), 0);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_WIFI_GET_PRIVATE (device)->mode;
-}
-
-/**
- * nm_device_wifi_get_bitrate:
- * @device: a #NMDeviceWifi
- *
- * Gets the bit rate of the #NMDeviceWifi in kbit/s.
- *
- * Returns: the bit rate (kbit/s)
- **/
-guint32
-nm_device_wifi_get_bitrate (NMDeviceWifi *device)
-{
- NMDeviceState state;
-
- g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), 0);
-
- state = nm_device_get_state (NM_DEVICE (device));
- switch (state) {
- case NM_DEVICE_STATE_IP_CONFIG:
- case NM_DEVICE_STATE_IP_CHECK:
- case NM_DEVICE_STATE_SECONDARIES:
- case NM_DEVICE_STATE_ACTIVATED:
- case NM_DEVICE_STATE_DEACTIVATING:
- break;
- default:
- return 0;
- }
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_WIFI_GET_PRIVATE (device)->rate;
-}
-
-/**
- * nm_device_wifi_get_capabilities:
- * @device: a #NMDeviceWifi
- *
- * Gets the Wi-Fi capabilities of the #NMDeviceWifi.
- *
- * Returns: the capabilities
- **/
-NMDeviceWifiCapabilities
-nm_device_wifi_get_capabilities (NMDeviceWifi *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), 0);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_WIFI_GET_PRIVATE (device)->wireless_caps;
-}
-
-/**
- * nm_device_wifi_get_active_access_point:
- * @device: a #NMDeviceWifi
- *
- * Gets the active #NMAccessPoint.
- *
- * Returns: (transfer none): the access point or %NULL if none is active
- **/
-NMAccessPoint *
-nm_device_wifi_get_active_access_point (NMDeviceWifi *device)
-{
- NMDeviceState state;
-
- g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), NULL);
-
- state = nm_device_get_state (NM_DEVICE (device));
- switch (state) {
- case NM_DEVICE_STATE_PREPARE:
- case NM_DEVICE_STATE_CONFIG:
- case NM_DEVICE_STATE_NEED_AUTH:
- case NM_DEVICE_STATE_IP_CONFIG:
- case NM_DEVICE_STATE_IP_CHECK:
- case NM_DEVICE_STATE_SECONDARIES:
- case NM_DEVICE_STATE_ACTIVATED:
- case NM_DEVICE_STATE_DEACTIVATING:
- break;
- default:
- return NULL;
- break;
- }
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return NM_DEVICE_WIFI_GET_PRIVATE (device)->active_ap;
-}
-
-/**
- * nm_device_wifi_get_access_points:
- * @device: a #NMDeviceWifi
- *
- * Gets all the scanned access points of the #NMDeviceWifi.
- *
- * Returns: (element-type NMAccessPoint): a #GPtrArray containing all the
- * scanned #NMAccessPoints.
- * The returned array is owned by the client and should not be modified.
- **/
-const GPtrArray *
-nm_device_wifi_get_access_points (NMDeviceWifi *device)
-{
- g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (device));
- return handle_ptr_array_return (NM_DEVICE_WIFI_GET_PRIVATE (device)->aps);
-}
-
-/**
- * nm_device_wifi_get_access_point_by_path:
- * @device: a #NMDeviceWifi
- * @path: the object path of the access point
- *
- * Gets a #NMAccessPoint by path.
- *
- * Returns: (transfer none): the access point or %NULL if none is found.
- **/
-NMAccessPoint *
-nm_device_wifi_get_access_point_by_path (NMDeviceWifi *device,
- const char *path)
-{
- const GPtrArray *aps;
- int i;
- NMAccessPoint *ap = NULL;
-
- g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), NULL);
- g_return_val_if_fail (path != NULL, NULL);
-
- aps = nm_device_wifi_get_access_points (device);
- if (!aps)
- return NULL;
-
- for (i = 0; i < aps->len; i++) {
- NMAccessPoint *candidate = g_ptr_array_index (aps, i);
- if (!strcmp (nm_object_get_path (NM_OBJECT (candidate)), path)) {
- ap = candidate;
- break;
- }
- }
-
- return ap;
-}
-
-static void
-request_scan_cb (DBusGProxy *proxy,
- DBusGProxyCall *call,
- gpointer user_data)
-{
- RequestScanInfo *info = user_data;
- NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (info->device);
- GError *error = NULL;
-
- dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID);
-
- if (info->callback)
- info->callback (info->device, error, info->user_data);
-
- g_clear_error (&error);
- g_slice_free (RequestScanInfo, info);
-
- priv->scan_call = NULL;
- priv->scan_info = NULL;
-}
-
-/**
- * nm_device_wifi_request_scan_simple:
- * @device: a #NMDeviceWifi
- * @callback: (scope async) (allow-none): the function to call when the call is done
- * @user_data: (closure): user data to pass to the callback function
- *
- * Request NM to scan for access points on the #NMDeviceWifi. This function only
- * instructs NM to perform scanning. Use nm_device_wifi_get_access_points()
- * to get available access points.
- *
- * Since: 0.9.8
- **/
-void
-nm_device_wifi_request_scan_simple (NMDeviceWifi *device,
- NMDeviceWifiRequestScanFn callback,
- gpointer user_data)
-{
- RequestScanInfo *info;
- GHashTable *options;
- NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (device);
-
- g_return_if_fail (NM_IS_DEVICE_WIFI (device));
-
- /* If a scan is in progress, just return */
- if (priv->scan_call)
- return;
-
- options = g_hash_table_new (g_str_hash, g_str_equal);
-
- info = g_slice_new0 (RequestScanInfo);
- info->device = device;
- info->callback = callback;
- info->user_data = user_data;
-
- priv->scan_info = info;
- priv->scan_call = dbus_g_proxy_begin_call (NM_DEVICE_WIFI_GET_PRIVATE (device)->proxy, "RequestScan",
- request_scan_cb, info, NULL,
- DBUS_TYPE_G_MAP_OF_VARIANT, options,
- G_TYPE_INVALID);
-
- g_hash_table_unref (options);
-}
-
-static void
-clean_up_aps (NMDeviceWifi *self, gboolean notify)
-{
- NMDeviceWifiPrivate *priv;
-
- g_return_if_fail (NM_IS_DEVICE_WIFI (self));
-
- priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
-
- if (priv->active_ap) {
- g_object_unref (priv->active_ap);
- priv->active_ap = NULL;
- }
-
- if (priv->aps) {
- while (priv->aps->len) {
- NMAccessPoint *ap = NM_ACCESS_POINT (g_ptr_array_index (priv->aps, 0));
-
- if (notify)
- g_signal_emit (self, signals[ACCESS_POINT_REMOVED], 0, ap);
- g_ptr_array_remove (priv->aps, ap);
- g_object_unref (ap);
- }
- g_ptr_array_free (priv->aps, TRUE);
- priv->aps = NULL;
- }
-}
-
-/**
- * _nm_device_wifi_set_wireless_enabled:
- * @device: a #NMDeviceWifi
- * @enabled: %TRUE to enable the device
- *
- * Enables or disables the wireless device.
- **/
-void
-_nm_device_wifi_set_wireless_enabled (NMDeviceWifi *device,
- gboolean enabled)
-{
- g_return_if_fail (NM_IS_DEVICE_WIFI (device));
-
- if (!enabled)
- clean_up_aps (device, TRUE);
-}
-
-#define WPA_CAPS (NM_WIFI_DEVICE_CAP_CIPHER_TKIP | \
- NM_WIFI_DEVICE_CAP_CIPHER_CCMP | \
- NM_WIFI_DEVICE_CAP_WPA | \
- NM_WIFI_DEVICE_CAP_RSN)
-
-#define RSN_CAPS (NM_WIFI_DEVICE_CAP_CIPHER_CCMP | NM_WIFI_DEVICE_CAP_RSN)
-
-static gboolean
-has_proto (NMSettingWirelessSecurity *s_wsec, const char *proto)
-{
- int i;
-
- for (i = 0; i < nm_setting_wireless_security_get_num_protos (s_wsec); i++) {
- if (g_strcmp0 (proto, nm_setting_wireless_security_get_proto (s_wsec, i)) == 0)
- return TRUE;
- }
- return FALSE;
-}
-
-static gboolean
-connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
-{
- NMSettingConnection *s_con;
- NMSettingWireless *s_wifi;
- NMSettingWirelessSecurity *s_wsec;
- const char *ctype;
- const GByteArray *mac;
- const char *hw_str;
- struct ether_addr *hw_mac;
- NMDeviceWifiCapabilities wifi_caps;
- const char *key_mgmt;
-
- s_con = nm_connection_get_setting_connection (connection);
- g_assert (s_con);
-
- ctype = nm_setting_connection_get_connection_type (s_con);
- if (strcmp (ctype, NM_SETTING_WIRELESS_SETTING_NAME) != 0) {
- g_set_error (error, NM_DEVICE_WIFI_ERROR, NM_DEVICE_WIFI_ERROR_NOT_WIFI_CONNECTION,
- "The connection was not a Wi-Fi connection.");
- return FALSE;
- }
-
- s_wifi = nm_connection_get_setting_wireless (connection);
- if (!s_wifi) {
- g_set_error (error, NM_DEVICE_WIFI_ERROR, NM_DEVICE_WIFI_ERROR_INVALID_WIFI_CONNECTION,
- "The connection was not a valid Wi-Fi connection.");
- return FALSE;
- }
-
- /* Check MAC address */
- hw_str = nm_device_wifi_get_permanent_hw_address (NM_DEVICE_WIFI (device));
- if (hw_str) {
- hw_mac = ether_aton (hw_str);
- if (!hw_mac) {
- g_set_error (error, NM_DEVICE_WIFI_ERROR, NM_DEVICE_WIFI_ERROR_INVALID_DEVICE_MAC,
- "Invalid device MAC address.");
- return FALSE;
- }
- mac = nm_setting_wireless_get_mac_address (s_wifi);
- if (mac && hw_mac && memcmp (mac->data, hw_mac->ether_addr_octet, ETH_ALEN)) {
- g_set_error (error, NM_DEVICE_WIFI_ERROR, NM_DEVICE_WIFI_ERROR_MAC_MISMATCH,
- "The MACs of the device and the connection didn't match.");
- return FALSE;
- }
- }
-
- /* Check device capabilities; we assume all devices can do WEP at least */
- wifi_caps = nm_device_wifi_get_capabilities (NM_DEVICE_WIFI (device));
-
- s_wsec = nm_connection_get_setting_wireless_security (connection);
- if (s_wsec) {
- /* Connection has security, verify it against the device's capabilities */
- key_mgmt = nm_setting_wireless_security_get_key_mgmt (s_wsec);
- if ( !g_strcmp0 (key_mgmt, "wpa-none")
- || !g_strcmp0 (key_mgmt, "wpa-psk")
- || !g_strcmp0 (key_mgmt, "wpa-eap")) {
-
- /* Is device only WEP capable? */
- if (!(wifi_caps & WPA_CAPS)) {
- g_set_error (error, NM_DEVICE_WIFI_ERROR, NM_DEVICE_WIFI_ERROR_MISSING_DEVICE_WPA_CAPS,
- "The device missed WPA capabilities required by the connection.");
- return FALSE;
- }
-
- /* Make sure WPA2/RSN-only connections don't get chosen for WPA-only cards */
- if (has_proto (s_wsec, "rsn") && !has_proto (s_wsec, "wpa") && !(wifi_caps & RSN_CAPS)) {
- g_set_error (error, NM_DEVICE_WIFI_ERROR, NM_DEVICE_WIFI_ERROR_MISSING_DEVICE_RSN_CAPS,
- "The device missed WPA2/RSN capabilities required by the connection.");
- return FALSE;
- }
- }
- }
-
- return NM_DEVICE_CLASS (nm_device_wifi_parent_class)->connection_compatible (device, connection, error);
-}
-
-static GType
-get_setting_type (NMDevice *device)
-{
- return NM_TYPE_SETTING_WIRELESS;
-}
-
-static const char *
-get_hw_address (NMDevice *device)
-{
- return nm_device_wifi_get_hw_address (NM_DEVICE_WIFI (device));
-}
-
-/*****************************************************************************/
-
-static void
-nm_device_wifi_init (NMDeviceWifi *device)
-{
- _nm_device_set_device_type (NM_DEVICE (device), NM_DEVICE_TYPE_WIFI);
-}
-
-static void
-get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- NMDeviceWifi *self = NM_DEVICE_WIFI (object);
-
- _nm_object_ensure_inited (NM_OBJECT (object));
-
- switch (prop_id) {
- case PROP_HW_ADDRESS:
- g_value_set_string (value, nm_device_wifi_get_hw_address (self));
- break;
- case PROP_PERM_HW_ADDRESS:
- g_value_set_string (value, nm_device_wifi_get_permanent_hw_address (self));
- break;
- case PROP_MODE:
- g_value_set_uint (value, nm_device_wifi_get_mode (self));
- break;
- case PROP_BITRATE:
- g_value_set_uint (value, nm_device_wifi_get_bitrate (self));
- break;
- case PROP_ACTIVE_ACCESS_POINT:
- g_value_set_object (value, nm_device_wifi_get_active_access_point (self));
- break;
- case PROP_WIRELESS_CAPABILITIES:
- g_value_set_uint (value, nm_device_wifi_get_capabilities (self));
- break;
- case PROP_ACCESS_POINTS:
- g_value_set_boxed (value, nm_device_wifi_get_access_points (self));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-state_changed_cb (NMDevice *device, GParamSpec *pspec, gpointer user_data)
-{
- NMDeviceWifi *self = NM_DEVICE_WIFI (device);
- NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
-
- switch (nm_device_get_state (device)) {
- case NM_DEVICE_STATE_UNKNOWN:
- case NM_DEVICE_STATE_UNMANAGED:
- case NM_DEVICE_STATE_UNAVAILABLE:
- case NM_DEVICE_STATE_DISCONNECTED:
- case NM_DEVICE_STATE_FAILED:
- /* Just clear active AP; don't clear the AP list unless wireless is disabled completely */
- if (priv->active_ap) {
- g_object_unref (priv->active_ap);
- priv->active_ap = NULL;
- }
- _nm_object_queue_notify (NM_OBJECT (device), NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT);
- priv->rate = 0;
- _nm_object_queue_notify (NM_OBJECT (device), NM_DEVICE_WIFI_BITRATE);
- break;
- default:
- break;
- }
-}
-
-static void
-register_properties (NMDeviceWifi *device)
-{
- NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (device);
- const NMPropertiesInfo property_info[] = {
- { NM_DEVICE_WIFI_HW_ADDRESS, &priv->hw_address },
- { NM_DEVICE_WIFI_PERMANENT_HW_ADDRESS, &priv->perm_hw_address },
- { NM_DEVICE_WIFI_MODE, &priv->mode },
- { NM_DEVICE_WIFI_BITRATE, &priv->rate },
- { NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT, &priv->active_ap, NULL, NM_TYPE_ACCESS_POINT },
- { NM_DEVICE_WIFI_CAPABILITIES, &priv->wireless_caps },
- { NM_DEVICE_WIFI_ACCESS_POINTS, &priv->aps, NULL, NM_TYPE_ACCESS_POINT, "access-point" },
- { NULL },
- };
-
- _nm_object_register_properties (NM_OBJECT (device),
- priv->proxy,
- property_info);
-}
-
-static void
-access_point_removed (NMDeviceWifi *self, NMAccessPoint *ap)
-{
- NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
-
- if (ap == priv->active_ap) {
- g_object_unref (priv->active_ap);
- priv->active_ap = NULL;
- _nm_object_queue_notify (NM_OBJECT (self), NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT);
-
- priv->rate = 0;
- _nm_object_queue_notify (NM_OBJECT (self), NM_DEVICE_WIFI_BITRATE);
- }
-}
-
-static void
-constructed (GObject *object)
-{
- NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (object);
-
- G_OBJECT_CLASS (nm_device_wifi_parent_class)->constructed (object);
-
- priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE_WIRELESS);
- register_properties (NM_DEVICE_WIFI (object));
-
- g_signal_connect (NM_DEVICE (object),
- "notify::" NM_DEVICE_STATE,
- G_CALLBACK (state_changed_cb),
- NULL);
-}
-
-static void
-dispose (GObject *object)
-{
- NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (object);
- GError *error = NULL;
-
- if (priv->scan_call) {
- g_set_error_literal (&error, NM_DEVICE_WIFI_ERROR, NM_DEVICE_WIFI_ERROR_UNKNOWN,
- "Wi-Fi device was destroyed");
- if (priv->scan_info) {
- if (priv->scan_info->callback)
- priv->scan_info->callback (NULL, error, priv->scan_info->user_data);
- g_slice_free (RequestScanInfo, priv->scan_info);
- priv->scan_info = NULL;
- }
- g_clear_error (&error);
-
- dbus_g_proxy_cancel_call (priv->proxy, priv->scan_call);
- priv->scan_call = NULL;
- }
-
- clean_up_aps (NM_DEVICE_WIFI (object), FALSE);
- g_clear_object (&priv->proxy);
-
- G_OBJECT_CLASS (nm_device_wifi_parent_class)->dispose (object);
-}
-
-static void
-finalize (GObject *object)
-{
- NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (object);
-
- g_free (priv->hw_address);
- g_free (priv->perm_hw_address);
-
- G_OBJECT_CLASS (nm_device_wifi_parent_class)->finalize (object);
-}
-
-static void
-nm_device_wifi_class_init (NMDeviceWifiClass *wifi_class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (wifi_class);
- NMDeviceClass *device_class = NM_DEVICE_CLASS (wifi_class);
-
- g_type_class_add_private (wifi_class, sizeof (NMDeviceWifiPrivate));
-
- /* virtual methods */
- object_class->constructed = constructed;
- object_class->get_property = get_property;
- object_class->dispose = dispose;
- object_class->finalize = finalize;
- device_class->connection_compatible = connection_compatible;
- device_class->get_setting_type = get_setting_type;
- device_class->get_hw_address = get_hw_address;
- wifi_class->access_point_removed = access_point_removed;
-
- /* properties */
-
- /**
- * NMDeviceWifi:hw-address:
- *
- * The hardware (MAC) address of the device.
- **/
- g_object_class_install_property
- (object_class, PROP_HW_ADDRESS,
- g_param_spec_string (NM_DEVICE_WIFI_HW_ADDRESS, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceWifi:perm-hw-address:
- *
- * The hardware (MAC) address of the device.
- **/
- g_object_class_install_property
- (object_class, PROP_PERM_HW_ADDRESS,
- g_param_spec_string (NM_DEVICE_WIFI_PERMANENT_HW_ADDRESS, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceWifi:mode:
- *
- * The mode of the device.
- **/
- g_object_class_install_property
- (object_class, PROP_MODE,
- g_param_spec_uint (NM_DEVICE_WIFI_MODE, "", "",
- NM_802_11_MODE_UNKNOWN, NM_802_11_MODE_AP, NM_802_11_MODE_INFRA,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceWifi:bitrate:
- *
- * The bit rate of the device in kbit/s.
- **/
- g_object_class_install_property
- (object_class, PROP_BITRATE,
- g_param_spec_uint (NM_DEVICE_WIFI_BITRATE, "", "",
- 0, G_MAXUINT32, 0,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceWifi:active-access-point:
- *
- * The active #NMAccessPoint of the device.
- **/
- g_object_class_install_property
- (object_class, PROP_ACTIVE_ACCESS_POINT,
- g_param_spec_object (NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT, "", "",
- NM_TYPE_ACCESS_POINT,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceWifi:wireless-capabilities:
- *
- * The wireless capabilities of the device.
- **/
- g_object_class_install_property
- (object_class, PROP_WIRELESS_CAPABILITIES,
- g_param_spec_uint (NM_DEVICE_WIFI_CAPABILITIES, "", "",
- 0, G_MAXUINT32, 0,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceWifi:access-points:
- *
- * List of all Wi-Fi access points the device can see.
- *
- * Since: 0.9.10
- **/
- g_object_class_install_property
- (object_class, PROP_ACCESS_POINTS,
- g_param_spec_boxed (NM_DEVICE_WIFI_ACCESS_POINTS, "", "",
- NM_TYPE_OBJECT_ARRAY,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /* signals */
-
- /**
- * NMDeviceWifi::access-point-added:
- * @device: the Wi-Fi device that received the signal
- * @ap: the new access point
- *
- * Notifies that a #NMAccessPoint is added to the Wi-Fi device.
- **/
- signals[ACCESS_POINT_ADDED] =
- g_signal_new ("access-point-added",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (NMDeviceWifiClass, access_point_added),
- NULL, NULL,
- g_cclosure_marshal_VOID__OBJECT,
- G_TYPE_NONE, 1,
- G_TYPE_OBJECT);
-
- /**
- * NMDeviceWifi::access-point-removed:
- * @device: the Wi-Fi device that received the signal
- * @ap: the removed access point
- *
- * Notifies that a #NMAccessPoint is removed from the Wi-Fi device.
- **/
- signals[ACCESS_POINT_REMOVED] =
- g_signal_new ("access-point-removed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (NMDeviceWifiClass, access_point_removed),
- NULL, NULL,
- g_cclosure_marshal_VOID__OBJECT,
- G_TYPE_NONE, 1,
- G_TYPE_OBJECT);
-}
diff --git a/libnm-glib/nm-device-wifi.h b/libnm-glib/nm-device-wifi.h
deleted file mode 100644
index 2bb432a7b..000000000
--- a/libnm-glib/nm-device-wifi.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2007 - 2008 Novell, Inc.
- * Copyright 2007 - 2012 Red Hat, Inc.
- */
-
-#ifndef NM_DEVICE_WIFI_H
-#define NM_DEVICE_WIFI_H
-
-#include "nm-device.h"
-#include "nm-access-point.h"
-
-G_BEGIN_DECLS
-
-#define NM_TYPE_DEVICE_WIFI (nm_device_wifi_get_type ())
-#define NM_DEVICE_WIFI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_WIFI, NMDeviceWifi))
-#define NM_DEVICE_WIFI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_WIFI, NMDeviceWifiClass))
-#define NM_IS_DEVICE_WIFI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_WIFI))
-#define NM_IS_DEVICE_WIFI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_WIFI))
-#define NM_DEVICE_WIFI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_WIFI, NMDeviceWifiClass))
-
-/**
- * NMDeviceWifiError:
- * @NM_DEVICE_WIFI_ERROR_UNKNOWN: unknown or unclassified error
- * @NM_DEVICE_WIFI_ERROR_NOT_WIFI_CONNECTION: the connection was not of Wi-Fi type
- * @NM_DEVICE_WIFI_ERROR_INVALID_WIFI_CONNECTION: the Wi-Fi connection was invalid
- * @NM_DEVICE_WIFI_ERROR_INVALID_DEVICE_MAC: the device's MAC was invalid
- * @NM_DEVICE_WIFI_ERROR_MAC_MISMATCH: the MACs of the connection and the device mismatched
- * @NM_DEVICE_WIFI_ERROR_MISSING_DEVICE_WPA_CAPS: the device missed WPA capabilities
- * required by the connection
- * @NM_DEVICE_WIFI_ERROR_MISSING_DEVICE_RSN_CAPS: the device missed RSN capabilities
- * required by the connection
- */
-typedef enum {
- NM_DEVICE_WIFI_ERROR_UNKNOWN = 0, /*< nick=UnknownError >*/
- NM_DEVICE_WIFI_ERROR_NOT_WIFI_CONNECTION, /*< nick=NotWifiConnection >*/
- NM_DEVICE_WIFI_ERROR_INVALID_WIFI_CONNECTION, /*< nick=InvalidWifiConnection >*/
- NM_DEVICE_WIFI_ERROR_INVALID_DEVICE_MAC, /*< nick=InvalidDeviceMac >*/
- NM_DEVICE_WIFI_ERROR_MAC_MISMATCH, /*< nick=MacMismatch >*/
- NM_DEVICE_WIFI_ERROR_MISSING_DEVICE_WPA_CAPS, /*< nick=MissingDeviceWpaCaps >*/
- NM_DEVICE_WIFI_ERROR_MISSING_DEVICE_RSN_CAPS, /*< nick=MissingDeviceRsnCaps >*/
-} NMDeviceWifiError;
-
-#define NM_DEVICE_WIFI_ERROR nm_device_wifi_error_quark ()
-GQuark nm_device_wifi_error_quark (void);
-
-#define NM_DEVICE_WIFI_HW_ADDRESS "hw-address"
-#define NM_DEVICE_WIFI_PERMANENT_HW_ADDRESS "perm-hw-address"
-#define NM_DEVICE_WIFI_MODE "mode"
-#define NM_DEVICE_WIFI_BITRATE "bitrate"
-#define NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT "active-access-point"
-#define NM_DEVICE_WIFI_CAPABILITIES "wireless-capabilities"
-#define NM_DEVICE_WIFI_ACCESS_POINTS "access-points"
-
-typedef struct {
- NMDevice parent;
-} NMDeviceWifi;
-
-typedef struct {
- NMDeviceClass parent;
-
- /* Signals */
- void (*access_point_added) (NMDeviceWifi *device, NMAccessPoint *ap);
- void (*access_point_removed) (NMDeviceWifi *device, NMAccessPoint *ap);
-
- /* Padding for future expansion */
- void (*_reserved1) (void);
- void (*_reserved2) (void);
- void (*_reserved3) (void);
- void (*_reserved4) (void);
- void (*_reserved5) (void);
- void (*_reserved6) (void);
-} NMDeviceWifiClass;
-
-GType nm_device_wifi_get_type (void);
-
-GObject *nm_device_wifi_new (DBusGConnection *connection, const char *path);
-
-const char * nm_device_wifi_get_hw_address (NMDeviceWifi *device);
-const char * nm_device_wifi_get_permanent_hw_address (NMDeviceWifi *device);
-NM80211Mode nm_device_wifi_get_mode (NMDeviceWifi *device);
-guint32 nm_device_wifi_get_bitrate (NMDeviceWifi *device);
-NMDeviceWifiCapabilities nm_device_wifi_get_capabilities (NMDeviceWifi *device);
-NMAccessPoint * nm_device_wifi_get_active_access_point (NMDeviceWifi *device);
-
-NMAccessPoint * nm_device_wifi_get_access_point_by_path (NMDeviceWifi *device,
- const char *path);
-
-const GPtrArray * nm_device_wifi_get_access_points (NMDeviceWifi *device);
-
-typedef void (*NMDeviceWifiRequestScanFn) (NMDeviceWifi *device,
- GError *error,
- gpointer user_data);
-void nm_device_wifi_request_scan_simple (NMDeviceWifi *device,
- NMDeviceWifiRequestScanFn callback,
- gpointer user_data);
-
-G_END_DECLS
-
-#endif /* NM_DEVICE_WIFI_H */
diff --git a/libnm-glib/nm-device-wimax.c b/libnm-glib/nm-device-wimax.c
deleted file mode 100644
index 3465475a4..000000000
--- a/libnm-glib/nm-device-wimax.c
+++ /dev/null
@@ -1,795 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2011 - 2012 Red Hat, Inc.
- * Copyright 2009 Novell, Inc.
- */
-
-#include "nm-default.h"
-
-#include <string.h>
-#include <netinet/ether.h>
-
-#include "nm-setting-connection.h"
-#include "nm-setting-wimax.h"
-
-#include "nm-device-wimax.h"
-#include "nm-object-private.h"
-#include "nm-object-cache.h"
-#include "nm-dbus-glib-types.h"
-#include "nm-types-private.h"
-#include "nm-device-private.h"
-
-G_DEFINE_TYPE (NMDeviceWimax, nm_device_wimax, NM_TYPE_DEVICE)
-
-#define NM_DEVICE_WIMAX_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_WIMAX, NMDeviceWimaxPrivate))
-
-void _nm_device_wimax_set_wireless_enabled (NMDeviceWimax *wimax, gboolean enabled);
-
-typedef struct {
- DBusGProxy *proxy;
-
- char *hw_address;
- NMWimaxNsp *active_nsp;
- GPtrArray *nsps;
-
- guint center_freq;
- int rssi;
- int cinr;
- int tx_power;
- char *bsid;
-} NMDeviceWimaxPrivate;
-
-enum {
- PROP_0,
- PROP_HW_ADDRESS,
- PROP_ACTIVE_NSP,
- PROP_CENTER_FREQ,
- PROP_RSSI,
- PROP_CINR,
- PROP_TX_POWER,
- PROP_BSID,
- PROP_NSPS,
-
- LAST_PROP
-};
-
-enum {
- NSP_ADDED,
- NSP_REMOVED,
-
- LAST_SIGNAL
-};
-static guint signals[LAST_SIGNAL] = { 0 };
-
-/**
- * nm_device_wimax_error_quark:
- *
- * Registers an error quark for #NMDeviceWimax if necessary.
- *
- * Returns: the error quark used for #NMDeviceWimax errors.
- *
- * Deprecated: 1.2: WiMAX is no longer supported.
- **/
-GQuark
-nm_device_wimax_error_quark (void)
-{
- static GQuark quark = 0;
-
- if (G_UNLIKELY (quark == 0))
- quark = g_quark_from_static_string ("nm-device-wimax-error-quark");
- return quark;
-}
-
-/**
- * nm_device_wimax_new:
- * @connection: the #DBusGConnection
- * @path: the D-Bus object path of the WiMAX device
- *
- * Creates a new #NMDeviceWimax.
- *
- * Returns: (transfer full): a new WiMAX device
- *
- * Deprecated: 1.2: WiMAX is no longer supported.
- **/
-GObject *
-nm_device_wimax_new (DBusGConnection *connection, const char *path)
-{
- GObject *device;
-
- g_return_val_if_fail (connection != NULL, NULL);
- g_return_val_if_fail (path != NULL, NULL);
-
- device = g_object_new (NM_TYPE_DEVICE_WIMAX,
- NM_OBJECT_DBUS_CONNECTION, connection,
- NM_OBJECT_DBUS_PATH, path,
- NULL);
- _nm_object_ensure_inited (NM_OBJECT (device));
- return device;
-}
-
-/**
- * nm_device_wimax_get_hw_address:
- * @wimax: a #NMDeviceWimax
- *
- * Gets the hardware (MAC) address of the #NMDeviceWimax
- *
- * Returns: the hardware address. This is the internal string used by the
- * device, and must not be modified.
- *
- * Deprecated: 1.2: WiMAX is no longer supported.
- **/
-const char *
-nm_device_wimax_get_hw_address (NMDeviceWimax *wimax)
-{
- g_return_val_if_fail (NM_IS_DEVICE_WIMAX (wimax), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (wimax));
- return NM_DEVICE_WIMAX_GET_PRIVATE (wimax)->hw_address;
-}
-
-/**
- * nm_device_wimax_get_active_nsp:
- * @wimax: a #NMDeviceWimax
- *
- * Gets the active #NMWimaxNsp.
- *
- * Returns: (transfer full): the access point or %NULL if none is active
- *
- * Deprecated: 1.2: WiMAX is no longer supported.
- **/
-NMWimaxNsp *
-nm_device_wimax_get_active_nsp (NMDeviceWimax *wimax)
-{
- NMDeviceState state;
-
- g_return_val_if_fail (NM_IS_DEVICE_WIMAX (wimax), NULL);
-
- state = nm_device_get_state (NM_DEVICE (wimax));
- switch (state) {
- case NM_DEVICE_STATE_PREPARE:
- case NM_DEVICE_STATE_CONFIG:
- case NM_DEVICE_STATE_NEED_AUTH:
- case NM_DEVICE_STATE_IP_CONFIG:
- case NM_DEVICE_STATE_IP_CHECK:
- case NM_DEVICE_STATE_SECONDARIES:
- case NM_DEVICE_STATE_ACTIVATED:
- case NM_DEVICE_STATE_DEACTIVATING:
- break;
- default:
- return NULL;
- break;
- }
-
- _nm_object_ensure_inited (NM_OBJECT (wimax));
- return NM_DEVICE_WIMAX_GET_PRIVATE (wimax)->active_nsp;
-}
-
-/**
- * nm_device_wimax_get_nsps:
- * @wimax: a #NMDeviceWimax
- *
- * Gets all the scanned NSPs of the #NMDeviceWimax.
- *
- * Returns: (element-type NMWimaxNsp): a #GPtrArray containing
- * all the scanned #NMWimaxNsps.
- * The returned array is owned by the client and should not be modified.
- *
- * Deprecated: 1.2: WiMAX is no longer supported.
- **/
-const GPtrArray *
-nm_device_wimax_get_nsps (NMDeviceWimax *wimax)
-{
- g_return_val_if_fail (NM_IS_DEVICE_WIMAX (wimax), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (wimax));
- return handle_ptr_array_return (NM_DEVICE_WIMAX_GET_PRIVATE (wimax)->nsps);
-}
-
-/**
- * nm_device_wimax_get_nsp_by_path:
- * @wimax: a #NMDeviceWimax
- * @path: the object path of the NSP
- *
- * Gets a #NMWimaxNsp by path.
- *
- * Returns: (transfer none): the access point or %NULL if none is found.
- *
- * Deprecated: 1.2: WiMAX is no longer supported.
- **/
-NMWimaxNsp *
-nm_device_wimax_get_nsp_by_path (NMDeviceWimax *wimax,
- const char *path)
-{
- const GPtrArray *nsps;
- int i;
- NMWimaxNsp *nsp = NULL;
-
- g_return_val_if_fail (NM_IS_DEVICE_WIMAX (wimax), NULL);
- g_return_val_if_fail (path != NULL, NULL);
-
- nsps = nm_device_wimax_get_nsps (wimax);
- if (!nsps)
- return NULL;
-
- for (i = 0; i < nsps->len; i++) {
- NMWimaxNsp *candidate = g_ptr_array_index (nsps, i);
- if (!strcmp (nm_object_get_path (NM_OBJECT (candidate)), path)) {
- nsp = candidate;
- break;
- }
- }
-
- return nsp;
-}
-
-static void
-clean_up_nsps (NMDeviceWimax *self, gboolean notify)
-{
- NMDeviceWimaxPrivate *priv;
-
- g_return_if_fail (NM_IS_DEVICE_WIMAX (self));
-
- priv = NM_DEVICE_WIMAX_GET_PRIVATE (self);
-
- if (priv->active_nsp) {
- g_object_unref (priv->active_nsp);
- priv->active_nsp = NULL;
- }
-
- if (priv->nsps) {
- while (priv->nsps->len) {
- NMWimaxNsp *nsp = NM_WIMAX_NSP (g_ptr_array_index (priv->nsps, 0));
-
- if (notify)
- g_signal_emit (self, signals[NSP_REMOVED], 0, nsp);
- g_ptr_array_remove (priv->nsps, nsp);
- g_object_unref (nsp);
- }
- g_ptr_array_free (priv->nsps, TRUE);
- priv->nsps = NULL;
- }
-}
-
-/**
- * nm_device_wimax_get_center_frequency:
- * @self: a #NMDeviceWimax
- *
- * Gets the center frequency (in KHz) of the radio channel the device is using
- * to communicate with the network when connected. Has no meaning when the
- * device is not connected.
- *
- * Returns: the center frequency in KHz, or 0
- *
- * Deprecated: 1.2: WiMAX is no longer supported.
- **/
-guint
-nm_device_wimax_get_center_frequency (NMDeviceWimax *self)
-{
- g_return_val_if_fail (NM_IS_DEVICE_WIMAX (self), 0);
-
- _nm_object_ensure_inited (NM_OBJECT (self));
- return NM_DEVICE_WIMAX_GET_PRIVATE (self)->center_freq;
-}
-
-/**
- * nm_device_wimax_get_rssi:
- * @self: a #NMDeviceWimax
- *
- * Gets the RSSI of the current radio link in dBm. This value indicates how
- * strong the raw received RF signal from the base station is, but does not
- * indicate the overall quality of the radio link. Has no meaning when the
- * device is not connected.
- *
- * Returns: the RSSI in dBm, or 0
- *
- * Deprecated: 1.2: WiMAX is no longer supported.
- **/
-int
-nm_device_wimax_get_rssi (NMDeviceWimax *self)
-{
- g_return_val_if_fail (NM_IS_DEVICE_WIMAX (self), 0);
-
- _nm_object_ensure_inited (NM_OBJECT (self));
- return NM_DEVICE_WIMAX_GET_PRIVATE (self)->rssi;
-}
-
-/**
- * nm_device_wimax_get_cinr:
- * @self: a #NMDeviceWimax
- *
- * Gets the CINR (Carrier to Interference + Noise Ratio) of the current radio
- * link in dB. CINR is a more accurate measure of radio link quality. Has no
- * meaning when the device is not connected.
- *
- * Returns: the CINR in dB, or 0
- *
- * Deprecated: 1.2: WiMAX is no longer supported.
- **/
-int
-nm_device_wimax_get_cinr (NMDeviceWimax *self)
-{
- g_return_val_if_fail (NM_IS_DEVICE_WIMAX (self), 0);
-
- _nm_object_ensure_inited (NM_OBJECT (self));
- return NM_DEVICE_WIMAX_GET_PRIVATE (self)->cinr;
-}
-
-/**
- * nm_device_wimax_get_tx_power:
- * @self: a #NMDeviceWimax
- *
- * Average power of the last burst transmitted by the device, in units of
- * 0.5 dBm. i.e. a TxPower of -11 represents an actual device TX power of
- * -5.5 dBm. Has no meaning when the device is not connected.
- *
- * Returns: the TX power in dBm, or 0
- *
- * Deprecated: 1.2: WiMAX is no longer supported.
- **/
-int
-nm_device_wimax_get_tx_power (NMDeviceWimax *self)
-{
- g_return_val_if_fail (NM_IS_DEVICE_WIMAX (self), 0);
-
- _nm_object_ensure_inited (NM_OBJECT (self));
- return NM_DEVICE_WIMAX_GET_PRIVATE (self)->tx_power;
-}
-
-/**
- * nm_device_wimax_get_bsid:
- * @self: a #NMDeviceWimax
- *
- * Gets the ID of the serving Base Station when the device is connected.
- *
- * Returns: the ID of the serving Base Station, or %NULL
- *
- * Deprecated: 1.2: WiMAX is no longer supported.
- **/
-const char *
-nm_device_wimax_get_bsid (NMDeviceWimax *self)
-{
- g_return_val_if_fail (NM_IS_DEVICE_WIMAX (self), NULL);
-
- _nm_object_ensure_inited (NM_OBJECT (self));
- return NM_DEVICE_WIMAX_GET_PRIVATE (self)->bsid;
-}
-
-static gboolean
-connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
-{
- NMSettingConnection *s_con;
- NMSettingWimax *s_wimax;
- const char *ctype;
- const GByteArray *mac;
- const char *hw_str;
- struct ether_addr *hw_mac;
-
- s_con = nm_connection_get_setting_connection (connection);
- g_assert (s_con);
-
- ctype = nm_setting_connection_get_connection_type (s_con);
- if (strcmp (ctype, NM_SETTING_WIMAX_SETTING_NAME) != 0) {
- g_set_error (error, NM_DEVICE_WIMAX_ERROR, NM_DEVICE_WIMAX_ERROR_NOT_WIMAX_CONNECTION,
- "The connection was not a Wimax connection.");
- return FALSE;
- }
-
- s_wimax = nm_connection_get_setting_wimax (connection);
- if (!s_wimax) {
- g_set_error (error, NM_DEVICE_WIMAX_ERROR, NM_DEVICE_WIMAX_ERROR_INVALID_WIMAX_CONNECTION,
- "The connection was not a valid Wimax connection.");
- return FALSE;
- }
-
- /* Check MAC address */
- hw_str = nm_device_wimax_get_hw_address (NM_DEVICE_WIMAX (device));
- if (hw_str) {
- hw_mac = ether_aton (hw_str);
- if (!hw_mac) {
- g_set_error (error, NM_DEVICE_WIMAX_ERROR, NM_DEVICE_WIMAX_ERROR_INVALID_DEVICE_MAC,
- "Invalid device MAC address.");
- return FALSE;
- }
- mac = nm_setting_wimax_get_mac_address (s_wimax);
- if (mac && hw_mac && memcmp (mac->data, hw_mac->ether_addr_octet, ETH_ALEN)) {
- g_set_error (error, NM_DEVICE_WIMAX_ERROR, NM_DEVICE_WIMAX_ERROR_MAC_MISMATCH,
- "The MACs of the device and the connection didn't match.");
- return FALSE;
- }
- }
-
- return NM_DEVICE_CLASS (nm_device_wimax_parent_class)->connection_compatible (device, connection, error);
-}
-
-static GType
-get_setting_type (NMDevice *device)
-{
- return NM_TYPE_SETTING_WIMAX;
-}
-
-static const char *
-get_hw_address (NMDevice *device)
-{
- return nm_device_wimax_get_hw_address (NM_DEVICE_WIMAX (device));
-}
-
-/*****************************************************************************/
-
-static void
-nm_device_wimax_init (NMDeviceWimax *device)
-{
- _nm_device_set_device_type (NM_DEVICE (device), NM_DEVICE_TYPE_WIMAX);
-}
-
-static void
-get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- NMDeviceWimax *self = NM_DEVICE_WIMAX (object);
-
- _nm_object_ensure_inited (NM_OBJECT (object));
-
- switch (prop_id) {
- case PROP_HW_ADDRESS:
- g_value_set_string (value, nm_device_wimax_get_hw_address (self));
- break;
- case PROP_ACTIVE_NSP:
- g_value_set_object (value, nm_device_wimax_get_active_nsp (self));
- break;
- case PROP_CENTER_FREQ:
- g_value_set_uint (value, nm_device_wimax_get_center_frequency (self));
- break;
- case PROP_RSSI:
- g_value_set_int (value, nm_device_wimax_get_rssi (self));
- break;
- case PROP_CINR:
- g_value_set_int (value, nm_device_wimax_get_cinr (self));
- break;
- case PROP_TX_POWER:
- g_value_set_int (value, nm_device_wimax_get_tx_power (self));
- break;
- case PROP_BSID:
- g_value_set_string (value, nm_device_wimax_get_bsid (self));
- break;
- case PROP_NSPS:
- g_value_set_boxed (value, nm_device_wimax_get_nsps (self));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-clear_link_status (NMDeviceWimax *self)
-{
- NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (self);
-
- if (priv->center_freq) {
- priv->center_freq = 0;
- _nm_object_queue_notify (NM_OBJECT (self), NM_DEVICE_WIMAX_CENTER_FREQUENCY);
- }
-
- if (priv->rssi) {
- priv->rssi = 0;
- _nm_object_queue_notify (NM_OBJECT (self), NM_DEVICE_WIMAX_RSSI);
- }
-
- if (priv->cinr) {
- priv->cinr = 0;
- _nm_object_queue_notify (NM_OBJECT (self), NM_DEVICE_WIMAX_CINR);
- }
-
- if (priv->tx_power) {
- priv->tx_power = 0;
- _nm_object_queue_notify (NM_OBJECT (self), NM_DEVICE_WIMAX_TX_POWER);
- }
-
- if (priv->bsid) {
- g_free (priv->bsid);
- priv->bsid = NULL;
- _nm_object_queue_notify (NM_OBJECT (self), NM_DEVICE_WIMAX_BSID);
- }
-}
-
-static void
-state_changed_cb (NMDevice *device, GParamSpec *pspec, gpointer user_data)
-{
- NMDeviceWimax *self = NM_DEVICE_WIMAX (device);
- NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (self);
- NMDeviceState state;
-
- state = nm_device_get_state (device);
- switch (state) {
- case NM_DEVICE_STATE_UNKNOWN:
- case NM_DEVICE_STATE_UNMANAGED:
- case NM_DEVICE_STATE_UNAVAILABLE:
- case NM_DEVICE_STATE_DISCONNECTED:
- case NM_DEVICE_STATE_FAILED:
- if (priv->active_nsp) {
- g_object_unref (priv->active_nsp);
- priv->active_nsp = NULL;
- }
- _nm_object_queue_notify (NM_OBJECT (device), NM_DEVICE_WIMAX_ACTIVE_NSP);
- clear_link_status (self);
- break;
- case NM_DEVICE_STATE_PREPARE:
- case NM_DEVICE_STATE_CONFIG:
- case NM_DEVICE_STATE_NEED_AUTH:
- case NM_DEVICE_STATE_IP_CONFIG:
- clear_link_status (self);
- break;
- default:
- break;
- }
-}
-
-static void
-register_properties (NMDeviceWimax *wimax)
-{
- NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (wimax);
- const NMPropertiesInfo property_info[] = {
- { NM_DEVICE_WIMAX_HW_ADDRESS, &priv->hw_address },
- { NM_DEVICE_WIMAX_ACTIVE_NSP, &priv->active_nsp, NULL, NM_TYPE_WIMAX_NSP },
- { NM_DEVICE_WIMAX_CENTER_FREQUENCY, &priv->center_freq },
- { NM_DEVICE_WIMAX_RSSI, &priv->rssi },
- { NM_DEVICE_WIMAX_CINR, &priv->cinr },
- { NM_DEVICE_WIMAX_TX_POWER, &priv->tx_power },
- { NM_DEVICE_WIMAX_BSID, &priv->bsid },
- { NM_DEVICE_WIMAX_NSPS, &priv->nsps, NULL, NM_TYPE_WIMAX_NSP, "nsp" },
- { NULL },
- };
-
- _nm_object_register_properties (NM_OBJECT (wimax),
- priv->proxy,
- property_info);
-}
-
-static void
-nsp_removed (NMDeviceWimax *self, NMWimaxNsp *nsp)
-{
- NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (self);
-
- if (nsp == priv->active_nsp) {
- g_object_unref (priv->active_nsp);
- priv->active_nsp = NULL;
- _nm_object_queue_notify (NM_OBJECT (self), NM_DEVICE_WIMAX_ACTIVE_NSP);
- }
-}
-
-static void
-constructed (GObject *object)
-{
- NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (object);
-
- G_OBJECT_CLASS (nm_device_wimax_parent_class)->constructed (object);
-
- priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE_WIMAX);
- register_properties (NM_DEVICE_WIMAX (object));
-
- g_signal_connect (object,
- "notify::" NM_DEVICE_STATE,
- G_CALLBACK (state_changed_cb),
- NULL);
-}
-
-static void
-dispose (GObject *object)
-{
- NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (object);
-
- if (priv->hw_address) {
- g_free (priv->hw_address);
- priv->hw_address = NULL;
- }
-
- if (priv->bsid) {
- g_free (priv->bsid);
- priv->bsid = NULL;
- }
-
- clean_up_nsps (NM_DEVICE_WIMAX (object), FALSE);
- g_clear_object (&priv->proxy);
-
- G_OBJECT_CLASS (nm_device_wimax_parent_class)->dispose (object);
-}
-
-static void
-nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (wimax_class);
- NMDeviceClass *device_class = NM_DEVICE_CLASS (wimax_class);
-
- g_type_class_add_private (wimax_class, sizeof (NMDeviceWimaxPrivate));
-
- /* virtual methods */
- object_class->constructed = constructed;
- object_class->get_property = get_property;
- object_class->dispose = dispose;
- device_class->connection_compatible = connection_compatible;
- device_class->get_setting_type = get_setting_type;
- device_class->get_hw_address = get_hw_address;
- wimax_class->nsp_removed = nsp_removed;
-
- /* properties */
-
- /**
- * NMDeviceWimax:hw-address:
- *
- * The hardware (MAC) address of the device.
- *
- * Deprecated: 1.2: WiMAX is no longer supported.
- **/
- g_object_class_install_property
- (object_class, PROP_HW_ADDRESS,
- g_param_spec_string (NM_DEVICE_WIMAX_HW_ADDRESS, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceWimax:active-nsp:
- *
- * The active #NMWimaxNsp of the device.
- *
- * Deprecated: 1.2: WiMAX is no longer supported.
- **/
- g_object_class_install_property
- (object_class, PROP_ACTIVE_NSP,
- g_param_spec_object (NM_DEVICE_WIMAX_ACTIVE_NSP, "", "",
- NM_TYPE_WIMAX_NSP,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceWimax:center-frequency:
- *
- * The center frequency (in KHz) of the radio channel the device is using to
- * communicate with the network when connected. Has no meaning when the
- * device is not connected.
- *
- * Deprecated: 1.2: WiMAX is no longer supported.
- **/
- g_object_class_install_property
- (object_class, PROP_CENTER_FREQ,
- g_param_spec_uint (NM_DEVICE_WIMAX_CENTER_FREQUENCY, "", "",
- 0, G_MAXUINT, 0,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceWimax:rssi:
- *
- * RSSI of the current radio link in dBm. This value indicates how strong
- * the raw received RF signal from the base station is, but does not
- * indicate the overall quality of the radio link. Has no meaning when the
- * device is not connected.
- *
- * Deprecated: 1.2: WiMAX is no longer supported.
- **/
- g_object_class_install_property
- (object_class, PROP_RSSI,
- g_param_spec_int (NM_DEVICE_WIMAX_RSSI, "", "",
- G_MININT, G_MAXINT, 0,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceWimax:cinr:
- *
- * CINR (Carrier to Interference + Noise Ratio) of the current radio link
- * in dB. CINR is a more accurate measure of radio link quality. Has no
- * meaning when the device is not connected.
- *
- * Deprecated: 1.2: WiMAX is no longer supported.
- **/
- g_object_class_install_property
- (object_class, PROP_CINR,
- g_param_spec_int (NM_DEVICE_WIMAX_CINR, "", "",
- G_MININT, G_MAXINT, 0,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceWimax:tx-power:
- *
- * Average power of the last burst transmitted by the device, in units of
- * 0.5 dBm. i.e. a TxPower of -11 represents an actual device TX power of
- * -5.5 dBm. Has no meaning when the device is not connected.
- *
- * Deprecated: 1.2: WiMAX is no longer supported.
- **/
- g_object_class_install_property
- (object_class, PROP_TX_POWER,
- g_param_spec_int (NM_DEVICE_WIMAX_TX_POWER, "", "",
- G_MININT, G_MAXINT, 0,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceWimax:bsid:
- *
- * The ID of the serving base station as received from the network. Has
- * no meaning when the device is not connected.
- *
- * Deprecated: 1.2: WiMAX is no longer supported.
- **/
- g_object_class_install_property
- (object_class, PROP_BSID,
- g_param_spec_string (NM_DEVICE_WIMAX_BSID, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDeviceWimax:nsps:
- *
- * List of all WiMAX Network Service Providers the device can see.
- *
- * Since: 0.9.10
- * Deprecated: 1.2: WiMAX is no longer supported.
- **/
- g_object_class_install_property
- (object_class, PROP_NSPS,
- g_param_spec_boxed (NM_DEVICE_WIMAX_NSPS, "", "",
- NM_TYPE_OBJECT_ARRAY,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /* signals */
-
- /**
- * NMDeviceWimax::nsp-added:
- * @self: the wimax device that received the signal
- * @nsp: the new NSP
- *
- * Notifies that a #NMWimaxNsp is added to the wimax device.
- *
- * Deprecated: 1.2: WiMAX is no longer supported.
- **/
- signals[NSP_ADDED] =
- g_signal_new ("nsp-added",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (NMDeviceWimaxClass, nsp_added),
- NULL, NULL,
- g_cclosure_marshal_VOID__OBJECT,
- G_TYPE_NONE, 1,
- G_TYPE_OBJECT);
-
- /**
- * NMDeviceWimax::nsp-removed:
- * @self: the wimax device that received the signal
- * @nsp: the removed NSP
- *
- * Notifies that a #NMWimaxNsp is removed from the wimax device.
- *
- * Deprecated: 1.2: WiMAX is no longer supported.
- **/
- signals[NSP_REMOVED] =
- g_signal_new ("nsp-removed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (NMDeviceWimaxClass, nsp_removed),
- NULL, NULL,
- g_cclosure_marshal_VOID__OBJECT,
- G_TYPE_NONE, 1,
- G_TYPE_OBJECT);
-}
diff --git a/libnm-glib/nm-device-wimax.h b/libnm-glib/nm-device-wimax.h
deleted file mode 100644
index 21d28117b..000000000
--- a/libnm-glib/nm-device-wimax.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2011 - 2012 Red Hat, Inc.
- * Copyright 2009 Novell, Inc.
- */
-
-#ifndef NM_DEVICE_WIMAX_H
-#define NM_DEVICE_WIMAX_H
-
-#include "nm-device.h"
-#include "nm-wimax-nsp.h"
-
-G_BEGIN_DECLS
-
-#define NM_TYPE_DEVICE_WIMAX (nm_device_wimax_get_type ())
-#define NM_DEVICE_WIMAX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_WIMAX, NMDeviceWimax))
-#define NM_DEVICE_WIMAX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_WIMAX, NMDeviceWimaxClass))
-#define NM_IS_DEVICE_WIMAX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_WIMAX))
-#define NM_IS_DEVICE_WIMAX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_WIMAX))
-#define NM_DEVICE_WIMAX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_WIMAX, NMDeviceWimaxClass))
-
-/**
- * NMDeviceWimaxError:
- * @NM_DEVICE_WIMAX_ERROR_UNKNOWN: unknown or unclassified error
- * @NM_DEVICE_WIMAX_ERROR_NOT_WIMAX_CONNECTION: the connection was not of WiMax type
- * @NM_DEVICE_WIMAX_ERROR_INVALID_WIMAX_CONNECTION: the WiMax connection was invalid
- * @NM_DEVICE_WIMAX_ERROR_INVALID_DEVICE_MAC: the device's MAC was invalid
- * @NM_DEVICE_WIMAX_ERROR_MAC_MISMATCH: the MACs of the connection and the device mismatched
- */
-typedef enum {
- NM_DEVICE_WIMAX_ERROR_UNKNOWN = 0, /*< nick=UnknownError >*/
- NM_DEVICE_WIMAX_ERROR_NOT_WIMAX_CONNECTION, /*< nick=NotWimaxConnection >*/
- NM_DEVICE_WIMAX_ERROR_INVALID_WIMAX_CONNECTION, /*< nick=InvalidWimaxConnection >*/
- NM_DEVICE_WIMAX_ERROR_INVALID_DEVICE_MAC, /*< nick=InvalidDeviceMac >*/
- NM_DEVICE_WIMAX_ERROR_MAC_MISMATCH, /*< nick=MacMismatch >*/
-} NMDeviceWimaxError;
-
-#define NM_DEVICE_WIMAX_ERROR nm_device_wimax_error_quark ()
-NM_DEPRECATED_IN_1_2
-GQuark nm_device_wimax_error_quark (void);
-
-#define NM_DEVICE_WIMAX_HW_ADDRESS "hw-address"
-#define NM_DEVICE_WIMAX_ACTIVE_NSP "active-nsp"
-#define NM_DEVICE_WIMAX_CENTER_FREQUENCY "center-frequency"
-#define NM_DEVICE_WIMAX_RSSI "rssi"
-#define NM_DEVICE_WIMAX_CINR "cinr"
-#define NM_DEVICE_WIMAX_TX_POWER "tx-power"
-#define NM_DEVICE_WIMAX_BSID "bsid"
-#define NM_DEVICE_WIMAX_NSPS "nsps"
-
-typedef struct {
- NMDevice parent;
-} NMDeviceWimax;
-
-typedef struct {
- NMDeviceClass parent;
-
- /* Signals */
- void (*nsp_added) (NMDeviceWimax *self, NMWimaxNsp *nsp);
- void (*nsp_removed) (NMDeviceWimax *self, NMWimaxNsp *nsp);
-} NMDeviceWimaxClass;
-
-NM_DEPRECATED_IN_1_2
-GType nm_device_wimax_get_type (void);
-
-NM_DEPRECATED_IN_1_2
-GObject *nm_device_wimax_new (DBusGConnection *connection,
- const char *path);
-
-NM_DEPRECATED_IN_1_2
-const char *nm_device_wimax_get_hw_address (NMDeviceWimax *wimax);
-NM_DEPRECATED_IN_1_2
-NMWimaxNsp *nm_device_wimax_get_active_nsp (NMDeviceWimax *wimax);
-NM_DEPRECATED_IN_1_2
-NMWimaxNsp *nm_device_wimax_get_nsp_by_path (NMDeviceWimax *wimax,
- const char *path);
-
-NM_DEPRECATED_IN_1_2
-const GPtrArray *nm_device_wimax_get_nsps (NMDeviceWimax *wimax);
-
-NM_DEPRECATED_IN_1_2
-guint nm_device_wimax_get_center_frequency (NMDeviceWimax *self);
-NM_DEPRECATED_IN_1_2
-int nm_device_wimax_get_rssi (NMDeviceWimax *self);
-NM_DEPRECATED_IN_1_2
-int nm_device_wimax_get_cinr (NMDeviceWimax *self);
-NM_DEPRECATED_IN_1_2
-int nm_device_wimax_get_tx_power (NMDeviceWimax *self);
-NM_DEPRECATED_IN_1_2
-const char * nm_device_wimax_get_bsid (NMDeviceWimax *self);
-
-G_END_DECLS
-
-#endif /* NM_DEVICE_WIMAX_H */
diff --git a/libnm-glib/nm-device.c b/libnm-glib/nm-device.c
deleted file mode 100644
index 6179b7578..000000000
--- a/libnm-glib/nm-device.c
+++ /dev/null
@@ -1,2375 +0,0 @@
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA.
- *
- * Copyright 2007 - 2008 Novell, Inc.
- * Copyright 2007 - 2012 Red Hat, Inc.
- */
-
-#include "nm-default.h"
-
-#include <string.h>
-#include <libudev.h>
-
-#include "NetworkManager.h"
-
-#include "nm-utils/nm-udev-utils.h"
-#include "nm-device-ethernet.h"
-#include "nm-device-adsl.h"
-#include "nm-device-wifi.h"
-#include "nm-device-modem.h"
-#include "nm-device-bt.h"
-#include "nm-device-olpc-mesh.h"
-#include "nm-device-wimax.h"
-#include "nm-device-infiniband.h"
-#include "nm-device-bond.h"
-#include "nm-device-team.h"
-#include "nm-device-bridge.h"
-#include "nm-device-vlan.h"
-#include "nm-device-generic.h"
-#include "nm-device.h"
-#include "nm-device-private.h"
-#include "nm-object-private.h"
-#include "nm-object-cache.h"
-#include "nm-remote-connection.h"
-#include "nm-types.h"
-#include "nm-dbus-glib-types.h"
-#include "nm-utils.h"
-#include "nm-dbus-helpers-private.h"
-
-static GType _nm_device_gtype_for_path (DBusGConnection *connection,
- const char *path);
-static void _nm_device_gtype_for_path_async (DBusGConnection *connection,
- const char *path,
- NMObjectTypeCallbackFunc callback,
- gpointer user_data);
-gboolean connection_compatible (NMDevice *device, NMConnection *connection, GError **error);
-
-G_DEFINE_TYPE_WITH_CODE (NMDevice, nm_device, NM_TYPE_OBJECT,
- _nm_object_register_type_func (g_define_type_id, _nm_device_gtype_for_path,
- _nm_device_gtype_for_path_async);
- )
-
-#define DBUS_G_TYPE_UINT_STRUCT (dbus_g_type_get_struct ("GValueArray", G_TYPE_UINT, G_TYPE_UINT, G_TYPE_INVALID))
-
-#define NM_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE, NMDevicePrivate))
-
-typedef struct {
- DBusGProxy *proxy;
-
- char *iface;
- char *ip_iface;
- NMDeviceType device_type;
- char *udi;
- char *driver;
- char *driver_version;
- char *firmware_version;
- char *type_description;
- NMDeviceCapabilities capabilities;
- gboolean real;
- gboolean managed;
- gboolean firmware_missing;
- gboolean autoconnect;
- NMIP4Config *ip4_config;
- NMDHCP4Config *dhcp4_config;
- NMIP6Config *ip6_config;
- NMDHCP6Config *dhcp6_config;
- NMDeviceState state;
- NMDeviceState last_seen_state;
- NMDeviceStateReason reason;
-
- NMActiveConnection *active_connection;
- GPtrArray *available_connections;
-
- NMUdevClient *udev_client;
- char *product, *short_product;
- char *vendor, *short_vendor;
- char *description, *bus_name;
-
- char *physical_port_id;
- guint32 mtu;
-} NMDevicePrivate;
-
-enum {
- PROP_0,
- PROP_INTERFACE,
- PROP_UDI,
- PROP_DRIVER,
- PROP_DRIVER_VERSION,
- PROP_FIRMWARE_VERSION,
- PROP_CAPABILITIES,
- PROP_REAL,
- PROP_MANAGED,
- PROP_AUTOCONNECT,
- PROP_FIRMWARE_MISSING,
- PROP_IP4_CONFIG,
- PROP_DHCP4_CONFIG,
- PROP_IP6_CONFIG,
- PROP_STATE,
- PROP_STATE_REASON,
- PROP_PRODUCT,
- PROP_VENDOR,
- PROP_DHCP6_CONFIG,
- PROP_IP_INTERFACE,
- PROP_DEVICE_TYPE,
- PROP_ACTIVE_CONNECTION,
- PROP_AVAILABLE_CONNECTIONS,
- PROP_PHYSICAL_PORT_ID,
- PROP_MTU,
-
- LAST_PROP
-};
-
-enum {
- STATE_CHANGED,
-
- LAST_SIGNAL
-};
-
-static guint signals[LAST_SIGNAL] = { 0 };
-
-/**
- * nm_device_error_quark:
- *
- * Registers an error quark for #NMDevice if necessary.
- *
- * Returns: the error quark used for #NMDevice errors.
- *
- * Since: 0.9.10
- **/
-GQuark
-nm_device_error_quark (void)
-{
- static GQuark quark = 0;
-
- if (G_UNLIKELY (quark == 0))
- quark = g_quark_from_static_string ("nm-device-error-quark");
- return quark;
-}
-
-static void
-nm_device_init (NMDevice *device)
-{
- NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device);
-
- priv->state = NM_DEVICE_STATE_UNKNOWN;
- priv->reason = NM_DEVICE_STATE_REASON_NONE;
-}
-
-static gboolean
-demarshal_state_reason (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field)
-{
- NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (object);
-
- if (!G_VALUE_HOLDS (value, DBUS_G_TYPE_UINT_STRUCT))
- return FALSE;
-
- dbus_g_type_struct_get (value,
- 0, &priv->state,
- 1, &priv->reason,
- G_MAXUINT);
-
- _nm_object_queue_notify (object, NM_DEVICE_STATE_REASON);
- return TRUE;
-}
-
-static void
-register_properties (NMDevice *device)
-{
- NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device);
- const NMPropertiesInfo property_info[] = {
- { NM_DEVICE_UDI, &priv->udi },
- { NM_DEVICE_INTERFACE, &priv->iface },
- { NM_DEVICE_IP_INTERFACE, &priv->ip_iface },
- { NM_DEVICE_DRIVER, &priv->driver },
- { NM_DEVICE_DRIVER_VERSION, &priv->driver_version },
- { NM_DEVICE_FIRMWARE_VERSION, &priv->firmware_version },
- { NM_DEVICE_CAPABILITIES, &priv->capabilities },
- { NM_DEVICE_REAL, &priv->real },
- { NM_DEVICE_MANAGED, &priv->managed },
- { NM_DEVICE_AUTOCONNECT, &priv->autoconnect },
- { NM_DEVICE_FIRMWARE_MISSING, &priv->firmware_missing },
- { NM_DEVICE_IP4_CONFIG, &priv->ip4_config, NULL, NM_TYPE_IP4_CONFIG },
- { NM_DEVICE_DHCP4_CONFIG, &priv->dhcp4_config, NULL, NM_TYPE_DHCP4_CONFIG },
- { NM_DEVICE_IP6_CONFIG, &priv->ip6_config, NULL, NM_TYPE_IP6_CONFIG },
- { NM_DEVICE_DHCP6_CONFIG, &priv->dhcp6_config, NULL, NM_TYPE_DHCP6_CONFIG },
- { NM_DEVICE_STATE, &priv->state },
- { NM_DEVICE_STATE_REASON, &priv->state, demarshal_state_reason },
- { NM_DEVICE_ACTIVE_CONNECTION, &priv->active_connection, NULL, NM_TYPE_ACTIVE_CONNECTION },
- { NM_DEVICE_AVAILABLE_CONNECTIONS, &priv->available_connections, NULL, NM_TYPE_REMOTE_CONNECTION },
- { NM_DEVICE_PHYSICAL_PORT_ID, &priv->physical_port_id },
- { NM_DEVICE_MTU, &priv->mtu },
-
- /* Properties that exist in D-Bus but that we don't track */
- { "ip4-address", NULL },
- { "device-type", NULL },
-
- { NULL },
- };
-
- _nm_object_register_properties (NM_OBJECT (device),
- priv->proxy,
- property_info);
-}
-
-typedef struct {
- NMDeviceState old_state;
- NMDeviceState new_state;
- NMDeviceStateReason reason;
-} StateChangeData;
-
-static void
-device_state_change_reloaded (GObject *object,
- GAsyncResult *result,
- gpointer user_data)
-{
- NMDevice *self = NM_DEVICE (object);
- NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
- StateChangeData *data = user_data;
- NMDeviceState old_state = data->old_state;
- NMDeviceState new_state = data->new_state;
- NMDeviceStateReason reason = data->reason;
-
- g_slice_free (StateChangeData, data);
-
- _nm_object_reload_properties_finish (NM_OBJECT (object), result, NULL);
-
- /* If the device changes state several times in rapid succession, then we'll
- * queue several reload_properties() calls, and there's no guarantee that
- * they'll finish in the right order. In that case, only emit the signal
- * for the last one.
- */
- if (priv->last_seen_state != new_state)
- return;
-
- /* Ensure that nm_device_get_state() will return the right value even if
- * we haven't processed the corresponding PropertiesChanged yet.
- */
- priv->state = new_state;
-
- g_signal_emit (self, signals[STATE_CHANGED], 0,
- new_state, old_state, reason);
-}
-
-static void
-device_state_changed (DBusGProxy *proxy,
- NMDeviceState new_state,
- NMDeviceState old_state,
- NMDeviceStateReason reason,
- gpointer user_data)
-{
- NMDevice *self = NM_DEVICE (user_data);
- NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
-
- if (old_state != new_state) {
- StateChangeData *data;
-
- /* Our object-valued properties (eg, ip4_config) will still
- * have their old values at this point, because NMObject is
- * in the process of asynchronously reading the new values.
- * Wait for that to finish before emitting the signal.
- */
- priv->last_seen_state = new_state;
-
- data = g_slice_new (StateChangeData);
- data->old_state = old_state;
- data->new_state = new_state;
- data->reason = reason;
- _nm_object_reload_properties_async (NM_OBJECT (user_data),
- device_state_change_reloaded,
- data);
- }
-}
-
-static GType
-_nm_device_gtype_from_dtype (NMDeviceType dtype)
-{
- switch (dtype) {
- case NM_DEVICE_TYPE_VETH:
- case NM_DEVICE_TYPE_ETHERNET:
- return NM_TYPE_DEVICE_ETHERNET;
- case NM_DEVICE_TYPE_WIFI:
- return NM_TYPE_DEVICE_WIFI;
- case NM_DEVICE_TYPE_MODEM:
- return NM_TYPE_DEVICE_MODEM;
- case NM_DEVICE_TYPE_BT:
- return NM_TYPE_DEVICE_BT;
- case NM_DEVICE_TYPE_ADSL:
- return NM_TYPE_DEVICE_ADSL;
- case NM_DEVICE_TYPE_OLPC_MESH:
- return NM_TYPE_DEVICE_OLPC_MESH;
- case NM_DEVICE_TYPE_WIMAX:
- return NM_TYPE_DEVICE_WIMAX;
- case NM_DEVICE_TYPE_INFINIBAND:
- return NM_TYPE_DEVICE_INFINIBAND;
- case NM_DEVICE_TYPE_BOND:
- return NM_TYPE_DEVICE_BOND;
- case NM_DEVICE_TYPE_TEAM:
- return NM_TYPE_DEVICE_TEAM;
- case NM_DEVICE_TYPE_BRIDGE:
- return NM_TYPE_DEVICE_BRIDGE;
- case NM_DEVICE_TYPE_VLAN:
- return NM_TYPE_DEVICE_VLAN;
- case NM_DEVICE_TYPE_GENERIC:
- case NM_DEVICE_TYPE_TUN:
- case NM_DEVICE_TYPE_IP_TUNNEL:
- return NM_TYPE_DEVICE_GENERIC;
- default:
- /* Fall back to NMDeviceGeneric for unknown devices */
- return NM_TYPE_DEVICE_GENERIC;
- }
-}
-
-static void
-constructed (GObject *object)
-{
- NMDevicePrivate *priv;
-
- G_OBJECT_CLASS (nm_device_parent_class)->constructed (object);
-
- priv = NM_DEVICE_GET_PRIVATE (object);
- /* Catch failure of subclasses to call _nm_device_set_device_type() */
- g_warn_if_fail (priv->device_type != NM_DEVICE_TYPE_UNKNOWN);
- /* Catch a subclass setting the wrong type */
- g_warn_if_fail (G_OBJECT_TYPE (object) == _nm_device_gtype_from_dtype (priv->device_type));
-
- priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE);
-
- register_properties (NM_DEVICE (object));
-
- dbus_g_object_register_marshaller (g_cclosure_marshal_generic,
- G_TYPE_NONE,
- G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT,
- G_TYPE_INVALID);
-
- dbus_g_proxy_add_signal (priv->proxy,
- "StateChanged",
- G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT,
- G_TYPE_INVALID);
-
- dbus_g_proxy_connect_signal (priv->proxy, "StateChanged",
- G_CALLBACK (device_state_changed),
- NM_DEVICE (object),
- NULL);
-}
-
-static void
-dispose (GObject *object)
-{
- NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (object);
-
- g_clear_object (&priv->proxy);
- g_clear_object (&priv->ip4_config);
- g_clear_object (&priv->dhcp4_config);
- g_clear_object (&priv->ip6_config);
- g_clear_object (&priv->dhcp6_config);
- g_clear_object (&priv->active_connection);
-
- priv->udev_client = nm_udev_client_unref (priv->udev_client);
-
- if (priv->available_connections) {
- int i;
-
- for (i = 0; i < priv->available_connections->len; i++)
- g_object_unref (priv->available_connections->pdata[i]);
- g_ptr_array_free (priv->available_connections, TRUE);
- priv->available_connections = NULL;
- }
-
- G_OBJECT_CLASS (nm_device_parent_class)->dispose (object);
-}
-
-static void
-finalize (GObject *object)
-{
- NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (object);
-
- g_free (priv->iface);
- g_free (priv->ip_iface);
- g_free (priv->udi);
- g_free (priv->driver);
- g_free (priv->driver_version);
- g_free (priv->firmware_version);
- g_free (priv->product);
- g_free (priv->short_product);
- g_free (priv->vendor);
- g_free (priv->short_vendor);
- g_free (priv->description);
- g_free (priv->bus_name);
- g_free (priv->type_description);
- g_free (priv->physical_port_id);
-
- G_OBJECT_CLASS (nm_device_parent_class)->finalize (object);
-}
-
-static void
-get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- NMDevice *device = NM_DEVICE (object);
- NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device);
-
- _nm_object_ensure_inited (NM_OBJECT (object));
-
- switch (prop_id) {
- case PROP_DEVICE_TYPE:
- g_value_set_uint (value, nm_device_get_device_type (device));
- break;
- case PROP_UDI:
- g_value_set_string (value, nm_device_get_udi (device));
- break;
- case PROP_INTERFACE:
- g_value_set_string (value, nm_device_get_iface (device));
- break;
- case PROP_IP_INTERFACE:
- g_value_set_string (value, nm_device_get_ip_iface (device));
- break;
- case PROP_DRIVER:
- g_value_set_string (value, nm_device_get_driver (device));
- break;
- case PROP_DRIVER_VERSION:
- g_value_set_string (value, nm_device_get_driver_version (device));
- break;
- case PROP_FIRMWARE_VERSION:
- g_value_set_string (value, nm_device_get_firmware_version (device));
- break;
- case PROP_CAPABILITIES:
- g_value_set_uint (value, nm_device_get_capabilities (device));
- break;
- case PROP_REAL:
- g_value_set_boolean (value, nm_device_is_real (device));
- break;
- case PROP_MANAGED:
- g_value_set_boolean (value, nm_device_get_managed (device));
- break;
- case PROP_AUTOCONNECT:
- g_value_set_boolean (value, nm_device_get_autoconnect (device));
- break;
- case PROP_FIRMWARE_MISSING:
- g_value_set_boolean (value, nm_device_get_firmware_missing (device));
- break;
- case PROP_IP4_CONFIG:
- g_value_set_object (value, nm_device_get_ip4_config (device));
- break;
- case PROP_DHCP4_CONFIG:
- g_value_set_object (value, nm_device_get_dhcp4_config (device));
- break;
- case PROP_IP6_CONFIG:
- g_value_set_object (value, nm_device_get_ip6_config (device));
- break;
- case PROP_DHCP6_CONFIG:
- g_value_set_object (value, nm_device_get_dhcp6_config (device));
- break;
- case PROP_STATE:
- g_value_set_uint (value, nm_device_get_state (device));
- break;
- case PROP_STATE_REASON:
- g_value_set_boxed (value,
- dbus_g_type_specialized_construct (DBUS_G_TYPE_UINT_STRUCT));
- dbus_g_type_struct_set (value,
- 0, priv->state,
- 1, priv->reason,
- G_MAXUINT);
- break;
- case PROP_ACTIVE_CONNECTION:
- g_value_set_object (value, nm_device_get_active_connection (device));
- break;
- case PROP_AVAILABLE_CONNECTIONS:
- g_value_set_boxed (value, nm_device_get_available_connections (device));
- break;
- case PROP_PRODUCT:
- g_value_set_string (value, nm_device_get_product (device));
- break;
- case PROP_VENDOR:
- g_value_set_string (value, nm_device_get_vendor (device));
- break;
- case PROP_PHYSICAL_PORT_ID:
- g_value_set_string (value, nm_device_get_physical_port_id (device));
- break;
- case PROP_MTU:
- g_value_set_uint (value, nm_device_get_mtu (device));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- NMDevice *self = NM_DEVICE (object);
- NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
- gboolean b;
-
- switch (prop_id) {
- case PROP_DEVICE_TYPE:
- /* construct-only */
- priv->device_type = g_value_get_uint (value);
- break;
- case PROP_MANAGED:
- b = g_value_get_boolean (value);
- if (priv->managed != b)
- nm_device_set_managed (NM_DEVICE (object), b);
- break;
- case PROP_AUTOCONNECT:
- b = g_value_get_boolean (value);
- if (priv->autoconnect != b)
- nm_device_set_autoconnect (NM_DEVICE (object), b);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-nm_device_class_init (NMDeviceClass *device_class)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (device_class);
-
- g_type_class_add_private (device_class, sizeof (NMDevicePrivate));
-
- /* virtual methods */
- object_class->constructed = constructed;
- object_class->get_property = get_property;
- object_class->set_property = set_property;
- object_class->dispose = dispose;
- object_class->finalize = finalize;
-
- device_class->connection_compatible = connection_compatible;
-
- /* properties */
-
- /**
- * NMDevice:interface:
- *
- * The interface of the device.
- **/
- g_object_class_install_property
- (object_class, PROP_INTERFACE,
- g_param_spec_string (NM_DEVICE_INTERFACE, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDevice:ip-interface:
- *
- * The IP interface of the device which should be used for all IP-related
- * operations like addressing and routing.
- **/
- g_object_class_install_property
- (object_class, PROP_IP_INTERFACE,
- g_param_spec_string (NM_DEVICE_IP_INTERFACE, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDevice:device-type:
- *
- * The numeric type of the device.
- **/
- g_object_class_install_property
- (object_class, PROP_DEVICE_TYPE,
- g_param_spec_uint (NM_DEVICE_DEVICE_TYPE, "", "",
- NM_DEVICE_TYPE_UNKNOWN, G_MAXUINT32, NM_DEVICE_TYPE_UNKNOWN,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
- /**
- * NMDevice:udi:
- *
- * An operating-system specific device hardware identifier; this is not
- * unique to a specific hardware device across reboots or hotplugs. It
- * is an opaque string which for some device types (Bluetooth, Modem)
- * contains an identifier provided by the underlying hardware service daemon
- * such as Bluez or ModemManager, and clients can use this property to
- * request more information about the device from those services.
- **/
- g_object_class_install_property
- (object_class, PROP_UDI,
- g_param_spec_string (NM_DEVICE_UDI, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDevice:driver:
- *
- * The driver of the device.
- **/
- g_object_class_install_property
- (object_class, PROP_DRIVER,
- g_param_spec_string (NM_DEVICE_DRIVER, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDevice:driver-version:
- *
- * The version of the device driver.
- **/
- g_object_class_install_property
- (object_class, PROP_DRIVER_VERSION,
- g_param_spec_string (NM_DEVICE_DRIVER_VERSION, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDevice:firmware-version:
- *
- * The firmware version of the device.
- **/
- g_object_class_install_property
- (object_class, PROP_FIRMWARE_VERSION,
- g_param_spec_string (NM_DEVICE_FIRMWARE_VERSION, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDevice:capabilities:
- *
- * The capabilities of the device.
- **/
- g_object_class_install_property
- (object_class, PROP_CAPABILITIES,
- g_param_spec_uint (NM_DEVICE_CAPABILITIES, "", "",
- 0, G_MAXUINT32, 0,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDevice:real:
- *
- * Whether the device is real or is a placeholder device that could
- * be created automatically by NetworkManager if one of its
- * #NMDevice:available-connections was activated.
- *
- * Since: 1.2
- **/
- g_object_class_install_property
- (object_class, PROP_REAL,
- g_param_spec_boolean (NM_DEVICE_REAL, "", "",
- FALSE,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDevice:managed:
- *
- * Whether the device is managed by NetworkManager.
- **/
- g_object_class_install_property
- (object_class, PROP_MANAGED,
- g_param_spec_boolean (NM_DEVICE_MANAGED, "", "",
- FALSE,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDevice:autoconnect:
- *
- * Whether the device can auto-activate a connection.
- **/
- g_object_class_install_property
- (object_class, PROP_AUTOCONNECT,
- g_param_spec_boolean (NM_DEVICE_AUTOCONNECT, "", "",
- TRUE,
- G_PARAM_READWRITE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDevice:firmware-missing:
- *
- * When %TRUE indicates the device is likely missing firmware required
- * for its operation.
- **/
- g_object_class_install_property
- (object_class, PROP_FIRMWARE_MISSING,
- g_param_spec_boolean (NM_DEVICE_FIRMWARE_MISSING, "", "",
- FALSE,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDevice:ip4-config:
- *
- * The #NMIP4Config of the device.
- **/
- g_object_class_install_property
- (object_class, PROP_IP4_CONFIG,
- g_param_spec_object (NM_DEVICE_IP4_CONFIG, "", "",
- NM_TYPE_IP4_CONFIG,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDevice:dhcp4-config:
- *
- * The #NMDHCP4Config of the device.
- **/
- g_object_class_install_property
- (object_class, PROP_DHCP4_CONFIG,
- g_param_spec_object (NM_DEVICE_DHCP4_CONFIG, "", "",
- NM_TYPE_DHCP4_CONFIG,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDevice:ip6-config:
- *
- * The #NMIP6Config of the device.
- **/
- g_object_class_install_property
- (object_class, PROP_IP6_CONFIG,
- g_param_spec_object (NM_DEVICE_IP6_CONFIG, "", "",
- NM_TYPE_IP6_CONFIG,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDevice:dhcp6-config:
- *
- * The #NMDHCP6Config of the device.
- **/
- g_object_class_install_property
- (object_class, PROP_DHCP6_CONFIG,
- g_param_spec_object (NM_DEVICE_DHCP6_CONFIG, "", "",
- NM_TYPE_DHCP6_CONFIG,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDevice:state:
- *
- * The state of the device.
- **/
- g_object_class_install_property
- (object_class, PROP_STATE,
- g_param_spec_uint (NM_DEVICE_STATE, "", "",
- 0, G_MAXUINT32, 0,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDevice:state-reason:
- *
- * The state and reason of the device.
- **/
- g_object_class_install_property
- (object_class, PROP_STATE_REASON,
- g_param_spec_boxed (NM_DEVICE_STATE_REASON, "", "",
- DBUS_G_TYPE_UINT_STRUCT,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDevice:active-connection:
- *
- * The #NMActiveConnection object that "owns" this device during activation.
- **/
- g_object_class_install_property
- (object_class, PROP_ACTIVE_CONNECTION,
- g_param_spec_object (NM_DEVICE_ACTIVE_CONNECTION, "", "",
- NM_TYPE_ACTIVE_CONNECTION,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDevice:available-connections:
- *
- * The available connections (#NMRemoteConnection) of the device
- *
- * Since: 0.9.8
- **/
- g_object_class_install_property
- (object_class, PROP_AVAILABLE_CONNECTIONS,
- g_param_spec_boxed (NM_DEVICE_AVAILABLE_CONNECTIONS, "", "",
- NM_TYPE_OBJECT_ARRAY,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDevice:vendor:
- *
- * The vendor string of the device.
- **/
- g_object_class_install_property
- (object_class, PROP_VENDOR,
- g_param_spec_string (NM_DEVICE_VENDOR, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDevice:product:
- *
- * The product string of the device.
- **/
- g_object_class_install_property
- (object_class, PROP_PRODUCT,
- g_param_spec_string (NM_DEVICE_PRODUCT, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDevice:physical-port-id:
- *
- * The physical port ID of the device. (See
- * nm_device_get_physical_port_id().)
- *
- * Since: 0.9.10
- **/
- g_object_class_install_property
- (object_class, PROP_PHYSICAL_PORT_ID,
- g_param_spec_string (NM_DEVICE_PHYSICAL_PORT_ID, "", "",
- NULL,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /**
- * NMDevice:mtu:
- *
- * The MTU of the device.
- *
- * Since: 0.9.10
- **/
- g_object_class_install_property
- (object_class, PROP_MTU,
- g_param_spec_uint (NM_DEVICE_MTU, "", "",
- 0, G_MAXUINT32, 1500,
- G_PARAM_READABLE |
- G_PARAM_STATIC_STRINGS));
-
- /* signals */
-
- /**
- * NMDevice::state-changed:
- * @device: the device object that received the signal
- * @new_state: the new state of the device
- * @old_state: the previous state of the device
- * @reason: the reason describing the state change
- *
- * Notifies the state change of a #NMDevice.
- **/
- signals[STATE_CHANGED] =
- g_signal_new ("state-changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (NMDeviceClass, state_changed),
- NULL, NULL, NULL,
- G_TYPE_NONE, 3,
- G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT);
-}
-
-/**
- * _nm_device_set_device_type:
- * @device: the device
- * @dtype: the NM device type
- *
- * Sets the NM device type if it wasn't set during construction. INTERNAL
- * ONLY METHOD.
- **/
-void
-_nm_device_set_device_type (NMDevice *device, NMDeviceType dtype)
-{
- NMDevicePrivate *priv;
-
- g_return_if_fail (device != NULL);
- g_r