From de06e5715e780baade318f3490ac7a4c9ce84e32 Mon Sep 17 00:00:00 2001
From: Michael Biebl
Date: Sat, 24 Mar 2012 01:37:02 +0100
Subject: Imported Upstream version 0.9.4.0
---
Makefile.am | 14 +-
Makefile.glib | 169 +
Makefile.in | 23 +-
NEWS | 42 +
TODO | 181 +-
build-aux/ltmain.sh | 2 +-
callouts/Makefile.am | 4 +
callouts/Makefile.in | 13 +
callouts/tests/Makefile.am | 2 +
callouts/tests/Makefile.in | 11 +
cli/Makefile.in | 9 +
cli/src/Makefile.am | 4 +
cli/src/Makefile.in | 37 +-
cli/src/common.c | 360 +++
cli/src/common.h | 39 +
cli/src/connections.c | 1053 ++++---
cli/src/devices.c | 466 +--
cli/src/nmcli.h | 30 +-
cli/src/settings.c | 416 ++-
cli/src/settings.h | 40 +-
cli/src/utils.c | 132 +-
cli/src/utils.h | 6 +-
config.h.in | 15 +-
configure | 616 +++-
configure.ac | 163 +-
data/Makefile.in | 9 +
data/NetworkManager.service.in | 4 +
docs/Makefile.in | 9 +
docs/api/Makefile.am | 2 +-
docs/api/Makefile.in | 11 +-
docs/api/generate-settings-spec.c | 6 +
docs/api/html/NetworkManager.devhelp2 | 28 +-
docs/api/html/index.html | 32 +-
docs/api/html/ix01.html | 2 +-
docs/api/html/ref-migrating.html | 72 +-
docs/api/html/ref-settings.html | 227 +-
docs/api/html/spec.html | 111 +-
docs/api/migrating-to-09.xml | 14 +-
docs/api/settings-spec.xml | 173 +-
docs/api/spec.html | 111 +-
docs/api/version.xml | 2 +-
docs/libnm-glib/Makefile.am | 1 -
docs/libnm-glib/Makefile.in | 10 +-
docs/libnm-glib/html/NMAccessPoint.html | 38 +
docs/libnm-glib/html/NMActiveConnection.html | 61 +
docs/libnm-glib/html/NMClient.html | 93 +-
docs/libnm-glib/html/NMDHCP4Config.html | 8 +
docs/libnm-glib/html/NMDHCP6Config.html | 8 +
docs/libnm-glib/html/NMDevice.html | 73 +-
docs/libnm-glib/html/NMDeviceBt.html | 8 +
docs/libnm-glib/html/NMDeviceEthernet.html | 8 +
docs/libnm-glib/html/NMDeviceModem.html | 8 +
docs/libnm-glib/html/NMDeviceWifi.html | 8 +
docs/libnm-glib/html/NMDeviceWimax.html | 8 +
docs/libnm-glib/html/NMIP4Config.html | 8 +
docs/libnm-glib/html/NMIP6Config.html | 8 +
docs/libnm-glib/html/NMObject.html | 8 +
docs/libnm-glib/html/NMRemoteConnection.html | 17 +-
docs/libnm-glib/html/NMRemoteSettings.html | 100 +-
docs/libnm-glib/html/NMSecretAgent.html | 171 +-
docs/libnm-glib/html/NMVPNConnection.html | 39 +
docs/libnm-glib/html/NMWimaxNsp.html | 8 +
docs/libnm-glib/html/api-index-full.html | 376 ++-
docs/libnm-glib/html/ch02.html | 2 +-
docs/libnm-glib/html/index.html | 2 +-
docs/libnm-glib/html/index.sgml | 33 +-
docs/libnm-glib/html/libnm-glib-NMVPNPlugin.html | 18 +-
docs/libnm-glib/html/libnm-glib.devhelp2 | 15 +-
docs/libnm-glib/html/object-tree.html | 4 +
docs/libnm-glib/libnm-glib-sections.txt | 205 +-
docs/libnm-glib/libnm-glib.types | 8 +
docs/libnm-glib/tmpl/libnm_glib.sgml | 2 -
docs/libnm-glib/tmpl/nm-access-point.sgml | 2 -
docs/libnm-glib/tmpl/nm-active-connection.sgml | 28 +-
docs/libnm-glib/tmpl/nm-client.sgml | 24 +-
docs/libnm-glib/tmpl/nm-device-bond.sgml | 93 +
docs/libnm-glib/tmpl/nm-device-bt.sgml | 2 -
docs/libnm-glib/tmpl/nm-device-ethernet.sgml | 2 -
.../tmpl/nm-device-infiniband-bindings.sgml | 29 +
docs/libnm-glib/tmpl/nm-device-infiniband.sgml | 93 +
docs/libnm-glib/tmpl/nm-device-modem.sgml | 2 -
docs/libnm-glib/tmpl/nm-device-olpc-mesh.sgml | 114 +
docs/libnm-glib/tmpl/nm-device-vlan.sgml | 114 +
docs/libnm-glib/tmpl/nm-device-wifi.sgml | 2 -
docs/libnm-glib/tmpl/nm-device-wimax.sgml | 2 -
docs/libnm-glib/tmpl/nm-device.sgml | 26 +-
docs/libnm-glib/tmpl/nm-dhcp4-config.sgml | 2 -
docs/libnm-glib/tmpl/nm-dhcp6-config.sgml | 2 -
.../tmpl/nm-exported-connection-bindings.sgml | 213 ++
.../tmpl/nm-exported-connection-glue.sgml | 247 ++
docs/libnm-glib/tmpl/nm-glib-enum-types.sgml | 22 +
docs/libnm-glib/tmpl/nm-glib-marshal.sgml | 22 +
docs/libnm-glib/tmpl/nm-ip4-config.sgml | 2 -
docs/libnm-glib/tmpl/nm-ip6-config.sgml | 2 -
docs/libnm-glib/tmpl/nm-object.sgml | 2 -
docs/libnm-glib/tmpl/nm-remote-connection.sgml | 7 -
docs/libnm-glib/tmpl/nm-remote-settings.sgml | 30 +-
docs/libnm-glib/tmpl/nm-secret-agent-glue.sgml | 2 -
docs/libnm-glib/tmpl/nm-secret-agent.sgml | 14 +-
.../tmpl/nm-settings-system-bindings.sgml | 120 +
docs/libnm-glib/tmpl/nm-types.sgml | 2 -
docs/libnm-glib/tmpl/nm-vpn-connection.sgml | 2 -
docs/libnm-glib/tmpl/nm-vpn-enum-types.sgml | 22 +
.../tmpl/nm-vpn-plugin-ui-interface.sgml | 2 -
docs/libnm-glib/tmpl/nm-vpn-plugin-utils.sgml | 2 -
docs/libnm-glib/tmpl/nm-vpn-plugin.sgml | 2 -
docs/libnm-glib/tmpl/nm-wimax-nsp.sgml | 2 -
docs/libnm-util/Makefile.in | 9 +
docs/libnm-util/html/NMConnection.html | 157 +-
docs/libnm-util/html/NMSetting.html | 124 +-
docs/libnm-util/html/NMSetting8021x.html | 277 +-
docs/libnm-util/html/NMSettingBluetooth.html | 17 +-
docs/libnm-util/html/NMSettingCdma.html | 23 +-
docs/libnm-util/html/NMSettingConnection.html | 230 +-
docs/libnm-util/html/NMSettingGsm.html | 55 +-
docs/libnm-util/html/NMSettingIP4Config.html | 19 +-
docs/libnm-util/html/NMSettingIP6Config.html | 118 +-
docs/libnm-util/html/NMSettingOlpcMesh.html | 15 +-
docs/libnm-util/html/NMSettingPPP.html | 17 +-
docs/libnm-util/html/NMSettingPPPOE.html | 23 +-
docs/libnm-util/html/NMSettingSerial.html | 17 +-
docs/libnm-util/html/NMSettingVPN.html | 70 +-
docs/libnm-util/html/NMSettingWimax.html | 15 +-
docs/libnm-util/html/NMSettingWired.html | 15 +-
docs/libnm-util/html/NMSettingWireless.html | 19 +-
.../libnm-util/html/NMSettingWirelessSecurity.html | 59 +-
docs/libnm-util/html/api-index-full.html | 548 +++-
docs/libnm-util/html/ch01.html | 2 +-
docs/libnm-util/html/index.sgml | 97 +-
docs/libnm-util/html/libnm-util-nm-utils.html | 178 +-
docs/libnm-util/html/libnm-util.devhelp2 | 85 +-
docs/libnm-util/html/object-tree.html | 19 +
docs/libnm-util/libnm-util-sections.txt | 280 +-
docs/libnm-util/libnm-util.types | 19 +
docs/libnm-util/tmpl/libnm-util-unused.sgml | 260 ++
docs/libnm-util/tmpl/nm-connection.sgml | 54 +-
docs/libnm-util/tmpl/nm-setting-8021x.sgml | 72 +-
docs/libnm-util/tmpl/nm-setting-adsl.sgml | 262 ++
docs/libnm-util/tmpl/nm-setting-bluetooth.sgml | 9 +-
docs/libnm-util/tmpl/nm-setting-bond.sgml | 228 ++
docs/libnm-util/tmpl/nm-setting-cdma.sgml | 9 +-
docs/libnm-util/tmpl/nm-setting-connection.sgml | 118 +-
docs/libnm-util/tmpl/nm-setting-gsm.sgml | 9 +-
docs/libnm-util/tmpl/nm-setting-infiniband.sgml | 143 +
docs/libnm-util/tmpl/nm-setting-ip4-config.sgml | 9 +-
docs/libnm-util/tmpl/nm-setting-ip6-config.sgml | 40 +-
docs/libnm-util/tmpl/nm-setting-olpc-mesh.sgml | 9 +-
docs/libnm-util/tmpl/nm-setting-ppp.sgml | 9 +-
docs/libnm-util/tmpl/nm-setting-pppoe.sgml | 9 +-
docs/libnm-util/tmpl/nm-setting-private.sgml | 2 -
docs/libnm-util/tmpl/nm-setting-serial.sgml | 9 +-
docs/libnm-util/tmpl/nm-setting-vlan.sgml | 270 ++
docs/libnm-util/tmpl/nm-setting-vpn.sgml | 27 +-
docs/libnm-util/tmpl/nm-setting-wimax.sgml | 9 +-
docs/libnm-util/tmpl/nm-setting-wired.sgml | 9 +-
.../tmpl/nm-setting-wireless-security.sgml | 9 +-
docs/libnm-util/tmpl/nm-setting-wireless.sgml | 9 +-
docs/libnm-util/tmpl/nm-setting.sgml | 20 +-
docs/libnm-util/tmpl/nm-utils-enum-types.sgml | 22 +
docs/libnm-util/tmpl/nm-utils.sgml | 58 +-
examples/C/Makefile.in | 9 +
examples/C/glib/Makefile.am | 27 +-
examples/C/glib/Makefile.in | 72 +-
examples/C/glib/list-connections-libnm-glib.c | 2 +-
examples/C/glib/monitor-nm-running-GDBus.c | 92 +
examples/C/glib/monitor-nm-running-dbus-glib.c | 125 +
examples/C/glib/monitor-nm-state-GDBus.c | 138 +
examples/C/qt/Makefile.am | 22 +-
examples/C/qt/Makefile.in | 58 +-
examples/C/qt/monitor-nm-running.cpp | 89 +
examples/Makefile.am | 2 +
examples/Makefile.in | 11 +
examples/python/Makefile.in | 9 +
examples/ruby/Makefile.am | 4 +
examples/ruby/Makefile.in | 482 +++
examples/ruby/add-connection.rb | 86 +
examples/ruby/get-basic-nm-info.rb | 51 +
examples/ruby/list-devices.rb | 85 +
examples/shell/Makefile.am | 3 +
examples/shell/Makefile.in | 481 +++
examples/shell/get-hostname.sh | 45 +
examples/shell/nm-logging.sh | 46 +
include/Makefile.am | 1 -
include/Makefile.in | 10 +-
include/NetworkManager.h | 54 +-
include/NetworkManagerVPN.h | 3 +
include/nm-glib-compat.h | 15 +
include/nm-version.h | 2 +-
include/wireless-helper.h | 32 -
initscript/Arch/Makefile.in | 9 +
initscript/Debian/Makefile.in | 9 +
initscript/Gentoo/Makefile.in | 9 +
initscript/Makefile.in | 9 +
initscript/Mandriva/Makefile.in | 9 +
initscript/Mandriva/networkmanager.in | 1 +
initscript/RedHat/Makefile.in | 9 +
initscript/SUSE/Makefile.in | 9 +
initscript/Slackware/Makefile.in | 9 +
initscript/linexa/Makefile.in | 9 +
initscript/paldo/Makefile.in | 9 +
introspection/Makefile.am | 3 +
introspection/Makefile.in | 12 +
introspection/all.xml.in | 3 +
introspection/nm-active-connection.xml | 3 +
introspection/nm-device-bond.xml | 27 +
introspection/nm-device-infiniband.xml | 27 +
introspection/nm-device-vlan.xml | 33 +
introspection/nm-device.xml | 62 +
libnm-glib/Makefile.am | 132 +-
libnm-glib/Makefile.in | 307 +-
libnm-glib/libnm-glib-test.c | 2 -
libnm-glib/libnm-glib.ver | 48 +
libnm-glib/nm-access-point.c | 179 +-
libnm-glib/nm-active-connection.c | 336 +-
libnm-glib/nm-active-connection.h | 2 +
libnm-glib/nm-client.c | 782 ++---
libnm-glib/nm-client.h | 9 +-
libnm-glib/nm-dbus-utils.c | 215 --
libnm-glib/nm-dbus-utils.h | 57 -
libnm-glib/nm-device-bond.c | 300 ++
libnm-glib/nm-device-bond.h | 82 +
libnm-glib/nm-device-bt.c | 141 +-
libnm-glib/nm-device-bt.h | 23 +-
libnm-glib/nm-device-ethernet.c | 156 +-
libnm-glib/nm-device-ethernet.h | 21 +-
libnm-glib/nm-device-infiniband.c | 310 ++
libnm-glib/nm-device-infiniband.h | 84 +
libnm-glib/nm-device-modem.c | 118 +-
libnm-glib/nm-device-modem.h | 19 +-
libnm-glib/nm-device-olpc-mesh.c | 333 ++
libnm-glib/nm-device-olpc-mesh.h | 84 +
libnm-glib/nm-device-private.h | 12 +-
libnm-glib/nm-device-vlan.c | 338 ++
libnm-glib/nm-device-vlan.h | 86 +
libnm-glib/nm-device-wifi.c | 340 +-
libnm-glib/nm-device-wifi.h | 27 +-
libnm-glib/nm-device-wimax.c | 339 +-
libnm-glib/nm-device-wimax.h | 21 +-
libnm-glib/nm-device.c | 786 ++---
libnm-glib/nm-device.h | 13 +-
libnm-glib/nm-dhcp4-config.c | 55 +-
libnm-glib/nm-dhcp6-config.c | 55 +-
libnm-glib/nm-glib-enum-types.c | 367 +++
libnm-glib/nm-glib-enum-types.h | 47 +
libnm-glib/nm-glib-marshal.c | 167 +
libnm-glib/nm-glib-marshal.h | 36 +
libnm-glib/nm-ip4-config.c | 157 +-
libnm-glib/nm-ip6-config.c | 123 +-
libnm-glib/nm-object-cache.c | 14 +-
libnm-glib/nm-object-cache.h | 2 -
libnm-glib/nm-object-private.h | 105 +-
libnm-glib/nm-object.c | 1096 +++++--
libnm-glib/nm-remote-connection.c | 223 +-
libnm-glib/nm-remote-settings.c | 430 ++-
libnm-glib/nm-remote-settings.h | 18 +-
libnm-glib/nm-secret-agent.c | 77 +-
libnm-glib/nm-secret-agent.h | 82 +-
libnm-glib/nm-types.c | 22 +-
libnm-glib/nm-types.h | 2 +
libnm-glib/nm-vpn-connection.c | 89 +-
libnm-glib/nm-vpn-enum-types.c | 61 +
libnm-glib/nm-vpn-enum-types.h | 21 +
libnm-glib/nm-vpn-plugin.c | 28 +-
libnm-glib/nm-vpn-plugin.h | 19 +-
libnm-glib/nm-wimax-nsp.c | 75 +-
libnm-glib/tests/Makefile.am | 2 +
libnm-glib/tests/Makefile.in | 11 +
libnm-util/Makefile.am | 20 +-
libnm-util/Makefile.in | 100 +-
libnm-util/libnm-util.ver | 67 +
libnm-util/nm-connection.c | 172 +-
libnm-util/nm-connection.h | 21 +-
libnm-util/nm-setting-8021x.c | 154 +-
libnm-util/nm-setting-8021x.h | 24 +-
libnm-util/nm-setting-bluetooth.c | 21 -
libnm-util/nm-setting-bluetooth.h | 11 +-
libnm-util/nm-setting-bond.c | 663 ++++
libnm-util/nm-setting-bond.h | 107 +
libnm-util/nm-setting-cdma.c | 25 -
libnm-util/nm-setting-cdma.h | 11 +-
libnm-util/nm-setting-connection.c | 216 +-
libnm-util/nm-setting-connection.h | 29 +-
libnm-util/nm-setting-gsm.c | 33 +-
libnm-util/nm-setting-gsm.h | 11 +-
libnm-util/nm-setting-infiniband.c | 291 ++
libnm-util/nm-setting-infiniband.h | 81 +
libnm-util/nm-setting-ip4-config.c | 27 +-
libnm-util/nm-setting-ip4-config.h | 11 +-
libnm-util/nm-setting-ip6-config.c | 81 +-
libnm-util/nm-setting-ip6-config.h | 34 +-
libnm-util/nm-setting-olpc-mesh.c | 23 -
libnm-util/nm-setting-olpc-mesh.h | 9 +-
libnm-util/nm-setting-ppp.c | 25 -
libnm-util/nm-setting-ppp.h | 11 +-
libnm-util/nm-setting-pppoe.c | 25 -
libnm-util/nm-setting-pppoe.h | 11 +-
libnm-util/nm-setting-serial.c | 25 -
libnm-util/nm-setting-serial.h | 11 +-
libnm-util/nm-setting-vlan.c | 728 +++++
libnm-util/nm-setting-vlan.h | 144 +
libnm-util/nm-setting-vpn.c | 59 +-
libnm-util/nm-setting-vpn.h | 11 +-
libnm-util/nm-setting-wimax.c | 23 -
libnm-util/nm-setting-wimax.h | 9 +-
libnm-util/nm-setting-wired.c | 23 -
libnm-util/nm-setting-wired.h | 9 +-
libnm-util/nm-setting-wireless-security.c | 31 -
libnm-util/nm-setting-wireless-security.h | 17 +-
libnm-util/nm-setting-wireless.c | 29 -
libnm-util/nm-setting-wireless.h | 13 +-
libnm-util/nm-setting.c | 42 +-
libnm-util/nm-setting.h | 16 +-
libnm-util/nm-utils-enum-types.c | 759 +++++
libnm-util/nm-utils-enum-types.h | 85 +
libnm-util/nm-utils.c | 202 +-
libnm-util/nm-utils.h | 16 +
libnm-util/tests/Makefile.am | 4 +-
libnm-util/tests/Makefile.in | 13 +-
libnm-util/tests/certs/Makefile.in | 9 +
libnm-util/tests/test-general.c | 78 +-
libnm-util/tests/test-secrets.c | 4 +-
m4/compiler_warnings.m4 | 8 +-
man/Makefile.in | 9 +
man/NetworkManager.conf.5 | 20 +
man/NetworkManager.conf.5.in | 20 +
marshallers/Makefile.am | 27 -
marshallers/Makefile.in | 635 ----
marshallers/nm-marshal-main.c | 2 -
marshallers/nm-marshal.list | 30 -
po/LINGUAS | 1 +
po/POTFILES.in | 5 +-
po/cs.po | 1612 +++++-----
po/hu.po | 1755 +++++++----
po/ml.po | 2021 ++++++++----
po/pl.po | 1398 ++++++---
po/pt_BR.po | 2606 ++++++++++++----
po/sl.po | 1730 +++++++----
po/tr.po | 2129 +++++++++++++
po/uk.po | 1588 +++++++---
policy/Makefile.in | 9 +
policy/org.freedesktop.NetworkManager.policy | 72 +-
src/Makefile.am | 80 +-
src/Makefile.in | 481 +--
src/NetworkManager.conf | 121 -
src/NetworkManagerUtils.c | 82 +-
src/NetworkManagerUtils.h | 16 +-
src/backends/Makefile.am | 7 +-
src/backends/Makefile.in | 22 +-
src/backends/NetworkManagerArch.c | 34 +-
src/backends/NetworkManagerDebian.c | 30 +-
src/backends/NetworkManagerExherbo.c | 32 +-
src/backends/NetworkManagerFrugalware.c | 29 +-
src/backends/NetworkManagerGeneric.c | 64 +-
src/backends/NetworkManagerGeneric.h | 15 +-
src/backends/NetworkManagerGentoo.c | 38 +-
src/backends/NetworkManagerLinexa.c | 29 +-
src/backends/NetworkManagerMandriva.c | 30 +-
src/backends/NetworkManagerPaldo.c | 36 +-
src/backends/NetworkManagerPardus.c | 29 +-
src/backends/NetworkManagerRedHat.c | 30 +-
src/backends/NetworkManagerSlackware.c | 29 +-
src/backends/NetworkManagerSuSE.c | 36 +-
src/backends/nm-backend.h | 30 +
src/bluez-manager/Makefile.am | 9 +-
src/bluez-manager/Makefile.in | 20 +-
src/bluez-manager/nm-bluez-manager.c | 7 +-
src/dhcp-manager/Makefile.am | 7 +-
src/dhcp-manager/Makefile.in | 18 +-
src/dhcp-manager/nm-dhcp-dhclient-utils.c | 4 +-
src/dhcp-manager/nm-dhcp-manager.c | 18 -
src/dhcp-manager/nm-dhcp-manager.h | 10 +-
src/dhcp-manager/tests/Makefile.am | 2 +
src/dhcp-manager/tests/Makefile.in | 11 +
src/dns-manager/Makefile.am | 4 +-
src/dns-manager/Makefile.in | 13 +-
src/dns-manager/nm-dns-bind.c | 2 +-
src/dns-manager/nm-dns-dnsmasq.c | 7 +-
src/dns-manager/nm-dns-manager.c | 4 +-
src/dnsmasq-manager/Makefile.in | 9 +
src/firewall-manager/Makefile.am | 23 +
src/firewall-manager/Makefile.in | 641 ++++
src/firewall-manager/nm-firewall-manager.c | 327 ++
src/firewall-manager/nm-firewall-manager.h | 73 +
src/generated/Makefile.am | 77 +
src/generated/Makefile.in | 697 +++++
src/generated/nm-enum-types.c | 913 ++++++
src/generated/nm-enum-types.h | 89 +
src/generated/nm-marshal.c | 705 +++++
src/generated/nm-marshal.h | 151 +
src/ip6-manager/Makefile.am | 7 +-
src/ip6-manager/Makefile.in | 18 +-
src/ip6-manager/nm-ip6-manager.c | 63 +-
src/logging/Makefile.in | 9 +
src/logging/nm-logging.c | 28 +-
src/logging/nm-logging.h | 9 +-
src/main.c | 175 +-
src/modem-manager/Makefile.am | 9 +-
src/modem-manager/Makefile.in | 19 +-
src/modem-manager/nm-modem-cdma.c | 55 +-
src/modem-manager/nm-modem-cdma.h | 6 +
src/modem-manager/nm-modem-gsm.c | 167 +-
src/modem-manager/nm-modem-gsm.h | 6 +
src/modem-manager/nm-modem-manager.c | 106 +-
src/modem-manager/nm-modem.c | 189 +-
src/modem-manager/nm-modem.h | 10 +-
src/nm-activation-request.c | 318 +-
src/nm-activation-request.h | 32 +-
src/nm-active-connection.c | 320 +-
src/nm-active-connection.h | 78 +-
src/nm-config.c | 93 +-
src/nm-config.h | 10 +-
src/nm-connectivity.c | 368 +++
src/nm-connectivity.h | 66 +
src/nm-device-bond.c | 569 ++++
src/nm-device-bond.h | 65 +
src/nm-device-bt.c | 157 +-
src/nm-device-bt.h | 8 +-
src/nm-device-ethernet.c | 970 ++----
src/nm-device-ethernet.h | 17 +-
src/nm-device-factory.h | 91 +
src/nm-device-infiniband.c | 517 +++
src/nm-device-infiniband.h | 66 +
src/nm-device-interface.c | 433 ---
src/nm-device-interface.h | 158 -
src/nm-device-modem.c | 78 +-
src/nm-device-olpc-mesh.c | 308 +-
src/nm-device-olpc-mesh.h | 7 +
src/nm-device-private.h | 41 +-
src/nm-device-vlan.c | 803 +++++
src/nm-device-vlan.h | 67 +
src/nm-device-wifi.c | 1205 +++----
src/nm-device-wifi.h | 14 +-
src/nm-device-wired.c | 595 ++++
src/nm-device-wired.h | 59 +
src/nm-device.c | 3283 ++++++++++++--------
src/nm-device.h | 137 +-
src/nm-ip6-config.c | 19 +-
src/nm-manager-auth.c | 2 +-
src/nm-manager.c | 1387 +++++++--
src/nm-manager.h | 35 +-
src/nm-netlink-compat.c | 137 +
src/nm-netlink-compat.h | 78 +-
src/nm-netlink-monitor.c | 122 +-
src/nm-netlink-monitor.h | 5 +-
src/nm-netlink-utils.c | 109 +-
src/nm-netlink-utils.h | 16 +-
src/nm-policy.c | 215 +-
src/nm-properties-changed-signal.c | 5 +-
src/nm-session-monitor-ck.c | 509 +++
src/nm-session-monitor-null.c | 171 +
src/nm-session-monitor-systemd.c | 251 ++
src/nm-session-monitor.c | 636 ----
src/nm-session-utils.c | 79 +
src/nm-session-utils.h | 41 +
src/nm-system.c | 832 ++++-
src/nm-system.h | 37 +-
src/nm-udev-manager.c | 209 +-
src/nm-udev-manager.h | 7 +-
src/nm-wifi-ap.c | 53 +-
src/nm-wifi-ap.h | 8 +-
src/org.freedesktop.NetworkManager.conf | 121 +
src/ppp-manager/Makefile.am | 9 +-
src/ppp-manager/Makefile.in | 20 +-
src/ppp-manager/nm-ppp-manager.c | 16 +-
src/settings/Makefile.am | 9 +-
src/settings/Makefile.in | 20 +-
src/settings/nm-agent-manager.c | 45 +-
src/settings/nm-agent-manager.h | 10 +
src/settings/nm-settings-connection.c | 20 +-
src/settings/nm-settings-connection.h | 4 +-
src/settings/nm-settings-error.c | 50 -
src/settings/nm-settings-error.h | 36 +-
src/settings/nm-settings.c | 229 +-
src/settings/nm-settings.h | 3 +
src/settings/nm-system-config-interface.h | 2 +-
src/settings/plugins/Makefile.in | 9 +
src/settings/plugins/ifcfg-rh/Makefile.am | 7 +-
src/settings/plugins/ifcfg-rh/Makefile.in | 22 +-
src/settings/plugins/ifcfg-rh/common.h | 11 +-
src/settings/plugins/ifcfg-rh/plugin.c | 4 +-
src/settings/plugins/ifcfg-rh/reader.c | 834 ++++-
src/settings/plugins/ifcfg-rh/reader.h | 2 -
src/settings/plugins/ifcfg-rh/tests/Makefile.am | 3 +
src/settings/plugins/ifcfg-rh/tests/Makefile.in | 15 +-
.../ifcfg-rh/tests/network-scripts/Makefile.am | 9 +-
.../ifcfg-rh/tests/network-scripts/Makefile.in | 18 +-
.../tests/network-scripts/ifcfg-test-bond-main | 5 +
.../tests/network-scripts/ifcfg-test-bond-slave | 4 +
.../tests/network-scripts/ifcfg-test-infiniband | 8 +
.../network-scripts/ifcfg-test-vlan-interface | 11 +-
.../network-scripts/ifcfg-test-vlan-only-device | 4 +
.../network-scripts/ifcfg-test-vlan-only-vlanid | 6 +
.../network-scripts/ifcfg-test-wifi-wpa-psk-2 | 19 +
.../tests/network-scripts/keys-test-wifi-wpa-psk-2 | 2 +
.../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 1443 +++++++--
src/settings/plugins/ifcfg-rh/utils.c | 99 +-
src/settings/plugins/ifcfg-rh/utils.h | 9 +-
src/settings/plugins/ifcfg-rh/writer.c | 276 +-
src/settings/plugins/ifcfg-suse/Makefile.in | 9 +
src/settings/plugins/ifcfg-suse/plugin.c | 4 +-
src/settings/plugins/ifnet/Makefile.am | 16 +-
src/settings/plugins/ifnet/Makefile.in | 25 +-
src/settings/plugins/ifnet/connection_parser.c | 89 +-
src/settings/plugins/ifnet/net_parser.c | 169 +-
src/settings/plugins/ifnet/net_parser.h | 4 +-
src/settings/plugins/ifnet/net_utils.c | 169 +-
src/settings/plugins/ifnet/net_utils.h | 1 +
src/settings/plugins/ifnet/plugin.c | 85 +-
src/settings/plugins/ifnet/plugin.h | 2 +
src/settings/plugins/ifnet/tests/Makefile.in | 9 +
src/settings/plugins/ifnet/tests/net | 11 +-
src/settings/plugins/ifnet/tests/test_all.c | 43 +-
.../plugins/ifnet/tests/wpa_supplicant.conf | 7 +
src/settings/plugins/ifnet/wpa_parser.c | 19 +-
src/settings/plugins/ifnet/wpa_parser.h | 5 +-
src/settings/plugins/ifupdown/Makefile.in | 9 +
src/settings/plugins/ifupdown/interface_parser.c | 13 +
src/settings/plugins/ifupdown/interface_parser.h | 3 +
src/settings/plugins/ifupdown/parser.c | 315 +-
src/settings/plugins/ifupdown/plugin.c | 49 +-
src/settings/plugins/ifupdown/tests/Makefile.am | 2 +-
src/settings/plugins/ifupdown/tests/Makefile.in | 11 +-
.../plugins/ifupdown/tests/test-ifupdown.c | 391 +++
.../ifupdown/tests/test17-wired-static-verify-ip4 | 5 +
src/settings/plugins/keyfile/Makefile.am | 4 +-
src/settings/plugins/keyfile/Makefile.in | 13 +-
src/settings/plugins/keyfile/plugin.c | 54 +-
src/settings/plugins/keyfile/plugin.h | 4 +-
src/settings/plugins/keyfile/reader.c | 89 +-
src/settings/plugins/keyfile/tests/Makefile.am | 2 +
src/settings/plugins/keyfile/tests/Makefile.in | 11 +
.../plugins/keyfile/tests/keyfiles/Makefile.am | 3 +-
.../plugins/keyfile/tests/keyfiles/Makefile.in | 12 +-
.../tests/keyfiles/Test_InfiniBand_Connection | 13 +
src/settings/plugins/keyfile/tests/test-keyfile.c | 207 +-
src/settings/plugins/keyfile/writer.c | 40 +-
src/settings/tests/Makefile.am | 1 +
src/settings/tests/Makefile.in | 10 +
src/supplicant-manager/Makefile.am | 6 +-
src/supplicant-manager/Makefile.in | 16 +-
src/supplicant-manager/nm-supplicant-config.c | 105 +-
src/supplicant-manager/nm-supplicant-config.h | 8 +-
src/supplicant-manager/nm-supplicant-interface.c | 353 ++-
src/supplicant-manager/nm-supplicant-interface.h | 26 +
src/supplicant-manager/nm-supplicant-manager.c | 2 +-
.../nm-supplicant-settings-verify.c | 34 +-
.../nm-supplicant-settings-verify.h | 3 +-
src/supplicant-manager/tests/Makefile.am | 2 +
src/supplicant-manager/tests/Makefile.in | 11 +
src/tests/Makefile.am | 2 +
src/tests/Makefile.in | 11 +
src/tests/test-wifi-ap-utils.c | 8 +-
src/vpn-manager/Makefile.am | 13 +-
src/vpn-manager/Makefile.in | 34 +-
src/vpn-manager/nm-vpn-connection-base.c | 209 --
src/vpn-manager/nm-vpn-connection-base.h | 57 -
src/vpn-manager/nm-vpn-connection.c | 91 +-
src/vpn-manager/nm-vpn-connection.h | 9 +-
src/vpn-manager/nm-vpn-manager.c | 38 +-
src/vpn-manager/nm-vpn-manager.h | 23 +-
src/wifi/Makefile.am | 31 +
src/wifi/Makefile.in | 665 ++++
src/wifi/wifi-utils-nl80211.c | 819 +++++
src/wifi/wifi-utils-nl80211.h | 30 +
src/wifi/wifi-utils-private.h | 74 +
src/wifi/wifi-utils-wext.c | 663 ++++
src/wifi/wifi-utils-wext.h | 30 +
src/wifi/wifi-utils.c | 213 ++
src/wifi/wifi-utils.h | 72 +
src/wimax/Makefile.am | 21 +-
src/wimax/Makefile.in | 190 +-
src/wimax/nm-device-wimax.c | 111 +-
src/wimax/nm-device-wimax.h | 8 +
src/wimax/nm-wimax-factory.c | 58 +
src/wimax/nm-wimax-nsp.c | 2 +-
src/wpa.c | 455 ---
src/wpa.h | 38 -
test/Makefile.am | 4 +-
test/Makefile.in | 13 +-
test/nm-tool.c | 2 +-
tools/Makefile.am | 2 +-
tools/Makefile.in | 11 +-
tools/glib-mkenums | 570 ++++
583 files changed, 56505 insertions(+), 19108 deletions(-)
create mode 100644 Makefile.glib
create mode 100644 cli/src/common.c
create mode 100644 cli/src/common.h
create mode 100644 docs/libnm-glib/tmpl/nm-device-bond.sgml
create mode 100644 docs/libnm-glib/tmpl/nm-device-infiniband-bindings.sgml
create mode 100644 docs/libnm-glib/tmpl/nm-device-infiniband.sgml
create mode 100644 docs/libnm-glib/tmpl/nm-device-olpc-mesh.sgml
create mode 100644 docs/libnm-glib/tmpl/nm-device-vlan.sgml
create mode 100644 docs/libnm-glib/tmpl/nm-exported-connection-bindings.sgml
create mode 100644 docs/libnm-glib/tmpl/nm-exported-connection-glue.sgml
create mode 100644 docs/libnm-glib/tmpl/nm-glib-enum-types.sgml
create mode 100644 docs/libnm-glib/tmpl/nm-glib-marshal.sgml
create mode 100644 docs/libnm-glib/tmpl/nm-settings-system-bindings.sgml
create mode 100644 docs/libnm-glib/tmpl/nm-vpn-enum-types.sgml
create mode 100644 docs/libnm-util/tmpl/nm-setting-adsl.sgml
create mode 100644 docs/libnm-util/tmpl/nm-setting-bond.sgml
create mode 100644 docs/libnm-util/tmpl/nm-setting-infiniband.sgml
create mode 100644 docs/libnm-util/tmpl/nm-setting-vlan.sgml
create mode 100644 docs/libnm-util/tmpl/nm-utils-enum-types.sgml
create mode 100644 examples/C/glib/monitor-nm-running-GDBus.c
create mode 100644 examples/C/glib/monitor-nm-running-dbus-glib.c
create mode 100644 examples/C/glib/monitor-nm-state-GDBus.c
create mode 100644 examples/C/qt/monitor-nm-running.cpp
create mode 100644 examples/ruby/Makefile.am
create mode 100644 examples/ruby/Makefile.in
create mode 100755 examples/ruby/add-connection.rb
create mode 100755 examples/ruby/get-basic-nm-info.rb
create mode 100755 examples/ruby/list-devices.rb
create mode 100644 examples/shell/Makefile.am
create mode 100644 examples/shell/Makefile.in
create mode 100755 examples/shell/get-hostname.sh
create mode 100755 examples/shell/nm-logging.sh
delete mode 100644 include/wireless-helper.h
create mode 100644 introspection/nm-device-bond.xml
create mode 100644 introspection/nm-device-infiniband.xml
create mode 100644 introspection/nm-device-vlan.xml
delete mode 100644 libnm-glib/nm-dbus-utils.c
delete mode 100644 libnm-glib/nm-dbus-utils.h
create mode 100644 libnm-glib/nm-device-bond.c
create mode 100644 libnm-glib/nm-device-bond.h
create mode 100644 libnm-glib/nm-device-infiniband.c
create mode 100644 libnm-glib/nm-device-infiniband.h
create mode 100644 libnm-glib/nm-device-olpc-mesh.c
create mode 100644 libnm-glib/nm-device-olpc-mesh.h
create mode 100644 libnm-glib/nm-device-vlan.c
create mode 100644 libnm-glib/nm-device-vlan.h
create mode 100644 libnm-glib/nm-glib-enum-types.c
create mode 100644 libnm-glib/nm-glib-enum-types.h
create mode 100644 libnm-glib/nm-glib-marshal.c
create mode 100644 libnm-glib/nm-glib-marshal.h
create mode 100644 libnm-glib/nm-vpn-enum-types.c
create mode 100644 libnm-glib/nm-vpn-enum-types.h
create mode 100644 libnm-util/nm-setting-bond.c
create mode 100644 libnm-util/nm-setting-bond.h
create mode 100644 libnm-util/nm-setting-infiniband.c
create mode 100644 libnm-util/nm-setting-infiniband.h
create mode 100644 libnm-util/nm-setting-vlan.c
create mode 100644 libnm-util/nm-setting-vlan.h
create mode 100644 libnm-util/nm-utils-enum-types.c
create mode 100644 libnm-util/nm-utils-enum-types.h
delete mode 100644 marshallers/Makefile.am
delete mode 100644 marshallers/Makefile.in
delete mode 100644 marshallers/nm-marshal-main.c
delete mode 100644 marshallers/nm-marshal.list
create mode 100644 po/tr.po
delete mode 100644 src/NetworkManager.conf
create mode 100644 src/backends/nm-backend.h
create mode 100644 src/firewall-manager/Makefile.am
create mode 100644 src/firewall-manager/Makefile.in
create mode 100644 src/firewall-manager/nm-firewall-manager.c
create mode 100644 src/firewall-manager/nm-firewall-manager.h
create mode 100644 src/generated/Makefile.am
create mode 100644 src/generated/Makefile.in
create mode 100644 src/generated/nm-enum-types.c
create mode 100644 src/generated/nm-enum-types.h
create mode 100644 src/generated/nm-marshal.c
create mode 100644 src/generated/nm-marshal.h
create mode 100644 src/nm-connectivity.c
create mode 100644 src/nm-connectivity.h
create mode 100644 src/nm-device-bond.c
create mode 100644 src/nm-device-bond.h
create mode 100644 src/nm-device-factory.h
create mode 100644 src/nm-device-infiniband.c
create mode 100644 src/nm-device-infiniband.h
delete mode 100644 src/nm-device-interface.c
delete mode 100644 src/nm-device-interface.h
create mode 100644 src/nm-device-vlan.c
create mode 100644 src/nm-device-vlan.h
create mode 100644 src/nm-device-wired.c
create mode 100644 src/nm-device-wired.h
create mode 100644 src/nm-session-monitor-ck.c
create mode 100644 src/nm-session-monitor-null.c
create mode 100644 src/nm-session-monitor-systemd.c
delete mode 100644 src/nm-session-monitor.c
create mode 100644 src/nm-session-utils.c
create mode 100644 src/nm-session-utils.h
create mode 100644 src/org.freedesktop.NetworkManager.conf
create mode 100644 src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bond-main
create mode 100644 src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-bond-slave
create mode 100644 src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-infiniband
create mode 100644 src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-vlan-only-device
create mode 100644 src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-vlan-only-vlanid
create mode 100644 src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-wpa-psk-2
create mode 100644 src/settings/plugins/ifcfg-rh/tests/network-scripts/keys-test-wifi-wpa-psk-2
create mode 100644 src/settings/plugins/ifupdown/tests/test17-wired-static-verify-ip4
create mode 100644 src/settings/plugins/keyfile/tests/keyfiles/Test_InfiniBand_Connection
delete mode 100644 src/vpn-manager/nm-vpn-connection-base.c
delete mode 100644 src/vpn-manager/nm-vpn-connection-base.h
create mode 100644 src/wifi/Makefile.am
create mode 100644 src/wifi/Makefile.in
create mode 100644 src/wifi/wifi-utils-nl80211.c
create mode 100644 src/wifi/wifi-utils-nl80211.h
create mode 100644 src/wifi/wifi-utils-private.h
create mode 100644 src/wifi/wifi-utils-wext.c
create mode 100644 src/wifi/wifi-utils-wext.h
create mode 100644 src/wifi/wifi-utils.c
create mode 100644 src/wifi/wifi-utils.h
create mode 100644 src/wimax/nm-wimax-factory.c
delete mode 100644 src/wpa.c
delete mode 100644 src/wpa.h
create mode 100755 tools/glib-mkenums
diff --git a/Makefile.am b/Makefile.am
index c128368c..bcd403bd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,6 @@
+include $(GLIB_MAKEFILE)
+
SUBDIRS = \
- marshallers \
include \
libnm-util \
libnm-glib \
@@ -22,14 +23,16 @@ EXTRA_DIST = \
NetworkManager.pc.in \
intltool-extract.in \
intltool-merge.in \
- intltool-update.in
+ intltool-update.in \
+ Makefile.glib
DISTCHECK_CONFIGURE_FLAGS = \
--with-tests=yes \
--with-docs=yes \
--enable-more-warnings=yes \
--with-udev-dir=$$dc_install_base/lib/udev \
- --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
+ --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) \
+ --with-wext=no
DISTCLEANFILES = intltool-extract intltool-merge intltool-update
@@ -38,3 +41,8 @@ pkgconfig_DATA = NetworkManager.pc
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
+CLEANFILES = cscope.in.out cscope.out cscope.po.out
+
+.PHONY: cscope
+cscope:
+ cscope -b -q -R -Iinclude -ssrc -slibnm-glib -slibnm-util -scli/src;
diff --git a/Makefile.glib b/Makefile.glib
new file mode 100644
index 00000000..951ce6f8
--- /dev/null
+++ b/Makefile.glib
@@ -0,0 +1,169 @@
+# -*- Mode: makefile -*-
+#
+# Work-in-progress...
+# See https://bugzilla.gnome.org/show_bug.cgi?id=654395
+
+_GLIB_CLEANFILES =
+_GLIB_DISTCLEANFILES =
+
+_GLIB_V_GEN = $(_glib_v_gen_$(V))
+_glib_v_gen_ = $(_glib_v_gen_$(AM_DEFAULT_VERBOSITY))
+_glib_v_gen_0 = @echo " GEN " $(subst .stamp,,$@);
+
+
+### glib-genmarshal
+
+_GLIB_MARSHAL_GENERATED = $(subst .h,,$(filter %marshal.h,$(GLIB_GENERATED)))
+
+_glib_marshal_prefix = $(subst marshal,,$(subst _marshal,,$(subst -,_,$(notdir $(1)))))_marshal
+_glib_marshal_sources_var = $(subst -,_,$(notdir $(1)))_sources
+_glib_marshal_sources = $(filter-out %.h,$(filter-out $(GLIB_GENERATED),$($(_glib_marshal_sources_var))))
+
+define _glib_make_genmarshal_rules
+$(if $(_glib_marshal_sources),,$(error Need to define $(_glib_marshal_sources_var) for $(1).[ch]))
+
+$(1).list.stamp: $(_glib_marshal_sources)
+ $$(_GLIB_V_GEN) LC_ALL=C sed -ne 's/.*_$(_glib_marshal_prefix)_\([_A-Z]*\).*/\1/p' $$^ | sort -u | sed -e 's/__/:/' -e 's/_/,/g' > $(1).list.tmp && \
+ (cmp -s $(1).list.tmp $(1).list || cp $(1).list.tmp $(1).list) && \
+ rm -f $(1).list.tmp && \
+ echo timestamp > $$@
+
+$(1).list: $(1).list.stamp
+ @true
+
+$(1).h: $(1).list
+ $$(_GLIB_V_GEN) $$(GLIB_GENMARSHAL) \
+ --prefix=_$(_glib_marshal_prefix) --header \
+ $$(GLIB_GENMARSHAL_H_FLAGS) \
+ $$($(_glib_marshal_prefix)_GENMARSHAL_H_FLAGS) \
+ $$< > $$@.tmp && \
+ mv $$@.tmp $$@
+
+$(1).c: $(1).list
+ $$(_GLIB_V_GEN) (echo "#include \"$$(subst .c,.h,$$(@F))\""; $$(GLIB_GENMARSHAL) \
+ --prefix=_$(_glib_marshal_prefix) --body \
+ $$(GLIB_GENMARSHAL_C_FLAGS) \
+ $$($(_glib_marshal_prefix)_GENMARSHAL_C_FLAGS) \
+ $$< ) > $$@.tmp && \
+ mv $$@.tmp $$@
+
+_GLIB_CLEANFILES += $(1).list.stamp $(1).list
+_GLIB_DISTCLEANFILES += $(1).h $(1).c
+endef
+
+$(foreach f,$(_GLIB_MARSHAL_GENERATED),$(eval $(call _glib_make_genmarshal_rules,$f)))
+
+
+### glib-mkenums
+
+_GLIB_ENUM_TYPES_GENERATED = $(subst .h,,$(filter %enum-types.h %enumtypes.h,$(GLIB_GENERATED)))
+
+_glib_enum_types_prefix = $(subst -,_,$(notdir $(1)))
+_glib_enum_types_guard = __$(shell LC_ALL=C echo $(_glib_enum_types_prefix) | tr 'a-z' 'A-Z')_H__
+_glib_enum_types_sources_var = $(_glib_enum_types_prefix)_sources
+_glib_enum_types_sources = $(filter-out $(GLIB_GENERATED),$($(_glib_enum_types_sources_var)))
+_glib_enum_types_h_sources = $(filter %.h,$(_glib_enum_types_sources))
+
+define _glib_make_mkenums_rules
+$(if $(_glib_enum_types_sources),,$(error Need to define $(_glib_enum_types_sources_var) for $(1).[ch]))
+
+$(1).h.stamp: $(_glib_enum_types_h_sources)
+ $$(_GLIB_V_GEN) $$(GLIB_MKENUMS) \
+ --fhead "/* Generated by glib-mkenums. Do not edit */\n\n#ifndef $(_glib_enum_types_guard)\n#define $(_glib_enum_types_guard)\n\n" \
+ $$(GLIB_MKENUMS_H_FLAGS) \
+ $$($(_glib_enum_types_prefix)_MKENUMS_H_FLAGS) \
+ --fhead "#include \n\nG_BEGIN_DECLS\n" \
+ --vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())\n" \
+ --ftail "G_END_DECLS\n\n#endif /* $(_glib_enum_types_guard) */" \
+ $$^ > $(1).h.tmp && \
+ (cmp -s $(1).h.tmp $(1).h || cp $(1).h.tmp $(1).h) && \
+ rm -f $(1).h.tmp && \
+ echo timestamp > $$@
+
+$(1).h: $(1).h.stamp
+ @true
+
+$(1).c.stamp: $(_glib_enum_types_h_sources)
+ $$(_GLIB_V_GEN) $$(GLIB_MKENUMS) \
+ --fhead "/* Generated by glib-mkenums. Do not edit */\n\n#include \"$(notdir $(1)).h\"\n" \
+ $$(GLIB_MKENUMS_C_FLAGS) \
+ $$($(_glib_enum_types_prefix)_MKENUMS_C_FLAGS) \
+ --fhead "$$(foreach f,$$(^F),\n#include \"$$(f)\")\n\n" \
+ --vhead "GType\n@enum_name@_get_type (void)\n{\n static volatile gsize g_define_type_id__volatile = 0;\n\n if (g_once_init_enter (&g_define_type_id__volatile))\n {\n static const G@Type@Value values[] = {\n" \
+ --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" },\n" \
+ --vtail " { 0, NULL, NULL }\n };\n GType g_define_type_id =\n g_@type@_register_static (g_intern_static_string (\"@EnumName@\"), values);\n g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);\n }\n\n return g_define_type_id__volatile;\n}\n" \
+ $$^ > $(1).c.tmp && \
+ (cmp -s $(1).c.tmp $(1).c || cp $(1).c.tmp $(1).c) && \
+ rm -f $(1).c.tmp && \
+ echo timestamp > $$@
+
+$(1).c: $(1).c.stamp
+ @true
+
+_GLIB_CLEANFILES += $(1).h.stamp $(1).c.stamp
+_GLIB_DISTCLEANFILES += $(1).h $(1).c $(1).h.stamp $(1).c.stamp
+endef
+
+$(foreach f,$(_GLIB_ENUM_TYPES_GENERATED),$(eval $(call _glib_make_mkenums_rules,$f)))
+
+
+### glib-compile-schemas
+
+_GLIB_ENUMS_XML_GENERATED = $(filter %.enums.xml,$(GLIB_GENERATED))
+_GLIB_GSETTINGS_SCHEMA_FILES = $(filter %.gschema.xml,$(gsettingsschema_DATA))
+_GLIB_GSETTINGS_VALID_FILES = $(subst .xml,.valid,$(_GLIB_GSETTINGS_SCHEMA_FILES))
+
+_glib_enums_xml_prefix = $(subst .,_,$(notdir $(1)))
+_glib_enums_xml_sources_var = $(_glib_enums_xml_prefix)_sources
+_glib_enums_xml_sources = $(filter-out $(GLIB_GENERATED),$($(_glib_enums_xml_sources_var)))
+_glib_enums_xml_namespace = $(subst .enums.xml,,$(notdir $(1)))
+
+define _glib_make_enums_xml_rule
+$(if $(_glib_enums_xml_sources),,$(error Need to define $(_glib_enums_xml_sources_var) for $(1)))
+
+$(1): $(_glib_enums_xml_sources)
+ $$(_GLIB_V_GEN) $$(GLIB_MKENUMS) --comments '' --fhead "" --vhead " <@type@ id='$(_glib_enums_xml_namespace).@EnumName@'>" --vprod " " --vtail " @type@>" --ftail "" $$^ > $$@.tmp && mv $$@.tmp $$@
+endef
+
+_GLIB_V_CHECK = $(_glib_v_check_$(V))
+_glib_v_check_ = $(_glib_v_check_$(AM_DEFAULT_VERBOSITY))
+_glib_v_check_0 = @echo " CHECK " $(subst .valid,.xml,$@);
+
+define _glib_make_schema_validate_rule
+$(subst .xml,.valid,$(1)): $(_GLIB_ENUMS_XML_GENERATED) $(1)
+ $$(_GLIB_V_CHECK) $$(GLIB_COMPILE_SCHEMAS) --strict --dry-run $$(addprefix --schema-file=,$$^) && touch $$@
+endef
+
+define _glib_make_schema_rules
+all-am: $(_GLIB_GSETTINGS_VALID_FILES)
+
+install-data-am: glib-install-schemas-hook
+
+glib-install-schemas-hook: install-gsettingsschemaDATA
+ @test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || (echo $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir))
+
+uninstall-am: glib-uninstall-schemas-hook
+
+glib-uninstall-schemas-hook: uninstall-gsettingsschemaDATA
+ @test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || (echo $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir); $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir))
+
+.PHONY: glib-install-schemas-hook glib-uninstall-schemas-hook
+endef
+
+_GLIB_CLEANFILES += $(_GLIB_ENUMS_XML_GENERATED) $(_GLIB_GSETTINGS_VALID_FILES)
+
+$(foreach f,$(_GLIB_ENUMS_XML_GENERATED),$(eval $(call _glib_make_enums_xml_rule,$f)))
+$(foreach f,$(_GLIB_GSETTINGS_SCHEMA_FILES),$(eval $(call _glib_make_schema_validate_rule,$f)))
+$(if $(_GLIB_GSETTINGS_SCHEMA_FILES),$(eval $(_glib_make_schema_rules)))
+
+
+### Cleanup
+.PHONY: clean-glib distclean-glib
+
+clean-am: clean-glib
+clean-glib:
+ $(if $(strip $(_GLIB_CLEANFILES)),-rm -f $(_GLIB_CLEANFILES))
+
+distclean-am: distclean-glib
+distclean-glib:
+ $(if $(strip $(_GLIB_DISTCLEANFILES)),-rm -f $(_GLIB_DISTCLEANFILES))
diff --git a/Makefile.in b/Makefile.in
index fd04cc7a..b87cf8aa 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -190,6 +190,8 @@ GIO_LIBS = @GIO_LIBS@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
GLIB_LIBS = @GLIB_LIBS@
+GLIB_MAKEFILE = @GLIB_MAKEFILE@
+GLIB_MKENUMS = @GLIB_MKENUMS@
GMODULE_CFLAGS = @GMODULE_CFLAGS@
GMODULE_LIBS = @GMODULE_LIBS@
GMSGFMT = @GMSGFMT@
@@ -244,11 +246,15 @@ LIBNL2_LIBS = @LIBNL2_LIBS@
LIBNL3_CFLAGS = @LIBNL3_CFLAGS@
LIBNL3_LIBS = @LIBNL3_LIBS@
LIBNL_CFLAGS = @LIBNL_CFLAGS@
+LIBNL_GENL3_CFLAGS = @LIBNL_GENL3_CFLAGS@
+LIBNL_GENL3_LIBS = @LIBNL_GENL3_LIBS@
LIBNL_LIBS = @LIBNL_LIBS@
LIBNL_ROUTE3_CFLAGS = @LIBNL_ROUTE3_CFLAGS@
LIBNL_ROUTE3_LIBS = @LIBNL_ROUTE3_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
+LIBSOUP_CFLAGS = @LIBSOUP_CFLAGS@
+LIBSOUP_LIBS = @LIBSOUP_LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
@@ -259,6 +265,7 @@ MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+MOC = @MOC@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
@@ -298,6 +305,8 @@ SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
SYSTEM_CA_PATH = @SYSTEM_CA_PATH@
UDEV_BASE_DIR = @UDEV_BASE_DIR@
USE_NLS = @USE_NLS@
@@ -362,7 +371,6 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = \
- marshallers \
include \
libnm-util \
libnm-glib \
@@ -385,19 +393,22 @@ EXTRA_DIST = \
NetworkManager.pc.in \
intltool-extract.in \
intltool-merge.in \
- intltool-update.in
+ intltool-update.in \
+ Makefile.glib
DISTCHECK_CONFIGURE_FLAGS = \
--with-tests=yes \
--with-docs=yes \
--enable-more-warnings=yes \
--with-udev-dir=$$dc_install_base/lib/udev \
- --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
+ --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) \
+ --with-wext=no
DISTCLEANFILES = intltool-extract intltool-merge intltool-update
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = NetworkManager.pc
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
+CLEANFILES = cscope.in.out cscope.out cscope.po.out
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
@@ -819,6 +830,7 @@ install-strip:
mostlyclean-generic:
clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
@@ -918,6 +930,11 @@ uninstall-am: uninstall-pkgconfigDATA
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
uninstall uninstall-am uninstall-pkgconfigDATA
+include $(GLIB_MAKEFILE)
+
+.PHONY: cscope
+cscope:
+ cscope -b -q -R -Iinclude -ssrc -slibnm-glib -slibnm-util -scli/src;
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/NEWS b/NEWS
index 31f24506..096869b4 100644
--- a/NEWS
+++ b/NEWS
@@ -1,8 +1,50 @@
+==============================================
+NetworkManager-0.9.4
+Overview of changes since NetworkManager-0.9.2
+==============================================
+
+This is a new stable release of NetworkManager. Notable changes include:
+
+* Better handling of WiFi devices via nl80211 when available (instead of WEXT)
+* IP configuration is now non-blocking; waiting for IPv6 RA no longer blocks
+ the device from activating if IPv4 is ready and vice versa
+* Addded support for firewall "zones" via FirewallD
+* Added basic support for bonded interfaces
+* WiFi connections are no longer locked to a specific MAC address if they are
+ "locally administered" addresses (ie, 02:::::)
+* New state change reasons have been added for mobile broadband PIN errors
+* Agent-owned secrets are now sent to agents for newly created connections
+* Support for non-UTF8-encoded 802.1x passwords has been added
+* libnm-glib now fetches some properties more aggressively (like active
+ connections, access points, etc)
+* Added basic support for IP-over-Infiniband interfaces
+* Added support for device plugins and converted WiMAX support to a plugin for
+ easier packaging and simpler dependencies
+* Added support for VLAN interfaces
+* Added support for 802.1x EAP-FAST authentication
+* Added non-blocking mode and API to libnm-glib
+* Linux Wireless Extensions (WEXT) support can be disabled at configure time
+ with --with-wext=no
+* IPv6 Privacy Extensions are now enabled by default for new connections
+* Support for checking Internet connectivity has been added
+* The ifnet system config plugin rewrites config files less often
+* A bug causing IPv6 address assignment to fail on newer kernels with libnl3
+ has been fixed
+* Fix a bug in the ifcfg-rh plugin with backticks in WPA passphrases
+* Ensure connections that cannot be stored are ignored by the ifnet plugin
+* Enable out-of-the-box IPv6 connectivity by allowing IPv4 to fail if IPv6 succeeds
+* Allow proxying of DNSSEC data when using the dnsmasq local caching nameserver plugin
+* Add support for multiple domain names sent from VPN plugins
+* Removed support for WiFi Ad-Hoc WPA connections due to kernel bugs
+
+
==============================================
NetworkManager-0.9.2
Overview of changes since NetworkManager-0.9.0
==============================================
+This is a new stable release of NetworkManager. Notable changes include:
+
* Support for libnl2 and libnl3 and various memory leak fixes
* Bug fixes for the ifnet config plugin
* Ensure IPv6 link-local DNS servers work correctly in the dnsmasq DNS plugin
diff --git a/TODO b/TODO
index 3b8438ac..2348b3c6 100644
--- a/TODO
+++ b/TODO
@@ -1,16 +1,30 @@
So you're interested in hacking on NetworkManager? Here's some cool
stuff you could do...
-* Internet Connectivity Detection
-
-This feature would consist of attempting to make an HTTP request to a known
-DNS address and compare the response to a well-known string, like Windows does.
-This feature and the server address should be configurable via an option in the
-/etc/NetworkManager/NetworkManager.conf config file.
-
-Once the device has successfully gotten an IPv4 or IPv6 address, it should
-enter the state NM_DEVICE_STATE_IP_CHECK, where this HTTP request would be
-performed. After the check was done, the device would set a property in
+* Internet Connectivity Detection Enhancements
+
+Current connectivity checking is global, while what we really want is to check
+connectivity per-interface and update the global state based on the composite
+of each device's state. Unfortunately that requires two things:
+
+1) latest libsoup and glib for using libsoup connection state signals, which
+ allow us to set socket options before the actual connection is made; here
+ we'd bind the socket to the specific IP address of the interface we're
+ using, and possibly set SO_BINDTODEVICE as well
+2) setting /proc/sys/net/ipv4/conf//rp_filter to "2" which tells the
+ kernel to route the incoming and outgoing packet properly even though the
+ interface may not have the necessary routes
+
+The first is the largest obstacle, but ideally we implement this and enable it
+when we have the required glib and libsoup versions available. One other
+complication is that this checking should be done during the
+NM_DEVICE_STATE_IP_CHECK phase (along with other operations like WiFi hotspot
+auto-login) while the current checks are done globally in nm-manager.c, so
+keeping both code paths might be complex.
+
+But ideally, once the device has successfully gotten an IPv4 or IPv6 address, it
+should enter the state NM_DEVICE_STATE_IP_CHECK, where a connectivity check is
+started. After the check returns, the device would set a property in
NMDevicePrivate to indicate whether Internet access was successful or not, and
advance to the NM_DEVICE_STATE_ACTIVATED state.
@@ -19,10 +33,6 @@ nm_manager_update_state() function, would query this property and set
NM_STATE_CONNECTED_LOCAL, NM_STATE_CONNECTED_SITE, or NM_STATE_CONNECTED_GLOBAL
based on it and the device's state.
-Ideally this feature would not require linking to an HTTP library like libcurl,
-but would use open-coded simple HTTP or libsoup for the request. The request
-must be done asynchronously, of course.
-
* ADSL support
@@ -41,24 +51,6 @@ attribute from the sysfs directory for the ATM interface on 2.6.38.8 and later
kernels).
-* Convert WEXT code to nl80211
-
-There's still some WEXT code in NetworkManager for signal strength reporting,
-mode, frequency, BSSID, etc. This should all get converted to nl80211 code,
-possibly using libnl as a base. It's not particularly hard, but some
-investigation on how to talk to netlink and how to use nl80211 and netlink
-attributes will need to be done. Tools like 'iw' already do much of this work,
-but we *cannot* copy & paste code from them since the 'iw' license is not
-compatible with NetworkManager's GPL license. For exmaple, the following code
-does the job, but should be reworked a bit to use the internal synchronous
-netlink connection from src/nm-netlink-manager.c instead of doing the
-netlink communication on its own with genl_connect() and such:
-
-http://mail.gnome.org/archives/networkmanager-list/2009-September/msg00214.html
-
-The same approach should be taken for signal strength reporting, etc.
-
-
* Real Access Point mode support
Now that NetworkManager requires wpa_supplicant 0.7.x or later, we can add
@@ -440,63 +432,6 @@ that handle different system proxy handlers. Some of the proxy handlers are:
GNOME/KDE: how do these desktop environments retrieve proxy configuration?
-* Bridging and Bonding Support
-
-The largest complication here is that NetworkManager normally operates on
-physical interfaces, while bridging and bonding involve tying multiple physical
-interfaces together into a logical interface. This has interesting implications
-for the D-Bus API and the NM device model. The first complication is that
-we may need to do 802.1x port authentication on an interface before it can
-communicate with the other side of the link, and those credentials may be
-different for each interface; thus we may need to do separate 802.1x
-operations on each interface that is part of a bridge/bond before adding each
-one to the master bridge/bond interface.
-
-In this way bridge/bond interfaces may be treated the same way as NetworkManager
-treats VPN interfaces already; one or more physical interface NMConnections must
-be activated before the master bridge/bond interface's NMConnection can be
-activated, though this all happens internally.
-
-To enable bridging and bonding in the NMConnection itself, we should create
-new NMSettingBridge and NMSettingBond classes that contain information specific
-to each. Both settings would contain a 'components' property with an
-'array of string' type which would contain the UUIDs of the Connections of
-physical interfaces that compose the bridge or bond. Thus NetworkManager would
-have the necessary information to tie lower-level interface configuration
-(802.1x, MTU, MAC address locking, duplex mode, speed, etc) to each physical
-interface that will be part of the bridge/bond, configure the interface with
-it, and then configure the master bridge/bond interface at upper layers using
-configuration specific for the bridge/bond interface (like IP details). Thus
-for a single active bridge, two or more NMConnections would be activated; one
-for each physical interface component of the bridge/bond, and one for the master
-bridge/bond interface itself.
-
-NMSettingBridge would contain at least the following keys:
-
- components: (array of string) UUIDs of component connections
- stp: (boolean) on to enable STP, off to disable
-
-NMSettingBond would contain at least the following keys:
-
- components: (array of string) UUIDs of component connections
- mode: (string) one of "balance-rr", "active-backup", "balance-xor",
- "broadcast", "802.3ad", "balance-tlb", or "balance-alb"
- monitor-interval: (uint) Specifies link monitoring interval (in milliseconds);
- NM will always enable netlink carrier monitoring if this
- value is non-zero so this property only affects speed and
- duplex checking
-
-In the future we may consider adding other bonding parameters like "up-delay"
-and "down-delay".
-
-Then we'd add a 'component' (boolean) property to NMSettingConnection to
-indicate that the component interface connections were in fact components of
-a bridge or bond and shouldn't be automatically started by NetworkManager or
-displayed as separate connections in the user interface.
-
-TO BE CONTINUED
-
-
* Better Tablet/Mobile Behavior
There are a few components to this:
@@ -547,71 +482,3 @@ Consequently the same behavior should be used when a better connection becomes
available. This behavior should be suspended when special connections like
Internet Connection Sharing ones are started, where clearly the priorities
are different (ie, for Mobile Hotspot 3G > WiFi).
-
-
-* IP over Infiniband (IPoIB)
-
-These interfaces are similar to Ethernet interfaces with a few distinct
-differences:
-
- 1) they have 64-bit MAC addresses (GUIDs in Infiniband parlance)
- 2) DHCP clients need to be modified to handle IPoIB
- 3) they have a different ARP type and different L2 options
-
-By default the interfaces do not have IP capability, but they gain that
-capability when certain kernel modules (ib_ipoib.ko) are loaded, which causes
-the IP-capable interface is created. The IP-capable interfaces apparently have
-ARPHRD_INFINIBAND set, which is likely what NM should use to identify them.
-
-One outstanding question is whether NM should (a) detect all Infiniband
-interfaces and load ib_ipoib.ko only when there is a defined NMConnection for
-an Infiniband interface, or (b) whether NM should automatically load ib_ipoib.ko
-for every Infiniband interface, or (c) whether NM should only manage Infiniband
-interfaces that already have associated IP-capable interfaces (ie, something
-else is responsible for loading ib_ipoib.ko). Depending on our implementation,
-(a) might not be possible, because if IPoIB connections are treated similar to
-plain Ethernet connections, we may not have any information about whether a
-specific NMConnection is Infiniband other than the MAC address.
-
-It turns out that on some distros other components (like system services) may
-load ib_ipoib.ko for us. For exmaple, the 'rdma' package on Fedora/RHEL systems
-contains /etc/rc.d/init.d/rdma which uses values in /etc/rdma/rdma.conf to load
-ib_ipoib.ko at system startup if the user has requested it via IPOIB_LOAD=yes.
-For the time being, if the some other component of the system loads IP for us,
-NetworkManager should probably still recognize the Infiniband interface, but
-leave it in unmanaged mode if there is no available IPoIB interface associated
-with the Infiniband one. i.e. for now, NM should not automatically load
-ib_ipoib.ko.
-
-The second question is whether to fold IPoIB support into the NMDeviceEthernet
-class as was done for s390 network interfaces, or whether to create a subclass
-of NMDevice:
-
-1) extend NMDeviceEthernet: this would involve loosening the assumption that
-hardware addresses (the 'hw-address'/'perm-hw-address' properties of
-NMDeviceEthernet and the 'mac-address'/'cloned-mac-address' properties of
-NMSettingWired) are 48 bits wide and instead can be either 48 or 64 bits wide.
-
-2) create a new NMDevice subclass for Infiniband devices tailored to Infiniband
-specific behavior and attributes. This would be a lot more code since we'd have
-to duplicate much of what NMDeviceEthernet already does, plus add the
-Infiniband device class to libnm-glib. This also would be the least invasive
-from an API standpoint since the existing API would be unchanged, except for
-the addition of a new value in the NMDeviceType enum, which clients should
-ignore if they don't understand it. (Need to coordinate additions to this enum
-between 0.8.x and 0.9.x since 0.9.x has more device types, but we want to make
-sure new device types get the same number for both branches).
-
-For Infiniband specific options we could either fold them into NMSettingEthernet
-or create a new NMSettingInfiniband class. Current Infiniband specific options
-are partitions/P_Keys, datagram vs. connected mode, and MTU. The default MTU
-varies with the 'mode'; for datagram it is currently 2044, while for connected
-mode it is currently 65520. Given that we only have 2 IB-specific options
-we should probably just fold them into NMSettingEthernet similar to what was
-done for s390-specific options.
-
-For some general (and also Red Hat/Fedora specific) information see:
-
-http://tools.ietf.org/html/rfc4392
-http://rhkernel.org/#RHEL6+2.6.32-71.18.2.el6/Documentation/infiniband/ipoib.txt
-
diff --git a/build-aux/ltmain.sh b/build-aux/ltmain.sh
index aa5624c8..78cf0175 100755
--- a/build-aux/ltmain.sh
+++ b/build-aux/ltmain.sh
@@ -8050,7 +8050,7 @@ EOF
elif test -n "$runpath_var"; then
case "$perm_rpath " in
*" $libdir "*) ;;
- *) func_apped perm_rpath " $libdir" ;;
+ *) func_append perm_rpath " $libdir" ;;
esac
fi
done
diff --git a/callouts/Makefile.am b/callouts/Makefile.am
index 4a1ea7ca..61627859 100644
--- a/callouts/Makefile.am
+++ b/callouts/Makefile.am
@@ -58,7 +58,9 @@ nm_dispatcher_action_SOURCES = \
nm_dispatcher_action_CPPFLAGS = \
-I${top_srcdir} \
-I${top_srcdir}/include \
+ -I${top_builddir}/include \
-I${top_srcdir}/libnm-util \
+ -I${top_builddir}/libnm-util \
$(DBUS_CFLAGS) \
$(GLIB_CFLAGS) \
-DG_DISABLE_DEPRECATED \
@@ -83,7 +85,9 @@ libtest_dispatcher_envp_la_SOURCES = \
libtest_dispatcher_envp_la_CPPFLAGS = \
-I${top_srcdir}/include \
+ -I${top_builddir}/include \
-I${top_srcdir}/libnm-util \
+ -I${top_builddir}/libnm-util \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS)
diff --git a/callouts/Makefile.in b/callouts/Makefile.in
index 1cef470c..4b46ce2a 100644
--- a/callouts/Makefile.in
+++ b/callouts/Makefile.in
@@ -234,6 +234,8 @@ GIO_LIBS = @GIO_LIBS@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
GLIB_LIBS = @GLIB_LIBS@
+GLIB_MAKEFILE = @GLIB_MAKEFILE@
+GLIB_MKENUMS = @GLIB_MKENUMS@
GMODULE_CFLAGS = @GMODULE_CFLAGS@
GMODULE_LIBS = @GMODULE_LIBS@
GMSGFMT = @GMSGFMT@
@@ -288,11 +290,15 @@ LIBNL2_LIBS = @LIBNL2_LIBS@
LIBNL3_CFLAGS = @LIBNL3_CFLAGS@
LIBNL3_LIBS = @LIBNL3_LIBS@
LIBNL_CFLAGS = @LIBNL_CFLAGS@
+LIBNL_GENL3_CFLAGS = @LIBNL_GENL3_CFLAGS@
+LIBNL_GENL3_LIBS = @LIBNL_GENL3_LIBS@
LIBNL_LIBS = @LIBNL_LIBS@
LIBNL_ROUTE3_CFLAGS = @LIBNL_ROUTE3_CFLAGS@
LIBNL_ROUTE3_LIBS = @LIBNL_ROUTE3_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
+LIBSOUP_CFLAGS = @LIBSOUP_CFLAGS@
+LIBSOUP_LIBS = @LIBSOUP_LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
@@ -303,6 +309,7 @@ MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+MOC = @MOC@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
@@ -342,6 +349,8 @@ SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
SYSTEM_CA_PATH = @SYSTEM_CA_PATH@
UDEV_BASE_DIR = @UDEV_BASE_DIR@
USE_NLS = @USE_NLS@
@@ -456,7 +465,9 @@ nm_dispatcher_action_SOURCES = \
nm_dispatcher_action_CPPFLAGS = \
-I${top_srcdir} \
-I${top_srcdir}/include \
+ -I${top_builddir}/include \
-I${top_srcdir}/libnm-util \
+ -I${top_builddir}/libnm-util \
$(DBUS_CFLAGS) \
$(GLIB_CFLAGS) \
-DG_DISABLE_DEPRECATED \
@@ -478,7 +489,9 @@ libtest_dispatcher_envp_la_SOURCES = \
libtest_dispatcher_envp_la_CPPFLAGS = \
-I${top_srcdir}/include \
+ -I${top_builddir}/include \
-I${top_srcdir}/libnm-util \
+ -I${top_builddir}/libnm-util \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS)
diff --git a/callouts/tests/Makefile.am b/callouts/tests/Makefile.am
index 6a46b629..93d3fae7 100644
--- a/callouts/tests/Makefile.am
+++ b/callouts/tests/Makefile.am
@@ -1,6 +1,8 @@
INCLUDES = \
-I$(top_srcdir)/include \
+ -I${top_builddir}/include \
-I$(top_srcdir)/libnm-util \
+ -I$(top_builddir)/libnm-util \
-I$(top_srcdir)/callouts
noinst_PROGRAMS = \
diff --git a/callouts/tests/Makefile.in b/callouts/tests/Makefile.in
index eac990b1..1d71988d 100644
--- a/callouts/tests/Makefile.in
+++ b/callouts/tests/Makefile.in
@@ -143,6 +143,8 @@ GIO_LIBS = @GIO_LIBS@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
GLIB_LIBS = @GLIB_LIBS@
+GLIB_MAKEFILE = @GLIB_MAKEFILE@
+GLIB_MKENUMS = @GLIB_MKENUMS@
GMODULE_CFLAGS = @GMODULE_CFLAGS@
GMODULE_LIBS = @GMODULE_LIBS@
GMSGFMT = @GMSGFMT@
@@ -197,11 +199,15 @@ LIBNL2_LIBS = @LIBNL2_LIBS@
LIBNL3_CFLAGS = @LIBNL3_CFLAGS@
LIBNL3_LIBS = @LIBNL3_LIBS@
LIBNL_CFLAGS = @LIBNL_CFLAGS@
+LIBNL_GENL3_CFLAGS = @LIBNL_GENL3_CFLAGS@
+LIBNL_GENL3_LIBS = @LIBNL_GENL3_LIBS@
LIBNL_LIBS = @LIBNL_LIBS@
LIBNL_ROUTE3_CFLAGS = @LIBNL_ROUTE3_CFLAGS@
LIBNL_ROUTE3_LIBS = @LIBNL_ROUTE3_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
+LIBSOUP_CFLAGS = @LIBSOUP_CFLAGS@
+LIBSOUP_LIBS = @LIBSOUP_LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
@@ -212,6 +218,7 @@ MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+MOC = @MOC@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
@@ -251,6 +258,8 @@ SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
SYSTEM_CA_PATH = @SYSTEM_CA_PATH@
UDEV_BASE_DIR = @UDEV_BASE_DIR@
USE_NLS = @USE_NLS@
@@ -316,7 +325,9 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
INCLUDES = \
-I$(top_srcdir)/include \
+ -I${top_builddir}/include \
-I$(top_srcdir)/libnm-util \
+ -I$(top_builddir)/libnm-util \
-I$(top_srcdir)/callouts
diff --git a/cli/Makefile.in b/cli/Makefile.in
index c3de35f3..46ab6733 100644
--- a/cli/Makefile.in
+++ b/cli/Makefile.in
@@ -147,6 +147,8 @@ GIO_LIBS = @GIO_LIBS@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
GLIB_LIBS = @GLIB_LIBS@
+GLIB_MAKEFILE = @GLIB_MAKEFILE@
+GLIB_MKENUMS = @GLIB_MKENUMS@
GMODULE_CFLAGS = @GMODULE_CFLAGS@
GMODULE_LIBS = @GMODULE_LIBS@
GMSGFMT = @GMSGFMT@
@@ -201,11 +203,15 @@ LIBNL2_LIBS = @LIBNL2_LIBS@
LIBNL3_CFLAGS = @LIBNL3_CFLAGS@
LIBNL3_LIBS = @LIBNL3_LIBS@
LIBNL_CFLAGS = @LIBNL_CFLAGS@
+LIBNL_GENL3_CFLAGS = @LIBNL_GENL3_CFLAGS@
+LIBNL_GENL3_LIBS = @LIBNL_GENL3_LIBS@
LIBNL_LIBS = @LIBNL_LIBS@
LIBNL_ROUTE3_CFLAGS = @LIBNL_ROUTE3_CFLAGS@
LIBNL_ROUTE3_LIBS = @LIBNL_ROUTE3_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
+LIBSOUP_CFLAGS = @LIBSOUP_CFLAGS@
+LIBSOUP_LIBS = @LIBSOUP_LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
@@ -216,6 +222,7 @@ MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+MOC = @MOC@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
@@ -255,6 +262,8 @@ SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
SYSTEM_CA_PATH = @SYSTEM_CA_PATH@
UDEV_BASE_DIR = @UDEV_BASE_DIR@
USE_NLS = @USE_NLS@
diff --git a/cli/src/Makefile.am b/cli/src/Makefile.am
index f49d0127..ec62bfea 100644
--- a/cli/src/Makefile.am
+++ b/cli/src/Makefile.am
@@ -4,10 +4,14 @@ bin_PROGRAMS = \
INCLUDES = \
-I${top_srcdir} \
-I${top_srcdir}/include \
+ -I${top_builddir}/include \
-I${top_srcdir}/libnm-util \
+ -I${top_builddir}/libnm-util \
-I${top_srcdir}/libnm-glib
nmcli_SOURCES = \
+ common.c \
+ common.h \
connections.c \
connections.h \
devices.c \
diff --git a/cli/src/Makefile.in b/cli/src/Makefile.in
index def0b286..ea5214e5 100644
--- a/cli/src/Makefile.in
+++ b/cli/src/Makefile.in
@@ -57,9 +57,10 @@ CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS)
-am_nmcli_OBJECTS = nmcli-connections.$(OBJEXT) nmcli-devices.$(OBJEXT) \
- nmcli-network-manager.$(OBJEXT) nmcli-settings.$(OBJEXT) \
- nmcli-nmcli.$(OBJEXT) nmcli-utils.$(OBJEXT)
+am_nmcli_OBJECTS = nmcli-common.$(OBJEXT) nmcli-connections.$(OBJEXT) \
+ nmcli-devices.$(OBJEXT) nmcli-network-manager.$(OBJEXT) \
+ nmcli-settings.$(OBJEXT) nmcli-nmcli.$(OBJEXT) \
+ nmcli-utils.$(OBJEXT)
nmcli_OBJECTS = $(am_nmcli_OBJECTS)
am__DEPENDENCIES_1 =
nmcli_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
@@ -144,6 +145,8 @@ GIO_LIBS = @GIO_LIBS@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
GLIB_LIBS = @GLIB_LIBS@
+GLIB_MAKEFILE = @GLIB_MAKEFILE@
+GLIB_MKENUMS = @GLIB_MKENUMS@
GMODULE_CFLAGS = @GMODULE_CFLAGS@
GMODULE_LIBS = @GMODULE_LIBS@
GMSGFMT = @GMSGFMT@
@@ -198,11 +201,15 @@ LIBNL2_LIBS = @LIBNL2_LIBS@
LIBNL3_CFLAGS = @LIBNL3_CFLAGS@
LIBNL3_LIBS = @LIBNL3_LIBS@
LIBNL_CFLAGS = @LIBNL_CFLAGS@
+LIBNL_GENL3_CFLAGS = @LIBNL_GENL3_CFLAGS@
+LIBNL_GENL3_LIBS = @LIBNL_GENL3_LIBS@
LIBNL_LIBS = @LIBNL_LIBS@
LIBNL_ROUTE3_CFLAGS = @LIBNL_ROUTE3_CFLAGS@
LIBNL_ROUTE3_LIBS = @LIBNL_ROUTE3_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
+LIBSOUP_CFLAGS = @LIBSOUP_CFLAGS@
+LIBSOUP_LIBS = @LIBSOUP_LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
@@ -213,6 +220,7 @@ MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+MOC = @MOC@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
@@ -252,6 +260,8 @@ SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
SYSTEM_CA_PATH = @SYSTEM_CA_PATH@
UDEV_BASE_DIR = @UDEV_BASE_DIR@
USE_NLS = @USE_NLS@
@@ -318,10 +328,14 @@ top_srcdir = @top_srcdir@
INCLUDES = \
-I${top_srcdir} \
-I${top_srcdir}/include \
+ -I${top_builddir}/include \
-I${top_srcdir}/libnm-util \
+ -I${top_builddir}/libnm-util \
-I${top_srcdir}/libnm-glib
nmcli_SOURCES = \
+ common.c \
+ common.h \
connections.c \
connections.h \
devices.c \
@@ -434,6 +448,7 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmcli-common.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmcli-connections.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmcli-devices.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmcli-network-manager.Po@am__quote@
@@ -468,6 +483,22 @@ distclean-compile:
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+nmcli-common.o: common.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-common.o -MD -MP -MF $(DEPDIR)/nmcli-common.Tpo -c -o nmcli-common.o `test -f 'common.c' || echo '$(srcdir)/'`common.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nmcli-common.Tpo $(DEPDIR)/nmcli-common.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='common.c' object='nmcli-common.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nmcli-common.o `test -f 'common.c' || echo '$(srcdir)/'`common.c
+
+nmcli-common.obj: common.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-common.obj -MD -MP -MF $(DEPDIR)/nmcli-common.Tpo -c -o nmcli-common.obj `if test -f 'common.c'; then $(CYGPATH_W) 'common.c'; else $(CYGPATH_W) '$(srcdir)/common.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nmcli-common.Tpo $(DEPDIR)/nmcli-common.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='common.c' object='nmcli-common.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nmcli-common.obj `if test -f 'common.c'; then $(CYGPATH_W) 'common.c'; else $(CYGPATH_W) '$(srcdir)/common.c'; fi`
+
nmcli-connections.o: connections.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(nmcli_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nmcli-connections.o -MD -MP -MF $(DEPDIR)/nmcli-connections.Tpo -c -o nmcli-connections.o `test -f 'connections.c' || echo '$(srcdir)/'`connections.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nmcli-connections.Tpo $(DEPDIR)/nmcli-connections.Po
diff --git a/cli/src/common.c b/cli/src/common.c
new file mode 100644
index 00000000..e9a5d760
--- /dev/null
+++ b/cli/src/common.c
@@ -0,0 +1,360 @@
+/*
+ * nmcli - command-line tool for controlling NetworkManager
+ * Common functions and data shared between files.
+ *
+ * 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.
+ *
+ * (C) Copyright 2012 Red Hat, Inc.
+ */
+
+#include "config.h"
+
+#include
+#include
+
+#include "common.h"
+#include "utils.h"
+
+/* Available fields for IPv4 group */
+static NmcOutputField nmc_fields_ip4_config[] = {
+ {"GROUP", N_("GROUP"), 15, NULL, 0}, /* 0 */
+ {"ADDRESS", N_("ADDRESS"), 68, NULL, 0}, /* 1 */
+ {"ROUTE", N_("ROUTE"), 68, NULL, 0}, /* 2 */
+ {"DNS", N_("DNS"), 35, NULL, 0}, /* 3 */
+ {"DOMAIN", N_("DOMAIN"), 35, NULL, 0}, /* 4 */
+ {"WINS", N_("WINS"), 20, NULL, 0}, /* 5 */
+ {NULL, NULL, 0, NULL, 0}
+};
+#define NMC_FIELDS_IP4_CONFIG_ALL "GROUP,ADDRESS,ROUTE,DNS,DOMAIN,WINS"
+
+/* Available fields for DHCPv4 group */
+static NmcOutputField nmc_fields_dhcp4_config[] = {
+ {"GROUP", N_("GROUP"), 15, NULL, 0}, /* 0 */
+ {"OPTION", N_("OPTION"), 80, NULL, 0}, /* 1 */
+ {NULL, NULL, 0, NULL, 0}
+};
+#define NMC_FIELDS_DHCP4_CONFIG_ALL "GROUP,OPTION"
+
+/* Available fields for IPv6 group */
+static NmcOutputField nmc_fields_ip6_config[] = {
+ {"GROUP", N_("GROUP"), 15, NULL, 0}, /* 0 */
+ {"ADDRESS", N_("ADDRESS"), 95, NULL, 0}, /* 1 */
+ {"ROUTE", N_("ROUTE"), 95, NULL, 0}, /* 2 */
+ {"DNS", N_("DNS"), 60, NULL, 0}, /* 3 */
+ {"DOMAIN", N_("DOMAIN"), 35, NULL, 0}, /* 4 */
+ {NULL, NULL, 0, NULL, 0}
+};
+#define NMC_FIELDS_IP6_CONFIG_ALL "GROUP,ADDRESS,ROUTE,DNS,DOMAIN"
+
+/* Available fields for DHCPv6 group */
+static NmcOutputField nmc_fields_dhcp6_config[] = {
+ {"GROUP", N_("GROUP"), 15, NULL, 0}, /* 0 */
+ {"OPTION", N_("OPTION"), 80, NULL, 0}, /* 1 */
+ {NULL, NULL, 0, NULL, 0}
+};
+#define NMC_FIELDS_DHCP6_CONFIG_ALL "GROUP,OPTION"
+
+
+gboolean
+print_ip4_config (NMIP4Config *cfg4, NmCli *nmc, const char *group_prefix)
+{
+ GSList *list, *iter;
+ const GArray *array;
+ const GPtrArray *ptr_array;
+ char **addr_arr = NULL;
+ char **route_arr = NULL;
+ char **dns_arr = NULL;
+ char **domain_arr = NULL;
+ char **wins_arr = NULL;
+ int i = 0;
+ guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0;
+ guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0;
+ guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0;
+
+ if (cfg4 == NULL)
+ return FALSE;
+
+ nmc->allowed_fields = nmc_fields_ip4_config;
+ nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES;
+ nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_IP4_CONFIG_ALL, nmc->allowed_fields, NULL);
+ print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */
+
+ /* addresses */
+ list = (GSList *) nm_ip4_config_get_addresses (cfg4);
+ addr_arr = g_new (char *, g_slist_length (list) + 1);
+ for (iter = list; iter; iter = g_slist_next (iter)) {
+ NMIP4Address *addr = (NMIP4Address *) iter->data;
+ guint32 prefix;
+ char *ip_str, *gw_str;
+
+ ip_str = nmc_ip4_address_as_string (nm_ip4_address_get_address (addr), NULL);
+ prefix = nm_ip4_address_get_prefix (addr);
+ gw_str = nmc_ip4_address_as_string (nm_ip4_address_get_gateway (addr), NULL);
+
+ addr_arr[i++] = g_strdup_printf ("ip = %s/%u, gw = %s", ip_str, prefix, gw_str);
+ g_free (ip_str);
+ g_free (gw_str);
+ }
+ addr_arr[i] = NULL;
+
+ /* routes */
+ list = (GSList *) nm_ip4_config_get_routes (cfg4);
+ route_arr = g_new (char *, g_slist_length (list) + 1);
+ i = 0;
+ for (iter = list; iter; iter = g_slist_next (iter)) {
+ NMIP4Route *route = (NMIP4Route *) iter->data;
+ guint32 prefix, metric;
+ char *dest_str, *nexthop_str;
+
+ dest_str = nmc_ip4_address_as_string (nm_ip4_route_get_dest (route), NULL);
+ nexthop_str = nmc_ip4_address_as_string (nm_ip4_route_get_next_hop (route), NULL);
+ prefix = nm_ip4_route_get_prefix (route);
+ metric = nm_ip4_route_get_metric (route);
+
+ route_arr[i++] = g_strdup_printf ("dst = %s/%u, nh = %s, mt = %u", dest_str, prefix, nexthop_str, metric);
+ g_free (dest_str);
+ g_free (nexthop_str);
+ }
+ route_arr[i] = NULL;
+
+ /* DNS */
+ array = nm_ip4_config_get_nameservers (cfg4);
+ if (array) {
+ dns_arr = g_new (char *, array->len + 1);
+ for (i = 0; i < array->len; i++)
+ dns_arr[i] = nmc_ip4_address_as_string (g_array_index (array, guint32, i), NULL);
+
+ dns_arr[i] = NULL;
+ }
+
+ /* domains */
+ ptr_array = nm_ip4_config_get_domains (cfg4);
+ if (ptr_array) {
+ domain_arr = g_new (char *, ptr_array->len + 1);
+ for (i = 0; i < ptr_array->len; i++)
+ domain_arr[i] = g_ptr_array_index (ptr_array, i);
+
+ domain_arr[i] = NULL;
+ }
+
+ /* WINS */
+ array = nm_ip4_config_get_wins_servers (cfg4);
+ if (array) {
+ wins_arr = g_new (char *, array->len + 1);
+ for (i = 0; i < array->len; i++)
+ wins_arr[i] = nmc_ip4_address_as_string (g_array_index (array, guint32, i), NULL);
+
+ wins_arr[i] = NULL;
+ }
+
+ set_val_str (nmc->allowed_fields, 0, group_prefix);
+ set_val_arr (nmc->allowed_fields, 1, (const char **) addr_arr);
+ set_val_arr (nmc->allowed_fields, 2, (const char **) route_arr);
+ set_val_arr (nmc->allowed_fields, 3, (const char **) dns_arr);
+ set_val_arr (nmc->allowed_fields, 4, (const char **) domain_arr);
+ set_val_arr (nmc->allowed_fields, 5, (const char **) wins_arr);
+
+ nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX;
+ print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */
+
+ g_strfreev (addr_arr);
+ g_strfreev (route_arr);
+ g_strfreev (dns_arr);
+ g_free (domain_arr);
+ g_strfreev (wins_arr);
+
+ return TRUE;
+}
+
+gboolean
+print_ip6_config (NMIP6Config *cfg6, NmCli *nmc, const char *group_prefix)
+{
+ GSList *list, *iter;
+ const GPtrArray *ptr_array;
+ char **addr_arr = NULL;
+ char **route_arr = NULL;
+ char **dns_arr = NULL;
+ char **domain_arr = NULL;
+ int i = 0;
+ guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0;
+ guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0;
+ guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0;
+
+ if (cfg6 == NULL)
+ return FALSE;
+
+ nmc->allowed_fields = nmc_fields_ip6_config;
+ nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES;
+ nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_IP6_CONFIG_ALL, nmc->allowed_fields, NULL);
+ print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */
+
+ /* addresses */
+ list = (GSList *) nm_ip6_config_get_addresses (cfg6);
+ addr_arr = g_new (char *, g_slist_length (list) + 1);
+ for (iter = list; iter; iter = g_slist_next (iter)) {
+ NMIP6Address *addr = (NMIP6Address *) iter->data;
+ guint32 prefix;
+ char *ip_str, *gw_str;
+
+ ip_str = nmc_ip6_address_as_string (nm_ip6_address_get_address (addr), NULL);
+ prefix = nm_ip6_address_get_prefix (addr);
+ gw_str = nmc_ip6_address_as_string (nm_ip6_address_get_gateway (addr), NULL);
+
+ addr_arr[i++] = g_strdup_printf ("ip = %s/%u, gw = %s", ip_str, prefix, gw_str);
+ g_free (ip_str);
+ g_free (gw_str);
+ }
+ addr_arr[i] = NULL;
+
+ /* routes */
+ list = (GSList *) nm_ip6_config_get_routes (cfg6);
+ route_arr = g_new (char *, g_slist_length (list) + 1);
+ i = 0;
+ for (iter = list; iter; iter = g_slist_next (iter)) {
+ NMIP6Route *route = (NMIP6Route *) iter->data;
+ guint32 prefix, metric;
+ char *dest_str, *nexthop_str;
+
+ dest_str = nmc_ip6_address_as_string (nm_ip6_route_get_dest (route), NULL);
+ nexthop_str = nmc_ip6_address_as_string (nm_ip6_route_get_next_hop (route), NULL);
+ prefix = nm_ip6_route_get_prefix (route);
+ metric = nm_ip6_route_get_metric (route);
+
+ route_arr[i++] = g_strdup_printf ("dst = %s/%u, nh = %s, mt = %u", dest_str, prefix, nexthop_str, metric);
+ g_free (dest_str);
+ g_free (nexthop_str);
+ }
+ route_arr[i] = NULL;
+
+ /* DNS */
+ list = (GSList *) nm_ip6_config_get_nameservers (cfg6);
+ dns_arr = g_new (char *, g_slist_length (list) + 1);
+ i = 0;
+ for (iter = list; iter; iter = g_slist_next (iter))
+ dns_arr[i++] = nmc_ip6_address_as_string (iter->data, NULL);
+
+ dns_arr[i] = NULL;
+
+ /* domains */
+ ptr_array = nm_ip6_config_get_domains (cfg6);
+ if (ptr_array) {
+ domain_arr = g_new (char *, ptr_array->len + 1);
+ for (i = 0; i < ptr_array->len; i++)
+ domain_arr[i] = g_ptr_array_index (ptr_array, i);
+
+ domain_arr[i] = NULL;
+ }
+
+ set_val_str (nmc->allowed_fields, 0, group_prefix);
+ set_val_arr (nmc->allowed_fields, 1, (const char **) addr_arr);
+ set_val_arr (nmc->allowed_fields, 2, (const char **) route_arr);
+ set_val_arr (nmc->allowed_fields, 3, (const char **) dns_arr);
+ set_val_arr (nmc->allowed_fields, 4, (const char **) domain_arr);
+
+ nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX;
+ print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */
+
+ g_strfreev (addr_arr);
+ g_strfreev (route_arr);
+ g_strfreev (dns_arr);
+ g_free (domain_arr);
+
+ return TRUE;
+}
+
+gboolean
+print_dhcp4_config (NMDHCP4Config *dhcp4, NmCli *nmc, const char *group_prefix)
+{
+ GHashTable *table;
+ guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0;
+ guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0;
+ guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0;
+
+ if (dhcp4 == NULL)
+ return FALSE;
+
+ table = nm_dhcp4_config_get_options (dhcp4);
+ if (table) {
+ GHashTableIter table_iter;
+ gpointer key, value;
+ char **options_arr = NULL;
+ int i = 0;
+
+ nmc->allowed_fields = nmc_fields_dhcp4_config;
+ nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES;
+ nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DHCP4_CONFIG_ALL, nmc->allowed_fields, NULL);
+ print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */
+
+ options_arr = g_new (char *, g_hash_table_size (table) + 1);
+ g_hash_table_iter_init (&table_iter, table);
+ while (g_hash_table_iter_next (&table_iter, &key, &value))
+ options_arr[i++] = g_strdup_printf ("%s = %s", (char *) key, (char *) value);
+ options_arr[i] = NULL;
+
+ set_val_str (nmc->allowed_fields, 0, group_prefix);
+ set_val_arr (nmc->allowed_fields, 1, (const char **) options_arr);
+
+ nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX;
+ print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */
+
+ g_strfreev (options_arr);
+
+ return TRUE;
+ }
+ return FALSE;
+}
+
+gboolean
+print_dhcp6_config (NMDHCP6Config *dhcp6, NmCli *nmc, const char *group_prefix)
+{
+ GHashTable *table;
+ guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0;
+ guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0;
+ guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0;
+
+ if (dhcp6 == NULL)
+ return FALSE;
+
+ table = nm_dhcp6_config_get_options (dhcp6);
+ if (table) {
+ GHashTableIter table_iter;
+ gpointer key, value;
+ char **options_arr = NULL;
+ int i = 0;
+
+ nmc->allowed_fields = nmc_fields_dhcp6_config;
+ nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES;
+ nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DHCP6_CONFIG_ALL, nmc->allowed_fields, NULL);
+ print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */
+
+ options_arr = g_new (char *, g_hash_table_size (table) + 1);
+ g_hash_table_iter_init (&table_iter, table);
+ while (g_hash_table_iter_next (&table_iter, &key, &value))
+ options_arr[i++] = g_strdup_printf ("%s = %s", (char *) key, (char *) value);
+ options_arr[i] = NULL;
+
+ set_val_str (nmc->allowed_fields, 0, group_prefix);
+ set_val_arr (nmc->allowed_fields, 1, (const char **) options_arr);
+
+ nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX;
+ print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */
+
+ g_strfreev (options_arr);
+
+ return TRUE;
+ }
+ return FALSE;
+}
+
diff --git a/cli/src/common.h b/cli/src/common.h
new file mode 100644
index 00000000..85015a9f
--- /dev/null
+++ b/cli/src/common.h
@@ -0,0 +1,39 @@
+/*
+ * nmcli - command-line tool for controlling NetworkManager
+ * Common functions and data shared between files.
+ *
+ * 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.
+ *
+ * (C) Copyright 2012 Red Hat, Inc.
+ */
+
+#ifndef NMC_COMMON_H
+#define NMC_COMMON_H
+
+#include
+
+#include
+#include
+#include
+#include
+
+#include "nmcli.h"
+
+gboolean print_ip4_config (NMIP4Config *cfg4, NmCli *nmc, const char *group_prefix);
+gboolean print_ip6_config (NMIP6Config *cfg6, NmCli *nmc, const char *group_prefix);
+gboolean print_dhcp4_config (NMDHCP4Config *dhcp4, NmCli *nmc, const char *group_prefix);
+gboolean print_dhcp6_config (NMDHCP6Config *dhcp6, NmCli *nmc, const char *group_prefix);
+
+#endif /* NMC_COMMON_H */
diff --git a/cli/src/connections.c b/cli/src/connections.c
index 7d4fffc0..ea5211f5 100644
--- a/cli/src/connections.c
+++ b/cli/src/connections.c
@@ -14,7 +14,7 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * (C) Copyright 2010 - 2011 Red Hat, Inc.
+ * (C) Copyright 2010 - 2012 Red Hat, Inc.
*/
#include "config.h"
@@ -32,17 +32,6 @@
#include
#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#if WITH_WIMAX
-#include
-#endif
#include
#include
#if WITH_WIMAX
@@ -50,29 +39,20 @@
#endif
#include
#include
-//#include
+#include
+#include
+#include
+#include
#include
#include
+#include
#include "utils.h"
+#include "common.h"
#include "settings.h"
#include "connections.h"
-/* Available fields for 'con status' */
-static NmcOutputField nmc_fields_con_status[] = {
- {"NAME", N_("NAME"), 25, NULL, 0}, /* 0 */
- {"UUID", N_("UUID"), 38, NULL, 0}, /* 1 */
- {"DEVICES", N_("DEVICES"), 10, NULL, 0}, /* 2 */
- {"DEFAULT", N_("DEFAULT"), 8, NULL, 0}, /* 3 */
- {"SPEC-OBJECT", N_("SPEC-OBJECT"), 10, NULL, 0}, /* 4 */
- {"VPN", N_("VPN"), 5, NULL, 0}, /* 5 */
- {"DBUS-PATH", N_("DBUS-PATH"), 51, NULL, 0}, /* 6 */
- {NULL, NULL, 0, NULL, 0}
-};
-#define NMC_FIELDS_CON_STATUS_ALL "NAME,UUID,DEVICES,DEFAULT,VPN,DBUS-PATH,SPEC-OBJECT"
-#define NMC_FIELDS_CON_STATUS_COMMON "NAME,UUID,DEVICES,DEFAULT,VPN"
-
/* Available fields for 'con list' */
static NmcOutputField nmc_fields_con_list[] = {
{"NAME", N_("NAME"), 25, NULL, 0}, /* 0 */
@@ -88,7 +68,6 @@ static NmcOutputField nmc_fields_con_list[] = {
#define NMC_FIELDS_CON_LIST_ALL "NAME,UUID,TYPE,TIMESTAMP,TIMESTAMP-REAL,AUTOCONNECT,READONLY,DBUS-PATH"
#define NMC_FIELDS_CON_LIST_COMMON "NAME,UUID,TYPE,TIMESTAMP-REAL"
-
/* Helper macro to define fields */
#define SETTING_FIELD(setting, width) { setting, N_(setting), width, NULL, 0 }
@@ -110,6 +89,9 @@ static NmcOutputField nmc_fields_settings_names[] = {
SETTING_FIELD (NM_SETTING_OLPC_MESH_SETTING_NAME, 0), /* 13 */
SETTING_FIELD (NM_SETTING_VPN_SETTING_NAME, 0), /* 14 */
SETTING_FIELD (NM_SETTING_WIMAX_SETTING_NAME, 0), /* 15 */
+ SETTING_FIELD (NM_SETTING_INFINIBAND_SETTING_NAME, 0), /* 16 */
+ SETTING_FIELD (NM_SETTING_BOND_SETTING_NAME, 0), /* 17 */
+ SETTING_FIELD (NM_SETTING_VLAN_SETTING_NAME, 0), /* 18 */
{NULL, NULL, 0, NULL, 0}
};
#define NMC_FIELDS_SETTINGS_NAMES_ALL_X NM_SETTING_CONNECTION_SETTING_NAME","\
@@ -126,7 +108,10 @@ static NmcOutputField nmc_fields_settings_names[] = {
NM_SETTING_CDMA_SETTING_NAME","\
NM_SETTING_BLUETOOTH_SETTING_NAME","\
NM_SETTING_OLPC_MESH_SETTING_NAME","\
- NM_SETTING_VPN_SETTING_NAME
+ NM_SETTING_VPN_SETTING_NAME","\
+ NM_SETTING_INFINIBAND_SETTING_NAME","\
+ NM_SETTING_BOND_SETTING_NAME","\
+ NM_SETTING_VLAN_SETTING_NAME
#if WITH_WIMAX
#define NMC_FIELDS_SETTINGS_NAMES_ALL NMC_FIELDS_SETTINGS_NAMES_ALL_X","\
NM_SETTING_WIMAX_SETTING_NAME
@@ -135,6 +120,54 @@ static NmcOutputField nmc_fields_settings_names[] = {
#endif
+/* Available fields for 'con status' */
+static NmcOutputField nmc_fields_con_status[] = {
+ {"GROUP", N_("GROUP"), 9, NULL, 0}, /* 0 */ /* used only for 'GENERAL' group listing */
+ {"NAME", N_("NAME"), 25, NULL, 0}, /* 1 */
+ {"UUID", N_("UUID"), 38, NULL, 0}, /* 2 */
+ {"DEVICES", N_("DEVICES"), 10, NULL, 0}, /* 3 */
+ {"STATE", N_("STATE"), 12, NULL, 0}, /* 4 */
+ {"DEFAULT", N_("DEFAULT"), 8, NULL, 0}, /* 5 */
+ {"DEFAULT6", N_("DEFAULT6"), 9, NULL, 0}, /* 6 */
+ {"SPEC-OBJECT", N_("SPEC-OBJECT"), 10, NULL, 0}, /* 7 */
+ {"VPN", N_("VPN"), 5, NULL, 0}, /* 8 */
+ {"DBUS-PATH", N_("DBUS-PATH"), 51, NULL, 0}, /* 9 */
+ {"CON-PATH", N_("CON-PATH"), 44, NULL, 0}, /* 10 */
+ {"ZONE", N_("ZONE"), 15, NULL, 0}, /* 11 */
+ {"MASTER-PATH", N_("MASTER-PATH"), 44, NULL, 0}, /* 12 */
+ {NULL, NULL, 0, NULL, 0}
+};
+#define NMC_FIELDS_CON_STATUS_ALL "NAME,UUID,DEVICES,STATE,DEFAULT,DEFAULT6,VPN,ZONE,DBUS-PATH,CON-PATH,SPEC-OBJECT,MASTER-PATH"
+#define NMC_FIELDS_CON_STATUS_COMMON "NAME,UUID,DEVICES,DEFAULT,VPN,MASTER-PATH"
+
+/* Available fields for 'con status id/uuid/path ' */
+static NmcOutputField nmc_fields_status_details_groups[] = {
+ {"GENERAL", N_("GENERAL"), 9, NULL, 0}, /* 0 */
+ {"IP", N_("IP"), 5, NULL, 0}, /* 1 */
+ {"VPN", N_("VPN"), 5, NULL, 0}, /* 2 */
+ {NULL, NULL, 0, NULL, 0}
+};
+#define NMC_FIELDS_CON_STATUS_DETAILS_ALL "GENERAL,IP,VPN"
+
+/* GENERAL group is the same as nmc_fields_con_status */
+#define NMC_FIELDS_CON_STATUS_DETAILS_GENERAL_ALL "GROUP,"NMC_FIELDS_CON_STATUS_ALL
+
+/* IP group is handled by common.c */
+
+/* Available fields for VPN group */
+static NmcOutputField nmc_fields_status_details_vpn[] = {
+ {"GROUP", N_("GROUP"), 9, NULL, 0}, /* 0 */
+ {"TYPE", N_("TYPE"), 15, NULL, 0}, /* 1 */
+ {"USERNAME", N_("USERNAME"), 15, NULL, 0}, /* 2 */
+ {"GATEWAY", N_("GATEWAY"), 25, NULL, 0}, /* 3 */
+ {"BANNER", N_("BANNER"), 120, NULL, 0}, /* 4 */
+ {"VPN-STATE", N_("VPN-STATE"), 40, NULL, 0}, /* 5 */
+ {"CFG", N_("CFG"), 120, NULL, 0}, /* 6 */
+ {NULL, NULL, 0, NULL, 0}
+};
+#define NMC_FIELDS_CON_STATUS_DETAILS_VPN_ALL "GROUP,TYPE,USERNAME,GATEWAY,BANNER,VPN-STATE,CFG"
+
+
typedef struct {
NmCli *nmc;
int argc;
@@ -153,7 +186,7 @@ usage (void)
_("Usage: nmcli con { COMMAND | help }\n"
" COMMAND := { list | status | up | down | delete }\n\n"
" list [id | uuid ]\n"
- " status\n"
+ " status [id | uuid | path ]\n"
#if WITH_WIMAX
" up id | uuid [iface ] [ap ] [nsp ] [--nowait] [--timeout ]\n"
#else
@@ -183,7 +216,6 @@ quit (void)
static gboolean
nmc_connection_detail (NMConnection *connection, NmCli *nmc)
{
- NMSetting *setting;
GError *error = NULL;
GArray *print_settings_array;
int i;
@@ -229,135 +261,135 @@ nmc_connection_detail (NMConnection *connection, NmCli *nmc)
was_output = FALSE;
if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[0].name)) {
- setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION);
- if (setting) {
- setting_connection_details (setting, nmc);
+ NMSettingConnection *s_con = nm_connection_get_setting_connection (connection);
+ if (s_con) {
+ setting_connection_details (s_con, nmc);
was_output = TRUE;
continue;
}
}
if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[1].name)) {
- setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRED);
- if (setting) {
- setting_wired_details (setting, nmc);
+ NMSettingWired *s_wired = nm_connection_get_setting_wired (connection);
+ if (s_wired) {
+ setting_wired_details (s_wired, nmc);
was_output = TRUE;
continue;
}
}
if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[2].name)) {
- setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_802_1X);
- if (setting) {
- setting_802_1X_details (setting, nmc);
+ NMSetting8021x *s_8021X = nm_connection_get_setting_802_1x (connection);
+ if (s_8021X) {
+ setting_802_1X_details (s_8021X, nmc);
was_output = TRUE;
continue;
}
}
if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[3].name)) {
- setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS);
- if (setting) {
- setting_wireless_details (setting, nmc);
+ NMSettingWireless *s_wireless = nm_connection_get_setting_wireless (connection);
+ if (s_wireless) {
+ setting_wireless_details (s_wireless, nmc);
was_output = TRUE;
continue;
}
}
if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[4].name)) {
- setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY);
- if (setting) {
- setting_wireless_security_details (setting, nmc);
+ NMSettingWirelessSecurity *s_wsec = nm_connection_get_setting_wireless_security (connection);
+ if (s_wsec) {
+ setting_wireless_security_details (s_wsec, nmc);
was_output = TRUE;
continue;
}
}
if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[5].name)) {
- setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG);
- if (setting) {
- setting_ip4_config_details (setting, nmc);
+ NMSettingIP4Config *s_ip4 = nm_connection_get_setting_ip4_config (connection);
+ if (s_ip4) {
+ setting_ip4_config_details (s_ip4, nmc);
was_output = TRUE;
continue;
}
}
if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[6].name)) {
- setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG);
- if (setting) {
- setting_ip6_config_details (setting, nmc);
+ NMSettingIP6Config *s_ip6 = nm_connection_get_setting_ip6_config (connection);
+ if (s_ip6) {
+ setting_ip6_config_details (s_ip6, nmc);
was_output = TRUE;
continue;
}
}
if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[7].name)) {
- setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_SERIAL);
- if (setting) {
- setting_serial_details (setting, nmc);
+ NMSettingSerial *s_serial = nm_connection_get_setting_serial (connection);
+ if (s_serial) {
+ setting_serial_details (s_serial, nmc);
was_output = TRUE;
continue;
}
}
if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[8].name)) {
- setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_PPP);
- if (setting) {
- setting_ppp_details (setting, nmc);
+ NMSettingPPP *s_ppp = nm_connection_get_setting_ppp (connection);
+ if (s_ppp) {
+ setting_ppp_details (s_ppp, nmc);
was_output = TRUE;
continue;
}
}
if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[9].name)) {
- setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_PPPOE);
- if (setting) {
- setting_pppoe_details (setting, nmc);
+ NMSettingPPPOE *s_pppoe = nm_connection_get_setting_pppoe (connection);
+ if (s_pppoe) {
+ setting_pppoe_details (s_pppoe, nmc);
was_output = TRUE;
continue;
}
}
if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[10].name)) {
- setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_GSM);
- if (setting) {
- setting_gsm_details (setting, nmc);
+ NMSettingGsm *s_gsm = nm_connection_get_setting_gsm (connection);
+ if (s_gsm) {
+ setting_gsm_details (s_gsm, nmc);
was_output = TRUE;
continue;
}
}
if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[11].name)) {
- setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_CDMA);
- if (setting) {
- setting_cdma_details (setting, nmc);
+ NMSettingCdma *s_cdma = nm_connection_get_setting_cdma (connection);
+ if (s_cdma) {
+ setting_cdma_details (s_cdma, nmc);
was_output = TRUE;
continue;
}
}
if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[12].name)) {
- setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_BLUETOOTH);
- if (setting) {
- setting_bluetooth_details (setting, nmc);
+ NMSettingBluetooth *s_bluetooth = nm_connection_get_setting_bluetooth (connection);
+ if (s_bluetooth) {
+ setting_bluetooth_details (s_bluetooth, nmc);
was_output = TRUE;
continue;
}
}
if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[13].name)) {
- setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_OLPC_MESH);
- if (setting) {
- setting_olpc_mesh_details (setting, nmc);
+ NMSettingOlpcMesh *s_olpc_mesh = nm_connection_get_setting_olpc_mesh (connection);
+ if (s_olpc_mesh) {
+ setting_olpc_mesh_details (s_olpc_mesh, nmc);
was_output = TRUE;
continue;
}
}
if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[14].name)) {
- setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_VPN);
- if (setting) {
- setting_vpn_details (setting, nmc);
+ NMSettingVPN *s_vpn = nm_connection_get_setting_vpn (connection);
+ if (s_vpn) {
+ setting_vpn_details (s_vpn, nmc);
was_output = TRUE;
continue;
}
@@ -365,14 +397,41 @@ nmc_connection_detail (NMConnection *connection, NmCli *nmc)
#if WITH_WIMAX
if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[15].name)) {
- setting = nm_connection_get_setting (connection, NM_TYPE_SETTING_WIMAX);
- if (setting) {
- setting_wimax_details (setting, nmc);
+ NMSettingWimax *s_wimax = nm_connection_get_setting_wimax (connection);
+ if (s_wimax) {
+ setting_wimax_details (s_wimax, nmc);
was_output = TRUE;
continue;
}
}
#endif
+
+ if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[16].name)) {
+ NMSettingInfiniband *s_infiniband = nm_connection_get_setting_infiniband (connection);
+ if (s_infiniband) {
+ setting_infiniband_details (s_infiniband, nmc);
+ was_output = TRUE;
+ continue;
+ }
+ }
+
+ if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[17].name)) {
+ NMSettingBond *s_bond = nm_connection_get_setting_bond (connection);
+ if (s_bond) {
+ setting_bond_details (s_bond, nmc);
+ was_output = TRUE;
+ continue;
+ }
+ }
+
+ if (!strcasecmp (nmc_fields_settings_names[section_idx].name, nmc_fields_settings_names[18].name)) {
+ NMSettingVlan *s_vlan = nm_connection_get_setting_vlan (connection);
+ if (s_vlan) {
+ setting_vlan_details (s_vlan, nmc);
+ was_output = TRUE;
+ continue;
+ }
+ }
}
if (print_settings_array)
@@ -544,19 +603,77 @@ error:
return nmc->return_value;
}
-static void
-show_active_connection (gpointer data, gpointer user_data)
+static const char *
+active_connection_state_to_string (NMActiveConnectionState state)
{
- NMActiveConnection *active = NM_ACTIVE_CONNECTION (data);
- NmCli *nmc = (NmCli *) user_data;
- GSList *con_list, *iter;
+ switch (state) {
+ case NM_ACTIVE_CONNECTION_STATE_ACTIVATING:
+ return _("activating");
+ case NM_ACTIVE_CONNECTION_STATE_ACTIVATED:
+ return _("activated");
+ case NM_ACTIVE_CONNECTION_STATE_DEACTIVATING:
+ return _("deactivating");
+ case NM_ACTIVE_CONNECTION_STATE_UNKNOWN:
+ default:
+ return _("unknown");
+ }
+}
+
+static const char *
+vpn_connection_state_to_string (NMVPNConnectionState state)
+{
+ switch (state) {
+ case NM_VPN_CONNECTION_STATE_PREPARE:
+ return _("VPN connecting (prepare)");
+ case NM_VPN_CONNECTION_STATE_NEED_AUTH:
+ return _("VPN connecting (need authentication)");
+ case NM_VPN_CONNECTION_STATE_CONNECT:
+ return _("VPN connecting");
+ case NM_VPN_CONNECTION_STATE_IP_CONFIG_GET:
+ return _("VPN connecting (getting IP configuration)");
+ case NM_VPN_CONNECTION_STATE_ACTIVATED:
+ return _("VPN connected");
+ case NM_VPN_CONNECTION_STATE_FAILED:
+ return _("VPN connection failed");
+ case NM_VPN_CONNECTION_STATE_DISCONNECTED:
+ return _("VPN disconnected");
+ default:
+ return _("unknown");
+ }
+}
+
+static NMConnection *
+get_connection_for_active (const GSList *con_list, NMActiveConnection *active)
+{
+ const GSList *iter;
+ const char *path;
+
+ path = nm_active_connection_get_connection (active);
+ g_return_val_if_fail (path != NULL, NULL);
+
+ for (iter = con_list; iter; iter = g_slist_next (iter)) {
+ NMConnection *candidate = NM_CONNECTION (iter->data);
+
+ if (strcmp (nm_connection_get_path (candidate), path) == 0)
+ return candidate;
+ }
+ return NULL;
+}
+
+static gboolean
+fill_in_fields_con_status (NMActiveConnection *active, GSList *con_list)
+{
+ GSList *iter;
const char *active_path;
NMSettingConnection *s_con;
const GPtrArray *devices;
GString *dev_str;
+ NMActiveConnectionState state;
int i;
+ gboolean success = FALSE;
active_path = nm_active_connection_get_connection (active);
+ state = nm_active_connection_get_state (active);
/* Get devices of the active connection */
dev_str = g_string_new (NULL);
@@ -570,7 +687,6 @@ show_active_connection (gpointer data, gpointer user_data)
if (dev_str->len > 0)
g_string_truncate (dev_str, dev_str->len - 1); /* Cut off last ',' */
- con_list = nmc->system_connections;
for (iter = con_list; iter; iter = g_slist_next (iter)) {
NMConnection *connection = (NMConnection *) iter->data;
const char *con_path = nm_connection_get_path (connection);
@@ -580,410 +696,432 @@ show_active_connection (gpointer data, gpointer user_data)
s_con = nm_connection_get_setting_connection (connection);
g_assert (s_con != NULL);
- /* Obtain field values */
- nmc->allowed_fields[0].value = nm_setting_connection_get_id (s_con);
- nmc->allowed_fields[1].value = nm_setting_connection_get_uuid (s_con);
- nmc->allowed_fields[2].value = dev_str->str;
- nmc->allowed_fields[3].value = nm_active_connection_get_default (active) ? _("yes") : _("no");
- nmc->allowed_fields[4].value = nm_active_connection_get_specific_object (active);
- nmc->allowed_fields[5].value = NM_IS_VPN_CONNECTION (active) ? _("yes") : _("no");
- nmc->allowed_fields[6].value = nm_object_get_path (NM_OBJECT (active));
-
- nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER_ADD & ~NMC_PF_FLAG_MAIN_HEADER_ONLY & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */
- print_fields (nmc->print_fields, nmc->allowed_fields);
+ /* Fill field values */
+ nmc_fields_con_status[0].value = nmc_fields_status_details_groups[0].name;
+ nmc_fields_con_status[1].value = nm_setting_connection_get_id (s_con);
+ nmc_fields_con_status[2].value = nm_setting_connection_get_uuid (s_con);
+ nmc_fields_con_status[3].value = dev_str->str;
+ nmc_fields_con_status[4].value = active_connection_state_to_string (state);
+ nmc_fields_con_status[5].value = nm_active_connection_get_default (active) ? _("yes") : _("no");
+ nmc_fields_con_status[6].value = nm_active_connection_get_default6 (active) ? _("yes") : _("no");
+ nmc_fields_con_status[7].value = nm_active_connection_get_specific_object (active);
+ nmc_fields_con_status[8].value = NM_IS_VPN_CONNECTION (active) ? _("yes") : _("no");
+ nmc_fields_con_status[9].value = nm_object_get_path (NM_OBJECT (active));
+ nmc_fields_con_status[10].value = nm_active_connection_get_connection (active);
+ nmc_fields_con_status[11].value = nm_setting_connection_get_zone (s_con);
+ nmc_fields_con_status[12].value = nm_active_connection_get_master (active);
+
+ success = TRUE;
break;
}
}
- g_string_free (dev_str, TRUE);
+ /* Just free GString here, the char array has to be freed after printing
+ * (by free_fields_con_status()) */
+ g_string_free (dev_str, FALSE);
+ return success;
}
-static NMCResultCode
-do_connections_status (NmCli *nmc, int argc, char **argv)
+static void
+free_fields_con_status (void)
{
- const GPtrArray *active_cons;
- GError *error = NULL;
- char *fields_str;
- char *fields_all = NMC_FIELDS_CON_STATUS_ALL;
- char *fields_common = NMC_FIELDS_CON_STATUS_COMMON;
- guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0;
- guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0;
- guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0;
-
- nmc->should_wait = FALSE;
-
- if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0)
- fields_str = fields_common;
- else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0)
- fields_str = fields_all;
- else
- fields_str = nmc->required_fields;
+ /* Just DEVICES string was dynamically allocated */
+ g_free ((char *) nmc_fields_con_status[3].value);
+ nmc_fields_con_status[3].value = NULL;
+}
- nmc->allowed_fields = nmc_fields_con_status;
- nmc->print_fields.indices = parse_output_fields (fields_str, nmc->allowed_fields, &error);
+static void
+show_active_connection (gpointer data, gpointer user_data)
+{
+ NMActiveConnection *active = NM_ACTIVE_CONNECTION (data);
+ NmCli *nmc = (NmCli *) user_data;
- if (error) {
- if (error->code == 0)
- g_string_printf (nmc->return_text, _("Error: 'con status': %s"), error->message);
- else
- g_string_printf (nmc->return_text, _("Error: 'con status': %s; allowed fields: %s"), error->message, NMC_FIELDS_CON_STATUS_ALL);
- g_error_free (error);
- nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
- goto error;
- }
+ fill_in_fields_con_status (active, nmc->system_connections);
- if (!nmc_is_nm_running (nmc, &error)) {
- if (error) {
- g_string_printf (nmc->return_text, _("Error: Can't find out if NetworkManager is running: %s."), error->message);
- nmc->return_value = NMC_RESULT_ERROR_UNKNOWN;
- g_error_free (error);
- } else {
- g_string_printf (nmc->return_text, _("Error: NetworkManager is not running."));
- nmc->return_value = NMC_RESULT_ERROR_NM_NOT_RUNNING;
- }
- goto error;
- }
-
- /* Print headers */
- nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES;
- nmc->print_fields.header_name = _("Active connections");
+ nmc->print_fields.flags &= ~NMC_PF_FLAG_MAIN_HEADER_ADD & ~NMC_PF_FLAG_MAIN_HEADER_ONLY & ~NMC_PF_FLAG_FIELD_NAMES; /* Clear header flags */
print_fields (nmc->print_fields, nmc->allowed_fields);
- nmc->get_client (nmc);
- active_cons = nm_client_get_active_connections (nmc->client);
- if (active_cons && active_cons->len)
- g_ptr_array_foreach ((GPtrArray *) active_cons, show_active_connection, (gpointer) nmc);
-
-error:
- return nmc->return_value;
+ free_fields_con_status ();
}
-/* --------------------
- * These function should be moved to libnm-glib in the end.
- */
-static gboolean
-check_ethernet_compatible (NMDeviceEthernet *device, NMConnection *connection, GError **error)
+static NMActiveConnection *
+find_active_connection (const GPtrArray *active_cons, const GSList *cons,
+ const char *filter_type, const char *filter_val)
{
+ int i;
+ const char *s_path, *a_path;
+ const char *id;
+ const char *uuid;
+ NMConnection *con;
NMSettingConnection *s_con;
- NMSettingWired *s_wired;
- const char *connection_type;
- gboolean is_pppoe = FALSE;
-
- g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
-
- s_con = nm_connection_get_setting_connection (connection);
- g_assert (s_con);
-
- connection_type = nm_setting_connection_get_connection_type (s_con);
- if ( strcmp (connection_type, NM_SETTING_WIRED_SETTING_NAME)
- && strcmp (connection_type, NM_SETTING_PPPOE_SETTING_NAME)) {
- g_set_error (error, 0, 0,
- "The connection was not a wired or PPPoE connection.");
- return FALSE;
- }
- if (!strcmp (connection_type, NM_SETTING_PPPOE_SETTING_NAME))
- is_pppoe = TRUE;
-
- s_wired = nm_connection_get_setting_wired (connection);
- /* Wired setting is optional for PPPoE */
- if (!is_pppoe && !s_wired) {
- g_set_error (error, 0, 0,
- "The connection was not a valid wired connection.");
- return FALSE;
- }
-
- if (s_wired) {
- const GByteArray *mac;
- const char *device_mac_str;
- struct ether_addr *device_mac = NULL;
-
- device_mac_str = nm_device_ethernet_get_permanent_hw_address (device);
- if (device_mac_str)
- device_mac = ether_aton (device_mac_str);
- if (!device_mac) {
- g_set_error (error, 0, 0, "Invalid device MAC address.");
- return FALSE;
- }
+ for (i = 0; active_cons && (i < active_cons->len); i++) {
+ NMActiveConnection *candidate = g_ptr_array_index (active_cons, i);
- mac = nm_setting_wired_get_mac_address (s_wired);
- if (mac && memcmp (mac->data, device_mac->ether_addr_octet, ETH_ALEN)) {
- g_set_error (error, 0, 0,
- "The connection's MAC address did not match this device.");
- return FALSE;
+ s_path = nm_active_connection_get_connection (candidate);
+ a_path = nm_object_get_path (NM_OBJECT (candidate));
+ uuid = nm_active_connection_get_uuid (candidate);
+
+ con = get_connection_for_active (cons, candidate);
+ s_con = nm_connection_get_setting_connection (con);
+ g_assert (s_con != NULL);
+ id = nm_setting_connection_get_id (s_con);
+
+ if (filter_type) {
+ if ( (strcmp (filter_type, "id") == 0 && strcmp (filter_val, id) == 0)
+ || (strcmp (filter_type, "uuid") == 0 && strcmp (filter_val, uuid) == 0)
+ || (strcmp (filter_type, "path") == 0 && strcmp (filter_val, s_path) == 0)
+ || (strcmp (filter_type, "path") == 0 && strcmp (filter_val, a_path) == 0)) {
+ return candidate;
+ }
}
}
+ return NULL;
+}
- // FIXME: check bitrate against device capabilities
+typedef struct {
+ char **array;
+ guint32 idx;
+} FillVPNDataInfo;
- return TRUE;
+static void
+fill_vpn_data_item (const char *key, const char *value, gpointer user_data)
+{
+ FillVPNDataInfo *info = (FillVPNDataInfo *) user_data;
+
+ info->array[info->idx++] = g_strdup_printf ("%s = %s", key, value);
}
-static gboolean
-check_wifi_compatible (NMDeviceWifi *device, NMConnection *connection, GError **error)
+// FIXME: The same or similar code for VPN info appears also in nm-applet (applet-dialogs.c),
+// and in gnome-control-center as well. It could probably be shared somehow.
+static char *
+get_vpn_connection_type (NMConnection *connection)
{
- NMSettingConnection *s_con;
- NMSettingWireless *s_wireless;
+ const char *type, *p;
- g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
-
- s_con = nm_connection_get_setting_connection (connection);
- g_assert (s_con);
+ /* The service type is in form of "org.freedesktop.NetworkManager.vpnc".
+ * Extract end part after last dot, e.g. "vpnc"
+ */
+ type = nm_setting_vpn_get_service_type (nm_connection_get_setting_vpn (connection));
+ p = strrchr (type, '.');
+ return g_strdup (p ? p + 1 : type);
+}
- if (strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_WIRELESS_SETTING_NAME)) {
- g_set_error (error, 0, 0,
- "The connection was not a WiFi connection.");
- return FALSE;
- }
+/* VPN parameters can be found at:
+ * http://git.gnome.org/browse/network-manager-openvpn/tree/src/nm-openvpn-service.h
+ * http://git.gnome.org/browse/network-manager-vpnc/tree/src/nm-vpnc-service.h
+ * http://git.gnome.org/browse/network-manager-pptp/tree/src/nm-pptp-service.h
+ * http://git.gnome.org/browse/network-manager-openconnect/tree/src/nm-openconnect-service.h
+ * http://git.gnome.org/browse/network-manager-openswan/tree/src/nm-openswan-service.h
+ * See also 'properties' directory in these plugins.
+ */
+static const gchar *
+find_vpn_gateway_key (const char *vpn_type)
+{
+ if (g_strcmp0 (vpn_type, "openvpn") == 0) return "remote";
+ if (g_strcmp0 (vpn_type, "vpnc") == 0) return "IPSec gateway";
+ if (g_strcmp0 (vpn_type, "pptp") == 0) return "gateway";
+ if (g_strcmp0 (vpn_type, "openconnect") == 0) return "gateway";
+ if (g_strcmp0 (vpn_type, "openswan") == 0) return "right";
+ return "";
+}
- s_wireless = nm_connection_get_setting_wireless (connection);
- if (!s_wireless) {
- g_set_error (error, 0, 0,
- "The connection was not a valid WiFi connection.");
- return FALSE;
- }
+static const gchar *
+find_vpn_username_key (const char *vpn_type)
+{
+ if (g_strcmp0 (vpn_type, "openvpn") == 0) return "username";
+ if (g_strcmp0 (vpn_type, "vpnc") == 0) return "Xauth username";
+ if (g_strcmp0 (vpn_type, "pptp") == 0) return "user";
+ if (g_strcmp0 (vpn_type, "openconnect") == 0) return "username";
+ if (g_strcmp0 (vpn_type, "openswan") == 0) return "leftxauthusername";
+ return "";
+}
- if (s_wireless) {
- const GByteArray *mac;
- const char *device_mac_str;
- struct ether_addr *device_mac = NULL;
+enum VpnDataItem {
+ VPN_DATA_ITEM_GATEWAY,
+ VPN_DATA_ITEM_USERNAME
+};
- device_mac_str = nm_device_wifi_get_permanent_hw_address (device);
- if (device_mac_str)
- device_mac = ether_aton (device_mac_str);
- if (!device_mac) {
- g_set_error (error, 0, 0, "Invalid device MAC address.");
- return FALSE;
- }
+static const gchar *
+get_vpn_data_item (NMConnection *connection, enum VpnDataItem vpn_data_item)
+{
+ const char *key;
+ char *type = get_vpn_connection_type (connection);
- mac = nm_setting_wireless_get_mac_address (s_wireless);
- if (mac && memcmp (mac->data, device_mac->ether_addr_octet, ETH_ALEN)) {
- g_set_error (error, 0, 0,
- "The connection's MAC address did not match this device.");
- return FALSE;
- }
+ switch (vpn_data_item) {
+ case VPN_DATA_ITEM_GATEWAY:
+ key = find_vpn_gateway_key (type);
+ break;
+ case VPN_DATA_ITEM_USERNAME:
+ key = find_vpn_username_key (type);
+ break;
+ default:
+ key = "";
+ break;
}
+ g_free (type);
- // FIXME: check channel/freq/band against bands the hardware supports
- // FIXME: check encryption against device capabilities
- // FIXME: check bitrate against device capabilities
-
- return TRUE;
+ return nm_setting_vpn_get_data_item (nm_connection_get_setting_vpn (connection), key);
}
+/* FIXME end */
static gboolean
-check_bt_compatible (NMDeviceBt *device, NMConnection *connection, GError **error)
+nmc_active_connection_detail (NMActiveConnection *acon, NmCli *nmc)
{
- NMSettingConnection *s_con;
- NMSettingBluetooth *s_bt;
- const GByteArray *array;
- char *str;
- const char *device_hw_str;
- int addr_match = FALSE;
- const char *bt_type_str;
- guint32 bt_type, bt_capab;
-
- g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+ GError *error = NULL;
+ GArray *print_groups;
+ int i;
+ char *fields_str;
+ char *fields_all = NMC_FIELDS_CON_STATUS_DETAILS_ALL;
+ char *fields_common = NMC_FIELDS_CON_STATUS_DETAILS_ALL;
+ guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0;
+ guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0;
+ guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0;
+ gboolean was_output = FALSE;
- s_con = nm_connection_get_setting_connection (connection);
- g_assert (s_con);
+ if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0)
+ fields_str = fields_common;
+ else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0)
+ fields_str = fields_all;
+ else
+ fields_str = nmc->required_fields;
- if (strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_BLUETOOTH_SETTING_NAME)) {
- g_set_error (error, 0, 0,
- "The connection was not a Bluetooth connection.");
+ print_groups = parse_output_fields (fields_str, nmc_fields_status_details_groups, &error);
+ if (error) {
+ if (error->code == 0)
+ g_string_printf (nmc->return_text, _("Error: 'con status': %s"), error->message);
+ else
+ g_string_printf (nmc->return_text, _("Error: 'con status': %s; allowed fields: %s"), error->message, NMC_FIELDS_CON_STATUS_DETAILS_ALL);
+ g_error_free (error);
+ nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
return FALSE;
}
- s_bt = nm_connection_get_setting_bluetooth (connection);
- if (!s_bt) {
- g_set_error (error, 0, 0,
- "The connection was not a valid Bluetooth connection.");
- return FALSE;
- }
+ nmc->allowed_fields = nmc_fields_status_details_groups;
+ nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ONLY;
+ nmc->print_fields.header_name = _("Active connection details");
+ nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_CON_STATUS_DETAILS_ALL, nmc->allowed_fields, NULL);
+ print_fields (nmc->print_fields, nmc->allowed_fields);
- array = nm_setting_bluetooth_get_bdaddr (s_bt);
- if (!array || (array->len != ETH_ALEN)) {
- g_set_error (error, 0, 0,
- "The connection did not contain a valid Bluetooth address.");
- return FALSE;
- }
+ /* Loop through the groups and print them. */
+ for (i = 0; i < print_groups->len; i++) {
+ int group_idx = g_array_index (print_groups, int, i);
- bt_type_str = nm_setting_bluetooth_get_connection_type (s_bt);
- g_assert (bt_type_str);
+ if (nmc->print_output != NMC_PRINT_TERSE && !nmc->multiline_output && was_output)
+ printf ("\n"); /* Empty line */
- bt_type = NM_BT_CAPABILITY_NONE;
- if (!strcmp (bt_type_str, NM_SETTING_BLUETOOTH_TYPE_DUN))
- bt_type = NM_BT_CAPABILITY_DUN;
- else if (!strcmp (bt_type_str, NM_SETTING_BLUETOOTH_TYPE_PANU))
- bt_type = NM_BT_CAPABILITY_NAP;
+ was_output = FALSE;
- bt_capab = nm_device_bt_get_capabilities (device);
- if (!(bt_type & bt_capab)) {
- g_set_error (error, 0, 0,
- "The connection was not compatible with the device's capabilities.");
- return FALSE;
- }
+ /* GENERAL */
+ if (strcasecmp (nmc_fields_status_details_groups[group_idx].name, nmc_fields_status_details_groups[0].name) == 0) {
+ nmc->allowed_fields = nmc_fields_con_status;
+ nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_CON_STATUS_DETAILS_GENERAL_ALL, nmc->allowed_fields, NULL);
- device_hw_str = nm_device_bt_get_hw_address (device);
+ /* Print field names */
+ nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES;
+ print_fields (nmc->print_fields, nmc->allowed_fields);
- str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X",
- array->data[0], array->data[1], array->data[2],
- array->data[3], array->data[4], array->data[5]);
- addr_match = !strcmp (device_hw_str, str);
- g_free (str);
+ /* Fill in values */
+ fill_in_fields_con_status (acon, nmc->system_connections);
- return addr_match;
-}
+ /* and print them */
+ nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX;
+ print_fields (nmc->print_fields, nmc->allowed_fields);
-#if 0
-static gboolean
-check_olpc_mesh_compatible (NMDeviceOlpcMesh *device, NMConnection *connection, GError **error)
-{
- NMSettingConnection *s_con;
- NMSettingOlpcMesh *s_mesh;
+ free_fields_con_status ();
+ was_output = TRUE;
+ }
- g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+ /* IP */
+ if (strcasecmp (nmc_fields_status_details_groups[group_idx].name, nmc_fields_status_details_groups[1].name) == 0) {
+ const GPtrArray *devices;
+ int j;
+
+ devices = nm_active_connection_get_devices (acon);
+ for (j = 0; devices && (j < devices->len); j++) {
+ gboolean b1 = FALSE, b2 = FALSE, b3 = FALSE, b4 = FALSE;
+ NMDevice *device = g_ptr_array_index (devices, j);
+ NMIP4Config *cfg4 = nm_device_get_ip4_config (device);
+ NMIP6Config *cfg6 = nm_device_get_ip6_config (device);
+ NMDHCP4Config *dhcp4 = nm_device_get_dhcp4_config (device);
+ NMDHCP6Config *dhcp6 = nm_device_get_dhcp6_config (device);
+
+ b1 = print_ip4_config (cfg4, nmc, "IP4");
+ b2 = print_dhcp4_config (dhcp4, nmc, "DHCP4");
+ b3 = print_ip6_config (cfg6, nmc, "IP6");
+ b4 = print_dhcp6_config (dhcp6, nmc, "DHCP6");
+ was_output = was_output || b1 || b2 || b3 || b4;
+ }
+ }
- s_con = nm_connection_get_setting_connection (connection);
- g_assert (s_con);
+ /* VPN */
+ if (NM_IS_VPN_CONNECTION (acon) &&
+ strcasecmp (nmc_fields_status_details_groups[group_idx].name, nmc_fields_status_details_groups[2].name) == 0) {
+ NMConnection *con;
+ NMSettingConnection *s_con;
+ NMSettingVPN *s_vpn;
+ NMVPNConnectionState vpn_state;
+ char *type_str, *banner_str, *vpn_state_str;
+ const char *username = NULL;
+ char **vpn_data_array = NULL;
+ guint32 items_num;
+
+ con = get_connection_for_active (nmc->system_connections, acon);
+
+ s_con = nm_connection_get_setting_connection (con);
+ g_assert (s_con != NULL);
- if (strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_OLPC_MESH_SETTING_NAME)) {
- g_set_error (error, 0, 0,
- "The connection was not a Mesh connection.");
- return FALSE;
- }
+ nmc->allowed_fields = nmc_fields_status_details_vpn;
+ nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_CON_STATUS_DETAILS_VPN_ALL, nmc->allowed_fields, NULL);
- s_mesh = nm_connection_get_setting_olpc_mesh (connection);
- if (!s_mesh) {
- g_set_error (error, 0, 0,
- "The connection was not a valid Mesh connection.");
- return FALSE;
+ /* Print field names */
+ nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES;
+ print_fields (nmc->print_fields, nmc->allowed_fields);
+
+ s_vpn = nm_connection_get_setting_vpn (con);
+ if (s_vpn) {
+ items_num = nm_setting_vpn_get_num_data_items (s_vpn);
+ if (items_num > 0) {
+ FillVPNDataInfo info;
+
+ vpn_data_array = g_new (char *, items_num + 1);
+ info.array = vpn_data_array;
+ info.idx = 0;
+ nm_setting_vpn_foreach_data_item (s_vpn, &fill_vpn_data_item, &info);
+ vpn_data_array[items_num] = NULL;
+ }
+ username = nm_setting_vpn_get_user_name (s_vpn);
+ }
+
+ type_str = get_vpn_connection_type (con);
+ banner_str = g_strescape (nm_vpn_connection_get_banner (NM_VPN_CONNECTION (acon)), "");
+ vpn_state = nm_vpn_connection_get_vpn_state (NM_VPN_CONNECTION (acon));
+ vpn_state_str = g_strdup_printf ("%d - %s", vpn_state, vpn_connection_state_to_string (vpn_state));
+
+ /* Print values */
+ set_val_str (nmc->allowed_fields, 0, nmc_fields_status_details_groups[2].name);
+ set_val_str (nmc->allowed_fields, 1, type_str);
+ set_val_str (nmc->allowed_fields, 2, username ? username : get_vpn_data_item (con, VPN_DATA_ITEM_USERNAME));
+ set_val_str (nmc->allowed_fields, 3, get_vpn_data_item (con, VPN_DATA_ITEM_GATEWAY));
+ set_val_str (nmc->allowed_fields, 4, banner_str);
+ set_val_str (nmc->allowed_fields, 5, vpn_state_str);
+ set_val_arr (nmc->allowed_fields, 6, (const char **) vpn_data_array);
+
+ nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX;
+ print_fields (nmc->print_fields, nmc->allowed_fields);
+
+ g_free (type_str);
+ g_free (banner_str);
+ g_free (vpn_state_str);
+ g_strfreev (vpn_data_array);
+ was_output = TRUE;
+ }
}
+ if (print_groups)
+ g_array_free (print_groups, FALSE);
+
return TRUE;
}
-#endif
-#if WITH_WIMAX
-static gboolean
-check_wimax_compatible (NMDeviceWimax *device, NMConnection *connection, GError **error)
+static NMCResultCode
+do_connections_status (NmCli *nmc, int argc, char **argv)
{
- NMSettingConnection *s_con;
- NMSettingWimax *s_wimax;
- const GByteArray *mac;
- const char *device_mac_str;
- struct ether_addr *device_mac = NULL;
-
- g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
-
- s_con = nm_connection_get_setting_connection (connection);
- g_assert (s_con);
-
- if (strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_WIMAX_SETTING_NAME)) {
- g_set_error (error, 0, 0,
- "The connection was not a WiMAX connection.");
- return FALSE;
- }
+ const GPtrArray *active_cons;
+ GError *err = NULL;
+ GError *err1 = NULL;
- s_wimax = nm_connection_get_setting_wimax (connection);
- if (!s_wimax) {
- g_set_error (error, 0, 0,
- "The connection was not a valid WiMAX connection.");
- return FALSE;
- }
+ nmc->should_wait = FALSE;
- device_mac_str = nm_device_wimax_get_hw_address (device);
- if (device_mac_str)
- device_mac = ether_aton (device_mac_str);
- if (!device_mac) {
- g_set_error (error, 0, 0, "Invalid device MAC address.");
- return FALSE;
+ if (!nmc_is_nm_running (nmc, &err)) {
+ if (err) {
+ g_string_printf (nmc->return_text, _("Error: Can't find out if NetworkManager is running: %s."), err->message);
+ nmc->return_value = NMC_RESULT_ERROR_UNKNOWN;
+ g_error_free (err);
+ } else {
+ g_string_printf (nmc->return_text, _("Error: NetworkManager is not running."));
+ nmc->return_value = NMC_RESULT_ERROR_NM_NOT_RUNNING;
+ }
+ goto error;
}
- mac = nm_setting_wimax_get_mac_address (s_wimax);
- if (mac && memcmp (mac->data, device_mac->ether_addr_octet, ETH_ALEN)) {
- g_set_error (error, 0, 0,
- "The connection's MAC address did not match this device.");
- return FALSE;
- }
+ /* Get active connections */
+ nmc->get_client (nmc);
+ active_cons = nm_client_get_active_connections (nmc->client);
- return TRUE;
-}
-#endif
+ if (argc == 0) {
+ char *fields_str;
+ char *fields_all = NMC_FIELDS_CON_STATUS_ALL;
+ char *fields_common = NMC_FIELDS_CON_STATUS_COMMON;
+ guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0;
+ guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0;
+ guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0;
+
+ if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0)
+ fields_str = fields_common;
+ else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0)
+ fields_str = fields_all;
+ else
+ fields_str = nmc->required_fields;
-static gboolean
-check_modem_compatible (NMDeviceModem *device, NMConnection *connection, GError **error)
-{
- NMSettingConnection *s_con;
- NMSettingGsm *s_gsm;
- NMSettingCdma *s_cdma;
- NMDeviceModemCapabilities caps = NM_DEVICE_MODEM_CAPABILITY_NONE;
+ nmc->allowed_fields = nmc_fields_con_status + 1 ;
+ nmc->print_fields.indices = parse_output_fields (fields_str, nmc->allowed_fields, &err1);
+ if (err1)
+ goto error;
- g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+ /* Print headers */
+ nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_MAIN_HEADER_ADD | NMC_PF_FLAG_FIELD_NAMES;
+ nmc->print_fields.header_name = _("Active connections");
+ print_fields (nmc->print_fields, nmc->allowed_fields);
- s_con = nm_connection_get_setting_connection (connection);
- g_assert (s_con);
+ if (active_cons && active_cons->len)
+ g_ptr_array_foreach ((GPtrArray *) active_cons, show_active_connection, (gpointer) nmc);
+ } else {
+ while (argc > 0) {
+ if ( strcmp (*argv, "id") == 0
+ || strcmp (*argv, "uuid") == 0
+ || strcmp (*argv, "path") == 0) {
+ const char *selector = *argv;
+ NMActiveConnection *acon;
- /* Figure out what the modem supports */
- caps = nm_device_modem_get_current_capabilities (device);
- if (caps & NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS) {
- if (strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_GSM_SETTING_NAME)) {
- g_set_error (error, 0, 0,
- "The connection was not a GSM connection.");
- return FALSE;
- }
+ if (next_arg (&argc, &argv) != 0) {
+ g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *argv);
+ nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
+ return nmc->return_value;
+ }
+ if (!nmc->mode_specified)
+ nmc->multiline_output = TRUE; /* multiline mode is default for 'con status id|uuid|path' */
- s_gsm = nm_connection_get_setting_gsm (connection);
- if (!s_gsm) {
- g_set_error (error, 0, 0,
- "The connection was not a valid GSM connection.");
- return FALSE;
- }
- } else if (caps & NM_DEVICE_MODEM_CAPABILITY_CDMA_EVDO) {
- if (strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_CDMA_SETTING_NAME)) {
- g_set_error (error, 0, 0,
- "The connection was not a CDMA connection.");
- return FALSE;
- }
+ acon = find_active_connection (active_cons, nmc->system_connections, selector, *argv);
+ if (acon) {
+ nmc_active_connection_detail (acon, nmc);
+ } else {
+ g_string_printf (nmc->return_text, _("Error: '%s' is not an active connection."), *argv);
+ nmc->return_value = NMC_RESULT_ERROR_UNKNOWN;
+ }
+ break;
+ } else {
+ g_string_printf (nmc->return_text, _("Error: unknown parameter: %s"), *argv);
+ nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
+ }
- s_cdma = nm_connection_get_setting_cdma (connection);
- if (!s_cdma) {
- g_set_error (error, 0, 0,
- "The connection was not a valid CDMA connection.");
- return FALSE;
+ argc--;
+ argv++;
}
}
- return TRUE;
-}
-
-static gboolean
-nm_device_is_connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
-{
- g_return_val_if_fail (NM_IS_DEVICE (device), FALSE);
- g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE);
-
- if (NM_IS_DEVICE_ETHERNET (device))
- return check_ethernet_compatible (NM_DEVICE_ETHERNET (device), connection, error);
- else if (NM_IS_DEVICE_WIFI (device))
- return check_wifi_compatible (NM_DEVICE_WIFI (device), connection, error);
- else if (NM_IS_DEVICE_BT (device))
- return check_bt_compatible (NM_DEVICE_BT (device), connection, error);
-// else if (NM_IS_DEVICE_OLPC_MESH (device))
-// return check_olpc_mesh_compatible (NM_DEVICE_OLPC_MESH (device), connection, error);
-#if WITH_WIMAX
- else if (NM_IS_DEVICE_WIMAX (device))
- return check_wimax_compatible (NM_DEVICE_WIMAX (device), connection, error);
-#endif
- else if (NM_IS_DEVICE_MODEM (device))
- return check_modem_compatible (NM_DEVICE_MODEM (device), connection, error);
-
- g_set_error (error, 0, 0, "unhandled device type '%s'", G_OBJECT_TYPE_NAME (device));
- return FALSE;
+error:
+ if (err1) {
+ if (err1->code == 0)
+ g_string_printf (nmc->return_text, _("Error: 'con status': %s"), err1->message);
+ else
+ g_string_printf (nmc->return_text, _("Error: 'con status': %s; allowed fields: %s"), err1->message, NMC_FIELDS_CON_STATUS_ALL);
+ g_error_free (err1);
+ nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
+ }
+ return nmc->return_value;
}
-/* -------------------- */
-
static NMActiveConnection *
get_default_active_connection (NmCli *nmc, NMDevice **device)
{
@@ -1095,11 +1233,11 @@ find_device_for_connection (NmCli *nmc,
if (iface) {
const char *dev_iface = nm_device_get_iface (dev);
if ( !strcmp (dev_iface, iface)
- && nm_device_is_connection_compatible (dev, connection, NULL)) {
+ && nm_device_connection_compatible (dev, connection, NULL)) {
found_device = dev;
}
} else {
- if (nm_device_is_connection_compatible (dev, connection, NULL)) {
+ if (nm_device_connection_compatible (dev, connection, NULL)) {
found_device = dev;
}
}
@@ -1157,45 +1295,6 @@ find_device_for_connection (NmCli *nmc,
}
}
-static const char *
-active_connection_state_to_string (NMActiveConnectionState state)
-{
- switch (state) {
- case NM_ACTIVE_CONNECTION_STATE_ACTIVATING:
- return _("activating");
- case NM_ACTIVE_CONNECTION_STATE_ACTIVATED:
- return _("activated");
- case NM_ACTIVE_CONNECTION_STATE_DEACTIVATING:
- return _("deactivating");
- case NM_ACTIVE_CONNECTION_STATE_UNKNOWN:
- default:
- return _("unknown");
- }
-}
-
-static const char *
-vpn_connection_state_to_string (NMVPNConnectionState state)
-{
- switch (state) {
- case NM_VPN_CONNECTION_STATE_PREPARE:
- return _("VPN connecting (prepare)");
- case NM_VPN_CONNECTION_STATE_NEED_AUTH:
- return _("VPN connecting (need authentication)");
- case NM_VPN_CONNECTION_STATE_CONNECT:
- return _("VPN connecting");
- case NM_VPN_CONNECTION_STATE_IP_CONFIG_GET:
- return _("VPN connecting (getting IP configuration)");
- case NM_VPN_CONNECTION_STATE_ACTIVATED:
- return _("VPN connected");
- case NM_VPN_CONNECTION_STATE_FAILED:
- return _("VPN connection failed");
- case NM_VPN_CONNECTION_STATE_DISCONNECTED:
- return _("VPN disconnected");
- default:
- return _("unknown");
- }
-}
-
static const char *
vpn_connection_state_reason_to_string (NMVPNConnectionStateReason reason)
{
@@ -1341,6 +1440,7 @@ do_connection_up (NmCli *nmc, int argc, char **argv)
gboolean id_specified = FALSE;
gboolean wait = TRUE;
GError *error = NULL;
+ gboolean is_virtual = FALSE;
/* Set default timeout for connection activation. It can take quite a long time.
* Using 90 seconds.
@@ -1444,9 +1544,13 @@ do_connection_up (NmCli *nmc, int argc, char **argv)
g_assert (s_con);
con_type = nm_setting_connection_get_connection_type (s_con);
- device_found = find_device_for_connection (nmc, connection, iface, ap, nsp, &device, &spec_object, &error);
+ if ( nm_connection_is_type (connection, NM_SETTING_BOND_SETTING_NAME)
+ || nm_connection_is_type (connection, NM_SETTING_VLAN_SETTING_NAME))
+ is_virtual = TRUE;
- if (!device_found) {
+ device_found = find_device_for_connection (nmc, connection, iface, ap, nsp, &device, &spec_object, &error);
+ /* Virtual connection may not have their interfaces created yet */
+ if (!device_found && !is_virtual) {
if (error)
g_string_printf (nmc->return_text, _("Error: No suitable device found: %s."), error->message);
else
@@ -1563,6 +1667,27 @@ error:
return nmc->return_value;
}
+static void
+delete_cb (NMRemoteConnection *con, GError *err, gpointer user_data)
+{
+ NmCli *nmc = (NmCli *) user_data;
+
+ if (err) {
+ g_string_printf (nmc->return_text, _("Error: Connection deletion failed: %s"), err->message);
+ nmc->return_value = NMC_RESULT_ERROR_CON_DEL;
+ }
+ quit ();
+}
+
+static void
+connection_removed_cb (NMRemoteConnection *con, gpointer user_data)
+{
+ NmCli *nmc = (NmCli *) user_data;
+
+ nmc->return_value = NMC_RESULT_SUCCESS;
+ quit ();
+}
+
static NMCResultCode
do_connection_delete (NmCli *nmc, int argc, char **argv)
{
@@ -1571,8 +1696,6 @@ do_connection_delete (NmCli *nmc, int argc, char **argv)
const char *id = NULL;
GError *error = NULL;
- nmc->should_wait = FALSE;
-
while (argc > 0) {
if (strcmp (*argv, "id") == 0 || strcmp (*argv, "uuid") == 0) {
selector = *argv;
@@ -1616,10 +1739,22 @@ do_connection_delete (NmCli *nmc, int argc, char **argv)
goto error;
}
+ /* We need to wait a bit so that nmcli's permissions can be queried.
+ * We will exit either on "Removed" signal or when D-Bus return (error)
+ * message is received.
+ */
+ nmc->should_wait = TRUE;
+
+ /* Connect to "Removed" signal to be able to exit when connection was removed */
+ g_signal_connect (connection, NM_REMOTE_CONNECTION_REMOVED, G_CALLBACK (connection_removed_cb), nmc);
+
/* Delete the connection */
- nm_remote_connection_delete (NM_REMOTE_CONNECTION (connection), NULL, NULL);
+ nm_remote_connection_delete (NM_REMOTE_CONNECTION (connection), delete_cb, nmc);
+
+ return nmc->return_value;
error:
+ nmc->should_wait = FALSE;
return nmc->return_value;
}
diff --git a/cli/src/devices.c b/cli/src/devices.c
index 500d2341..0b1b6d6e 100644
--- a/cli/src/devices.c
+++ b/cli/src/devices.c
@@ -14,7 +14,7 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * (C) Copyright 2010 - 2011 Red Hat, Inc.
+ * (C) Copyright 2010 - 2012 Red Hat, Inc.
*/
#include "config.h"
@@ -24,10 +24,6 @@
#include
#include
-#include
-#include
-#include
-
#include
#include
@@ -37,10 +33,13 @@
#include
#include
#include
-//#include
+#include
#if WITH_WIMAX
#include
#endif
+#include
+#include
+#include
#include
#include
#include
@@ -56,8 +55,10 @@
#if WITH_WIMAX
#include
#endif
+#include
#include "utils.h"
+#include "common.h"
#include "devices.h"
@@ -82,32 +83,40 @@ static NmcOutputField nmc_fields_dev_list_sections[] = {
{"WIRED-PROPERTIES", N_("WIRED-PROPERTIES"), 0, NULL, 0}, /* 4 */
{"WIMAX-PROPERTIES", N_("WIMAX-PROPERTIES"), 0, NULL, 0}, /* 5 */
{"NSP", N_("NSP"), 0, NULL, 0}, /* 6 */
- {"IP4-SETTINGS", N_("IP4-SETTINGS"), 0, NULL, 0}, /* 7 */
- {"IP4-DNS", N_("IP4-DNS"), 0, NULL, 0}, /* 8 */
- {"IP6-SETTINGS", N_("IP6-SETTINGS"), 0, NULL, 0}, /* 9 */
- {"IP6-DNS", N_("IP6-DNS"), 0, NULL, 0}, /* 10 */
+ {"IP4", N_("IP4"), 0, NULL, 0}, /* 7 */
+ {"DHCP4", N_("DHCP4"), 0, NULL, 0}, /* 8 */
+ {"IP6", N_("IP6"), 0, NULL, 0}, /* 9 */
+ {"DHCP6", N_("DHCP6"), 0, NULL, 0}, /* 10 */
{NULL, NULL, 0, NULL, 0}
};
#if WITH_WIMAX
-#define NMC_FIELDS_DEV_LIST_SECTIONS_ALL "GENERAL,CAPABILITIES,WIFI-PROPERTIES,AP,WIRED-PROPERTIES,WIMAX-PROPERTIES,NSP,IP4-SETTINGS,IP4-DNS,IP6-SETTINGS,IP6-DNS"
-#define NMC_FIELDS_DEV_LIST_SECTIONS_COMMON "GENERAL,CAPABILITIES,WIFI-PROPERTIES,AP,WIRED-PROPERTIES,WIMAX-PROPERTIES,NSP,IP4-SETTINGS,IP4-DNS,IP6-SETTINGS,IP6-DNS"
+#define NMC_FIELDS_DEV_LIST_SECTIONS_ALL "GENERAL,CAPABILITIES,WIFI-PROPERTIES,AP,WIRED-PROPERTIES,WIMAX-PROPERTIES,NSP,IP4,DHCP4,IP6,DHCP6"
+#define NMC_FIELDS_DEV_LIST_SECTIONS_COMMON "GENERAL,CAPABILITIES,WIFI-PROPERTIES,AP,WIRED-PROPERTIES,WIMAX-PROPERTIES,NSP,IP4,DHCP4,IP6,DHCP6"
#else
-#define NMC_FIELDS_DEV_LIST_SECTIONS_ALL "GENERAL,CAPABILITIES,WIFI-PROPERTIES,AP,WIRED-PROPERTIES,IP4-SETTINGS,IP4-DNS,IP6-SETTINGS,IP6-DNS"
-#define NMC_FIELDS_DEV_LIST_SECTIONS_COMMON "GENERAL,CAPABILITIES,WIFI-PROPERTIES,AP,WIRED-PROPERTIES,IP4-SETTINGS,IP4-DNS,IP6-SETTINGS,IP6-DNS"
+#define NMC_FIELDS_DEV_LIST_SECTIONS_ALL "GENERAL,CAPABILITIES,WIFI-PROPERTIES,AP,WIRED-PROPERTIES,IP4,DHCP4,IP6,DHCP6"
+#define NMC_FIELDS_DEV_LIST_SECTIONS_COMMON "GENERAL,CAPABILITIES,WIFI-PROPERTIES,AP,WIRED-PROPERTIES,IP4,DHCP4,IP6,DHCP6"
#endif
/* Available fields for 'dev list' - GENERAL part */
static NmcOutputField nmc_fields_dev_list_general[] = {
- {"NAME", N_("NAME"), 10, NULL, 0}, /* 0 */
- {"DEVICE", N_("DEVICE"), 10, NULL, 0}, /* 1 */
- {"TYPE", N_("TYPE"), 17, NULL, 0}, /* 2 */
- {"DRIVER", N_("DRIVER"), 10, NULL, 0}, /* 3 */
- {"HWADDR", N_("HWADDR"), 19, NULL, 0}, /* 4 */
- {"STATE", N_("STATE"), 14, NULL, 0}, /* 5 */
- {NULL, NULL, 0, NULL, 0}
+ {"NAME", N_("NAME"), 10, NULL, 0}, /* 0 */
+ {"DEVICE", N_("DEVICE"), 10, NULL, 0}, /* 1 */
+ {"TYPE", N_("TYPE"), 17, NULL, 0}, /* 2 */
+ {"VENDOR", N_("VENDOR"), 20, NULL, 0}, /* 3 */
+ {"PRODUCT", N_("PRODUCT"), 50, NULL, 0}, /* 4 */
+ {"DRIVER", N_("DRIVER"), 9, NULL, 0}, /* 5 */
+ {"HWADDR", N_("HWADDR"), 19, NULL, 0}, /* 6 */
+ {"STATE", N_("STATE"), 14, NULL, 0}, /* 7 */
+ {"REASON", N_("REASON"), 25, NULL, 0}, /* 8 */
+ {"UDI", N_("UDI"), 64, NULL, 0}, /* 9 */
+ {"IP-IFACE", N_("IP-IFACE"), 10, NULL, 0}, /* 10 */
+ {"NM-MANAGED", N_("NM-MANAGED"), 15, NULL, 0}, /* 11 */
+ {"FIRMWARE-MISSING", N_("FIRMWARE-MISSING"), 18, NULL, 0}, /* 12 */
+ {"CONNECTION", N_("CONNECTION"), 51, NULL, 0}, /* 13 */
+ {NULL, NULL, 0, NULL, 0}
};
-#define NMC_FIELDS_DEV_LIST_GENERAL_ALL "NAME,DEVICE,TYPE,DRIVER,HWADDR,STATE"
-#define NMC_FIELDS_DEV_LIST_GENERAL_COMMON "NAME,DEVICE,TYPE,DRIVER,HWADDR,STATE"
+#define NMC_FIELDS_DEV_LIST_GENERAL_ALL "NAME,DEVICE,TYPE,VENDOR,PRODUCT,DRIVER,HWADDR,STATE,REASON,UDI,IP-IFACE,NM-MANAGED,FIRMWARE-MISSING,CONNECTION"
+#define NMC_FIELDS_DEV_LIST_GENERAL_COMMON "NAME,DEVICE,TYPE,VENDOR,PRODUCT,DRIVER,HWADDR,STATE"
/* Available fields for 'dev list' - CAPABILITIES part */
static NmcOutputField nmc_fields_dev_list_cap[] = {
@@ -157,46 +166,6 @@ static NmcOutputField nmc_fields_dev_list_wimax_prop[] = {
#define NMC_FIELDS_DEV_LIST_WIMAX_PROP_COMMON "NAME,CTR-FREQ,RSSI,CINR,TX-POW,BSID"
#endif
-/* Available fields for 'dev list' - IPv4 settings part */
-static NmcOutputField nmc_fields_dev_list_ip4_settings[] = {
- {"NAME", N_("NAME"), 15, NULL, 0}, /* 0 */
- {"ADDRESS", N_("ADDRESS"), 15, NULL, 0}, /* 1 */
- {"PREFIX", N_("PREFIX"), 20, NULL, 0}, /* 2 */
- {"GATEWAY", N_("GATEWAY"), 20, NULL, 0}, /* 3 */
- {NULL, NULL, 0, NULL, 0}
-};
-#define NMC_FIELDS_DEV_LIST_IP4_SETTINGS_ALL "NAME,ADDRESS,PREFIX,GATEWAY"
-#define NMC_FIELDS_DEV_LIST_IP4_SETTINGS_COMMON "NAME,ADDRESS,PREFIX,GATEWAY"
-
-/* Available fields for 'dev list' - IPv6 settings part */
-static NmcOutputField nmc_fields_dev_list_ip6_settings[] = {
- {"NAME", N_("NAME"), 15, NULL, 0}, /* 0 */
- {"ADDRESS", N_("ADDRESS"), 15, NULL, 0}, /* 1 */
- {"PREFIX", N_("PREFIX"), 20, NULL, 0}, /* 2 */
- {"GATEWAY", N_("GATEWAY"), 20, NULL, 0}, /* 3 */
- {NULL, NULL, 0, NULL, 0}
-};
-#define NMC_FIELDS_DEV_LIST_IP6_SETTINGS_ALL "NAME,ADDRESS,PREFIX,GATEWAY"
-#define NMC_FIELDS_DEV_LIST_IP6_SETTINGS_COMMON "NAME,ADDRESS,PREFIX,GATEWAY"
-
-/* Available fields for 'dev list' - IPv4 settings DNS part */
-static NmcOutputField nmc_fields_dev_list_ip4_dns[] = {
- {"NAME", N_("NAME"), 15, NULL, 0}, /* 0 */
- {"DNS", N_("DNS"), 17, NULL, 0}, /* 1 */
- {NULL, NULL, 0, NULL, 0}
-};
-#define NMC_FIELDS_DEV_LIST_IP4_DNS_ALL "NAME,DNS"
-#define NMC_FIELDS_DEV_LIST_IP4_DNS_COMMON "NAME,DNS"
-
-/* Available fields for 'dev list' - IPv6 settings DNS part */
-static NmcOutputField nmc_fields_dev_list_ip6_dns[] = {
- {"NAME", N_("NAME"), 15, NULL, 0}, /* 0 */
- {"DNS", N_("DNS"), 17, NULL, 0}, /* 1 */
- {NULL, NULL, 0, NULL, 0}
-};
-#define NMC_FIELDS_DEV_LIST_IP6_DNS_ALL "NAME,DNS"
-#define NMC_FIELDS_DEV_LIST_IP6_DNS_COMMON "NAME,DNS"
-
/* Available fields for 'dev wifi list' */
static NmcOutputField nmc_fields_dev_wifi_list[] = {
{"NAME", N_("NAME"), 15, NULL, 0}, /* 0 */
@@ -299,6 +268,167 @@ device_state_to_string (NMDeviceState state)
}
}
+static const char *
+device_reason_to_string (NMDeviceStateReason reason)
+{
+ switch (reason) {
+ case NM_DEVICE_STATE_REASON_NONE:
+ return _("No reason given");
+
+ case NM_DEVICE_STATE_REASON_UNKNOWN:
+ return _("Unknown error");
+
+ case NM_DEVICE_STATE_REASON_NOW_MANAGED:
+ return _("Device is now managed");
+
+ case NM_DEVICE_STATE_REASON_NOW_UNMANAGED:
+ return _("Device is now unmanaged");
+
+ case NM_DEVICE_STATE_REASON_CONFIG_FAILED:
+ return _("The device could not be readied for configuration");
+
+ case NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE:
+ return _("IP configuration could not be reserved (no available address, timeout, etc)");
+
+ case NM_DEVICE_STATE_REASON_IP_CONFIG_EXPIRED:
+ return _("The IP configuration is no longer valid");
+
+ case NM_DEVICE_STATE_REASON_NO_SECRETS:
+ return _("Secrets were required, but not provided");
+
+ case NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT:
+ return _("802.1X supplicant disconnected");
+
+ case NM_DEVICE_STATE_REASON_SUPPLICANT_CONFIG_FAILED:
+ return _("802.1X supplicant configuration failed");
+
+ case NM_DEVICE_STATE_REASON_SUPPLICANT_FAILED:
+ return _("802.1X supplicant failed");
+
+ case NM_DEVICE_STATE_REASON_SUPPLICANT_TIMEOUT:
+ return _("802.1X supplicant took too long to authenticate");
+
+ case NM_DEVICE_STATE_REASON_PPP_START_FAILED:
+ return _("PPP service failed to start");
+
+ case NM_DEVICE_STATE_REASON_PPP_DISCONNECT:
+ return _("PPP service disconnected");
+
+ case NM_DEVICE_STATE_REASON_PPP_FAILED:
+ return _("PPP failed");
+
+ case NM_DEVICE_STATE_REASON_DHCP_START_FAILED:
+ return _("DHCP client failed to start");
+
+ case NM_DEVICE_STATE_REASON_DHCP_ERROR:
+ return _("DHCP client error");
+
+ case NM_DEVICE_STATE_REASON_DHCP_FAILED:
+ return _("DHCP client failed");
+
+ case NM_DEVICE_STATE_REASON_SHARED_START_FAILED:
+ return _("Shared connection service failed to start");
+
+ case NM_DEVICE_STATE_REASON_SHARED_FAILED:
+ return _("Shared connection service failed");
+
+ case NM_DEVICE_STATE_REASON_AUTOIP_START_FAILED:
+ return _("AutoIP service failed to start");
+
+ case NM_DEVICE_STATE_REASON_AUTOIP_ERROR:
+ return _("AutoIP service error");
+
+ case NM_DEVICE_STATE_REASON_AUTOIP_FAILED:
+ return _("AutoIP service failed");
+
+ case NM_DEVICE_STATE_REASON_MODEM_BUSY:
+ return _("The line is busy");
+
+ case NM_DEVICE_STATE_REASON_MODEM_NO_DIAL_TONE:
+ return _("No dial tone");
+
+ case NM_DEVICE_STATE_REASON_MODEM_NO_CARRIER:
+ return _("No carrier could be established");
+
+ case NM_DEVICE_STATE_REASON_MODEM_DIAL_TIMEOUT:
+ return _("The dialing request timed out");
+
+ case NM_DEVICE_STATE_REASON_MODEM_DIAL_FAILED:
+ return _("The dialing attempt failed");
+
+ case NM_DEVICE_STATE_REASON_MODEM_INIT_FAILED:
+ return _("Modem initialization failed");
+
+ case NM_DEVICE_STATE_REASON_GSM_APN_FAILED:
+ return _("Failed to select the specified APN");
+
+ case NM_DEVICE_STATE_REASON_GSM_REGISTRATION_NOT_SEARCHING:
+ return _("Not searching for networks");
+
+ case NM_DEVICE_STATE_REASON_GSM_REGISTRATION_DENIED:
+ return _("Network registration denied");
+
+ case NM_DEVICE_STATE_REASON_GSM_REGISTRATION_TIMEOUT:
+ return _("Network registration timed out");
+
+ case NM_DEVICE_STATE_REASON_GSM_REGISTRATION_FAILED:
+ return _("Failed to register with the requested network");
+
+ case NM_DEVICE_STATE_REASON_GSM_PIN_CHECK_FAILED:
+ return _("PIN check failed");
+
+ case NM_DEVICE_STATE_REASON_FIRMWARE_MISSING:
+ return _("Necessary firmware for the device may be missing");
+
+ case NM_DEVICE_STATE_REASON_REMOVED:
+ return _("The device was removed");
+
+ case NM_DEVICE_STATE_REASON_SLEEPING:
+ return _("NetworkManager went to sleep");
+
+ case NM_DEVICE_STATE_REASON_CONNECTION_REMOVED:
+ return _("The device's active connection disappeared");
+
+ case NM_DEVICE_STATE_REASON_USER_REQUESTED:
+ return _("Device disconnected by user or client");
+
+ case NM_DEVICE_STATE_REASON_CARRIER:
+ return _("Carrier/link changed");
+
+ case NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED:
+ return _("The device's existing connection was assumed");
+
+ case NM_DEVICE_STATE_REASON_SUPPLICANT_AVAILABLE:
+ return _("The supplicant is now available");
+
+ case NM_DEVICE_STATE_REASON_MODEM_NOT_FOUND:
+ return _("The modem could not be found");
+
+ case NM_DEVICE_STATE_REASON_BT_FAILED:
+ return _("The Bluetooth connection failed or timed out");
+
+ case NM_DEVICE_STATE_REASON_GSM_SIM_NOT_INSERTED:
+ return _("GSM Modem's SIM card not inserted");
+
+ case NM_DEVICE_STATE_REASON_GSM_SIM_PIN_REQUIRED:
+ return _("GSM Modem's SIM PIN required");
+
+ case NM_DEVICE_STATE_REASON_GSM_SIM_PUK_REQUIRED:
+ return _("GSM Modem's SIM PUK required");
+
+ case NM_DEVICE_STATE_REASON_GSM_SIM_WRONG:
+ return _("GSM Modem's SIM wrong");
+
+ case NM_DEVICE_STATE_REASON_INFINIBAND_MODE:
+ return _("InfiniBand device does not support connected mode");
+
+ case NM_DEVICE_STATE_REASON_DEPENDENCY_FAILED:
+ return _("A dependency of the connection failed");
+ default:
+ return _("Unknown");
+ }
+}
+
/* Convert device type to string. Use setting names strings to match with
* connection type names.
*/
@@ -321,12 +451,18 @@ device_type_to_string (NMDevice *device)
return _("Unknown");
case NM_DEVICE_TYPE_BT:
return NM_SETTING_BLUETOOTH_SETTING_NAME;
-// case NM_DEVICE_TYPE_OLPC_MESH:
-// return NM_SETTING_OLPC_MESH_SETTING_NAME;
+ case NM_DEVICE_TYPE_OLPC_MESH:
+ return NM_SETTING_OLPC_MESH_SETTING_NAME;
#if WITH_WIMAX
case NM_DEVICE_TYPE_WIMAX:
return NM_SETTING_WIMAX_SETTING_NAME;
#endif
+ case NM_DEVICE_TYPE_INFINIBAND:
+ return NM_SETTING_INFINIBAND_SETTING_NAME;
+ case NM_DEVICE_TYPE_BOND:
+ return NM_SETTING_BOND_SETTING_NAME;
+ case NM_DEVICE_TYPE_VLAN:
+ return NM_SETTING_VLAN_SETTING_NAME;
default:
return _("Unknown");
}
@@ -374,46 +510,6 @@ ap_wpa_rsn_flags_to_string (NM80211ApSecurityFlags flags)
return ret_str;
}
-static gchar *
-ip4_address_as_string (guint32 ip)
-{
- struct in_addr tmp_addr;
- char buf[INET_ADDRSTRLEN+1];
-
- memset (&buf, '\0', sizeof (buf));
- tmp_addr.s_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.s_addr));
- return NULL;
- }
-}
-
-static gchar *
-ip6_address_as_string (const struct in6_addr *ip)
-{
- char buf[INET6_ADDRSTRLEN];
-
- memset (&buf, '\0', sizeof (buf));
-
- if (inet_ntop (AF_INET6, ip, buf, INET6_ADDRSTRLEN)) {
- return g_strdup (buf);
- } else {
- int j;
- GString *ip6_str = g_string_new (NULL);
- g_string_append_printf (ip6_str, "%02X", ip->s6_addr[0]);
- for (j = 1; j < 16; j++)
- g_string_append_printf (ip6_str, " %02X", ip->s6_addr[j]);
- g_warning ("%s: error converting IP6 address %s",
- __func__, ip6_str->str);
- g_string_free (ip6_str, TRUE);
- return NULL;
- }
-}
-
typedef struct {
NmCli *nmc;
int index;
@@ -572,13 +668,15 @@ show_device_info (gpointer data, gpointer user_data)
NmCli *nmc = (NmCli *) user_data;
GError *error = NULL;
APInfo *info;
- char *tmp;
const char *hwaddr = NULL;
NMDeviceState state = NM_DEVICE_STATE_UNKNOWN;
+ NMDeviceStateReason reason = NM_DEVICE_STATE_REASON_NONE;
NMDeviceCapabilities caps;
+ NMActiveConnection *acon;
guint32 speed;
char *speed_str = NULL;
- const GArray *array;
+ char *state_str = NULL;
+ char *reason_str = NULL;
GArray *sections_array;
int k;
char *fields_str;
@@ -623,7 +721,7 @@ show_device_info (gpointer data, gpointer user_data)
was_output = FALSE;
- state = nm_device_get_state (device);
+ state = nm_device_get_state_reason (device, &reason);
/* section GENERAL */
if (!strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[0].name)) {
@@ -640,16 +738,36 @@ show_device_info (gpointer data, gpointer user_data)
else if (NM_IS_DEVICE_WIMAX (device))
hwaddr = nm_device_wimax_get_hw_address (NM_DEVICE_WIMAX (device));
#endif
+ else if (NM_IS_DEVICE_INFINIBAND (device))
+ hwaddr = nm_device_infiniband_get_hw_address (NM_DEVICE_INFINIBAND (device));
+ else if (NM_IS_DEVICE_BOND (device))
+ hwaddr = nm_device_bond_get_hw_address (NM_DEVICE_BOND (device));
+ else if (NM_IS_DEVICE_VLAN (device))
+ hwaddr = nm_device_vlan_get_hw_address (NM_DEVICE_VLAN (device));
+
+ state_str = g_strdup_printf ("%d (%s)", state, device_state_to_string (state));
+ reason_str = g_strdup_printf ("%d (%s)", reason, device_reason_to_string (reason));
nmc->allowed_fields[0].value = nmc_fields_dev_list_sections[0].name; /* "GENERAL"*/
nmc->allowed_fields[1].value = nm_device_get_iface (device);
nmc->allowed_fields[2].value = device_type_to_string (device);
- nmc->allowed_fields[3].value = nm_device_get_driver (device) ? nm_device_get_driver (device) : _("(unknown)");
- nmc->allowed_fields[4].value = hwaddr ? hwaddr : _("unknown)");
- nmc->allowed_fields[5].value = device_state_to_string (state);
+ nmc->allowed_fields[3].value = nm_device_get_vendor (device);
+ nmc->allowed_fields[4].value = nm_device_get_product (device);
+ nmc->allowed_fields[5].value = nm_device_get_driver (device) ? nm_device_get_driver (device) : _("(unknown)");
+ nmc->allowed_fields[6].value = hwaddr ? hwaddr : _("(unknown)");
+ nmc->allowed_fields[7].value = state_str;
+ nmc->allowed_fields[8].value = reason_str;
+ nmc->allowed_fields[9].value = nm_device_get_udi (device);
+ nmc->allowed_fields[10].value = nm_device_get_ip_iface (device);
+ nmc->allowed_fields[11].value = nm_device_get_managed (device) ? _("yes") : _("no");
+ nmc->allowed_fields[12].value = nm_device_get_firmware_missing (device) ? _("yes") : _("no");
+ nmc->allowed_fields[13].value = (acon = nm_device_get_active_connection (device)) ?
+ nm_object_get_path (NM_OBJECT (acon)) : _("not connected");
nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX;
print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */
+ g_free (state_str);
+ g_free (reason_str);
was_output = TRUE;
}
@@ -823,124 +941,28 @@ show_device_info (gpointer data, gpointer user_data)
}
#endif
- /* IP Setup info */
+ /* IP configuration info */
if (state == NM_DEVICE_STATE_ACTIVATED) {
NMIP4Config *cfg4 = nm_device_get_ip4_config (device);
NMIP6Config *cfg6 = nm_device_get_ip6_config (device);
- GSList *iter;
+ NMDHCP4Config *dhcp4 = nm_device_get_dhcp4_config (device);
+ NMDHCP6Config *dhcp6 = nm_device_get_dhcp6_config (device);
- /* IP4-SETTINGS */
- if (cfg4 && !strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[7].name)) {
- nmc->allowed_fields = nmc_fields_dev_list_ip4_settings;
- nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES;
- nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_IP4_SETTINGS_ALL, nmc->allowed_fields, NULL);
- print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */
-
- for (iter = (GSList *) nm_ip4_config_get_addresses (cfg4); iter; iter = g_slist_next (iter)) {
- NMIP4Address *addr = (NMIP4Address *) iter->data;
- guint32 prefix = nm_ip4_address_get_prefix (addr);
- char *tmp2;
- char *addr_str, *prefix_str, *gateway_str;
-
- addr_str = ip4_address_as_string (nm_ip4_address_get_address (addr));
-
- tmp2 = ip4_address_as_string (nm_utils_ip4_prefix_to_netmask (prefix));
- prefix_str = g_strdup_printf ("%d (%s)", prefix, tmp2);
- g_free (tmp2);
-
- gateway_str = ip4_address_as_string (nm_ip4_address_get_gateway (addr));
-
- nmc->allowed_fields[0].value = nmc_fields_dev_list_sections[7].name; /* "IP4-SETTINGS" */
- nmc->allowed_fields[1].value = addr_str;
- nmc->allowed_fields[2].value = prefix_str;
- nmc->allowed_fields[3].value = gateway_str;
-
- nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX;
- print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */
- g_free (addr_str);
- g_free (prefix_str);
- g_free (gateway_str);
- }
- was_output = TRUE;
- }
- /* IP4-DNS */
- if (cfg4 && !strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[8].name)) {
- array = nm_ip4_config_get_nameservers (cfg4);
- if (array) {
- int i;
-
- nmc->allowed_fields = nmc_fields_dev_list_ip4_dns;
- nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES;
- nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_IP4_DNS_ALL, nmc->allowed_fields, NULL);
- print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */
-
- for (i = 0; i < array->len; i++) {
- char *dns_name = g_strdup_printf ("%s%d", nmc_fields_dev_list_sections[8].name, i+1);
- tmp = ip4_address_as_string (g_array_index (array, guint32, i));
- nmc->allowed_fields[0].value = dns_name; /* "IP4-DNS" */
- nmc->allowed_fields[1].value = tmp;
-
- nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX;
- print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */
- g_free (tmp);
- g_free (dns_name);
- }
- }
- was_output = TRUE;
- }
-
- /* IP6-SETTINGS */
- if (cfg6 && !strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[9].name)) {
- nmc->allowed_fields = nmc_fields_dev_list_ip6_settings;
- nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES;
- nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_IP6_SETTINGS_ALL, nmc->allowed_fields, NULL);
- print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */
-
- for (iter = (GSList *) nm_ip6_config_get_addresses (cfg6); iter; iter = g_slist_next (iter)) {
- NMIP6Address *addr = (NMIP6Address *) iter->data;
- guint32 prefix = nm_ip6_address_get_prefix (addr);
- char *addr_str, *prefix_str, *gateway_str;
-
- addr_str = ip6_address_as_string (nm_ip6_address_get_address (addr));
+ /* IP4 */
+ if (cfg4 && !strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[7].name))
+ was_output = print_ip4_config (cfg4, nmc, nmc_fields_dev_list_sections[7].name);
- prefix_str = g_strdup_printf ("%d", prefix);
- gateway_str = ip6_address_as_string (nm_ip6_address_get_gateway (addr));
+ /* DHCP4 */
+ if (dhcp4 && !strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[8].name))
+ was_output = print_dhcp4_config (dhcp4, nmc, nmc_fields_dev_list_sections[8].name);
- nmc->allowed_fields[0].value = nmc_fields_dev_list_sections[9].name; /* "IP6-SETTINGS" */
- nmc->allowed_fields[1].value = addr_str;
- nmc->allowed_fields[2].value = prefix_str;
- nmc->allowed_fields[3].value = gateway_str;
+ /* IP6 */
+ if (cfg6 && !strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[9].name))
+ was_output = print_ip6_config (cfg6, nmc, nmc_fields_dev_list_sections[9].name);
- nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX;
- print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */
- g_free (addr_str);
- g_free (prefix_str);
- g_free (gateway_str);
- }
- was_output = TRUE;
- }
- /* IP6-DNS */
- if (cfg6 && !strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[10].name)) {
- int i = 1;
- nmc->allowed_fields = nmc_fields_dev_list_ip6_dns;
- nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES;
- nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_DEV_LIST_IP6_DNS_ALL, nmc->allowed_fields, NULL);
- print_fields (nmc->print_fields, nmc->allowed_fields); /* Print header */
-
- for (iter = (GSList *) nm_ip6_config_get_nameservers (cfg6); iter; iter = g_slist_next (iter)) {
- char *dns_name = g_strdup_printf ("%s%d", nmc_fields_dev_list_sections[10].name, i++);
-
- tmp = ip6_address_as_string (iter->data);
- nmc->allowed_fields[0].value = dns_name; /* "IP6-DNS" */
- nmc->allowed_fields[1].value = tmp;
-
- nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX;
- print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */
- g_free (tmp);
- g_free (dns_name);
- }
- was_output = TRUE;
- }
+ /* DHCP6 */
+ if (dhcp6 && !strcasecmp (nmc_fields_dev_list_sections[section_idx].name, nmc_fields_dev_list_sections[10].name))
+ was_output = print_dhcp6_config (dhcp6, nmc, nmc_fields_dev_list_sections[10].name);
}
}
diff --git a/cli/src/nmcli.h b/cli/src/nmcli.h
index 90091b36..9ffa42ed 100644
--- a/cli/src/nmcli.h
+++ b/cli/src/nmcli.h
@@ -14,7 +14,7 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * (C) Copyright 2010 - 2011 Red Hat, Inc.
+ * (C) Copyright 2010 - 2012 Red Hat, Inc.
*/
#ifndef NMC_NMCLI_H
@@ -48,11 +48,14 @@ typedef enum {
/* Error in device disconnect */
NMC_RESULT_ERROR_DEV_DISCONNECT = 6,
+ /* Error in connection deletion */
+ NMC_RESULT_ERROR_CON_DEL = 7,
+
/* NetworkManager is not running */
- NMC_RESULT_ERROR_NM_NOT_RUNNING = 7,
+ NMC_RESULT_ERROR_NM_NOT_RUNNING = 8,
/* nmcli and NetworkManager versions mismatch */
- NMC_RESULT_ERROR_VERSIONS_MISMATCH = 8
+ NMC_RESULT_ERROR_VERSIONS_MISMATCH = 9
} NMCResultCode;
typedef enum {
@@ -62,23 +65,26 @@ typedef enum {
} NMCPrintOutput;
/* === Output fields === */
+/* Flags for NmcOutputField */
+#define NMC_OF_FLAG_ARRAY 0x00000001 /* 'value' is an NULL-terminated array rather then a single string */
+
typedef struct {
const char *name; /* Field's name */
const char *name_l10n; /* Field's name for translation */
int width; /* Width in screen columns */
- const char *value; /* Value of current field */
+ const void *value; /* Value of current field - char* or char** */
guint32 flags; /* Flags */
} NmcOutputField;
/* Flags for NmcPrintFields */
-#define NMC_PF_FLAG_MULTILINE 0x00000001 /* Multiline output instead of tabular */
-#define NMC_PF_FLAG_TERSE 0x00000002 /* Terse output mode */
-#define NMC_PF_FLAG_PRETTY 0x00000004 /* Pretty output mode */
-#define NMC_PF_FLAG_MAIN_HEADER_ADD 0x00000008 /* Print main header in addition to values/field names */
-#define NMC_PF_FLAG_MAIN_HEADER_ONLY 0x00000010 /* Print main header only */
-#define NMC_PF_FLAG_FIELD_NAMES 0x00000020 /* Print field names instead of values */
-#define NMC_PF_FLAG_ESCAPE 0x00000040 /* Escape column separator and '\' */
-#define NMC_PF_FLAG_SECTION_PREFIX 0x00000080 /* Use the first value as section prefix for the other field names - just in multiline */
+#define NMC_PF_FLAG_MULTILINE 0x00000001 /* Multiline output instead of tabular */
+#define NMC_PF_FLAG_TERSE 0x00000002 /* Terse output mode */
+#define NMC_PF_FLAG_PRETTY 0x00000004 /* Pretty output mode */
+#define NMC_PF_FLAG_MAIN_HEADER_ADD 0x00000008 /* Print main header in addition to values/field names */
+#define NMC_PF_FLAG_MAIN_HEADER_ONLY 0x00000010 /* Print main header only */
+#define NMC_PF_FLAG_FIELD_NAMES 0x00000020 /* Print field names instead of values */
+#define NMC_PF_FLAG_ESCAPE 0x00000040 /* Escape column separator and '\' */
+#define NMC_PF_FLAG_SECTION_PREFIX 0x00000080 /* Use the first value as section prefix for the other field names - just in multiline */
typedef struct {
GArray *indices; /* Array of field indices to the array of allowed fields */
diff --git a/cli/src/settings.c b/cli/src/settings.c
index ccbe9589..bf422920 100644
--- a/cli/src/settings.c
+++ b/cli/src/settings.c
@@ -14,11 +14,13 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * (C) Copyright 2010 - 2011 Red Hat, Inc.
+ * (C) Copyright 2010 - 2012 Red Hat, Inc.
*/
#include "config.h"
+#include "net/if_arp.h"
+
#include
#include
#include
@@ -88,34 +90,36 @@ static NmcOutputField nmc_fields_setting_8021X[] = {
SETTING_FIELD (NM_SETTING_802_1X_EAP, 10), /* 1 */
SETTING_FIELD (NM_SETTING_802_1X_IDENTITY, 15), /* 2 */
SETTING_FIELD (NM_SETTING_802_1X_ANONYMOUS_IDENTITY, 15), /* 3 */
- SETTING_FIELD (NM_SETTING_802_1X_CA_CERT, 10), /* 4 */
- SETTING_FIELD (NM_SETTING_802_1X_CA_PATH, 10), /* 5 */
- SETTING_FIELD (NM_SETTING_802_1X_SUBJECT_MATCH, 10), /* 6 */
- SETTING_FIELD (NM_SETTING_802_1X_ALTSUBJECT_MATCHES, 10), /* 7 */
- SETTING_FIELD (NM_SETTING_802_1X_CLIENT_CERT, 10), /* 8 */
- SETTING_FIELD (NM_SETTING_802_1X_PHASE1_PEAPVER, 10), /* 9 */
- SETTING_FIELD (NM_SETTING_802_1X_PHASE1_PEAPLABEL, 10), /* 10 */
- SETTING_FIELD (NM_SETTING_802_1X_PHASE1_FAST_PROVISIONING, 10), /* 11 */
- SETTING_FIELD (NM_SETTING_802_1X_PHASE2_AUTH, 10), /* 12 */
- SETTING_FIELD (NM_SETTING_802_1X_PHASE2_AUTHEAP, 10), /* 13 */
- SETTING_FIELD (NM_SETTING_802_1X_PHASE2_CA_CERT, 20), /* 14 */
- SETTING_FIELD (NM_SETTING_802_1X_PHASE2_CA_PATH, 20), /* 15 */
- SETTING_FIELD (NM_SETTING_802_1X_PHASE2_SUBJECT_MATCH, 10), /* 16 */
- SETTING_FIELD (NM_SETTING_802_1X_PHASE2_ALTSUBJECT_MATCHES, 10), /* 17 */
- SETTING_FIELD (NM_SETTING_802_1X_PHASE2_CLIENT_CERT, 20), /* 18 */
- SETTING_FIELD (NM_SETTING_802_1X_PASSWORD, 10), /* 19 */
- SETTING_FIELD (NM_SETTING_802_1X_PRIVATE_KEY, 15), /* 20 */
- SETTING_FIELD (NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD, 20), /* 21 */
- SETTING_FIELD (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY, 20), /* 22 */
- SETTING_FIELD (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD, 20), /* 23 */
- SETTING_FIELD (NM_SETTING_802_1X_PIN, 8), /* 24 */
- SETTING_FIELD (NM_SETTING_802_1X_SYSTEM_CA_CERTS, 17), /* 25 */
+ SETTING_FIELD (NM_SETTING_802_1X_PAC_FILE, 15), /* 4 */
+ SETTING_FIELD (NM_SETTING_802_1X_CA_CERT, 10), /* 5 */
+ SETTING_FIELD (NM_SETTING_802_1X_CA_PATH, 10), /* 6 */
+ SETTING_FIELD (NM_SETTING_802_1X_SUBJECT_MATCH, 10), /* 7 */
+ SETTING_FIELD (NM_SETTING_802_1X_ALTSUBJECT_MATCHES, 10), /* 8 */
+ SETTING_FIELD (NM_SETTING_802_1X_CLIENT_CERT, 10), /* 9 */
+ SETTING_FIELD (NM_SETTING_802_1X_PHASE1_PEAPVER, 10), /* 10 */
+ SETTING_FIELD (NM_SETTING_802_1X_PHASE1_PEAPLABEL, 10), /* 11 */
+ SETTING_FIELD (NM_SETTING_802_1X_PHASE1_FAST_PROVISIONING, 10), /* 12 */
+ SETTING_FIELD (NM_SETTING_802_1X_PHASE2_AUTH, 10), /* 13 */
+ SETTING_FIELD (NM_SETTING_802_1X_PHASE2_AUTHEAP, 10), /* 14 */
+ SETTING_FIELD (NM_SETTING_802_1X_PHASE2_CA_CERT, 20), /* 15 */
+ SETTING_FIELD (NM_SETTING_802_1X_PHASE2_CA_PATH, 20), /* 16 */
+ SETTING_FIELD (NM_SETTING_802_1X_PHASE2_SUBJECT_MATCH, 10), /* 17 */
+ SETTING_FIELD (NM_SETTING_802_1X_PHASE2_ALTSUBJECT_MATCHES, 10), /* 18 */
+ SETTING_FIELD (NM_SETTING_802_1X_PHASE2_CLIENT_CERT, 20), /* 19 */
+ SETTING_FIELD (NM_SETTING_802_1X_PASSWORD, 10), /* 20 */
+ SETTING_FIELD (NM_SETTING_802_1X_PRIVATE_KEY, 15), /* 21 */
+ SETTING_FIELD (NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD, 20), /* 22 */
+ SETTING_FIELD (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY, 20), /* 23 */
+ SETTING_FIELD (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD, 20), /* 24 */
+ SETTING_FIELD (NM_SETTING_802_1X_PIN, 8), /* 25 */
+ SETTING_FIELD (NM_SETTING_802_1X_SYSTEM_CA_CERTS, 17), /* 26 */
{NULL, NULL, 0, NULL, 0}
};
#define NMC_FIELDS_SETTING_802_1X_ALL "name"","\
NM_SETTING_802_1X_EAP","\
NM_SETTING_802_1X_IDENTITY","\
NM_SETTING_802_1X_ANONYMOUS_IDENTITY","\
+ NM_SETTING_802_1X_PAC_FILE","\
NM_SETTING_802_1X_CA_CERT","\
NM_SETTING_802_1X_CA_PATH","\
NM_SETTING_802_1X_SUBJECT_MATCH","\
@@ -438,6 +442,52 @@ static NmcOutputField nmc_fields_setting_wimax[] = {
NM_SETTING_WIMAX_NETWORK_NAME
#define NMC_FIELDS_SETTING_WIMAX_COMMON NMC_FIELDS_SETTING_WIMAX_ALL
+/* Available fields for NM_SETTING_INFINIBAND_SETTING_NAME */
+static NmcOutputField nmc_fields_setting_infiniband[] = {
+ SETTING_FIELD ("name", 12), /* 0 */
+ SETTING_FIELD (NM_SETTING_INFINIBAND_MAC_ADDRESS, 61), /* 1 */
+ SETTING_FIELD (NM_SETTING_INFINIBAND_MTU, 6), /* 2 */
+ SETTING_FIELD (NM_SETTING_INFINIBAND_TRANSPORT_MODE, 12), /* 3 */
+ {NULL, NULL, 0, NULL, 0}
+};
+#define NMC_FIELDS_SETTING_INFINIBAND_ALL "name"","\
+ NM_SETTING_INFINIBAND_MAC_ADDRESS","\
+ NM_SETTING_INFINIBAND_MTU","\
+ NM_SETTING_INFINIBAND_TRANSPORT_MODE
+#define NMC_FIELDS_SETTING_INFINIBAND_COMMON NMC_FIELDS_SETTING_INFINIBAND_ALL
+
+/* Available fields for NM_SETTING_BOND_SETTING_NAME */
+static NmcOutputField nmc_fields_setting_bond[] = {
+ SETTING_FIELD ("name", 8), /* 0 */
+ SETTING_FIELD (NM_SETTING_BOND_INTERFACE_NAME, 15), /* 1 */
+ SETTING_FIELD (NM_SETTING_BOND_OPTIONS, 30), /* 2 */
+ {NULL, NULL, 0, NULL, 0}
+};
+#define NMC_FIELDS_SETTING_BOND_ALL "name"","\
+ NM_SETTING_BOND_INTERFACE_NAME","\
+ NM_SETTING_BOND_OPTIONS
+#define NMC_FIELDS_SETTING_BOND_COMMON NMC_FIELDS_SETTING_BOND_ALL
+
+/* Available fields for NM_SETTING_VLAN_SETTING_NAME */
+static NmcOutputField nmc_fields_setting_vlan[] = {
+ SETTING_FIELD ("name", 6), /* 0 */
+ SETTING_FIELD (NM_SETTING_VLAN_INTERFACE_NAME, 15), /* 1 */
+ SETTING_FIELD (NM_SETTING_VLAN_PARENT, 8), /* 2 */
+ SETTING_FIELD (NM_SETTING_VLAN_ID, 6), /* 3 */
+ SETTING_FIELD (NM_SETTING_VLAN_FLAGS, 45), /* 4 */
+ SETTING_FIELD (NM_SETTING_VLAN_INGRESS_PRIORITY_MAP, 22), /* 5 */
+ SETTING_FIELD (NM_SETTING_VLAN_EGRESS_PRIORITY_MAP, 22), /* 6 */
+ {NULL, NULL, 0, NULL, 0}
+};
+#define NMC_FIELDS_SETTING_VLAN_ALL "name"","\
+ NM_SETTING_VLAN_INTERFACE_NAME","\
+ NM_SETTING_VLAN_PARENT","\
+ NM_SETTING_VLAN_ID","\
+ NM_SETTING_VLAN_FLAGS","\
+ NM_SETTING_VLAN_INGRESS_PRIORITY_MAP","\
+ NM_SETTING_VLAN_EGRESS_PRIORITY_MAP
+#define NMC_FIELDS_SETTING_VLAN_COMMON NMC_FIELDS_SETTING_VLAN_ALL
+
static char *
wep_key_type_to_string (NMWepKeyType type)
@@ -519,10 +569,57 @@ allowed_bands_to_string (guint32 bands)
return g_string_free (band_str, FALSE);
}
+static char *
+vlan_flags_to_string (guint32 flags)
+{
+ GString *flag_str;
+
+ if (flags == 0)
+ return g_strdup (_("0 (NONE)"));
+
+ flag_str = g_string_new (NULL);
+ g_string_printf (flag_str, "%d (", flags);
+
+ if (flags & NM_VLAN_FLAG_REORDER_HEADERS)
+ g_string_append (flag_str, _("REORDER_HEADERS, "));
+ if (flags & NM_VLAN_FLAG_GVRP)
+ g_string_append (flag_str, _("GVRP, "));
+ if (flags & NM_VLAN_FLAG_LOOSE_BINDING)
+ g_string_append (flag_str, _("LOOSE_BINDING, "));
+
+ if (flag_str->str[flag_str->len-1] == '(')
+ g_string_assign (flag_str, _("unknown"));
+ else
+ g_string_truncate (flag_str, flag_str->len-2); /* chop off trailing ', ' */
+
+ g_string_append_c (flag_str, ')');
+
+ return g_string_free (flag_str, FALSE);
+}
+
+static char *
+vlan_priorities_to_string (NMSettingVlan *s_vlan, NMVlanPriorityMap map)
+{
+ GString *priorities;
+ int i;
+
+ priorities = g_string_new (NULL);
+ for (i = 0; i < nm_setting_vlan_get_num_priorities (s_vlan, map); i++) {
+ guint32 from, to;
+
+ nm_setting_vlan_get_priority (s_vlan, map, i, &from, &to);
+ g_string_append_printf (priorities, "%d:%d,", from, to);
+ }
+ g_string_truncate (priorities, priorities->len-1); /* chop off trailing ',' */
+
+ return g_string_free (priorities, FALSE);
+}
+
+/*----------------------------------------------------------------------------*/
+
gboolean
-setting_connection_details (NMSetting *setting, NmCli *nmc)
+setting_connection_details (NMSettingConnection *s_con, NmCli *nmc)
{
- NMSettingConnection *s_con;
guint64 timestamp;
char *timestamp_str;
const char *perm_item;
@@ -533,8 +630,7 @@ setting_connection_details (NMSetting *setting, NmCli *nmc)
guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0;
guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0;
- g_return_val_if_fail (NM_IS_SETTING_CONNECTION (setting), FALSE);
- s_con = (NMSettingConnection *) setting;
+ g_return_val_if_fail (NM_IS_SETTING_CONNECTION (s_con), FALSE);
nmc->allowed_fields = nmc_fields_setting_connection;
nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_CONNECTION_ALL, nmc->allowed_fields, NULL);
@@ -572,9 +668,8 @@ setting_connection_details (NMSetting *setting, NmCli *nmc)
}
gboolean
-setting_wired_details (NMSetting *setting, NmCli *nmc)
+setting_wired_details (NMSettingWired *s_wired, NmCli *nmc)
{
- NMSettingWired *s_wired;
const GByteArray *mac;
const GSList *iter;
const GPtrArray *s390_channels;
@@ -585,8 +680,7 @@ setting_wired_details (NMSetting *setting, NmCli *nmc)
guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0;
guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0;
- g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), FALSE);
- s_wired = (NMSettingWired *) setting;
+ g_return_val_if_fail (NM_IS_SETTING_WIRED (s_wired), FALSE);
nmc->allowed_fields = nmc_fields_setting_wired;
nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_WIRED_ALL, nmc->allowed_fields, NULL);
@@ -597,10 +691,10 @@ setting_wired_details (NMSetting *setting, NmCli *nmc)
mtu_str = g_strdup_printf ("%d", nm_setting_wired_get_mtu (s_wired));
mac = nm_setting_wired_get_mac_address (s_wired);
if (mac)
- device_mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", mac->data[0], mac->data[1], mac->data[2], mac->data[3], mac->data[4], mac->data[5]);
+ device_mac_str = nm_utils_hwaddr_ntoa (mac->data, ARPHRD_ETHER);
mac = nm_setting_wired_get_cloned_mac_address (s_wired);
if (mac)
- cloned_mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", mac->data[0], mac->data[1], mac->data[2], mac->data[3], mac->data[4], mac->data[5]);
+ cloned_mac_str = nm_utils_hwaddr_ntoa (mac->data, ARPHRD_ETHER);
mac_blacklist_s = g_string_new (NULL);
iter = nm_setting_wired_get_mac_address_blacklist (s_wired);
@@ -653,9 +747,8 @@ setting_wired_details (NMSetting *setting, NmCli *nmc)
}
gboolean
-setting_802_1X_details (NMSetting *setting, NmCli *nmc)
+setting_802_1X_details (NMSetting8021x *s_8021X, NmCli *nmc)
{
- NMSetting8021x *s_8021X;
NMSetting8021xCKScheme scheme;
GString *eap_str, *alt_sub_match, *phase2_alt_sub_match;
char *ca_cert_str = NULL, *client_cert_str = NULL, *phase2_ca_cert_str = NULL;
@@ -665,8 +758,7 @@ setting_802_1X_details (NMSetting *setting, NmCli *nmc)
guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0;
guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0;
- g_return_val_if_fail (NM_IS_SETTING_802_1X (setting), FALSE);
- s_8021X = (NMSetting8021x *) setting;
+ g_return_val_if_fail (NM_IS_SETTING_802_1X (s_8021X), FALSE);
nmc->allowed_fields = nmc_fields_setting_8021X;
nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_802_1X_ALL, nmc->allowed_fields, NULL);
@@ -729,28 +821,29 @@ setting_802_1X_details (NMSetting *setting, NmCli *nmc)
nmc->allowed_fields[1].value = eap_str->str;
nmc->allowed_fields[2].value = nm_setting_802_1x_get_identity (s_8021X);
nmc->allowed_fields[3].value = nm_setting_802_1x_get_anonymous_identity (s_8021X);
- nmc->allowed_fields[4].value = ca_cert_str;
- nmc->allowed_fields[5].value = nm_setting_802_1x_get_ca_path (s_8021X);
- nmc->allowed_fields[6].value = nm_setting_802_1x_get_subject_match (s_8021X);
- nmc->allowed_fields[7].value = alt_sub_match->str;
- nmc->allowed_fields[8].value = client_cert_str;
- nmc->allowed_fields[9].value = nm_setting_802_1x_get_phase1_peapver (s_8021X);
- nmc->allowed_fields[10].value = nm_setting_802_1x_get_phase1_peaplabel (s_8021X);
- nmc->allowed_fields[11].value = nm_setting_802_1x_get_phase1_fast_provisioning (s_8021X);
- nmc->allowed_fields[12].value = nm_setting_802_1x_get_phase2_auth (s_8021X);
- nmc->allowed_fields[13].value = nm_setting_802_1x_get_phase2_autheap (s_8021X);
- nmc->allowed_fields[14].value = phase2_ca_cert_str;
- nmc->allowed_fields[15].value = nm_setting_802_1x_get_phase2_ca_path (s_8021X);
- nmc->allowed_fields[16].value = nm_setting_802_1x_get_phase2_subject_match (s_8021X);
- nmc->allowed_fields[17].value = phase2_alt_sub_match->str;
- nmc->allowed_fields[18].value = phase2_client_cert_str;
- nmc->allowed_fields[19].value = nm_setting_802_1x_get_password (s_8021X);
- nmc->allowed_fields[20].value = private_key_str;
- nmc->allowed_fields[21].value = nm_setting_802_1x_get_private_key_password (s_8021X);
- nmc->allowed_fields[22].value = phase2_private_key_str;
- nmc->allowed_fields[23].value = nm_setting_802_1x_get_phase2_private_key_password (s_8021X);
- nmc->allowed_fields[24].value = nm_setting_802_1x_get_pin (s_8021X);
- nmc->allowed_fields[25].value = nm_setting_802_1x_get_system_ca_certs (s_8021X) ? _("yes") : _("no");
+ nmc->allowed_fields[4].value = nm_setting_802_1x_get_pac_file (s_8021X);
+ nmc->allowed_fields[5].value = ca_cert_str;
+ nmc->allowed_fields[6].value = nm_setting_802_1x_get_ca_path (s_8021X);
+ nmc->allowed_fields[7].value = nm_setting_802_1x_get_subject_match (s_8021X);
+ nmc->allowed_fields[8].value = alt_sub_match->str;
+ nmc->allowed_fields[9].value = client_cert_str;
+ nmc->allowed_fields[10].value = nm_setting_802_1x_get_phase1_peapver (s_8021X);
+ nmc->allowed_fields[11].value = nm_setting_802_1x_get_phase1_peaplabel (s_8021X);
+ nmc->allowed_fields[12].value = nm_setting_802_1x_get_phase1_fast_provisioning (s_8021X);
+ nmc->allowed_fields[13].value = nm_setting_802_1x_get_phase2_auth (s_8021X);
+ nmc->allowed_fields[14].value = nm_setting_802_1x_get_phase2_autheap (s_8021X);
+ nmc->allowed_fields[15].value = phase2_ca_cert_str;
+ nmc->allowed_fields[16].value = nm_setting_802_1x_get_phase2_ca_path (s_8021X);
+ nmc->allowed_fields[17].value = nm_setting_802_1x_get_phase2_subject_match (s_8021X);
+ nmc->allowed_fields[18].value = phase2_alt_sub_match->str;
+ nmc->allowed_fields[19].value = phase2_client_cert_str;
+ nmc->allowed_fields[20].value = nm_setting_802_1x_get_password (s_8021X);
+ nmc->allowed_fields[21].value = private_key_str;
+ nmc->allowed_fields[22].value = nm_setting_802_1x_get_private_key_password (s_8021X);
+ nmc->allowed_fields[23].value = phase2_private_key_str;
+ nmc->allowed_fields[24].value = nm_setting_802_1x_get_phase2_private_key_password (s_8021X);
+ nmc->allowed_fields[25].value = nm_setting_802_1x_get_pin (s_8021X);
+ nmc->allowed_fields[26].value = nm_setting_802_1x_get_system_ca_certs (s_8021X) ? _("yes") : _("no");
nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX;
print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */
@@ -769,9 +862,8 @@ setting_802_1X_details (NMSetting *setting, NmCli *nmc)
}
gboolean
-setting_wireless_details (NMSetting *setting, NmCli *nmc)
+setting_wireless_details (NMSettingWireless *s_wireless, NmCli *nmc)
{
- NMSettingWireless *s_wireless;
int i;
const GByteArray *ssid, *bssid, *mac;
char *ssid_str, *channel_str, *rate_str, *tx_power_str, *mtu_str;
@@ -782,8 +874,7 @@ setting_wireless_details (NMSetting *setting, NmCli *nmc)
guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0;
guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0;
- g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), FALSE);
- s_wireless = (NMSettingWireless *) setting;
+ g_return_val_if_fail (NM_IS_SETTING_WIRELESS (s_wireless), FALSE);
nmc->allowed_fields = nmc_fields_setting_wireless;
nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_WIRELESS_ALL, nmc->allowed_fields, NULL);
@@ -796,15 +887,15 @@ setting_wireless_details (NMSetting *setting, NmCli *nmc)
rate_str = g_strdup_printf ("%d", nm_setting_wireless_get_rate (s_wireless));
bssid = nm_setting_wireless_get_bssid (s_wireless);
if (bssid)
- bssid_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", bssid->data[0], bssid->data[1], bssid->data[2], bssid->data[3], bssid->data[4], bssid->data[5]);
+ bssid_str = nm_utils_hwaddr_ntoa (bssid->data, ARPHRD_ETHER);
tx_power_str = g_strdup_printf ("%d", nm_setting_wireless_get_tx_power (s_wireless));
mtu_str = g_strdup_printf ("%d", nm_setting_wireless_get_mtu (s_wireless));
mac = nm_setting_wireless_get_mac_address (s_wireless);
if (mac)
- device_mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", mac->data[0], mac->data[1], mac->data[2], mac->data[3], mac->data[4], mac->data[5]);
+ device_mac_str = nm_utils_hwaddr_ntoa (mac->data, ARPHRD_ETHER);
mac = nm_setting_wireless_get_cloned_mac_address (s_wireless);
if (mac)
- cloned_mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", mac->data[0], mac->data[1], mac->data[2], mac->data[3], mac->data[4], mac->data[5]);
+ cloned_mac_str = nm_utils_hwaddr_ntoa (mac->data, ARPHRD_ETHER);
mac_blacklist = g_string_new (NULL);
iter = nm_setting_wireless_get_mac_address_blacklist (s_wireless);
@@ -854,9 +945,8 @@ setting_wireless_details (NMSetting *setting, NmCli *nmc)
}
gboolean
-setting_wireless_security_details (NMSetting *setting, NmCli *nmc)
+setting_wireless_security_details (NMSettingWirelessSecurity *s_wireless_sec, NmCli *nmc)
{
- NMSettingWirelessSecurity *s_wireless_sec;
int i;
char *wep_tx_keyidx_str, *wep_key_type_str;
GString *protos, *pairwises, *groups;
@@ -864,8 +954,7 @@ setting_wireless_security_details (NMSetting *setting, NmCli *nmc)
guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0;
guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0;
- g_return_val_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (setting), FALSE);
- s_wireless_sec = (NMSettingWirelessSecurity *) setting;
+ g_return_val_if_fail (NM_IS_SETTING_WIRELESS_SECURITY (s_wireless_sec), FALSE);
nmc->allowed_fields = nmc_fields_setting_wireless_security;
nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_WIRELESS_SECURITY_ALL, nmc->allowed_fields, NULL);
@@ -922,17 +1011,15 @@ setting_wireless_security_details (NMSetting *setting, NmCli *nmc)
}
gboolean
-setting_ip4_config_details (NMSetting *setting, NmCli *nmc)
+setting_ip4_config_details (NMSettingIP4Config *s_ip4, NmCli *nmc)
{
- NMSettingIP4Config *s_ip4;
GString *dns_str, *dns_search_str, *addr_str, *route_str;
int i, num;
guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0;
guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0;
guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0;
- g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), FALSE);
- s_ip4 = (NMSettingIP4Config *) setting;
+ g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (s_ip4), FALSE);
nmc->allowed_fields = nmc_fields_setting_ip4_config;
nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_IP4_CONFIG_ALL, nmc->allowed_fields, NULL);
@@ -1058,17 +1145,15 @@ setting_ip4_config_details (NMSetting *setting, NmCli *nmc)
}
gboolean
-setting_ip6_config_details (NMSetting *setting, NmCli *nmc)
+setting_ip6_config_details (NMSettingIP6Config *s_ip6, NmCli *nmc)
{
- NMSettingIP6Config *s_ip6;
GString *dns_str, *dns_search_str, *addr_str, *route_str;
int i, num;
guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0;
guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0;
guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0;
- g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), FALSE);
- s_ip6 = (NMSettingIP6Config *) setting;
+ g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (s_ip6), FALSE);
nmc->allowed_fields = nmc_fields_setting_ip6_config;
nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_IP6_CONFIG_ALL, nmc->allowed_fields, NULL);
@@ -1191,16 +1276,14 @@ setting_ip6_config_details (NMSetting *setting, NmCli *nmc)
}
gboolean
-setting_serial_details (NMSetting *setting, NmCli *nmc)
+setting_serial_details (NMSettingSerial *s_serial, NmCli *nmc)
{
- NMSettingSerial *s_serial;
char *baud_str, *bits_str, *parity_str, *stopbits_str, *send_delay_str;
guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0;
guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0;
guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0;
- g_return_val_if_fail (NM_IS_SETTING_SERIAL (setting), FALSE);
- s_serial = (NMSettingSerial *) setting;
+ g_return_val_if_fail (NM_IS_SETTING_SERIAL (s_serial), FALSE);
nmc->allowed_fields = nmc_fields_setting_serial;
nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_SERIAL_ALL, nmc->allowed_fields, NULL);
@@ -1233,16 +1316,14 @@ setting_serial_details (NMSetting *setting, NmCli *nmc)
}
gboolean
-setting_ppp_details (NMSetting *setting, NmCli *nmc)
+setting_ppp_details (NMSettingPPP *s_ppp, NmCli *nmc)
{
- NMSettingPPP *s_ppp;
char *baud_str, *mru_str, *mtu_str, *lcp_echo_failure_str, *lcp_echo_interval_str;
guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0;
guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0;
guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0;
- g_return_val_if_fail (NM_IS_SETTING_PPP (setting), FALSE);
- s_ppp = (NMSettingPPP *) setting;
+ g_return_val_if_fail (NM_IS_SETTING_PPP (s_ppp), FALSE);
nmc->allowed_fields = nmc_fields_setting_ppp;
nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_PPP_ALL, nmc->allowed_fields, NULL);
@@ -1288,15 +1369,13 @@ setting_ppp_details (NMSetting *setting, NmCli *nmc)
}
gboolean
-setting_pppoe_details (NMSetting *setting, NmCli *nmc)
+setting_pppoe_details (NMSettingPPPOE *s_pppoe, NmCli *nmc)
{
- NMSettingPPPOE *s_pppoe;
guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0;
guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0;
guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0;
- g_return_val_if_fail (NM_IS_SETTING_PPPOE (setting), FALSE);
- s_pppoe = (NMSettingPPPOE *) setting;
+ g_return_val_if_fail (NM_IS_SETTING_PPPOE (s_pppoe), FALSE);
nmc->allowed_fields = nmc_fields_setting_pppoe;
nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_PPPOE_ALL, nmc->allowed_fields, NULL);
@@ -1315,16 +1394,14 @@ setting_pppoe_details (NMSetting *setting, NmCli *nmc)
}
gboolean
-setting_gsm_details (NMSetting *setting, NmCli *nmc)
+setting_gsm_details (NMSettingGsm *s_gsm, NmCli *nmc)
{
- NMSettingGsm *s_gsm;
char *network_type_str, *allowed_bands_str;
guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0;
guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0;
guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0;
- g_return_val_if_fail (NM_IS_SETTING_GSM (setting), FALSE);
- s_gsm = (NMSettingGsm *) setting;
+ g_return_val_if_fail (NM_IS_SETTING_GSM (s_gsm), FALSE);
nmc->allowed_fields = nmc_fields_setting_gsm;
nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_GSM_ALL, nmc->allowed_fields, NULL);
@@ -1355,15 +1432,13 @@ setting_gsm_details (NMSetting *setting, NmCli *nmc)
}
gboolean
-setting_cdma_details (NMSetting *setting, NmCli *nmc)
+setting_cdma_details (NMSettingCdma *s_cdma, NmCli *nmc)
{
- NMSettingCdma *s_cdma;
guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0;
guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0;
guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0;
- g_return_val_if_fail (NM_IS_SETTING_CDMA (setting), FALSE);
- s_cdma = (NMSettingCdma *) setting;
+ g_return_val_if_fail (NM_IS_SETTING_CDMA (s_cdma), FALSE);
nmc->allowed_fields = nmc_fields_setting_cdma;
nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_CDMA_ALL, nmc->allowed_fields, NULL);
@@ -1382,17 +1457,15 @@ setting_cdma_details (NMSetting *setting, NmCli *nmc)
}
gboolean
-setting_bluetooth_details (NMSetting *setting, NmCli *nmc)
+setting_bluetooth_details (NMSettingBluetooth *s_bluetooth, NmCli *nmc)
{
- NMSettingBluetooth *s_bluetooth;
const GByteArray *bdaddr;
char *bdaddr_str = NULL;
guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0;
guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0;
guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0;
- g_return_val_if_fail (NM_IS_SETTING_BLUETOOTH (setting), FALSE);
- s_bluetooth = (NMSettingBluetooth *) setting;
+ g_return_val_if_fail (NM_IS_SETTING_BLUETOOTH (s_bluetooth), FALSE);
nmc->allowed_fields = nmc_fields_setting_bluetooth;
nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_BLUETOOTH_ALL, nmc->allowed_fields, NULL);
@@ -1401,8 +1474,8 @@ setting_bluetooth_details (NMSetting *setting, NmCli *nmc)
bdaddr = nm_setting_bluetooth_get_bdaddr (s_bluetooth);
if (bdaddr)
- bdaddr_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", bdaddr->data[0], bdaddr->data[1], bdaddr->data[2],
- bdaddr->data[3], bdaddr->data[4], bdaddr->data[5]);
+ bdaddr_str = nm_utils_hwaddr_ntoa (bdaddr->data, ARPHRD_ETHER);
+
nmc->allowed_fields[0].value = NM_SETTING_BLUETOOTH_SETTING_NAME;
nmc->allowed_fields[1].value = bdaddr_str;
nmc->allowed_fields[2].value = nm_setting_bluetooth_get_connection_type (s_bluetooth);
@@ -1416,17 +1489,15 @@ setting_bluetooth_details (NMSetting *setting, NmCli *nmc)
}
gboolean
-setting_olpc_mesh_details (NMSetting *setting, NmCli *nmc)
+setting_olpc_mesh_details (NMSettingOlpcMesh *s_olpc_mesh, NmCli *nmc)
{
- NMSettingOlpcMesh *s_olpc_mesh;
const GByteArray *ssid, *dhcp_anycast;
char *ssid_str, *channel_str, *dhcp_anycast_str = NULL;
guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0;
guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0;
guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0;
- g_return_val_if_fail (NM_IS_SETTING_OLPC_MESH (setting), FALSE);
- s_olpc_mesh = (NMSettingOlpcMesh *) setting;
+ g_return_val_if_fail (NM_IS_SETTING_OLPC_MESH (s_olpc_mesh), FALSE);
nmc->allowed_fields = nmc_fields_setting_olpc_mesh;
nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_OLPC_MESH_ALL, nmc->allowed_fields, NULL);
@@ -1438,8 +1509,8 @@ setting_olpc_mesh_details (NMSetting *setting, NmCli *nmc)
channel_str = g_strdup_printf ("%d", nm_setting_olpc_mesh_get_channel (s_olpc_mesh));
dhcp_anycast = nm_setting_olpc_mesh_get_dhcp_anycast_address (s_olpc_mesh);
if (dhcp_anycast)
- dhcp_anycast_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", dhcp_anycast->data[0], dhcp_anycast->data[1], dhcp_anycast->data[2],
- dhcp_anycast->data[3], dhcp_anycast->data[4], dhcp_anycast->data[5]);
+ dhcp_anycast_str = nm_utils_hwaddr_ntoa (dhcp_anycast->data, ARPHRD_ETHER);
+
nmc->allowed_fields[0].value = NM_SETTING_OLPC_MESH_SETTING_NAME;
nmc->allowed_fields[1].value = ssid_str;
nmc->allowed_fields[2].value = channel_str;
@@ -1467,16 +1538,14 @@ vpn_data_item (const char *key, const char *value, gpointer user_data)
}
gboolean
-setting_vpn_details (NMSetting *setting, NmCli *nmc)
+setting_vpn_details (NMSettingVPN *s_vpn, NmCli *nmc)
{
- NMSettingVPN *s_vpn;
GString *data_item_str, *secret_str;
guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0;
guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0;
guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0;
- g_return_val_if_fail (NM_IS_SETTING_VPN (setting), FALSE);
- s_vpn = (NMSettingVPN *) setting;
+ g_return_val_if_fail (NM_IS_SETTING_VPN (s_vpn), FALSE);
nmc->allowed_fields = nmc_fields_setting_vpn;
nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_VPN_ALL, nmc->allowed_fields, NULL);
@@ -1504,17 +1573,15 @@ setting_vpn_details (NMSetting *setting, NmCli *nmc)
}
gboolean
-setting_wimax_details (NMSetting *setting, NmCli *nmc)
+setting_wimax_details (NMSettingWimax *s_wimax, NmCli *nmc)
{
- NMSettingWimax *s_wimax;
const GByteArray *mac;
char *device_mac_str = NULL;
guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0;
guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0;
guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0;
- g_return_val_if_fail (NM_IS_SETTING_WIMAX (setting), FALSE);
- s_wimax = (NMSettingWimax *) setting;
+ g_return_val_if_fail (NM_IS_SETTING_WIMAX (s_wimax), FALSE);
nmc->allowed_fields = nmc_fields_setting_wimax;
nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_WIMAX_ALL, nmc->allowed_fields, NULL);
@@ -1523,7 +1590,7 @@ setting_wimax_details (NMSetting *setting, NmCli *nmc)
mac = nm_setting_wimax_get_mac_address (s_wimax);
if (mac)
- device_mac_str = g_strdup_printf ("%02X:%02X:%02X:%02X:%02X:%02X", mac->data[0], mac->data[1], mac->data[2], mac->data[3], mac->data[4], mac->data[5]);
+ device_mac_str = nm_utils_hwaddr_ntoa (mac->data, ARPHRD_ETHER);
nmc->allowed_fields[0].value = NM_SETTING_WIMAX_SETTING_NAME;
nmc->allowed_fields[1].value = device_mac_str;
@@ -1537,3 +1604,114 @@ setting_wimax_details (NMSetting *setting, NmCli *nmc)
return TRUE;
}
+gboolean
+setting_infiniband_details (NMSettingInfiniband *s_infiniband, NmCli *nmc)
+{
+ const GByteArray *mac;
+ char *mtu_str, *mac_str = NULL;
+ guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0;
+ guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0;
+ guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0;
+
+ g_return_val_if_fail (NM_IS_SETTING_INFINIBAND (s_infiniband), FALSE);
+
+ nmc->allowed_fields = nmc_fields_setting_infiniband;
+ nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_INFINIBAND_ALL, nmc->allowed_fields, NULL);
+ nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES;
+ print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */
+
+ mac = nm_setting_infiniband_get_mac_address (s_infiniband);
+ if (mac)
+ mac_str = nm_utils_hwaddr_ntoa (mac->data, ARPHRD_INFINIBAND);
+ mtu_str = g_strdup_printf ("%d", nm_setting_infiniband_get_mtu (s_infiniband));
+
+ nmc->allowed_fields[0].value = NM_SETTING_INFINIBAND_SETTING_NAME;
+ nmc->allowed_fields[1].value = mac_str;
+ nmc->allowed_fields[2].value = strcmp (mtu_str, "0") ? mtu_str : _("auto");
+ nmc->allowed_fields[3].value = nm_setting_infiniband_get_transport_mode (s_infiniband);
+
+ nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX;
+ print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */
+
+ g_free (mac_str);
+ g_free (mtu_str);
+
+ return TRUE;
+}
+
+gboolean
+setting_bond_details (NMSettingBond *s_bond, NmCli *nmc)
+{
+ GString *bond_options_s;
+ int i;
+ guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0;
+ guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0;
+ guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0;
+
+ g_return_val_if_fail (NM_IS_SETTING_BOND (s_bond), FALSE);
+
+ nmc->allowed_fields = nmc_fields_setting_bond;
+ nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_BOND_ALL, nmc->allowed_fields, NULL);
+ nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES;
+ print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */
+
+ bond_options_s = g_string_new (NULL);
+ for (i = 0; i < nm_setting_bond_get_num_options (s_bond); i++) {
+ const char *key, *value;
+
+ nm_setting_bond_get_option (s_bond, i, &key, &value);
+ g_string_append_printf (bond_options_s, "%s=%s,", key, value);
+ }
+ g_string_truncate (bond_options_s, bond_options_s->len-1); /* chop off trailing ',' */
+
+ nmc->allowed_fields[0].value = NM_SETTING_BOND_SETTING_NAME;
+ nmc->allowed_fields[1].value = nm_setting_bond_get_interface_name (s_bond);
+ nmc->allowed_fields[2].value = bond_options_s->str;
+
+ nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX;
+ print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */
+
+ g_string_free (bond_options_s, TRUE);
+
+ return TRUE;
+}
+
+gboolean
+setting_vlan_details (NMSettingVlan *s_vlan, NmCli *nmc)
+{
+ char *vlan_id_str, *vlan_flags_str, *vlan_ingress_prio_str, *vlan_egress_prio_str;
+ guint32 mode_flag = (nmc->print_output == NMC_PRINT_PRETTY) ? NMC_PF_FLAG_PRETTY : (nmc->print_output == NMC_PRINT_TERSE) ? NMC_PF_FLAG_TERSE : 0;
+ guint32 multiline_flag = nmc->multiline_output ? NMC_PF_FLAG_MULTILINE : 0;
+ guint32 escape_flag = nmc->escape_values ? NMC_PF_FLAG_ESCAPE : 0;
+
+ g_return_val_if_fail (NM_IS_SETTING_VLAN (s_vlan), FALSE);
+
+ nmc->allowed_fields = nmc_fields_setting_vlan;
+ nmc->print_fields.indices = parse_output_fields (NMC_FIELDS_SETTING_VLAN_ALL, nmc->allowed_fields, NULL);
+ nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_FIELD_NAMES;
+ print_fields (nmc->print_fields, nmc->allowed_fields); /* Print field names */
+
+ vlan_id_str = g_strdup_printf ("%d", nm_setting_vlan_get_id (s_vlan));
+ vlan_flags_str = vlan_flags_to_string (nm_setting_vlan_get_flags (s_vlan));
+ vlan_ingress_prio_str = vlan_priorities_to_string (s_vlan, NM_VLAN_INGRESS_MAP);
+ vlan_egress_prio_str = vlan_priorities_to_string (s_vlan, NM_VLAN_EGRESS_MAP);
+
+ nmc->allowed_fields[0].value = NM_SETTING_VLAN_SETTING_NAME;
+ nmc->allowed_fields[1].value = nm_setting_vlan_get_interface_name (s_vlan);
+ nmc->allowed_fields[2].value = nm_setting_vlan_get_parent (s_vlan);
+ nmc->allowed_fields[3].value = vlan_id_str;
+ nmc->allowed_fields[4].value = vlan_flags_str;
+ nmc->allowed_fields[5].value = vlan_ingress_prio_str;
+ nmc->allowed_fields[6].value = vlan_egress_prio_str;
+
+ nmc->print_fields.flags = multiline_flag | mode_flag | escape_flag | NMC_PF_FLAG_SECTION_PREFIX;
+ print_fields (nmc->print_fields, nmc->allowed_fields); /* Print values */
+
+ g_free (vlan_id_str);
+ g_free (vlan_flags_str);
+ g_free (vlan_ingress_prio_str);
+ g_free (vlan_egress_prio_str);
+
+ return TRUE;
+}
+
diff --git a/cli/src/settings.h b/cli/src/settings.h
index 4901bf27..964d6648 100644
--- a/cli/src/settings.h
+++ b/cli/src/settings.h
@@ -14,7 +14,7 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * (C) Copyright 2010 Red Hat, Inc.
+ * (C) Copyright 2010 - 2012 Red Hat, Inc.
*/
#ifndef NMC_SETTINGS_H
@@ -36,26 +36,32 @@
#include
#include
#include
+#include
+#include
+#include
#include "nmcli.h"
#include "utils.h"
-gboolean setting_connection_details (NMSetting *setting, NmCli *nmc);
-gboolean setting_wired_details (NMSetting *setting, NmCli *nmc);
-gboolean setting_802_1X_details (NMSetting *setting, NmCli *nmc);
-gboolean setting_wireless_details (NMSetting *setting, NmCli *nmc);
-gboolean setting_wireless_security_details (NMSetting *setting, NmCli *nmc);
-gboolean setting_ip4_config_details (NMSetting *setting, NmCli *nmc);
-gboolean setting_ip6_config_details (NMSetting *setting, NmCli *nmc);
-gboolean setting_serial_details (NMSetting *setting, NmCli *nmc);
-gboolean setting_ppp_details (NMSetting *setting, NmCli *nmc);
-gboolean setting_pppoe_details (NMSetting *setting, NmCli *nmc);
-gboolean setting_gsm_details (NMSetting *setting, NmCli *nmc);
-gboolean setting_cdma_details (NMSetting *setting, NmCli *nmc);
-gboolean setting_bluetooth_details (NMSetting *setting, NmCli *nmc);
-gboolean setting_olpc_mesh_details (NMSetting *setting, NmCli *nmc);
-gboolean setting_vpn_details (NMSetting *setting, NmCli *nmc);
-gboolean setting_wimax_details (NMSetting *setting, NmCli *nmc);
+gboolean setting_connection_details (NMSettingConnection *s_con, NmCli *nmc);
+gboolean setting_wired_details (NMSettingWired *s_wired, NmCli *nmc);
+gboolean setting_802_1X_details (NMSetting8021x *s_8021X, NmCli *nmc);
+gboolean setting_wireless_details (NMSettingWireless *s_wireless, NmCli *nmc);
+gboolean setting_wireless_security_details (NMSettingWirelessSecurity *s_wsec, NmCli *nmc);
+gboolean setting_ip4_config_details (NMSettingIP4Config *s_ip4, NmCli *nmc);
+gboolean setting_ip6_config_details (NMSettingIP6Config *s_ip6, NmCli *nmc);
+gboolean setting_serial_details (NMSettingSerial *s_serial, NmCli *nmc);
+gboolean setting_ppp_details (NMSettingPPP *s_ppp, NmCli *nmc);
+gboolean setting_pppoe_details (NMSettingPPPOE *s_pppoe, NmCli *nmc);
+gboolean setting_gsm_details (NMSettingGsm *s_gsm, NmCli *nmc);
+gboolean setting_cdma_details (NMSettingCdma *s_cdma, NmCli *nmc);
+gboolean setting_bluetooth_details (NMSettingBluetooth *s_bluetooth, NmCli *nmc);
+gboolean setting_olpc_mesh_details (NMSettingOlpcMesh *s_olpc_mesh, NmCli *nmc);
+gboolean setting_vpn_details (NMSettingVPN *s_vpn, NmCli *nmc);
+gboolean setting_wimax_details (NMSettingWimax *s_wimax, NmCli *nmc);
+gboolean setting_infiniband_details (NMSettingInfiniband *s_infiniband, NmCli *nmc);
+gboolean setting_bond_details (NMSettingBond *s_bond, NmCli *nmc);
+gboolean setting_vlan_details (NMSettingVlan *s_vlan, NmCli *nmc);
#endif /* NMC_SETTINGS_H */
diff --git a/cli/src/utils.c b/cli/src/utils.c
index c5637e4f..24bc998c 100644
--- a/cli/src/utils.c
+++ b/cli/src/utils.c
@@ -14,7 +14,7 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * (C) Copyright 2010 - 2011 Red Hat, Inc.
+ * (C) Copyright 2010 - 2012 Red Hat, Inc.
*/
/* Generated configuration file */
@@ -23,6 +23,10 @@
#include
#include
+#include
+#include
+#include
+
#include
#include
#include
@@ -78,6 +82,60 @@ ssid_to_printable (const char *str, gsize len)
return printable_str;
}
+/*
+ * Converts IPv4 address from guint32 in network-byte order to text representation.
+ * Returns: text form of the IP or NULL (then error is set)
+ */
+char *
+nmc_ip4_address_as_string (guint32 ip, GError **error)
+{
+ struct in_addr tmp_addr;
+ char buf[INET_ADDRSTRLEN];
+
+ g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+
+ memset (&buf, '\0', sizeof (buf));
+ tmp_addr.s_addr = ip;
+
+ if (inet_ntop (AF_INET, &tmp_addr, buf, INET_ADDRSTRLEN)) {
+ return g_strdup (buf);
+ } else {
+ g_set_error (error, 0, 0, _("Error converting IP4 address '0x%X' to text form"),
+ ntohl (tmp_addr.s_addr));
+ return NULL;
+ }
+}
+
+/*
+ * Converts IPv6 address in in6_addr structure to text representation.
+ * Returns: text form of the IP or NULL (then error is set)
+ */
+char *
+nmc_ip6_address_as_string (const struct in6_addr *ip, GError **error)
+{
+ char buf[INET6_ADDRSTRLEN];
+
+ g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+
+ memset (&buf, '\0', sizeof (buf));
+
+ if (inet_ntop (AF_INET6, ip, buf, INET6_ADDRSTRLEN)) {
+ return g_strdup (buf);
+ } else {
+ if (error) {
+ int j;
+ GString *ip6_str = g_string_new (NULL);
+ g_string_append_printf (ip6_str, "%02X", ip->s6_addr[0]);
+ for (j = 1; j < 16; j++)
+ g_string_append_printf (ip6_str, " %02X", ip->s6_addr[j]);
+ g_set_error (error, 0, 0, _("Error converting IP6 address '%s' to text form"),
+ ip6_str->str);
+ g_string_free (ip6_str, TRUE);
+ }
+ return NULL;
+ }
+}
+
/*
* Find out how many columns an UTF-8 string occupies on the screen
*/
@@ -96,6 +154,20 @@ nmc_string_screen_width (const char *start, const char *end)
return width;
}
+void
+set_val_str (NmcOutputField fields_array[], guint32 idx, const char *value)
+{
+ fields_array[idx].flags = 0;
+ fields_array[idx].value = value;
+}
+
+void
+set_val_arr (NmcOutputField fields_array[], guint32 idx, const char **value)
+{
+ fields_array[idx].flags = NMC_OF_FLAG_ARRAY;
+ fields_array[idx].value = value;
+}
+
/*
* Parse comma separated fields in 'fields_str' according to 'fields_array'.
* IN: 'field_str': comma-separated fields names
@@ -172,9 +244,8 @@ print_fields (const NmcPrintFields fields, const NmcOutputField field_values[])
int table_width = 0;
char *line = NULL;
char *indent_str;
- const char *value;
const char *not_set_str = _("not set");
- int i, idx;
+ int i;
gboolean multiline = fields.flags & NMC_PF_FLAG_MULTILINE;
gboolean terse = fields.flags & NMC_PF_FLAG_TERSE;
gboolean pretty = fields.flags & NMC_PF_FLAG_PRETTY;
@@ -213,14 +284,39 @@ print_fields (const NmcPrintFields fields, const NmcOutputField field_values[])
if (!main_header_only && !field_names) {
for (i = 0; i < fields.indices->len; i++) {
char *tmp;
- idx = g_array_index (fields.indices, int, i);
+ int idx = g_array_index (fields.indices, int, i);
+ guint32 value_is_array = field_values[idx].flags & NMC_OF_FLAG_ARRAY;
+
+ /* section prefix can't be an array */
+ g_assert (!value_is_array || !section_prefix || idx != 0);
+
if (section_prefix && idx == 0) /* The first field is section prefix */
continue;
- tmp = g_strdup_printf ("%s%s%s:", section_prefix ? field_values[0].value : "",
- section_prefix ? "." : "",
- _(field_values[idx].name_l10n));
- printf ("%-*s%s\n", terse ? 0 : ML_VALUE_INDENT, tmp, field_values[idx].value ? field_values[idx].value : not_set_str);
- g_free (tmp);
+
+ if (value_is_array) {
+ /* value is a null-terminated string array */
+ const char **p;
+ int j;
+
+ for (p = (const char **) field_values[idx].value, j = 1; p && *p; p++, j++) {
+ tmp = g_strdup_printf ("%s%s%s[%d]:", section_prefix ? (const char*) field_values[0].value : "",
+ section_prefix ? "." : "",
+ _(field_values[idx].name_l10n),
+ j);
+ printf ("%-*s%s\n", terse ? 0 : ML_VALUE_INDENT, tmp, *p ? *p : not_set_str);
+ g_free (tmp);
+ }
+ } else {
+ /* value is a string */
+ const char *hdr_name = (const char*) field_values[0].value;
+ const char *val = (const char*) field_values[idx].value;
+
+ tmp = g_strdup_printf ("%s%s%s:", section_prefix ? hdr_name : "",
+ section_prefix ? "." : "",
+ _(field_values[idx].name_l10n));
+ printf ("%-*s%s\n", terse ? 0 : ML_VALUE_INDENT, tmp, val ? val : not_set_str);
+ g_free (tmp);
+ }
}
if (pretty) {
line = g_strnfill (ML_HEADER_WIDTH, '-');
@@ -235,11 +331,16 @@ print_fields (const NmcPrintFields fields, const NmcOutputField field_values[])
str = g_string_new (NULL);
for (i = 0; i < fields.indices->len; i++) {
- idx = g_array_index (fields.indices, int, i);
+ int idx = g_array_index (fields.indices, int, i);
+ guint32 value_is_array = field_values[idx].flags & NMC_OF_FLAG_ARRAY;
+ char *value;
if (field_names)
value = _(field_values[idx].name_l10n);
else
- value = field_values[idx].value ? field_values[idx].value : not_set_str;
+ value = field_values[idx].value ?
+ (value_is_array ? g_strjoinv (" | ", (char **) field_values[idx].value) : (char *) field_values[idx].value) :
+ (char *) not_set_str;
+
if (terse) {
if (escape) {
const char *p = value;
@@ -250,18 +351,19 @@ print_fields (const NmcPrintFields fields, const NmcOutputField field_values[])
p++;
}
}
- else
+ else
g_string_append_printf (str, "%s", value);
g_string_append_c (str, ':'); /* Column separator */
} else {
width1 = strlen (value);
width2 = nmc_string_screen_width (value, NULL); /* Width of the string (in screen colums) */
- if (strlen (value) == 0)
- value = "--";
- g_string_append_printf (str, "%-*s", field_values[idx].width + width1 - width2, value);
+ g_string_append_printf (str, "%-*s", field_values[idx].width + width1 - width2, strlen (value) > 0 ? value : "--");
g_string_append_c (str, ' '); /* Column separator */
table_width += field_values[idx].width + width1 - width2 + 1;
}
+
+ if (value_is_array && field_values[idx].value && !field_values)
+ g_free (value);
}
/* Print the main table header */
diff --git a/cli/src/utils.h b/cli/src/utils.h
index 467054a2..a22ae144 100644
--- a/cli/src/utils.h
+++ b/cli/src/utils.h
@@ -14,7 +14,7 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * (C) Copyright 2010 - 2011 Red Hat, Inc.
+ * (C) Copyright 2010 - 2012 Red Hat, Inc.
*/
#ifndef NMC_UTILS_H
@@ -28,7 +28,11 @@
int matches (const char *cmd, const char *pattern);
int next_arg (int *argc, char ***argv);
char *ssid_to_printable (const char *str, gsize len);
+char *nmc_ip4_address_as_string (guint32 ip, GError **error);
+char *nmc_ip6_address_as_string (const struct in6_addr *ip, GError **error);
int nmc_string_screen_width (const char *start, const char *end);
+void set_val_str (NmcOutputField fields_array[], guint32 index, const char *value);
+void set_val_arr (NmcOutputField fields_array[], guint32 index, const char **value);
GArray *parse_output_fields (const char *fields_str, const NmcOutputField fields_array[], GError **error);
gboolean nmc_terse_option_check (NMCPrintOutput print_output, const char *fields, GError **error);
void print_fields (const NmcPrintFields fields, const NmcOutputField field_values[]);
diff --git a/config.h.in b/config.h.in
index 2a002e91..2bd16ce8 100644
--- a/config.h.in
+++ b/config.h.in
@@ -107,6 +107,12 @@
/* Define to 1 if you have the header file. */
#undef HAVE_UNISTD_H
+/* Define if you have VLAN_FLAG_LOOSE_BINDING */
+#undef HAVE_VLAN_FLAG_LOOSE_BINDING
+
+/* Define if you have Linux Wireless Extensions support */
+#undef HAVE_WEXT
+
/* Define to path of iptables binary */
#undef IPTABLES_PATH
@@ -123,9 +129,6 @@
/* Define the distribution version string */
#undef NM_DIST_VERSION
-/* Define to disable use of ConsoleKit */
-#undef NO_CONSOLEKIT
-
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
#undef NO_MINUS_C_MINUS_O
@@ -171,6 +174,9 @@
/* Define if you have Frugalware */
#undef TARGET_FRUGALWARE
+/* Define for a general unknown Linux system */
+#undef TARGET_GENERIC
+
/* Define if you have Gentoo */
#undef TARGET_GENTOO
@@ -223,6 +229,9 @@
/* Version number of package */
#undef VERSION
+/* Define if you want connectivity checking support */
+#undef WITH_CONCHECK
+
/* Define if you have PolicyKit support */
#undef WITH_POLKIT
diff --git a/configure b/configure
index 7e31eb6e..3663c681 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for NetworkManager 0.9.2.0.
+# Generated by GNU Autoconf 2.68 for NetworkManager 0.9.4.0.
#
# Report bugs to .
#
@@ -571,8 +571,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='NetworkManager'
PACKAGE_TARNAME='NetworkManager'
-PACKAGE_VERSION='0.9.2.0'
-PACKAGE_STRING='NetworkManager 0.9.2.0'
+PACKAGE_VERSION='0.9.4.0'
+PACKAGE_STRING='NetworkManager 0.9.4.0'
PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager'
PACKAGE_URL=''
@@ -634,6 +634,10 @@ HTML_DIR
GTKDOC_MKPDF
GTKDOC_REBASE
GTKDOC_CHECK
+WITH_CONCHECK_FALSE
+WITH_CONCHECK_TRUE
+LIBSOUP_LIBS
+LIBSOUP_CFLAGS
KERNEL_FIRMWARE_DIR
SYSTEM_CA_PATH
IPTABLES_PATH
@@ -645,7 +649,9 @@ PPPD_PLUGIN_DIR
WITH_PPP_FALSE
WITH_PPP_TRUE
DBUS_SYS_DIR
+GLIB_MKENUMS
GLIB_GENMARSHAL
+GLIB_MAKEFILE
WITH_GNUTLS_FALSE
WITH_GNUTLS_TRUE
WITH_NSS_FALSE
@@ -674,18 +680,25 @@ LIBNL1_LIBS
LIBNL1_CFLAGS
LIBNL2_LIBS
LIBNL2_CFLAGS
+LIBNL_GENL3_LIBS
+LIBNL_GENL3_CFLAGS
LIBNL_ROUTE3_LIBS
LIBNL_ROUTE3_CFLAGS
LIBNL3_LIBS
LIBNL3_CFLAGS
-WITH_CONSOLEKIT_FALSE
-WITH_CONSOLEKIT_TRUE
+SESSION_TRACKING_SYSTEMD_FALSE
+SESSION_TRACKING_SYSTEMD_TRUE
+SESSION_TRACKING_CK_FALSE
+SESSION_TRACKING_CK_TRUE
+SYSTEMD_LIBS
+SYSTEMD_CFLAGS
HAVE_SYSTEMD_FALSE
HAVE_SYSTEMD_TRUE
systemdsystemunitdir
UDEV_BASE_DIR
WITH_QT_FALSE
WITH_QT_TRUE
+MOC
QT_LIBS
QT_CFLAGS
HAVE_INTROSPECTION_FALSE
@@ -713,6 +726,8 @@ PKG_CONFIG_PATH
PKG_CONFIG
LIBDL
LIBM
+WITH_WEXT_FALSE
+WITH_WEXT_TRUE
TARGET_EXHERBO_FALSE
TARGET_EXHERBO_TRUE
TARGET_LINEXA_FALSE
@@ -737,6 +752,8 @@ TARGET_SUSE_FALSE
TARGET_SUSE_TRUE
TARGET_REDHAT_FALSE
TARGET_REDHAT_TRUE
+TARGET_GENERIC_FALSE
+TARGET_GENERIC_TRUE
WITH_DOCS_FALSE
WITH_DOCS_TRUE
GETTEXT_PACKAGE
@@ -927,11 +944,12 @@ with_libintl_prefix
with_docs
with_distro
with_dist_version
+with_wext
enable_introspection
enable_qt
with_udev_dir
with_systemdsystemunitdir
-with_ck
+with_session_tracking
enable_wimax
enable_polkit
with_crypto
@@ -945,6 +963,7 @@ with_iptables
with_system_ca_path
with_kernel_firmware_dir
enable_crashtrace
+enable_concheck
enable_more_warnings
with_html_dir
enable_gtk_doc
@@ -980,10 +999,14 @@ GIO_CFLAGS
GIO_LIBS
QT_CFLAGS
QT_LIBS
+SYSTEMD_CFLAGS
+SYSTEMD_LIBS
LIBNL3_CFLAGS
LIBNL3_LIBS
LIBNL_ROUTE3_CFLAGS
LIBNL_ROUTE3_LIBS
+LIBNL_GENL3_CFLAGS
+LIBNL_GENL3_LIBS
LIBNL2_CFLAGS
LIBNL2_LIBS
LIBNL1_CFLAGS
@@ -998,6 +1021,8 @@ NSS_CFLAGS
NSS_LIBS
GNUTLS_CFLAGS
GNUTLS_LIBS
+LIBSOUP_CFLAGS
+LIBSOUP_LIBS
GTKDOC_DEPS_CFLAGS
GTKDOC_DEPS_LIBS'
@@ -1542,7 +1567,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures NetworkManager 0.9.2.0 to adapt to many kinds of systems.
+\`configure' configures NetworkManager 0.9.4.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1612,7 +1637,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of NetworkManager 0.9.2.0:";;
+ short | recursive ) echo "Configuration of NetworkManager 0.9.4.0:";;
esac
cat <<\_ACEOF
@@ -1640,7 +1665,8 @@ Optional Features:
--enable-polkit enable PolicyKit support
--enable-ppp enable PPP/PPPoE support
--disable-crashtrace Disable GNU backtrace extensions
- --enable-more-warnings Maximum compiler warnings
+ --enable-concheck enable connectivity checking support
+ --enable-more-warnings Possible values: no/yes/error
--enable-gtk-doc use gtk-doc to build documentation [[default=no]]
--enable-gtk-doc-html build documentation in html format [[default=yes]]
--enable-gtk-doc-pdf build documentation in pdf format [[default=no]]
@@ -1664,11 +1690,13 @@ Optional Packages:
paldo, mandriva, pardus, linexa or exherbo
--with-dist-version=
Define the NM's distribution version string
+ --with-wext=yes Enable or disable Linux Wireless Extensions
--with-udev-dir=DIR where the udev base directory is
--with-systemdsystemunitdir=DIR
Directory for systemd service files
- --without-ck Build NetworkManager without ConsoleKit session
- tracking support
+ --with-session-tracking=systemd
+ Build NetworkManager with specific session tracking
+ support
--with-crypto=nss | gnutls
Cryptography library to use for certificate and key
operations
@@ -1723,6 +1751,10 @@ Some influential environment variables:
GIO_LIBS linker flags for GIO, overriding pkg-config
QT_CFLAGS C compiler flags for QT, overriding pkg-config
QT_LIBS linker flags for QT, overriding pkg-config
+ SYSTEMD_CFLAGS
+ C compiler flags for SYSTEMD, overriding pkg-config
+ SYSTEMD_LIBS
+ linker flags for SYSTEMD, overriding pkg-config
LIBNL3_CFLAGS
C compiler flags for LIBNL3, overriding pkg-config
LIBNL3_LIBS linker flags for LIBNL3, overriding pkg-config
@@ -1730,6 +1762,10 @@ Some influential environment variables:
C compiler flags for LIBNL_ROUTE3, overriding pkg-config
LIBNL_ROUTE3_LIBS
linker flags for LIBNL_ROUTE3, overriding pkg-config
+ LIBNL_GENL3_CFLAGS
+ C compiler flags for LIBNL_GENL3, overriding pkg-config
+ LIBNL_GENL3_LIBS
+ linker flags for LIBNL_GENL3, overriding pkg-config
LIBNL2_CFLAGS
C compiler flags for LIBNL2, overriding pkg-config
LIBNL2_LIBS linker flags for LIBNL2, overriding pkg-config
@@ -1750,6 +1786,10 @@ Some influential environment variables:
GNUTLS_CFLAGS
C compiler flags for GNUTLS, overriding pkg-config
GNUTLS_LIBS linker flags for GNUTLS, overriding pkg-config
+ LIBSOUP_CFLAGS
+ C compiler flags for LIBSOUP, overriding pkg-config
+ LIBSOUP_LIBS
+ linker flags for LIBSOUP, overriding pkg-config
GTKDOC_DEPS_CFLAGS
C compiler flags for GTKDOC_DEPS, overriding pkg-config
GTKDOC_DEPS_LIBS
@@ -1821,7 +1861,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-NetworkManager configure 0.9.2.0
+NetworkManager configure 0.9.4.0
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2365,7 +2405,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by NetworkManager $as_me 0.9.2.0, which was
+It was created by NetworkManager $as_me 0.9.4.0, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
@@ -3186,7 +3226,7 @@ fi
# Define the identity of the package.
PACKAGE='NetworkManager'
- VERSION='0.9.2.0'
+ VERSION='0.9.4.0'
cat >>confdefs.h <<_ACEOF
@@ -16313,8 +16353,8 @@ fi
NM_MAJOR_VERSION=0
NM_MINOR_VERSION=9
-NM_MICRO_VERSION=2
-NM_VERSION=0.9.2.0
+NM_MICRO_VERSION=4
+NM_VERSION=0.9.4.0
@@ -19573,12 +19613,26 @@ if test "z$with_distro" = "z"; then
exit 1
else
case $with_distro in
- redhat|suse|gentoo|debian|slackware|arch|paldo|frugalware|mandriva|pardus|linexa|exherbo) ;;
+ redhat|suse|gentoo|debian|slackware|arch|paldo|frugalware|mandriva|pardus|linexa|exherbo|generic) ;;
*)
echo "Your distribution (${with_distro}) is not yet supported! (patches welcome)"
exit 1
;;
esac
+fi
+
+ if test x"$with_distro" = xgeneric; then
+ TARGET_GENERIC_TRUE=
+ TARGET_GENERIC_FALSE='#'
+else
+ TARGET_GENERIC_TRUE='#'
+ TARGET_GENERIC_FALSE=
+fi
+
+if test x"$with_distro" = xgeneric; then
+
+$as_echo "#define TARGET_GENERIC 1" >>confdefs.h
+
fi
if test x"$with_distro" = xredhat; then
@@ -19765,8 +19819,66 @@ _ACEOF
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Linux Wireless Extensions >= 18" >&5
-$as_echo_n "checking Linux Wireless Extensions >= 18... " >&6; }
+
+# Check whether --with-wext was given.
+if test "${with_wext+set}" = set; then :
+ withval=$with_wext; ac_with_wext=$withval
+else
+ ac_with_wext="yes"
+fi
+
+if test x"$ac_with_wext" = x"yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Linux kernel WEXT headers" >&5
+$as_echo_n "checking Linux kernel WEXT headers... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __user
+ #define __user
+ #endif
+ #include
+ #include
+ #include
+ #include
+int
+main ()
+{
+#ifndef IWEVGENIE
+ #error "not found"
+ #endif
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_have_iwevgenie=yes
+else
+ ac_have_iwevgenie=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_have_iwevgenie" >&5
+$as_echo "$ac_have_iwevgenie" >&6; }
+ if test "$ac_have_iwevgenie" = no; then
+ as_fn_error $? "Linux kernel development header linux/wireless.h not installed or not functional" "$LINENO" 5
+ fi
+
+$as_echo "#define HAVE_WEXT 1" >>confdefs.h
+
+else
+
+$as_echo "#define HAVE_WEXT 0" >>confdefs.h
+
+fi
+ if test x"${ac_with_wext}" = x"yes"; then
+ WITH_WEXT_TRUE=
+ WITH_WEXT_FALSE='#'
+else
+ WITH_WEXT_TRUE='#'
+ WITH_WEXT_FALSE=
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Linux kernel nl80211 headers" >&5
+$as_echo_n "checking Linux kernel nl80211 headers... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifndef __user
@@ -19775,28 +19887,61 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#include
#include
#include
- #include
- #include
+ #include
int
main ()
{
-#ifndef IWEVGENIE
- #error "not found"
+int a = NL80211_RATE_INFO_BITRATE;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_have_nl80211=yes
+else
+ ac_have_nl80211=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_have_nl80211" >&5
+$as_echo "$ac_have_nl80211" >&6; }
+if test "$ac_have_nl80211" = no; then
+ as_fn_error $? "Linux kernel development header linux/nl80211.h not installed or not functional" "$LINENO" 5
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Linux kernel VLAN_FLAG_LOOSE_BINDING enum value" >&5
+$as_echo_n "checking Linux kernel VLAN_FLAG_LOOSE_BINDING enum value... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __user
+ #define __user
#endif
+ #include
+ #include
+ #include
+int
+main ()
+{
+unsigned int a = VLAN_FLAG_LOOSE_BINDING;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- ac_have_iwevgenie=yes
+ ac_have_vlan_flag_loose_binding=yes
else
- ac_have_iwevgenie=no
+ ac_have_vlan_flag_loose_binding=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_have_iwevgenie" >&5
-$as_echo "$ac_have_iwevgenie" >&6; }
-if test "$ac_have_iwevgenie" = no; then
- as_fn_error $? "wireless-tools or libiw development headers >= 28pre9 not installed or not functional" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_have_vlan_flag_loose_binding" >&5
+$as_echo "$ac_have_vlan_flag_loose_binding" >&6; }
+if test "$ac_have_vlan_flag_loose_binding" = yes; then
+
+$as_echo "#define HAVE_VLAN_FLAG_LOOSE_BINDING 1" >>confdefs.h
+
+else
+
+$as_echo "#define HAVE_VLAN_FLAG_LOOSE_BINDING 0" >>confdefs.h
+
fi
LIBM=
@@ -20790,6 +20935,51 @@ if (test "${enable_qt}" = "yes"); then
fi
+ # Check for moc-qt4 and if not found then moc
+ QT4_BINDIR=`$PKG_CONFIG Qt --variable bindir`
+ for ac_prog in moc-qt4 moc
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_MOC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$MOC"; then
+ ac_cv_prog_MOC="$MOC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_dummy="$QT4_BINDIR:$PATH"
+for as_dir in $as_dummy
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_MOC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+MOC=$ac_cv_prog_MOC
+if test -n "$MOC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOC" >&5
+$as_echo "$MOC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$MOC" && break
+done
+
fi
if test "${enable_qt}" = "yes"; then
WITH_QT_TRUE=
@@ -20814,7 +21004,7 @@ else
fi
-# systemd
+# systemd unit support
# Check whether --with-systemdsystemunitdir was given.
if test "${with_systemdsystemunitdir+set}" = set; then :
@@ -20837,29 +21027,133 @@ fi
-# Check whether --with-ck was given.
-if test "${with_ck+set}" = set; then :
- withval=$with_ck;
+# Check whether --with-session-tracking was given.
+if test "${with_session_tracking+set}" = set; then :
+ withval=$with_session_tracking;
fi
- if test x"$with_ck" != xno; then
- WITH_CONSOLEKIT_TRUE=
- WITH_CONSOLEKIT_FALSE='#'
+if test "z$with_session_tracking" = "z"; then
+ # Default to ConsoleKit session tracking like we used before
+ with_session_tracking=ck
+fi
+
+case $with_session_tracking in
+ ck|none) ;;
+ systemd)
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD" >&5
+$as_echo_n "checking for SYSTEMD... " >&6; }
+
+if test -n "$SYSTEMD_CFLAGS"; then
+ pkg_cv_SYSTEMD_CFLAGS="$SYSTEMD_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libsystemd-login") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_SYSTEMD_CFLAGS=`$PKG_CONFIG --cflags "libsystemd-login" 2>/dev/null`
else
- WITH_CONSOLEKIT_TRUE='#'
- WITH_CONSOLEKIT_FALSE=
+ pkg_failed=yes
fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$SYSTEMD_LIBS"; then
+ pkg_cv_SYSTEMD_LIBS="$SYSTEMD_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libsystemd-login") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_SYSTEMD_LIBS=`$PKG_CONFIG --libs "libsystemd-login" 2>/dev/null`
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
-no_ck=0
-if test x"$with_ck" = x"no"; then
- no_ck="1"
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
else
- with_ck="yes"
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libsystemd-login" 2>&1`
+ else
+ SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --print-errors "libsystemd-login" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$SYSTEMD_PKG_ERRORS" >&5
+
+ as_fn_error $? "Package requirements (libsystemd-login) were not met:
+
+$SYSTEMD_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables SYSTEMD_CFLAGS
+and SYSTEMD_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables SYSTEMD_CFLAGS
+and SYSTEMD_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see .
+See \`config.log' for more details" "$LINENO" 5; }
+
+else
+ SYSTEMD_CFLAGS=$pkg_cv_SYSTEMD_CFLAGS
+ SYSTEMD_LIBS=$pkg_cv_SYSTEMD_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+ ;;
+ *)
+ as_fn_error $? "--with-session-tracking must be one of none, ck, systemd" "$LINENO" 5
+ ;;
+esac
+
+
+ if test "x$with_session_tracking" = "xck"; then
+ SESSION_TRACKING_CK_TRUE=
+ SESSION_TRACKING_CK_FALSE='#'
+else
+ SESSION_TRACKING_CK_TRUE='#'
+ SESSION_TRACKING_CK_FALSE=
+fi
+
+ if test "x$with_session_tracking" = "xsystemd"; then
+ SESSION_TRACKING_SYSTEMD_TRUE=
+ SESSION_TRACKING_SYSTEMD_FALSE='#'
+else
+ SESSION_TRACKING_SYSTEMD_TRUE='#'
+ SESSION_TRACKING_SYSTEMD_FALSE=
fi
-cat >>confdefs.h <<_ACEOF
-#define NO_CONSOLEKIT $no_ck
-_ACEOF
have_libnl="no"
@@ -21001,12 +21295,81 @@ else
$as_echo "yes" >&6; }
have_libnl_route3=yes
fi
-if (test "${have_libnl3}" = "yes" -a "${have_libnl_route3}" = "yes"); then
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBNL_GENL3" >&5
+$as_echo_n "checking for LIBNL_GENL3... " >&6; }
+
+if test -n "$LIBNL_GENL3_CFLAGS"; then
+ pkg_cv_LIBNL_GENL3_CFLAGS="$LIBNL_GENL3_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnl-genl-3.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libnl-genl-3.0") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBNL_GENL3_CFLAGS=`$PKG_CONFIG --cflags "libnl-genl-3.0" 2>/dev/null`
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LIBNL_GENL3_LIBS"; then
+ pkg_cv_LIBNL_GENL3_LIBS="$LIBNL_GENL3_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnl-genl-3.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libnl-genl-3.0") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBNL_GENL3_LIBS=`$PKG_CONFIG --libs "libnl-genl-3.0" 2>/dev/null`
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LIBNL_GENL3_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libnl-genl-3.0" 2>&1`
+ else
+ LIBNL_GENL3_PKG_ERRORS=`$PKG_CONFIG --print-errors "libnl-genl-3.0" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LIBNL_GENL3_PKG_ERRORS" >&5
+
+ have_libnl_genl3=no
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ have_libnl_genl3=no
+else
+ LIBNL_GENL3_CFLAGS=$pkg_cv_LIBNL_GENL3_CFLAGS
+ LIBNL_GENL3_LIBS=$pkg_cv_LIBNL_GENL3_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ have_libnl_genl3=yes
+fi
+if (test "${have_libnl3}" = "yes" -a "${have_libnl_route3}" = "yes" -a "${have_libnl_genl3}" = "yes"); then
$as_echo "#define HAVE_LIBNL3 1" >>confdefs.h
- LIBNL_CFLAGS="$LIBNL3_CFLAGS $LIBNL_ROUTE3_CFLAGS"
- LIBNL_LIBS="$LIBNL3_LIBS $LIBNL_ROUTE3_LIBS"
+ LIBNL_CFLAGS="$LIBNL3_CFLAGS $LIBNL_ROUTE3_CFLAGS $LIBNL_GENL3_CFLAGS"
+ LIBNL_LIBS="$LIBNL3_LIBS $LIBNL_ROUTE3_LIBS $LIBNL_GENL3_LIBS"
libnl_version="3"
have_libnl="yes"
else
@@ -21893,8 +22256,12 @@ if test x"$ac_nss" = xno -a x"$ac_gnutls" = xno; then
as_fn_error $? "Could not find required development headers and libraries for '$ac_crypto'" "$LINENO" 5
fi
+GLIB_MAKEFILE='$(top_srcdir)/Makefile.glib'
+
GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
+GLIB_MKENUMS='$(top_srcdir)/tools/glib-mkenums'
+
# Check whether --with-dbus-sys-dir was given.
@@ -22225,11 +22592,110 @@ $as_echo "#define ENABLE_CRASHTRACE 1" >>confdefs.h
fi
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBSOUP" >&5
+$as_echo_n "checking for LIBSOUP... " >&6; }
+
+if test -n "$LIBSOUP_CFLAGS"; then
+ pkg_cv_LIBSOUP_CFLAGS="$LIBSOUP_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsoup-2.4 >= 2.26\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libsoup-2.4 >= 2.26") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBSOUP_CFLAGS=`$PKG_CONFIG --cflags "libsoup-2.4 >= 2.26" 2>/dev/null`
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LIBSOUP_LIBS"; then
+ pkg_cv_LIBSOUP_LIBS="$LIBSOUP_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsoup-2.4 >= 2.26\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libsoup-2.4 >= 2.26") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBSOUP_LIBS=`$PKG_CONFIG --libs "libsoup-2.4 >= 2.26" 2>/dev/null`
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LIBSOUP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libsoup-2.4 >= 2.26" 2>&1`
+ else
+ LIBSOUP_PKG_ERRORS=`$PKG_CONFIG --print-errors "libsoup-2.4 >= 2.26" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LIBSOUP_PKG_ERRORS" >&5
+
+ have_libsoup=no
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ have_libsoup=no
+else
+ LIBSOUP_CFLAGS=$pkg_cv_LIBSOUP_CFLAGS
+ LIBSOUP_LIBS=$pkg_cv_LIBSOUP_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ have_libsoup=yes
+fi
+# Check whether --enable-concheck was given.
+if test "${enable_concheck+set}" = set; then :
+ enableval=$enable_concheck; enable_concheck=${enableval}
+else
+ enable_concheck=${have_libsoup}
+fi
+
+if (test "${enable_concheck}" = "yes"); then
+ if test x"$have_concheck" = x"no"; then
+ as_fn_error $? "Connectivity checking requires libsoup development headers" "$LINENO" 5
+ fi
+
+
+
+$as_echo "#define WITH_CONCHECK 1" >>confdefs.h
+
+else
+
+$as_echo "#define WITH_CONCHECK 0" >>confdefs.h
+
+fi
+ if test "${enable_concheck}" = "yes"; then
+ WITH_CONCHECK_TRUE=
+ WITH_CONCHECK_FALSE='#'
+else
+ WITH_CONCHECK_TRUE='#'
+ WITH_CONCHECK_FALSE=
+fi
+
+
# Check whether --enable-more-warnings was given.
if test "${enable_more_warnings+set}" = set; then :
enableval=$enable_more_warnings; set_more_warnings="$enableval"
else
- set_more_warnings=yes
+ set_more_warnings=error
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for more warnings" >&5
@@ -22274,7 +22740,9 @@ $as_echo "$has_option" >&6; }
unset SAVE_CFLAGS
done
unset option
- CFLAGS="$CFLAGS -Werror"
+ if test "x$set_more_warnings" = xerror; then
+ CFLAGS="$CFLAGS -Werror"
+ fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
@@ -22627,7 +23095,7 @@ case $with_tests in
esac
-ac_config_files="$ac_config_files Makefile include/Makefile include/nm-version.h src/Makefile src/tests/Makefile marshallers/Makefile src/logging/Makefile src/dns-manager/Makefile src/vpn-manager/Makefile src/dhcp-manager/Makefile src/dhcp-manager/tests/Makefile src/ip6-manager/Makefile src/supplicant-manager/Makefile src/supplicant-manager/tests/Makefile src/ppp-manager/Makefile src/dnsmasq-manager/Makefile src/modem-manager/Makefile src/bluez-manager/Makefile src/settings/Makefile src/settings/plugins/Makefile src/settings/plugins/ifupdown/Makefile src/settings/plugins/ifupdown/tests/Makefile src/settings/plugins/ifnet/Makefile src/settings/plugins/ifnet/tests/Makefile src/settings/plugins/ifcfg-rh/Makefile src/settings/plugins/ifcfg-rh/tests/Makefile src/settings/plugins/ifcfg-rh/tests/network-scripts/Makefile src/settings/plugins/ifcfg-suse/Makefile src/settings/plugins/keyfile/Makefile src/settings/plugins/keyfile/tests/Makefile src/settings/plugins/keyfile/tests/keyfiles/Makefile src/settings/tests/Makefile src/wimax/Makefile src/backends/Makefile libnm-util/libnm-util.pc libnm-util/Makefile libnm-util/tests/Makefile libnm-util/tests/certs/Makefile libnm-glib/libnm-glib.pc libnm-glib/libnm-glib-vpn.pc libnm-glib/Makefile libnm-glib/tests/Makefile callouts/Makefile callouts/tests/Makefile tools/Makefile cli/Makefile cli/src/Makefile test/Makefile initscript/Makefile initscript/RedHat/Makefile initscript/RedHat/NetworkManager initscript/Gentoo/Makefile initscript/Gentoo/NetworkManager initscript/Debian/Makefile initscript/Debian/NetworkManager initscript/Slackware/Makefile initscript/Slackware/rc.networkmanager initscript/SUSE/Makefile initscript/SUSE/networkmanager initscript/Arch/Makefile initscript/Arch/networkmanager initscript/paldo/Makefile initscript/paldo/NetworkManager initscript/Mandriva/Makefile initscript/Mandriva/networkmanager initscript/linexa/Makefile initscript/linexa/networkmanager introspection/Makefile introspection/all.xml man/Makefile man/NetworkManager.8 man/NetworkManager.conf.5 man/nm-system-settings.conf.5 man/nm-tool.1 man/nm-online.1 man/nmcli.1 po/Makefile.in policy/Makefile data/Makefile docs/Makefile docs/api/Makefile docs/api/version.xml docs/libnm-glib/Makefile docs/libnm-util/Makefile NetworkManager.pc examples/Makefile examples/python/Makefile examples/C/Makefile examples/C/glib/Makefile examples/C/qt/Makefile"
+ac_config_files="$ac_config_files Makefile include/Makefile include/nm-version.h src/Makefile src/tests/Makefile src/generated/Makefile src/logging/Makefile src/dns-manager/Makefile src/vpn-manager/Makefile src/dhcp-manager/Makefile src/dhcp-manager/tests/Makefile src/ip6-manager/Makefile src/supplicant-manager/Makefile src/supplicant-manager/tests/Makefile src/ppp-manager/Makefile src/dnsmasq-manager/Makefile src/modem-manager/Makefile src/bluez-manager/Makefile src/wifi/Makefile src/firewall-manager/Makefile src/settings/Makefile src/settings/plugins/Makefile src/settings/plugins/ifupdown/Makefile src/settings/plugins/ifupdown/tests/Makefile src/settings/plugins/ifnet/Makefile src/settings/plugins/ifnet/tests/Makefile src/settings/plugins/ifcfg-rh/Makefile src/settings/plugins/ifcfg-rh/tests/Makefile src/settings/plugins/ifcfg-rh/tests/network-scripts/Makefile src/settings/plugins/ifcfg-suse/Makefile src/settings/plugins/keyfile/Makefile src/settings/plugins/keyfile/tests/Makefile src/settings/plugins/keyfile/tests/keyfiles/Makefile src/settings/tests/Makefile src/wimax/Makefile src/backends/Makefile libnm-util/libnm-util.pc libnm-util/Makefile libnm-util/tests/Makefile libnm-util/tests/certs/Makefile libnm-glib/libnm-glib.pc libnm-glib/libnm-glib-vpn.pc libnm-glib/Makefile libnm-glib/tests/Makefile callouts/Makefile callouts/tests/Makefile tools/Makefile cli/Makefile cli/src/Makefile test/Makefile initscript/Makefile initscript/RedHat/Makefile initscript/RedHat/NetworkManager initscript/Gentoo/Makefile initscript/Gentoo/NetworkManager initscript/Debian/Makefile initscript/Debian/NetworkManager initscript/Slackware/Makefile initscript/Slackware/rc.networkmanager initscript/SUSE/Makefile initscript/SUSE/networkmanager initscript/Arch/Makefile initscript/Arch/networkmanager initscript/paldo/Makefile initscript/paldo/NetworkManager initscript/Mandriva/Makefile initscript/Mandriva/networkmanager initscript/linexa/Makefile initscript/linexa/networkmanager introspection/Makefile introspection/all.xml man/Makefile man/NetworkManager.8 man/NetworkManager.conf.5 man/nm-system-settings.conf.5 man/nm-tool.1 man/nm-online.1 man/nmcli.1 po/Makefile.in policy/Makefile data/Makefile docs/Makefile docs/api/Makefile docs/api/version.xml docs/libnm-glib/Makefile docs/libnm-util/Makefile NetworkManager.pc examples/Makefile examples/shell/Makefile examples/python/Makefile examples/ruby/Makefile examples/C/Makefile examples/C/glib/Makefile examples/C/qt/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -22775,6 +23243,10 @@ if test -z "${WITH_DOCS_TRUE}" && test -z "${WITH_DOCS_FALSE}"; then
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${TARGET_GENERIC_TRUE}" && test -z "${TARGET_GENERIC_FALSE}"; then
+ as_fn_error $? "conditional \"TARGET_GENERIC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${TARGET_REDHAT_TRUE}" && test -z "${TARGET_REDHAT_FALSE}"; then
as_fn_error $? "conditional \"TARGET_REDHAT\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -22823,6 +23295,10 @@ if test -z "${TARGET_EXHERBO_TRUE}" && test -z "${TARGET_EXHERBO_FALSE}"; then
as_fn_error $? "conditional \"TARGET_EXHERBO\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${WITH_WEXT_TRUE}" && test -z "${WITH_WEXT_FALSE}"; then
+ as_fn_error $? "conditional \"WITH_WEXT\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${HAVE_INTROSPECTION_TRUE}" && test -z "${HAVE_INTROSPECTION_FALSE}"; then
as_fn_error $? "conditional \"HAVE_INTROSPECTION\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -22835,8 +23311,12 @@ if test -z "${HAVE_SYSTEMD_TRUE}" && test -z "${HAVE_SYSTEMD_FALSE}"; then
as_fn_error $? "conditional \"HAVE_SYSTEMD\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
-if test -z "${WITH_CONSOLEKIT_TRUE}" && test -z "${WITH_CONSOLEKIT_FALSE}"; then
- as_fn_error $? "conditional \"WITH_CONSOLEKIT\" was never defined.
+if test -z "${SESSION_TRACKING_CK_TRUE}" && test -z "${SESSION_TRACKING_CK_FALSE}"; then
+ as_fn_error $? "conditional \"SESSION_TRACKING_CK\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${SESSION_TRACKING_SYSTEMD_TRUE}" && test -z "${SESSION_TRACKING_SYSTEMD_FALSE}"; then
+ as_fn_error $? "conditional \"SESSION_TRACKING_SYSTEMD\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${WITH_WIMAX_TRUE}" && test -z "${WITH_WIMAX_FALSE}"; then
@@ -22859,6 +23339,10 @@ if test -z "${WITH_PPP_TRUE}" && test -z "${WITH_PPP_FALSE}"; then
as_fn_error $? "conditional \"WITH_PPP\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${WITH_CONCHECK_TRUE}" && test -z "${WITH_CONCHECK_FALSE}"; then
+ as_fn_error $? "conditional \"WITH_CONCHECK\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${ENABLE_GTK_DOC_TRUE}" && test -z "${ENABLE_GTK_DOC_FALSE}"; then
as_fn_error $? "conditional \"ENABLE_GTK_DOC\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -23292,7 +23776,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by NetworkManager $as_me 0.9.2.0, which was
+This file was extended by NetworkManager $as_me 0.9.4.0, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -23358,7 +23842,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-NetworkManager config.status 0.9.2.0
+NetworkManager config.status 0.9.4.0
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
@@ -23880,7 +24364,7 @@ do
"include/nm-version.h") CONFIG_FILES="$CONFIG_FILES include/nm-version.h" ;;
"src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
"src/tests/Makefile") CONFIG_FILES="$CONFIG_FILES src/tests/Makefile" ;;
- "marshallers/Makefile") CONFIG_FILES="$CONFIG_FILES marshallers/Makefile" ;;
+ "src/generated/Makefile") CONFIG_FILES="$CONFIG_FILES src/generated/Makefile" ;;
"src/logging/Makefile") CONFIG_FILES="$CONFIG_FILES src/logging/Makefile" ;;
"src/dns-manager/Makefile") CONFIG_FILES="$CONFIG_FILES src/dns-manager/Makefile" ;;
"src/vpn-manager/Makefile") CONFIG_FILES="$CONFIG_FILES src/vpn-manager/Makefile" ;;
@@ -23893,6 +24377,8 @@ do
"src/dnsmasq-manager/Makefile") CONFIG_FILES="$CONFIG_FILES src/dnsmasq-manager/Makefile" ;;
"src/modem-manager/Makefile") CONFIG_FILES="$CONFIG_FILES src/modem-manager/Makefile" ;;
"src/bluez-manager/Makefile") CONFIG_FILES="$CONFIG_FILES src/bluez-manager/Makefile" ;;
+ "src/wifi/Makefile") CONFIG_FILES="$CONFIG_FILES src/wifi/Makefile" ;;
+ "src/firewall-manager/Makefile") CONFIG_FILES="$CONFIG_FILES src/firewall-manager/Makefile" ;;
"src/settings/Makefile") CONFIG_FILES="$CONFIG_FILES src/settings/Makefile" ;;
"src/settings/plugins/Makefile") CONFIG_FILES="$CONFIG_FILES src/settings/plugins/Makefile" ;;
"src/settings/plugins/ifupdown/Makefile") CONFIG_FILES="$CONFIG_FILES src/settings/plugins/ifupdown/Makefile" ;;
@@ -23961,7 +24447,9 @@ do
"docs/libnm-util/Makefile") CONFIG_FILES="$CONFIG_FILES docs/libnm-util/Makefile" ;;
"NetworkManager.pc") CONFIG_FILES="$CONFIG_FILES NetworkManager.pc" ;;
"examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;;
+ "examples/shell/Makefile") CONFIG_FILES="$CONFIG_FILES examples/shell/Makefile" ;;
"examples/python/Makefile") CONFIG_FILES="$CONFIG_FILES examples/python/Makefile" ;;
+ "examples/ruby/Makefile") CONFIG_FILES="$CONFIG_FILES examples/ruby/Makefile" ;;
"examples/C/Makefile") CONFIG_FILES="$CONFIG_FILES examples/C/Makefile" ;;
"examples/C/glib/Makefile") CONFIG_FILES="$CONFIG_FILES examples/C/glib/Makefile" ;;
"examples/C/qt/Makefile") CONFIG_FILES="$CONFIG_FILES examples/C/qt/Makefile" ;;
@@ -25650,9 +26138,9 @@ else
fi
if test -n "${with_systemdsystemunitdir}"; then
- echo systemd support: ${with_systemdsystemunitdir}
+ echo systemd unit support: ${with_systemdsystemunitdir}
else
- echo systemd support: no
+ echo systemd unit support: no
fi
if test "${enable_polkit}" = "yes"; then
@@ -25661,11 +26149,7 @@ else
echo PolicyKit support: no
fi
-if test -n "${with_ck}"; then
- echo ConsoleKit support: ${with_ck}
-else
- echo ConsoleKit support: no
-fi
+ echo Session tracking: ${with_session_tracking}
if test "${enable_wimax}" = "yes"; then
echo WiMAX support: yes
@@ -25679,6 +26163,12 @@ else
echo PPP support: no
fi
+if test "${enable_concheck}" = "yes"; then
+ echo Connectivity checking support: yes
+else
+ echo Connectivity checking support: no
+fi
+
echo libnl version: ${libnl_version}
echo
diff --git a/configure.ac b/configure.ac
index 1822f84f..ed66b3d8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@ AC_PREREQ([2.63])
dnl The NM version number
m4_define([nm_major_version], [0])
m4_define([nm_minor_version], [9])
-m4_define([nm_micro_version], [2])
+m4_define([nm_micro_version], [4])
m4_define([nm_nano_version], [0])
m4_define([nm_version],
[nm_major_version.nm_minor_version.nm_micro_version.nm_nano_version])
@@ -132,7 +132,7 @@ if test "z$with_distro" = "z"; then
exit 1
else
case $with_distro in
- redhat|suse|gentoo|debian|slackware|arch|paldo|frugalware|mandriva|pardus|linexa|exherbo) ;;
+ redhat|suse|gentoo|debian|slackware|arch|paldo|frugalware|mandriva|pardus|linexa|exherbo|generic) ;;
*)
echo "Your distribution (${with_distro}) is not yet supported! (patches welcome)"
exit 1
@@ -140,6 +140,11 @@ else
esac
fi
+AM_CONDITIONAL(TARGET_GENERIC, test x"$with_distro" = xgeneric)
+if test x"$with_distro" = xgeneric; then
+ AC_DEFINE(TARGET_GENERIC, 1, [Define for a general unknown Linux system])
+fi
+
AM_CONDITIONAL(TARGET_REDHAT, test x"$with_distro" = xredhat)
if test x"$with_distro" = xredhat; then
AC_DEFINE(TARGET_REDHAT, 1, [Define if you have Fedora or RHEL])
@@ -208,7 +213,37 @@ if ! test x"$ac_distver" = x""; then
AC_DEFINE_UNQUOTED(NM_DIST_VERSION, "$ac_distver", [Define the distribution version string])
fi
-AC_MSG_CHECKING([Linux Wireless Extensions >= 18])
+dnl
+dnl Default to using WEXT but allow it to be disabled
+dnl
+AC_ARG_WITH(wext, AS_HELP_STRING([--with-wext=yes], [Enable or disable Linux Wireless Extensions]), ac_with_wext=$withval, ac_with_wext="yes")
+if test x"$ac_with_wext" = x"yes"; then
+ AC_MSG_CHECKING([Linux kernel WEXT headers])
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#ifndef __user
+ #define __user
+ #endif
+ #include
+ #include
+ #include
+ #include ]],
+ [[#ifndef IWEVGENIE
+ #error "not found"
+ #endif]])],
+ [ac_have_iwevgenie=yes],
+ [ac_have_iwevgenie=no])
+ AC_MSG_RESULT($ac_have_iwevgenie)
+ if test "$ac_have_iwevgenie" = no; then
+ AC_MSG_ERROR(Linux kernel development header linux/wireless.h not installed or not functional)
+ fi
+ AC_DEFINE(HAVE_WEXT, 1, [Define if you have Linux Wireless Extensions support])
+else
+ AC_DEFINE(HAVE_WEXT, 0, [Define if you have Linux Wireless Extensions support])
+fi
+AM_CONDITIONAL(WITH_WEXT, test x"${ac_with_wext}" = x"yes")
+
+AC_MSG_CHECKING([Linux kernel nl80211 headers])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#ifndef __user
@@ -217,16 +252,35 @@ AC_COMPILE_IFELSE(
#include
#include
#include
- #include
- #include ]],
- [[#ifndef IWEVGENIE
- #error "not found"
- #endif]])],
- [ac_have_iwevgenie=yes],
- [ac_have_iwevgenie=no])
-AC_MSG_RESULT($ac_have_iwevgenie)
-if test "$ac_have_iwevgenie" = no; then
- AC_MSG_ERROR(wireless-tools or libiw development headers >= 28pre9 not installed or not functional)
+ #include ]],
+ [[int a = NL80211_RATE_INFO_BITRATE;]])],
+ [ac_have_nl80211=yes],
+ [ac_have_nl80211=no])
+AC_MSG_RESULT($ac_have_nl80211)
+if test "$ac_have_nl80211" = no; then
+ AC_MSG_ERROR(Linux kernel development header linux/nl80211.h not installed or not functional)
+fi
+
+dnl
+dnl Default to using WEXT but allow it to be disabled
+dnl
+AC_MSG_CHECKING([Linux kernel VLAN_FLAG_LOOSE_BINDING enum value])
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#ifndef __user
+ #define __user
+ #endif
+ #include
+ #include
+ #include ]],
+ [[unsigned int a = VLAN_FLAG_LOOSE_BINDING;]])],
+ [ac_have_vlan_flag_loose_binding=yes],
+ [ac_have_vlan_flag_loose_binding=no])
+AC_MSG_RESULT($ac_have_vlan_flag_loose_binding)
+if test "$ac_have_vlan_flag_loose_binding" = yes; then
+ AC_DEFINE(HAVE_VLAN_FLAG_LOOSE_BINDING, 1, [Define if you have VLAN_FLAG_LOOSE_BINDING])
+else
+ AC_DEFINE(HAVE_VLAN_FLAG_LOOSE_BINDING, 0, [Define if you have VLAN_FLAG_LOOSE_BINDING])
fi
dnl
@@ -278,6 +332,9 @@ if (test "${enable_qt}" = "yes"); then
fi
AC_SUBST(QT_CFLAGS)
AC_SUBST(QT_LIBS)
+ # Check for moc-qt4 and if not found then moc
+ QT4_BINDIR=`$PKG_CONFIG Qt --variable bindir`
+ AC_CHECK_PROGS(MOC, [moc-qt4 moc],, [$QT4_BINDIR:$PATH])
fi
AM_CONDITIONAL(WITH_QT, test "${enable_qt}" = "yes")
@@ -290,7 +347,7 @@ else
fi
AC_SUBST(UDEV_BASE_DIR)
-# systemd
+# systemd unit support
AC_ARG_WITH([systemdsystemunitdir],
AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
[],
@@ -300,26 +357,35 @@ if test "x$with_systemdsystemunitdir" != xno; then
fi
AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
-dnl
-dnl Disable ConsoleKit support
-dnl
-AC_ARG_WITH(ck, AS_HELP_STRING([--without-ck], [Build NetworkManager without ConsoleKit session tracking support]))
-AM_CONDITIONAL(WITH_CONSOLEKIT, test x"$with_ck" != xno)
-no_ck=0
-if test x"$with_ck" = x"no"; then
- no_ck="1"
-else
- with_ck="yes"
+AC_ARG_WITH(session-tracking, AS_HELP_STRING([--with-session-tracking=systemd], [Build NetworkManager with specific session tracking support]))
+if test "z$with_session_tracking" = "z"; then
+ # Default to ConsoleKit session tracking like we used before
+ with_session_tracking=ck
fi
-AC_DEFINE_UNQUOTED(NO_CONSOLEKIT, $no_ck, [Define to disable use of ConsoleKit])
+
+case $with_session_tracking in
+ ck|none) ;;
+ systemd)
+ PKG_CHECK_MODULES(SYSTEMD, [libsystemd-login])
+ ;;
+ *)
+ AC_MSG_ERROR(--with-session-tracking must be one of [none, ck, systemd])
+ ;;
+esac
+AC_SUBST(SYSTEMD_CFLAGS)
+AC_SUBST(SYSTEMD_LIBS)
+AM_CONDITIONAL(SESSION_TRACKING_CK, test "x$with_session_tracking" = "xck")
+AM_CONDITIONAL(SESSION_TRACKING_SYSTEMD, test "x$with_session_tracking" = "xsystemd")
+
have_libnl="no"
PKG_CHECK_MODULES(LIBNL3, libnl-3.0, [have_libnl3=yes], [have_libnl3=no])
PKG_CHECK_MODULES(LIBNL_ROUTE3, libnl-route-3.0, [have_libnl_route3=yes], [have_libnl_route3=no])
-if (test "${have_libnl3}" = "yes" -a "${have_libnl_route3}" = "yes"); then
+PKG_CHECK_MODULES(LIBNL_GENL3, libnl-genl-3.0, [have_libnl_genl3=yes], [have_libnl_genl3=no])
+if (test "${have_libnl3}" = "yes" -a "${have_libnl_route3}" = "yes" -a "${have_libnl_genl3}" = "yes"); then
AC_DEFINE(HAVE_LIBNL3, 1, [Define if you require specific libnl-3 support])
- LIBNL_CFLAGS="$LIBNL3_CFLAGS $LIBNL_ROUTE3_CFLAGS"
- LIBNL_LIBS="$LIBNL3_LIBS $LIBNL_ROUTE3_LIBS"
+ LIBNL_CFLAGS="$LIBNL3_CFLAGS $LIBNL_ROUTE3_CFLAGS $LIBNL_GENL3_CFLAGS"
+ LIBNL_LIBS="$LIBNL3_LIBS $LIBNL_ROUTE3_LIBS $LIBNL_GENL3_LIBS"
libnl_version="3"
have_libnl="yes"
else
@@ -433,8 +499,12 @@ if test x"$ac_nss" = xno -a x"$ac_gnutls" = xno; then
AC_MSG_ERROR([Could not find required development headers and libraries for '$ac_crypto'])
fi
+GLIB_MAKEFILE='$(top_srcdir)/Makefile.glib'
+AC_SUBST(GLIB_MAKEFILE)
GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
AC_SUBST(GLIB_GENMARSHAL)
+GLIB_MKENUMS='$(top_srcdir)/tools/glib-mkenums'
+AC_SUBST(GLIB_MKENUMS)
AC_ARG_WITH(dbus-sys-dir, AS_HELP_STRING([--with-dbus-sys-dir=DIR], [where D-BUS system.d directory is]))
@@ -618,6 +688,21 @@ if test x"$enable_crashtrace" = xyes; then
AC_DEFINE(ENABLE_CRASHTRACE, 1, [Define if you have GNU backtrace extensions])
fi
+PKG_CHECK_MODULES(LIBSOUP, [libsoup-2.4 >= 2.26], [have_libsoup=yes],[have_libsoup=no])
+AC_ARG_ENABLE(concheck, AS_HELP_STRING([--enable-concheck], [enable connectivity checking support]),
+ [enable_concheck=${enableval}], [enable_concheck=${have_libsoup}])
+if (test "${enable_concheck}" = "yes"); then
+ if test x"$have_concheck" = x"no"; then
+ AC_MSG_ERROR(Connectivity checking requires libsoup development headers)
+ fi
+ AC_SUBST(LIBSOUP_CFLAGS)
+ AC_SUBST(LIBSOUP_LIBS)
+ AC_DEFINE(WITH_CONCHECK, 1, [Define if you want connectivity checking support])
+else
+ AC_DEFINE(WITH_CONCHECK, 0, [Define if you want connectivity checking support])
+fi
+AM_CONDITIONAL(WITH_CONCHECK, test "${enable_concheck}" = "yes")
+
NM_COMPILER_WARNINGS
GTK_DOC_CHECK(1.0)
@@ -643,7 +728,7 @@ include/Makefile
include/nm-version.h
src/Makefile
src/tests/Makefile
-marshallers/Makefile
+src/generated/Makefile
src/logging/Makefile
src/dns-manager/Makefile
src/vpn-manager/Makefile
@@ -656,6 +741,8 @@ src/ppp-manager/Makefile
src/dnsmasq-manager/Makefile
src/modem-manager/Makefile
src/bluez-manager/Makefile
+src/wifi/Makefile
+src/firewall-manager/Makefile
src/settings/Makefile
src/settings/plugins/Makefile
src/settings/plugins/ifupdown/Makefile
@@ -724,7 +811,9 @@ docs/libnm-glib/Makefile
docs/libnm-util/Makefile
NetworkManager.pc
examples/Makefile
+examples/shell/Makefile
examples/python/Makefile
+examples/ruby/Makefile
examples/C/Makefile
examples/C/glib/Makefile
examples/C/qt/Makefile
@@ -751,9 +840,9 @@ else
fi
if test -n "${with_systemdsystemunitdir}"; then
- echo systemd support: ${with_systemdsystemunitdir}
+ echo systemd unit support: ${with_systemdsystemunitdir}
else
- echo systemd support: no
+ echo systemd unit support: no
fi
if test "${enable_polkit}" = "yes"; then
@@ -762,11 +851,7 @@ else
echo PolicyKit support: no
fi
-if test -n "${with_ck}"; then
- echo ConsoleKit support: ${with_ck}
-else
- echo ConsoleKit support: no
-fi
+ echo Session tracking: ${with_session_tracking}
if test "${enable_wimax}" = "yes"; then
echo WiMAX support: yes
@@ -780,6 +865,12 @@ else
echo PPP support: no
fi
+if test "${enable_concheck}" = "yes"; then
+ echo Connectivity checking support: yes
+else
+ echo Connectivity checking support: no
+fi
+
echo libnl version: ${libnl_version}
echo
diff --git a/data/Makefile.in b/data/Makefile.in
index 73947bd7..44049fad 100644
--- a/data/Makefile.in
+++ b/data/Makefile.in
@@ -132,6 +132,8 @@ GIO_LIBS = @GIO_LIBS@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
GLIB_LIBS = @GLIB_LIBS@
+GLIB_MAKEFILE = @GLIB_MAKEFILE@
+GLIB_MKENUMS = @GLIB_MKENUMS@
GMODULE_CFLAGS = @GMODULE_CFLAGS@
GMODULE_LIBS = @GMODULE_LIBS@
GMSGFMT = @GMSGFMT@
@@ -186,11 +188,15 @@ LIBNL2_LIBS = @LIBNL2_LIBS@
LIBNL3_CFLAGS = @LIBNL3_CFLAGS@
LIBNL3_LIBS = @LIBNL3_LIBS@
LIBNL_CFLAGS = @LIBNL_CFLAGS@
+LIBNL_GENL3_CFLAGS = @LIBNL_GENL3_CFLAGS@
+LIBNL_GENL3_LIBS = @LIBNL_GENL3_LIBS@
LIBNL_LIBS = @LIBNL_LIBS@
LIBNL_ROUTE3_CFLAGS = @LIBNL_ROUTE3_CFLAGS@
LIBNL_ROUTE3_LIBS = @LIBNL_ROUTE3_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
+LIBSOUP_CFLAGS = @LIBSOUP_CFLAGS@
+LIBSOUP_LIBS = @LIBSOUP_LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
@@ -201,6 +207,7 @@ MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+MOC = @MOC@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
@@ -240,6 +247,8 @@ SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
SYSTEM_CA_PATH = @SYSTEM_CA_PATH@
UDEV_BASE_DIR = @UDEV_BASE_DIR@
USE_NLS = @USE_NLS@
diff --git a/data/NetworkManager.service.in b/data/NetworkManager.service.in
index bb169fb4..1198c1ba 100644
--- a/data/NetworkManager.service.in
+++ b/data/NetworkManager.service.in
@@ -8,6 +8,10 @@ Before=network.target
Type=dbus
BusName=org.freedesktop.NetworkManager
ExecStart=@sbindir@/NetworkManager --no-daemon
+# Suppress stderr to eliminate duplicated messages in syslog. NM calls openlog()
+# with LOG_PERROR when run in foreground. But systemd redirects stderr to
+# syslog by default, which results in logging each message twice.
+StandardError=null
[Install]
WantedBy=multi-user.target
diff --git a/docs/Makefile.in b/docs/Makefile.in
index 651d7609..ab5c8c88 100644
--- a/docs/Makefile.in
+++ b/docs/Makefile.in
@@ -147,6 +147,8 @@ GIO_LIBS = @GIO_LIBS@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
GLIB_LIBS = @GLIB_LIBS@
+GLIB_MAKEFILE = @GLIB_MAKEFILE@
+GLIB_MKENUMS = @GLIB_MKENUMS@
GMODULE_CFLAGS = @GMODULE_CFLAGS@
GMODULE_LIBS = @GMODULE_LIBS@
GMSGFMT = @GMSGFMT@
@@ -201,11 +203,15 @@ LIBNL2_LIBS = @LIBNL2_LIBS@
LIBNL3_CFLAGS = @LIBNL3_CFLAGS@
LIBNL3_LIBS = @LIBNL3_LIBS@
LIBNL_CFLAGS = @LIBNL_CFLAGS@
+LIBNL_GENL3_CFLAGS = @LIBNL_GENL3_CFLAGS@
+LIBNL_GENL3_LIBS = @LIBNL_GENL3_LIBS@
LIBNL_LIBS = @LIBNL_LIBS@
LIBNL_ROUTE3_CFLAGS = @LIBNL_ROUTE3_CFLAGS@
LIBNL_ROUTE3_LIBS = @LIBNL_ROUTE3_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
+LIBSOUP_CFLAGS = @LIBSOUP_CFLAGS@
+LIBSOUP_LIBS = @LIBSOUP_LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
@@ -216,6 +222,7 @@ MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+MOC = @MOC@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
@@ -255,6 +262,8 @@ SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
SYSTEM_CA_PATH = @SYSTEM_CA_PATH@
UDEV_BASE_DIR = @UDEV_BASE_DIR@
USE_NLS = @USE_NLS@
diff --git a/docs/api/Makefile.am b/docs/api/Makefile.am
index 276b4aef..e061ec62 100644
--- a/docs/api/Makefile.am
+++ b/docs/api/Makefile.am
@@ -37,7 +37,7 @@ OTHER_FILES= \
GENERATED_FILES = spec.html settings-spec.xml
spec.html: $(XMLS) $(OTHER_FILES) html-build.stamp
- $(XSLTPROC) $(top_srcdir)/tools/doc-generator.xsl $(top_builddir)/introspection/all.xml > $@
+ $(XSLTPROC) --path "$(top_builddir)/introspection:$(top_srcdir)/introspection" $(top_srcdir)/tools/doc-generator.xsl $(top_builddir)/introspection/all.xml > $@
mkdir -p $(builddir)/html/
cp $@ $(builddir)/html/
diff --git a/docs/api/Makefile.in b/docs/api/Makefile.in
index cfb75153..40f1784f 100644
--- a/docs/api/Makefile.in
+++ b/docs/api/Makefile.in
@@ -151,6 +151,8 @@ GIO_LIBS = @GIO_LIBS@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
GLIB_LIBS = @GLIB_LIBS@
+GLIB_MAKEFILE = @GLIB_MAKEFILE@
+GLIB_MKENUMS = @GLIB_MKENUMS@
GMODULE_CFLAGS = @GMODULE_CFLAGS@
GMODULE_LIBS = @GMODULE_LIBS@
GMSGFMT = @GMSGFMT@
@@ -205,11 +207,15 @@ LIBNL2_LIBS = @LIBNL2_LIBS@
LIBNL3_CFLAGS = @LIBNL3_CFLAGS@
LIBNL3_LIBS = @LIBNL3_LIBS@
LIBNL_CFLAGS = @LIBNL_CFLAGS@
+LIBNL_GENL3_CFLAGS = @LIBNL_GENL3_CFLAGS@
+LIBNL_GENL3_LIBS = @LIBNL_GENL3_LIBS@
LIBNL_LIBS = @LIBNL_LIBS@
LIBNL_ROUTE3_CFLAGS = @LIBNL_ROUTE3_CFLAGS@
LIBNL_ROUTE3_LIBS = @LIBNL_ROUTE3_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
+LIBSOUP_CFLAGS = @LIBSOUP_CFLAGS@
+LIBSOUP_LIBS = @LIBSOUP_LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
@@ -220,6 +226,7 @@ MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
+MOC = @MOC@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
@@ -259,6 +266,8 @@ SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
SYSTEM_CA_PATH = @SYSTEM_CA_PATH@
UDEV_BASE_DIR = @UDEV_BASE_DIR@
USE_NLS = @USE_NLS@
@@ -742,7 +751,7 @@ uninstall-am: uninstall-local
@WITH_DOCS_TRUE@spec.html: $(XMLS) $(OTHER_FILES) html-build.stamp
-@WITH_DOCS_TRUE@ $(XSLTPROC) $(top_srcdir)/tools/doc-generator.xsl $(top_builddir)/introspection/all.xml > $@
+@WITH_DOCS_TRUE@ $(XSLTPROC) --path "$(top_builddir)/introspection:$(top_srcdir)/introspection" $(top_srcdir)/tools/doc-generator.xsl $(top_builddir)/introspection/all.xml > $@
@WITH_DOCS_TRUE@ mkdir -p $(builddir)/html/
@WITH_DOCS_TRUE@ cp $@ $(builddir)/html/
diff --git a/docs/api/generate-settings-spec.c b/docs/api/generate-settings-spec.c
index c37615b8..7a540e3b 100644
--- a/docs/api/generate-settings-spec.c
+++ b/docs/api/generate-settings-spec.c
@@ -46,6 +46,9 @@
#include
#include
#include
+#include
+#include
+#include
#include
@@ -54,15 +57,18 @@ typedef NMSetting* (*SettingNewFunc) (void);
static SettingNewFunc funcs[] = {
nm_setting_802_1x_new,
nm_setting_bluetooth_new,
+ nm_setting_bond_new,
nm_setting_cdma_new,
nm_setting_connection_new,
nm_setting_gsm_new,
+ nm_setting_infiniband_new,
nm_setting_ip4_config_new,
nm_setting_ip6_config_new,
nm_setting_olpc_mesh_new,
nm_setting_ppp_new,
nm_setting_pppoe_new,
nm_setting_serial_new,
+ nm_setting_vlan_new,
nm_setting_vpn_new,
nm_setting_wimax_new,
nm_setting_wired_new,
diff --git a/docs/api/html/NetworkManager.devhelp2 b/docs/api/html/NetworkManager.devhelp2
index b611186d..ba5d51b3 100644
--- a/docs/api/html/NetworkManager.devhelp2
+++ b/docs/api/html/NetworkManager.devhelp2
@@ -4,23 +4,23 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/api/html/index.html b/docs/api/html/index.html
index d0f34722..2c9b8d1b 100644
--- a/docs/api/html/index.html
+++ b/docs/api/html/index.html
@@ -22,11 +22,11 @@
<dcbw@redhat.com>
-Version 0.9.2.0
+
Copyright © 2011 The NetworkManager Authors
This section details the architectural and D-Bus API changes in
NetworkManager 0.9.
-Elimination of the User Settings Service
+
Elimination of the User Settings Service
Previously there were two "settings services", or D-Bus services that
provided and saved network configuration information. NetworkManager
@@ -103,7 +103,7 @@
Even with the elimination of the user settings service, in some cases it
is still desirable to store secrets in the user's session and not in
@@ -152,7 +152,7 @@
-Settings Service Interface Changes
+
Settings Service Interface Changes
With the elimination of the user settings service, the old
org.freedesktop.NetworkManagerUserSettings and
@@ -160,7 +160,8 @@
service names are no longer used. Instead NetworkManager provides the
settings service using its own D-Bus service name,
org.freedesktop.NetworkManager. The object path of
- the settings service remains unchanged.
+ the settings service has also changed to
+ /org/freedesktop/NetworkManager/Settings.
Additionally, the D-Bus interface of the settings service has changed
@@ -177,18 +178,19 @@
and CanModify properties.
- Action: change the service name that
- your application uses to request system network settings to
- org.freedesktop.NetworkManager, and update the D-Bus
- interface that codes uses to talk to the settings service to
-
+ Action: change the service name and
+ object path that your application uses to request system network settings
+ to org.freedesktop.NetworkManager and
+ /org/freedesktop/NetworkManager/Settings respectively,
+ and update the D-Bus interface that codes uses to talk to the settings
+ service to
org.freedesktop.NetworkManager.Settings.
Listen for hostname changes using the new interface name as well.
-Connection Object Interface Changes
+
Connection Object Interface Changes
Consistent with the interface changes to the Settings object, the
Connection object's D-Bus interface has changed to
@@ -222,7 +224,7 @@
-Permissions Methods Consolidation
+
Permissions Methods Consolidation
Previously there were two D-Bus method calls to retrieve the list of
operations that a user client could perform, and two signals notifying
@@ -254,7 +256,7 @@
are now string-based permissions. The mapping is as follows: