From 494f296a3baab08522617b24b1f126d8f9a17502 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Wed, 20 Jan 2016 16:26:51 +0100 Subject: Imported Upstream version 1.1.90 --- Makefile.am | 19 +- Makefile.glib | 2 +- Makefile.in | 95 +- NEWS | 193 +- TODO | 6 +- autogen.sh | 4 +- callouts/Makefile.am | 20 +- callouts/Makefile.in | 53 +- callouts/nm-avahi-autoipd-action.c | 126 - callouts/nm-avahi-autoipd.conf | 13 - callouts/nm-dispatcher-api.h | 6 +- callouts/nm-dispatcher-utils.c | 43 +- callouts/nm-dispatcher-utils.h | 5 +- callouts/nm-dispatcher.c | 498 +- callouts/tests/Makefile.am | 11 +- callouts/tests/Makefile.in | 31 +- callouts/tests/dispatcher-down | 1 + callouts/tests/dispatcher-external | 33 + callouts/tests/dispatcher-up | 1 + callouts/tests/dispatcher-vpn-down | 1 + callouts/tests/dispatcher-vpn-up | 1 + callouts/tests/test-dispatcher-envp.c | 39 +- clients/Makefile.am | 4 +- clients/Makefile.in | 22 +- clients/cli/Makefile.am | 12 +- clients/cli/Makefile.in | 118 +- clients/cli/agent.c | 7 +- clients/cli/common.c | 227 +- clients/cli/common.h | 6 + clients/cli/connections.c | 3032 +++++-- clients/cli/connections.h | 2 + clients/cli/devices.c | 1657 ++-- clients/cli/devices.h | 2 + clients/cli/general.c | 290 +- clients/cli/general.h | 1 + clients/cli/nmcli-completion | 325 +- clients/cli/nmcli.c | 40 +- clients/cli/nmcli.h | 44 +- clients/cli/polkit-agent.c | 23 +- clients/cli/settings-docs.c | 101 +- clients/cli/settings.c | 1763 +++- clients/cli/utils.c | 260 +- clients/cli/utils.h | 10 +- clients/common/nm-polkit-listener.c | 4 +- clients/common/nm-polkit-listener.h | 4 +- clients/common/nm-secret-agent-simple.c | 22 +- clients/common/nm-vpn-helpers.c | 189 +- clients/common/nm-vpn-helpers.h | 7 +- clients/nm-online.c | 8 +- clients/tui/Makefile.am | 10 +- clients/tui/Makefile.in | 28 +- clients/tui/newt/Makefile.am | 5 +- clients/tui/newt/Makefile.in | 23 +- clients/tui/newt/nmt-newt-form.c | 2 - clients/tui/newt/nmt-newt-popup.c | 2 - clients/tui/newt/nmt-newt-types.h | 4 +- clients/tui/newt/nmt-newt-utils.c | 4 +- clients/tui/newt/nmt-newt-utils.h | 3 +- clients/tui/nm-editor-bindings.c | 1 - clients/tui/nm-editor-utils.c | 4 +- clients/tui/nmt-address-list.c | 2 - clients/tui/nmt-connect-connection-list.c | 1 - clients/tui/nmt-device-entry.c | 1 - clients/tui/nmt-edit-connection-list.c | 2 - clients/tui/nmt-editor-page.c | 2 - clients/tui/nmt-editor-section.c | 2 - clients/tui/nmt-editor.c | 3 +- clients/tui/nmt-ip-entry.c | 2 - clients/tui/nmt-mac-entry.h | 1 + clients/tui/nmt-mtu-entry.c | 2 - clients/tui/nmt-page-bond.c | 4 +- clients/tui/nmt-page-bridge-port.c | 4 +- clients/tui/nmt-page-bridge.c | 10 +- clients/tui/nmt-page-dsl.c | 4 +- clients/tui/nmt-page-dsl.h | 1 + clients/tui/nmt-page-ethernet.c | 4 +- clients/tui/nmt-page-infiniband.c | 4 +- clients/tui/nmt-page-ip4.c | 4 +- clients/tui/nmt-page-ip6.c | 4 +- clients/tui/nmt-page-ppp.c | 4 +- clients/tui/nmt-page-team-port.c | 4 +- clients/tui/nmt-page-team.c | 4 +- clients/tui/nmt-page-team.h | 1 + clients/tui/nmt-page-vlan.c | 4 +- clients/tui/nmt-page-wifi.c | 4 +- clients/tui/nmt-password-dialog.c | 2 - clients/tui/nmt-password-fields.c | 2 - clients/tui/nmt-route-editor.c | 4 +- clients/tui/nmt-route-entry.c | 1 - clients/tui/nmt-route-table.c | 1 - clients/tui/nmt-slave-list.c | 1 - clients/tui/nmt-utils.h | 2 +- clients/tui/nmt-widget-list.c | 2 - clients/tui/nmtui-connect.c | 4 - clients/tui/nmtui-edit.c | 1 - clients/tui/nmtui-hostname.c | 2 - clients/tui/nmtui.c | 4 +- config.h.in | 66 +- configure | 2702 +++--- configure.ac | 424 +- data/Makefile.in | 18 +- data/NetworkManager-wait-online.service.in | 5 +- data/NetworkManager.service.in | 3 + docs/Makefile.am | 7 +- docs/Makefile.in | 26 +- docs/api/Makefile.in | 18 +- docs/api/html/index.html | 2 +- docs/api/html/ref-migrating.html | 6 +- docs/api/html/ref-settings.html | 452 +- docs/api/html/spec.html | 117 +- docs/api/network-manager-docs.xml | 2 +- docs/api/settings-spec.xml | 79 +- docs/api/spec.html | 117 +- docs/api/version.xml | 2 +- docs/libnm-glib/Makefile.am | 4 +- docs/libnm-glib/Makefile.in | 22 +- docs/libnm-glib/html/NMAccessPoint.html | 8 +- docs/libnm-glib/html/NMClient.html | 280 +- docs/libnm-glib/html/NMDevice.html | 191 +- docs/libnm-glib/html/NMDeviceWimax.html | 130 +- docs/libnm-glib/html/api-index-full.html | 119 + docs/libnm-glib/html/index.html | 2 +- docs/libnm-glib/html/index.sgml | 29 + .../html/libnm-glib-NMVpnPluginUiWidget.html | 200 + docs/libnm-glib/html/libnm-glib.devhelp2 | 53 +- docs/libnm-glib/version.xml | 2 +- docs/libnm-util/Makefile.in | 18 +- docs/libnm-util/html/NMConnection.html | 2 +- docs/libnm-util/html/NMSetting.html | 2 +- docs/libnm-util/html/NMSetting8021x.html | 2 +- docs/libnm-util/html/NMSettingAdsl.html | 2 +- docs/libnm-util/html/NMSettingBluetooth.html | 2 +- docs/libnm-util/html/NMSettingBond.html | 2 +- docs/libnm-util/html/NMSettingBridge.html | 2 +- docs/libnm-util/html/NMSettingBridgePort.html | 2 +- docs/libnm-util/html/NMSettingCdma.html | 2 +- docs/libnm-util/html/NMSettingConnection.html | 2 +- docs/libnm-util/html/NMSettingDcb.html | 2 +- docs/libnm-util/html/NMSettingGeneric.html | 2 +- docs/libnm-util/html/NMSettingGsm.html | 2 +- docs/libnm-util/html/NMSettingIP4Config.html | 73 +- docs/libnm-util/html/NMSettingIP6Config.html | 4 +- docs/libnm-util/html/NMSettingInfiniband.html | 2 +- docs/libnm-util/html/NMSettingOlpcMesh.html | 2 +- docs/libnm-util/html/NMSettingPPP.html | 2 +- docs/libnm-util/html/NMSettingPPPOE.html | 2 +- docs/libnm-util/html/NMSettingSerial.html | 2 +- docs/libnm-util/html/NMSettingTeam.html | 2 +- docs/libnm-util/html/NMSettingTeamPort.html | 2 +- docs/libnm-util/html/NMSettingVPN.html | 12 +- docs/libnm-util/html/NMSettingVlan.html | 70 +- docs/libnm-util/html/NMSettingWimax.html | 41 +- docs/libnm-util/html/NMSettingWired.html | 2 +- docs/libnm-util/html/NMSettingWireless.html | 83 +- .../libnm-util/html/NMSettingWirelessSecurity.html | 2 +- docs/libnm-util/html/api-index-full.html | 143 + docs/libnm-util/html/index.html | 2 +- docs/libnm-util/html/index.sgml | 11 + .../libnm-util/html/libnm-util-NetworkManager.html | 14 + docs/libnm-util/html/libnm-util-nm-utils.html | 2 +- docs/libnm-util/html/libnm-util.devhelp2 | 19 +- docs/libnm-util/html/object-tree.html | 4 +- docs/libnm-util/libnm-util-sections.txt | 43 + docs/libnm-util/version.xml | 2 +- docs/libnm/Makefile.am | 2 + docs/libnm/Makefile.in | 20 +- docs/libnm/html/NMAccessPoint.html | 52 +- docs/libnm/html/NMActiveConnection.html | 60 +- docs/libnm/html/NMClient.html | 287 +- docs/libnm/html/NMDevice.html | 840 +- docs/libnm/html/NMDeviceEthernet.html | 61 + docs/libnm/html/NMDeviceIPTunnel.html | 739 ++ docs/libnm/html/NMDeviceInfiniband.html | 4 +- docs/libnm/html/NMDeviceMacvlan.html | 388 + docs/libnm/html/NMDeviceModem.html | 12 +- docs/libnm/html/NMDeviceOlpcMesh.html | 12 +- docs/libnm/html/NMDeviceTeam.html | 16 +- docs/libnm/html/NMDeviceTun.html | 490 ++ docs/libnm/html/NMDeviceVlan.html | 24 +- docs/libnm/html/NMDeviceVxlan.html | 1151 +++ docs/libnm/html/NMDeviceWifi.html | 60 +- docs/libnm/html/NMDeviceWimax.html | 112 +- docs/libnm/html/NMDhcpConfig.html | 12 +- docs/libnm/html/NMIPConfig.html | 38 +- docs/libnm/html/NMRemoteConnection.html | 48 +- docs/libnm/html/NMSetting.html | 138 +- docs/libnm/html/NMSetting8021x.html | 310 +- docs/libnm/html/NMSettingBridge.html | 62 + docs/libnm/html/NMSettingConnection.html | 121 +- docs/libnm/html/NMSettingDcb.html | 2 +- docs/libnm/html/NMSettingGsm.html | 209 +- docs/libnm/html/NMSettingIP4Config.html | 140 +- docs/libnm/html/NMSettingIP6Config.html | 144 +- docs/libnm/html/NMSettingIPConfig.html | 792 +- docs/libnm/html/NMSettingIPTunnel.html | 844 ++ docs/libnm/html/NMSettingInfiniband.html | 4 +- docs/libnm/html/NMSettingMacvlan.html | 433 + docs/libnm/html/NMSettingOlpcMesh.html | 12 +- docs/libnm/html/NMSettingPpp.html | 74 +- docs/libnm/html/NMSettingPppoe.html | 18 +- docs/libnm/html/NMSettingSerial.html | 26 +- docs/libnm/html/NMSettingTeam.html | 6 +- docs/libnm/html/NMSettingTeamPort.html | 10 +- docs/libnm/html/NMSettingTun.html | 525 ++ docs/libnm/html/NMSettingVlan.html | 78 +- docs/libnm/html/NMSettingVpn.html | 114 +- docs/libnm/html/NMSettingVxlan.html | 1067 +++ docs/libnm/html/NMSettingWimax.html | 37 +- docs/libnm/html/NMSettingWired.html | 108 +- docs/libnm/html/NMSettingWireless.html | 211 +- docs/libnm/html/NMSettingWirelessSecurity.html | 112 +- docs/libnm/html/NMVpnConnection.html | 8 +- docs/libnm/html/NMVpnEditor.html | 546 -- docs/libnm/html/NMVpnEditorPlugin.html | 540 ++ docs/libnm/html/NMWimaxNsp.html | 24 +- docs/libnm/html/api-index-full.html | 1745 +++- docs/libnm/html/ch03.html | 18 +- docs/libnm/html/ch04.html | 12 + docs/libnm/html/ch06.html | 2 +- docs/libnm/html/index.html | 34 +- docs/libnm/html/index.sgml | 641 +- docs/libnm/html/libnm-NMConnection.html | 347 +- docs/libnm/html/libnm-nm-dbus-interface.html | 343 +- docs/libnm/html/libnm-nm-errors.html | 2 +- docs/libnm/html/libnm-nm-utils.html | 265 +- docs/libnm/html/libnm-nm-version.html | 24 +- docs/libnm/html/libnm-nm-vpn-dbus-interface.html | 6 +- docs/libnm/html/libnm.devhelp2 | 563 +- docs/libnm/html/object-tree.html | 35 +- docs/libnm/libnm-docs.xml | 10 +- docs/libnm/libnm-sections.txt | 461 +- docs/libnm/libnm.types | 15 + docs/libnm/version.xml | 2 +- examples/C/Makefile.in | 18 +- examples/C/glib/Makefile.am | 4 +- examples/C/glib/Makefile.in | 22 +- examples/C/qt/Makefile.in | 18 +- examples/Makefile.am | 1 + examples/Makefile.in | 19 +- examples/dispatcher/10-ifcfg-rh-routes.sh | 3 + examples/dispatcher/Makefile.in | 18 +- examples/lua/Makefile.am | 2 + examples/lua/Makefile.in | 772 ++ examples/lua/lgi/Makefile.am | 9 + examples/lua/lgi/Makefile.in | 601 ++ examples/lua/lgi/add-connection.lua | 98 + examples/lua/lgi/change-vpn-username.lua | 85 + examples/lua/lgi/deactivate-all.lua | 82 + examples/lua/lgi/get-basic-nm-info.lua | 51 + examples/lua/lgi/get-ips.lua | 160 + examples/lua/lgi/list-connections.lua | 63 + examples/lua/lgi/list-devices.lua | 51 + examples/lua/lgi/show-wifi-networks.lua | 122 + examples/python/Makefile.am | 2 +- examples/python/Makefile.in | 20 +- examples/python/dbus/Makefile.am | 8 +- examples/python/dbus/Makefile.in | 26 +- examples/python/dbus/add-system-wifi-connection.py | 63 - examples/python/dbus/add-wifi-eap-connection.py | 63 + examples/python/dbus/add-wifi-psk-connection.py | 56 + examples/python/dbus/create-bond.py | 114 + examples/python/dbus/nm-state.py | 25 +- examples/python/dbus/vpn.py | 4 +- examples/python/dbus/wifi-active-ap.py | 66 + examples/python/dbus/wifi-hotspot.py | 112 + examples/python/gi/Makefile.am | 4 +- examples/python/gi/Makefile.in | 24 +- examples/python/gi/README | 2 + examples/python/gi/add_connection.py | 2 +- examples/python/gi/deactivate-all.py | 83 + examples/python/gi/firewall-zone.py | 2 +- examples/python/gi/show-wifi-networks.py | 64 + examples/python/gi/update-ip4-method.py | 2 +- examples/python/python-networkmanager/Makefile.am | 2 + examples/python/python-networkmanager/Makefile.in | 594 ++ examples/python/python-networkmanager/README | 6 + examples/ruby/Makefile.in | 18 +- examples/shell/Makefile.in | 18 +- include/Makefile.am | 10 - include/Makefile.in | 605 -- include/gsystem-local-alloc.h | 208 - include/nm-dbus-glib-types.h | 45 - include/nm-glib-compat.h | 264 - include/nm-gvaluearray-compat.h | 108 - include/nm-macros-internal.h | 346 - include/nm-test-utils.h | 1507 ---- include/nm-version-macros.h | 80 - include/nm-version-macros.h.in | 80 - initscript/Arch/networkmanager.in | 67 - initscript/Debian/NetworkManager.in | 91 - initscript/Mandriva/networkmanager.in | 107 - initscript/RedHat/NetworkManager.in | 104 - initscript/SUSE/networkmanager.in | 51 - initscript/Slackware/rc.networkmanager.in | 92 - initscript/linexa/networkmanager.in | 59 - introspection/Makefile.am | 14 +- introspection/Makefile.in | 65 +- introspection/nm-access-point.xml | 4 + introspection/nm-active-connection.xml | 1 + introspection/nm-agent-manager.xml | 6 - introspection/nm-device-ethernet.xml | 6 + introspection/nm-device-gre.xml | 81 - introspection/nm-device-ip-tunnel.xml | 86 + introspection/nm-device-macvlan.xml | 6 + introspection/nm-device-tun.xml | 6 + introspection/nm-device-vxlan.xml | 6 + introspection/nm-device-wifi.xml | 4 - introspection/nm-device-wimax.xml | 1 - introspection/nm-device.xml | 52 +- introspection/nm-dhcp4-config.xml | 1 + introspection/nm-dhcp6-config.xml | 1 + introspection/nm-ip4-config.xml | 7 + introspection/nm-ip6-config.xml | 11 + introspection/nm-manager.xml | 79 +- introspection/nm-ppp-manager.xml | 5 - introspection/nm-settings-connection.xml | 14 - introspection/nm-settings.xml | 13 - libnm-core/Makefile.am | 12 +- libnm-core/Makefile.in | 158 +- libnm-core/Makefile.libnm-core | 20 +- libnm-core/crypto.c | 3 +- libnm-core/crypto.h | 2 +- libnm-core/crypto_gnutls.c | 118 +- libnm-core/crypto_nss.c | 4 +- libnm-core/nm-connection.c | 116 +- libnm-core/nm-connection.h | 9 + libnm-core/nm-core-enum-types.c | 165 +- libnm-core/nm-core-enum-types.h | 14 + libnm-core/nm-core-internal.h | 130 +- libnm-core/nm-core-types-internal.h | 30 + libnm-core/nm-core-types.h | 4 + libnm-core/nm-dbus-interface.h | 67 +- libnm-core/nm-dbus-utils.c | 294 + libnm-core/nm-errors.c | 3 +- libnm-core/nm-keyfile-internal.h | 3 +- libnm-core/nm-keyfile-reader.c | 41 +- libnm-core/nm-keyfile-utils.c | 4 +- libnm-core/nm-keyfile-writer.c | 36 +- libnm-core/nm-property-compare.c | 7 +- libnm-core/nm-property-compare.h | 2 +- libnm-core/nm-setting-8021x.c | 5 +- libnm-core/nm-setting-8021x.h | 3 + libnm-core/nm-setting-adsl.c | 11 +- libnm-core/nm-setting-bluetooth.c | 1 - libnm-core/nm-setting-bond.c | 1 - libnm-core/nm-setting-bridge-port.c | 1 - libnm-core/nm-setting-bridge.c | 52 +- libnm-core/nm-setting-bridge.h | 5 +- libnm-core/nm-setting-cdma.c | 11 +- libnm-core/nm-setting-connection.c | 77 +- libnm-core/nm-setting-connection.h | 21 +- libnm-core/nm-setting-dcb.c | 1 - libnm-core/nm-setting-gsm.c | 185 +- libnm-core/nm-setting-gsm.h | 44 +- libnm-core/nm-setting-infiniband.c | 1 - libnm-core/nm-setting-ip-config.c | 381 +- libnm-core/nm-setting-ip-config.h | 46 +- libnm-core/nm-setting-ip-tunnel.c | 767 ++ libnm-core/nm-setting-ip-tunnel.h | 98 + libnm-core/nm-setting-ip4-config.c | 131 +- libnm-core/nm-setting-ip4-config.h | 6 + libnm-core/nm-setting-ip6-config.c | 93 +- libnm-core/nm-setting-ip6-config.h | 23 + libnm-core/nm-setting-macvlan.c | 350 + libnm-core/nm-setting-macvlan.h | 94 + libnm-core/nm-setting-olpc-mesh.c | 9 +- libnm-core/nm-setting-ppp.c | 2 - libnm-core/nm-setting-pppoe.c | 1 - libnm-core/nm-setting-private.h | 21 +- libnm-core/nm-setting-serial.c | 2 +- libnm-core/nm-setting-team-port.c | 1 - libnm-core/nm-setting-team.c | 1 - libnm-core/nm-setting-tun.c | 409 + libnm-core/nm-setting-tun.h | 94 + libnm-core/nm-setting-vlan.c | 260 +- libnm-core/nm-setting-vlan.h | 11 + libnm-core/nm-setting-vpn.c | 45 +- libnm-core/nm-setting-vpn.h | 3 + libnm-core/nm-setting-vxlan.c | 843 ++ libnm-core/nm-setting-vxlan.h | 109 + libnm-core/nm-setting-wimax.c | 15 +- libnm-core/nm-setting-wimax.h | 4 + libnm-core/nm-setting-wired.c | 15 +- libnm-core/nm-setting-wired.h | 4 +- libnm-core/nm-setting-wireless-security.c | 59 +- libnm-core/nm-setting-wireless.c | 102 +- libnm-core/nm-setting-wireless.h | 7 + libnm-core/nm-setting.c | 73 +- libnm-core/nm-setting.h | 29 +- libnm-core/nm-utils-private.h | 5 + libnm-core/nm-utils.c | 470 +- libnm-core/nm-utils.h | 22 +- libnm-core/nm-version.h | 14 +- libnm-core/nm-vpn-editor-plugin.c | 287 + libnm-core/nm-vpn-editor-plugin.h | 152 + libnm-core/nm-vpn-plugin-info.c | 1030 +++ libnm-core/nm-vpn-plugin-info.h | 114 + libnm-core/tests/Makefile.am | 8 +- libnm-core/tests/Makefile.in | 35 +- libnm-core/tests/nm-core-tests-enum-types.c | 2 + libnm-core/tests/test-compare.c | 3 +- libnm-core/tests/test-crypto.c | 3 +- libnm-core/tests/test-general.c | 461 +- libnm-core/tests/test-secrets.c | 2 +- libnm-core/tests/test-setting-8021x.c | 2 +- libnm-core/tests/test-setting-dcb.c | 18 +- libnm-core/tests/test-settings-defaults.c | 2 +- libnm-glib/Makefile.am | 5 +- libnm-glib/Makefile.in | 23 +- libnm-glib/libnm-glib-test.c | 15 +- libnm-glib/libnm-glib.ver | 3 + libnm-glib/libnm_glib.c | 6 +- libnm-glib/nm-access-point.c | 11 +- libnm-glib/nm-access-point.h | 4 +- libnm-glib/nm-active-connection.c | 6 +- libnm-glib/nm-client.c | 220 +- libnm-glib/nm-client.h | 3 + libnm-glib/nm-dbus-helpers-private.h | 5 +- libnm-glib/nm-dbus-helpers.c | 55 +- libnm-glib/nm-device-bond.c | 3 +- libnm-glib/nm-device-bridge.c | 3 +- libnm-glib/nm-device-bt.c | 3 +- libnm-glib/nm-device-ethernet.c | 3 +- libnm-glib/nm-device-generic.c | 30 +- libnm-glib/nm-device-infiniband.c | 3 +- libnm-glib/nm-device-modem.c | 3 +- libnm-glib/nm-device-olpc-mesh.c | 3 +- libnm-glib/nm-device-private.h | 1 + libnm-glib/nm-device-team.c | 3 +- libnm-glib/nm-device-vlan.c | 3 +- libnm-glib/nm-device-wifi.c | 3 +- libnm-glib/nm-device-wimax.c | 44 +- libnm-glib/nm-device-wimax.h | 12 + libnm-glib/nm-device.c | 124 +- libnm-glib/nm-device.h | 5 + libnm-glib/nm-glib-enum-types.c | 2 + libnm-glib/nm-object-cache.c | 2 +- libnm-glib/nm-object-cache.h | 3 +- libnm-glib/nm-object-private.h | 4 +- libnm-glib/nm-object.c | 294 +- libnm-glib/nm-remote-connection.c | 11 +- libnm-glib/nm-remote-settings.c | 93 +- libnm-glib/nm-secret-agent.c | 58 +- libnm-glib/nm-types.c | 2 +- libnm-glib/nm-vpn-enum-types.c | 2 + libnm-glib/nm-vpn-plugin-ui-interface.h | 46 + libnm-glib/nm-vpn-plugin.c | 8 +- libnm-glib/nm-wimax-nsp.c | 3 +- libnm-glib/tests/Makefile.am | 13 +- libnm-glib/tests/Makefile.in | 60 +- libnm-glib/tests/common.c | 121 - libnm-glib/tests/common.h | 31 - libnm-glib/tests/test-nm-client.c | 366 +- libnm-glib/tests/test-remote-settings-client.c | 35 +- libnm-util/Makefile.am | 19 +- libnm-util/Makefile.in | 45 +- libnm-util/NetworkManager.h | 4 + libnm-util/crypto.c | 3 +- libnm-util/crypto.h | 2 +- libnm-util/crypto_gnutls.c | 146 +- libnm-util/crypto_nss.c | 4 +- libnm-util/libnm-util.ver | 2 + libnm-util/nm-connection.c | 3 +- libnm-util/nm-dbus-glib-types.h | 45 + libnm-util/nm-gvaluearray-compat.h | 104 + libnm-util/nm-param-spec-specialized.c | 7 +- libnm-util/nm-param-spec-specialized.h | 2 +- libnm-util/nm-setting-8021x.c | 1 - libnm-util/nm-setting-adsl.c | 1 - libnm-util/nm-setting-bluetooth.c | 1 - libnm-util/nm-setting-bond.c | 1 - libnm-util/nm-setting-bridge-port.c | 1 - libnm-util/nm-setting-bridge.c | 1 - libnm-util/nm-setting-cdma.c | 1 - libnm-util/nm-setting-connection.c | 1 - libnm-util/nm-setting-dcb.c | 1 - libnm-util/nm-setting-gsm.c | 1 - libnm-util/nm-setting-infiniband.c | 1 - libnm-util/nm-setting-ip4-config.c | 43 +- libnm-util/nm-setting-ip4-config.h | 3 + libnm-util/nm-setting-ip6-config.c | 3 +- libnm-util/nm-setting-olpc-mesh.c | 1 - libnm-util/nm-setting-ppp.c | 2 - libnm-util/nm-setting-pppoe.c | 1 - libnm-util/nm-setting-private.h | 4 +- libnm-util/nm-setting-serial.c | 2 +- libnm-util/nm-setting-team-port.c | 1 - libnm-util/nm-setting-team.c | 1 - libnm-util/nm-setting-vlan.c | 10 +- libnm-util/nm-setting-vlan.h | 8 + libnm-util/nm-setting-vpn.c | 1 - libnm-util/nm-setting-vpn.h | 4 + libnm-util/nm-setting-wimax.c | 17 +- libnm-util/nm-setting-wimax.h | 5 + libnm-util/nm-setting-wired.c | 1 - libnm-util/nm-setting-wireless-security.c | 1 - libnm-util/nm-setting-wireless.c | 42 +- libnm-util/nm-setting-wireless.h | 3 + libnm-util/nm-setting.c | 5 +- libnm-util/nm-utils-enum-types.c | 3 + libnm-util/nm-utils.c | 5 +- libnm-util/nm-value-transforms.c | 3 +- libnm-util/nm-version.h | 14 +- libnm-util/tests/Makefile.am | 4 +- libnm-util/tests/Makefile.in | 22 +- libnm-util/tests/test-crypto.c | 3 +- libnm-util/tests/test-general.c | 5 +- libnm-util/tests/test-libnm-linking.c | 3 +- libnm-util/tests/test-secrets.c | 2 +- libnm-util/tests/test-setting-8021x.c | 2 +- libnm-util/tests/test-setting-dcb.c | 25 +- libnm-util/tests/test-settings-defaults.c | 2 +- libnm/Makefile.am | 26 +- libnm/Makefile.in | 91 +- libnm/NetworkManager.h | 6 + libnm/libnm.pc.in | 1 + libnm/libnm.ver | 204 +- libnm/nm-access-point.c | 13 +- libnm/nm-access-point.h | 2 +- libnm/nm-active-connection.c | 2 +- libnm/nm-client.c | 114 +- libnm/nm-client.h | 9 +- libnm/nm-dbus-helpers.c | 242 +- libnm/nm-dbus-helpers.h | 13 +- libnm/nm-device-adsl.c | 1 - libnm/nm-device-bond.c | 4 +- libnm/nm-device-bridge.c | 4 +- libnm/nm-device-bt.c | 4 +- libnm/nm-device-ethernet.c | 141 +- libnm/nm-device-ethernet.h | 3 + libnm/nm-device-generic.c | 1 - libnm/nm-device-infiniband.c | 4 +- libnm/nm-device-ip-tunnel.c | 544 ++ libnm/nm-device-ip-tunnel.h | 90 + libnm/nm-device-macvlan.c | 347 + libnm/nm-device-macvlan.h | 72 + libnm/nm-device-modem.c | 4 +- libnm/nm-device-olpc-mesh.c | 4 +- libnm/nm-device-team.c | 4 +- libnm/nm-device-tun.c | 439 + libnm/nm-device-tun.h | 78 + libnm/nm-device-vlan.c | 4 +- libnm/nm-device-vxlan.c | 815 ++ libnm/nm-device-vxlan.h | 110 + libnm/nm-device-wifi.c | 17 +- libnm/nm-device-wifi.h | 4 +- libnm/nm-device-wimax.c | 40 +- libnm/nm-device-wimax.h | 10 + libnm/nm-device.c | 573 +- libnm/nm-device.h | 51 +- libnm/nm-enum-types.c | 32 +- libnm/nm-enum-types.h | 2 - libnm/nm-ifcfg-rh-docs.xml | 21 +- libnm/nm-ip-config.c | 7 +- libnm/nm-keyfile-docs.xml | 8 + libnm/nm-manager.c | 102 +- libnm/nm-manager.h | 5 + libnm/nm-object-cache.c | 2 +- libnm/nm-object-cache.h | 3 +- libnm/nm-object-private.h | 2 +- libnm/nm-object.c | 201 +- libnm/nm-property-docs.xml | 79 +- libnm/nm-remote-connection.c | 4 +- libnm/nm-remote-settings.c | 8 +- libnm/nm-secret-agent-old.c | 2 +- libnm/nm-setting-docs-overrides.xml | 8 + libnm/nm-setting-docs.xml | 79 +- libnm/nm-types.h | 4 + libnm/nm-vpn-editor-plugin.c | 181 - libnm/nm-vpn-editor-plugin.h | 189 - libnm/nm-vpn-editor.c | 69 + libnm/nm-vpn-editor.h | 86 + libnm/nm-vpn-plugin-old.c | 88 +- libnm/nm-vpn-plugin-old.h | 36 +- libnm/nm-vpn-service-plugin.c | 1302 +++ libnm/nm-vpn-service-plugin.h | 160 + libnm/nm-wimax-nsp.c | 3 +- libnm/tests/Makefile.am | 18 +- libnm/tests/Makefile.in | 72 +- libnm/tests/common.c | 187 - libnm/tests/common.h | 37 - libnm/tests/test-nm-client.c | 380 +- libnm/tests/test-remote-settings-client.c | 21 +- libnm/tests/test-secret-agent.c | 34 +- man/Makefile.am | 27 +- man/Makefile.in | 44 +- man/NetworkManager.8 | 277 - man/NetworkManager.conf.5 | 670 -- man/NetworkManager.conf.xml | 988 +++ man/NetworkManager.conf.xml.in | 295 +- man/NetworkManager.xml | 461 + man/nm-settings-ifcfg-rh.5 | 212 +- man/nm-settings-ifcfg-rh.xml | 46 +- man/nm-settings-ifcfg-rh.xsl | 6 +- man/nm-settings-keyfile.5 | 8 +- man/nm-settings-keyfile.xml | 8 +- man/nm-settings-keyfile.xsl | 2 +- man/nm-settings.5 | 884 +- man/nm-settings.xml | 83 +- man/nm-settings.xsl | 2 +- man/nmcli-examples.5 | 693 -- man/nmcli-examples.xml | 568 ++ man/nmcli.1.in | 316 +- po/POTFILES.in | 17 +- po/ar.po | 4767 ++++++---- po/as.po | 5102 ++++++----- po/be@latin.po | 4754 ++++++---- po/bg.po | 4897 +++++++---- po/bn_IN.po | 5107 ++++++----- po/bs.po | 4762 ++++++---- po/ca.po | 9130 ++++++++++++-------- po/cs.po | 5013 ++++++----- po/da.po | 4854 +++++++---- po/de.po | 6606 ++++++++------ po/dz.po | 4767 ++++++---- po/el.po | 5048 ++++++----- po/en_CA.po | 4838 +++++++---- po/en_GB.po | 4960 ++++++----- po/eo.po | 5000 ++++++----- po/es.po | 5021 ++++++----- po/et.po | 4761 ++++++---- po/eu.po | 4846 +++++++---- po/fi.po | 4844 +++++++---- po/fr.po | 5060 ++++++----- po/gl.po | 5046 ++++++----- po/gu.po | 5014 ++++++----- po/he.po | 4754 ++++++---- po/hi.po | 5100 ++++++----- po/hr.po | 4958 ++++++----- po/hu.po | 5036 ++++++----- po/id.po | 4956 +++++++---- po/it.po | 5976 ++++++++----- po/ja.po | 5020 ++++++----- po/ka.po | 4842 +++++++---- po/kn.po | 5038 ++++++----- po/ko.po | 5022 ++++++----- po/ku.po | 4765 ++++++---- po/lt.po | 4985 ++++++----- po/lv.po | 4841 +++++++---- po/mk.po | 4754 ++++++---- po/ml.po | 5016 ++++++----- po/mr.po | 5031 ++++++----- po/nb.po | 4760 ++++++---- po/ne.po | 4767 ++++++---- po/nl.po | 4754 ++++++---- po/oc.po | 5195 ++++++----- po/or.po | 5022 ++++++----- po/pa.po | 5017 ++++++----- po/pl.po | 5074 ++++++----- po/pt.po | 4767 ++++++---- po/pt_BR.po | 6763 +++++++-------- po/ru.po | 5057 ++++++----- po/rw.po | 4826 +++++++---- po/sk.po | 4842 +++++++---- po/sl.po | 4954 +++++++---- po/sq.po | 4762 ++++++---- po/sr.po | 4858 +++++++---- po/sr@latin.po | 4858 +++++++---- po/sv.po | 5462 +++++++----- po/ta.po | 5149 ++++++----- po/te.po | 5026 ++++++----- po/th.po | 4842 +++++++---- po/tr.po | 5201 ++++++----- po/uk.po | 5318 +++++++----- po/vi.po | 4761 ++++++---- po/wa.po | 4762 ++++++---- po/zh_CN.po | 5017 ++++++----- po/zh_HK.po | 4843 +++++++---- po/zh_TW.po | 5017 ++++++----- policy/Makefile.in | 18 +- policy/org.freedesktop.NetworkManager.policy.in.in | 10 + shared/Makefile.am | 10 + shared/Makefile.in | 605 ++ shared/gsystem-local-alloc.h | 208 + shared/nm-dbus-compat.h | 74 + shared/nm-default.h | 121 + shared/nm-glib.h | 356 + shared/nm-macros-internal.h | 357 + shared/nm-test-libnm-utils.h | 101 + shared/nm-test-utils-impl.c | 466 + shared/nm-test-utils.h | 1743 ++++ shared/nm-version-macros.h | 75 + shared/nm-version-macros.h.in | 75 + src/Makefile.am | 346 +- src/Makefile.in | 1099 ++- src/NetworkManagerUtils.c | 880 +- src/NetworkManagerUtils.h | 251 +- src/devices/Makefile.am | 1 + src/devices/Makefile.in | 772 ++ src/devices/adsl/Makefile.am | 25 +- src/devices/adsl/Makefile.in | 62 +- src/devices/adsl/nm-adsl-enum-types.c | 12 - src/devices/adsl/nm-adsl-enum-types.h | 17 - src/devices/adsl/nm-atm-manager.c | 8 +- src/devices/adsl/nm-atm-manager.h | 3 +- src/devices/adsl/nm-device-adsl-glue.h | 73 - src/devices/adsl/nm-device-adsl.c | 32 +- src/devices/adsl/nm-device-adsl.h | 3 +- src/devices/bluetooth/Makefile.am | 18 +- src/devices/bluetooth/Makefile.in | 39 +- src/devices/bluetooth/nm-bluez-common.h | 2 +- src/devices/bluetooth/nm-bluez-device.c | 48 +- src/devices/bluetooth/nm-bluez-device.h | 6 +- src/devices/bluetooth/nm-bluez-manager.c | 28 +- src/devices/bluetooth/nm-bluez-manager.h | 3 +- src/devices/bluetooth/nm-bluez4-adapter.c | 95 +- src/devices/bluetooth/nm-bluez4-adapter.h | 3 +- src/devices/bluetooth/nm-bluez4-manager.c | 173 +- src/devices/bluetooth/nm-bluez4-manager.h | 7 +- src/devices/bluetooth/nm-bluez5-dun.c | 7 +- src/devices/bluetooth/nm-bluez5-dun.h | 3 +- src/devices/bluetooth/nm-bluez5-manager.c | 130 +- src/devices/bluetooth/nm-bluez5-manager.h | 7 +- src/devices/bluetooth/nm-bt-enum-types.c | 2 + src/devices/bluetooth/nm-bt-error.c | 2 +- src/devices/bluetooth/nm-device-bt-glue.h | 73 - src/devices/bluetooth/nm-device-bt.c | 107 +- src/devices/bluetooth/nm-device-bt.h | 2 +- src/devices/nm-device-bond.c | 164 +- src/devices/nm-device-bond.h | 4 - src/devices/nm-device-bridge.c | 195 +- src/devices/nm-device-bridge.h | 5 +- src/devices/nm-device-ethernet-utils.c | 3 +- src/devices/nm-device-ethernet-utils.h | 2 +- src/devices/nm-device-ethernet.c | 256 +- src/devices/nm-device-ethernet.h | 3 +- src/devices/nm-device-factory.c | 150 +- src/devices/nm-device-factory.h | 100 +- src/devices/nm-device-generic.c | 57 +- src/devices/nm-device-generic.h | 4 +- src/devices/nm-device-gre.c | 283 - src/devices/nm-device-gre.h | 55 - src/devices/nm-device-infiniband.c | 165 +- src/devices/nm-device-infiniband.h | 2 - src/devices/nm-device-ip-tunnel.c | 1052 +++ src/devices/nm-device-ip-tunnel.h | 60 + src/devices/nm-device-logging.h | 2 +- src/devices/nm-device-macvlan.c | 653 +- src/devices/nm-device-macvlan.h | 9 +- src/devices/nm-device-private.h | 13 +- src/devices/nm-device-tun.c | 356 +- src/devices/nm-device-tun.h | 6 +- src/devices/nm-device-veth.c | 43 +- src/devices/nm-device-veth.h | 2 - src/devices/nm-device-vlan.c | 538 +- src/devices/nm-device-vlan.h | 5 - src/devices/nm-device-vxlan.c | 602 +- src/devices/nm-device-vxlan.h | 6 +- src/devices/nm-device.c | 4145 ++++++--- src/devices/nm-device.h | 205 +- src/devices/nm-lldp-listener.c | 648 ++ src/devices/nm-lldp-listener.h | 57 + src/devices/team/Makefile.am | 30 +- src/devices/team/Makefile.in | 73 +- src/devices/team/nm-device-team-glue.h | 73 - src/devices/team/nm-device-team.c | 156 +- src/devices/team/nm-device-team.h | 18 +- src/devices/team/nm-team-enum-types.c | 12 - src/devices/team/nm-team-enum-types.h | 17 - src/devices/team/nm-team-factory.c | 26 +- src/devices/team/nm-team-factory.h | 2 +- src/devices/tests/Makefile.am | 42 + src/devices/tests/Makefile.in | 1193 +++ src/devices/tests/test-lldp.c | 221 + src/devices/wifi/Makefile.am | 37 +- src/devices/wifi/Makefile.in | 80 +- src/devices/wifi/nm-device-olpc-mesh-glue.h | 73 - src/devices/wifi/nm-device-olpc-mesh.c | 90 +- src/devices/wifi/nm-device-olpc-mesh.h | 4 +- src/devices/wifi/nm-device-wifi-glue.h | 167 - src/devices/wifi/nm-device-wifi.c | 1379 ++- src/devices/wifi/nm-device-wifi.h | 4 +- src/devices/wifi/nm-wifi-ap-utils.c | 3 +- src/devices/wifi/nm-wifi-ap.c | 1428 ++- src/devices/wifi/nm-wifi-ap.h | 112 +- src/devices/wifi/nm-wifi-enum-types.c | 14 - src/devices/wifi/nm-wifi-enum-types.h | 17 - src/devices/wifi/nm-wifi-factory.c | 33 +- src/devices/wifi/tests/Makefile.am | 10 +- src/devices/wifi/tests/Makefile.in | 28 +- src/devices/wifi/tests/test-wifi-ap-utils.c | 13 +- src/devices/wimax/Makefile.am | 60 - src/devices/wimax/Makefile.in | 866 -- src/devices/wimax/exports.ver | 6 - src/devices/wimax/iwmxsdk.c | 1515 ---- src/devices/wimax/iwmxsdk.h | 112 - src/devices/wimax/nm-device-wimax.c | 1416 --- src/devices/wimax/nm-device-wimax.h | 64 - src/devices/wimax/nm-wimax-factory.c | 91 - src/devices/wimax/nm-wimax-nsp.c | 241 - src/devices/wimax/nm-wimax-nsp.h | 63 - src/devices/wimax/nm-wimax-types.h | 31 - src/devices/wimax/nm-wimax-util.c | 83 - src/devices/wimax/nm-wimax-util.h | 43 - src/devices/wwan/Makefile.am | 24 +- src/devices/wwan/Makefile.in | 55 +- src/devices/wwan/nm-device-modem-glue.h | 73 - src/devices/wwan/nm-device-modem.c | 33 +- src/devices/wwan/nm-device-modem.h | 3 - src/devices/wwan/nm-modem-broadband.c | 368 +- src/devices/wwan/nm-modem-broadband.h | 1 - src/devices/wwan/nm-modem-enum-types.c | 2 + src/devices/wwan/nm-modem-manager.c | 15 +- src/devices/wwan/nm-modem-manager.h | 1 - src/devices/wwan/nm-modem.c | 171 +- src/devices/wwan/nm-modem.h | 50 +- src/devices/wwan/nm-wwan-factory.c | 17 +- src/devices/wwan/nm-wwan-factory.h | 2 +- src/dhcp-manager/Makefile.am | 16 +- src/dhcp-manager/Makefile.in | 106 +- src/dhcp-manager/nm-dhcp-client.c | 76 +- src/dhcp-manager/nm-dhcp-client.h | 13 +- src/dhcp-manager/nm-dhcp-dhclient-utils.c | 29 +- src/dhcp-manager/nm-dhcp-dhclient-utils.h | 7 +- src/dhcp-manager/nm-dhcp-dhclient.c | 28 +- src/dhcp-manager/nm-dhcp-dhclient.h | 4 +- src/dhcp-manager/nm-dhcp-dhcpcd.c | 31 +- src/dhcp-manager/nm-dhcp-dhcpcd.h | 3 - src/dhcp-manager/nm-dhcp-helper.c | 84 +- src/dhcp-manager/nm-dhcp-helper.conf | 13 - src/dhcp-manager/nm-dhcp-listener.c | 178 +- src/dhcp-manager/nm-dhcp-listener.h | 3 +- src/dhcp-manager/nm-dhcp-manager.c | 33 +- src/dhcp-manager/nm-dhcp-manager.h | 6 +- src/dhcp-manager/nm-dhcp-systemd.c | 96 +- src/dhcp-manager/nm-dhcp-systemd.h | 3 - src/dhcp-manager/nm-dhcp-utils.c | 27 +- src/dhcp-manager/nm-dhcp-utils.h | 10 +- src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c | 236 - src/dhcp-manager/systemd-dhcp/nm-sd-adapt.h | 132 - .../src/libsystemd-network/dhcp-internal.h | 76 - .../src/libsystemd-network/dhcp-lease-internal.h | 89 - .../src/libsystemd-network/dhcp-network.c | 241 - .../src/libsystemd-network/dhcp-option.c | 257 - .../src/libsystemd-network/dhcp-packet.c | 204 - .../src/libsystemd-network/dhcp-protocol.h | 142 - .../src/libsystemd-network/dhcp6-internal.h | 81 - .../src/libsystemd-network/dhcp6-lease-internal.h | 64 - .../src/libsystemd-network/dhcp6-network.c | 198 - .../src/libsystemd-network/dhcp6-option.c | 323 - .../src/libsystemd-network/dhcp6-protocol.h | 141 - .../src/libsystemd-network/network-internal.c | 484 -- .../src/libsystemd-network/network-internal.h | 78 - .../src/libsystemd-network/sd-dhcp-client.c | 1726 ---- .../src/libsystemd-network/sd-dhcp-lease.c | 917 -- .../src/libsystemd-network/sd-dhcp6-client.c | 1250 --- .../src/libsystemd-network/sd-dhcp6-lease.c | 223 - src/dhcp-manager/systemd-dhcp/src/shared/async.h | 27 - src/dhcp-manager/systemd-dhcp/src/shared/fileio.c | 817 -- src/dhcp-manager/systemd-dhcp/src/shared/fileio.h | 45 - .../systemd-dhcp/src/shared/in-addr-util.c | 294 - .../systemd-dhcp/src/shared/in-addr-util.h | 49 - src/dhcp-manager/systemd-dhcp/src/shared/list.h | 138 - src/dhcp-manager/systemd-dhcp/src/shared/macro.h | 422 - src/dhcp-manager/systemd-dhcp/src/shared/refcnt.h | 34 - .../systemd-dhcp/src/shared/siphash24.c | 137 - .../systemd-dhcp/src/shared/siphash24.h | 6 - .../systemd-dhcp/src/shared/socket-util.h | 118 - .../systemd-dhcp/src/shared/sparse-endian.h | 88 - src/dhcp-manager/systemd-dhcp/src/shared/strv.c | 616 -- src/dhcp-manager/systemd-dhcp/src/shared/strv.h | 137 - .../systemd-dhcp/src/shared/time-util.c | 1003 --- .../systemd-dhcp/src/shared/time-util.h | 111 - .../systemd-dhcp/src/shared/unaligned.h | 66 - src/dhcp-manager/systemd-dhcp/src/shared/utf8.c | 314 - src/dhcp-manager/systemd-dhcp/src/shared/utf8.h | 42 - src/dhcp-manager/systemd-dhcp/src/shared/util.c | 7350 ---------------- src/dhcp-manager/systemd-dhcp/src/shared/util.h | 1038 --- .../systemd-dhcp/src/systemd/_sd-common.h | 78 - .../systemd-dhcp/src/systemd/sd-dhcp-client.h | 75 - .../systemd-dhcp/src/systemd/sd-dhcp-lease.h | 55 - .../systemd-dhcp/src/systemd/sd-dhcp6-client.h | 66 - .../systemd-dhcp/src/systemd/sd-dhcp6-lease.h | 42 - .../systemd-dhcp/src/systemd/sd-event.h | 135 - .../systemd-dhcp/src/systemd/sd-id128.h | 113 - src/dhcp-manager/tests/Makefile.am | 6 +- src/dhcp-manager/tests/Makefile.in | 24 +- src/dhcp-manager/tests/test-dhcp-dhclient.c | 76 +- src/dhcp-manager/tests/test-dhcp-utils.c | 43 +- src/dns-manager/nm-dns-dnsmasq.c | 74 +- src/dns-manager/nm-dns-dnsmasq.h | 3 - src/dns-manager/nm-dns-manager.c | 684 +- src/dns-manager/nm-dns-manager.h | 38 +- src/dns-manager/nm-dns-plugin.c | 10 +- src/dns-manager/nm-dns-plugin.h | 10 +- src/dns-manager/nm-dns-unbound.c | 3 +- src/dns-manager/nm-dns-unbound.h | 2 - src/dnsmasq-manager/nm-dnsmasq-manager.c | 26 +- src/dnsmasq-manager/nm-dnsmasq-manager.h | 6 +- src/dnsmasq-manager/nm-dnsmasq-utils.h | 2 +- src/dnsmasq-manager/tests/Makefile.am | 6 +- src/dnsmasq-manager/tests/Makefile.in | 24 +- src/dnsmasq-manager/tests/test-dnsmasq-utils.c | 47 +- src/main-utils.c | 7 +- src/main-utils.h | 2 +- src/main.c | 110 +- src/nm-access-point-glue.h | 73 - src/nm-activation-request.c | 214 +- src/nm-activation-request.h | 42 +- src/nm-active-connection-glue.h | 73 - src/nm-active-connection.c | 439 +- src/nm-active-connection.h | 30 +- src/nm-agent-manager-glue.h | 170 - src/nm-audit-manager.c | 389 + src/nm-audit-manager.h | 114 + src/nm-auth-manager.c | 66 +- src/nm-auth-manager.h | 2 +- src/nm-auth-subject.c | 40 +- src/nm-auth-subject.h | 12 +- src/nm-auth-utils.c | 157 +- src/nm-auth-utils.h | 15 +- src/nm-bus-manager.c | 949 ++ src/nm-bus-manager.h | 111 + src/nm-config-data.c | 797 +- src/nm-config-data.h | 51 +- src/nm-config.c | 1081 ++- src/nm-config.h | 48 +- src/nm-connection-provider.c | 35 +- src/nm-connection-provider.h | 15 +- src/nm-connectivity.c | 9 +- src/nm-connectivity.h | 5 +- src/nm-dbus-manager.c | 998 --- src/nm-dbus-manager.h | 133 - src/nm-dcb.c | 3 +- src/nm-dcb.h | 2 +- src/nm-default-route-manager.c | 25 +- src/nm-default-route-manager.h | 3 +- src/nm-device-bond-glue.h | 73 - src/nm-device-bridge-glue.h | 73 - src/nm-device-ethernet-glue.h | 73 - src/nm-device-generic-glue.h | 73 - src/nm-device-glue.h | 79 - src/nm-device-gre-glue.h | 73 - src/nm-device-infiniband-glue.h | 73 - src/nm-device-macvlan-glue.h | 73 - src/nm-device-tun-glue.h | 73 - src/nm-device-veth-glue.h | 73 - src/nm-device-vlan-glue.h | 73 - src/nm-device-vxlan-glue.h | 73 - src/nm-dhcp4-config-glue.h | 73 - src/nm-dhcp4-config.c | 116 +- src/nm-dhcp4-config.h | 20 +- src/nm-dhcp6-config-glue.h | 73 - src/nm-dhcp6-config.c | 116 +- src/nm-dhcp6-config.h | 20 +- src/nm-dispatcher.c | 571 +- src/nm-dispatcher.h | 15 +- src/nm-enum-types.c | 212 +- src/nm-enum-types.h | 26 +- src/nm-exported-object.c | 883 ++ src/nm-exported-object.h | 85 + src/nm-firewall-manager.c | 578 +- src/nm-firewall-manager.h | 29 +- src/nm-iface-helper.c | 71 +- src/nm-ip4-config-glue.h | 73 - src/nm-ip4-config.c | 598 +- src/nm-ip4-config.h | 34 +- src/nm-ip6-config-glue.h | 73 - src/nm-ip6-config.c | 557 +- src/nm-ip6-config.h | 31 +- src/nm-logging.c | 566 +- src/nm-logging.h | 52 +- src/nm-manager-glue.h | 416 - src/nm-manager.c | 2439 +++--- src/nm-manager.h | 28 +- src/nm-multi-index.c | 157 +- src/nm-multi-index.h | 7 +- src/nm-policy.c | 213 +- src/nm-policy.h | 2 +- src/nm-ppp-manager-glue.h | 175 - src/nm-properties-changed-signal.c | 248 - src/nm-properties-changed-signal.h | 31 - src/nm-rfkill-manager.c | 4 +- src/nm-rfkill-manager.h | 10 +- src/nm-route-manager.c | 35 +- src/nm-route-manager.h | 3 +- src/nm-session-monitor-ck.c | 503 -- src/nm-session-monitor-null.c | 169 - src/nm-session-monitor-systemd.c | 268 - src/nm-session-monitor.c | 450 + src/nm-session-monitor.h | 32 +- src/nm-session-utils.c | 70 - src/nm-session-utils.h | 30 - src/nm-settings-connection-glue.h | 172 - src/nm-settings-glue.h | 219 - src/nm-sleep-monitor-systemd.c | 49 +- src/nm-sleep-monitor-upower.c | 124 +- src/nm-sleep-monitor.h | 3 +- src/nm-types.h | 27 +- src/nm-vpn-connection-glue.h | 73 - src/org.freedesktop.NetworkManager.conf | 16 +- src/platform/Makefile.in | 18 +- src/platform/nm-fake-platform.c | 379 +- src/platform/nm-linux-platform.c | 6695 ++++++++------ src/platform/nm-linux-platform.h | 2 + src/platform/nm-platform-utils.c | 3 +- src/platform/nm-platform.c | 1731 +++- src/platform/nm-platform.h | 467 +- src/platform/nmp-object.c | 663 +- src/platform/nmp-object.h | 114 +- src/platform/tests/Makefile.am | 6 +- src/platform/tests/Makefile.in | 24 +- src/platform/tests/monitor.c | 44 +- src/platform/tests/test-address.c | 278 +- src/platform/tests/test-cleanup.c | 6 +- src/platform/tests/test-common.c | 1222 ++- src/platform/tests/test-common.h | 131 +- src/platform/tests/test-general.c | 3 +- src/platform/tests/test-link.c | 1351 ++- src/platform/tests/test-nmp-object.c | 6 +- src/platform/tests/test-route.c | 38 +- src/platform/wifi/wifi-utils-nl80211.c | 287 +- src/platform/wifi/wifi-utils-private.h | 8 +- src/platform/wifi/wifi-utils-wext.c | 60 +- src/platform/wifi/wifi-utils.c | 17 +- src/platform/wifi/wifi-utils.h | 7 +- src/ppp-manager/Makefile.am | 7 +- src/ppp-manager/Makefile.in | 25 +- src/ppp-manager/nm-ppp-manager.c | 420 +- src/ppp-manager/nm-ppp-manager.h | 11 +- src/ppp-manager/nm-pppd-plugin.c | 6 +- src/ppp-manager/nm-pppd-plugin.h | 2 - src/rdisc/Makefile.in | 18 +- src/rdisc/nm-fake-rdisc.c | 126 +- src/rdisc/nm-fake-rdisc.h | 10 +- src/rdisc/nm-lndp-rdisc.c | 67 +- src/rdisc/nm-lndp-rdisc.h | 6 +- src/rdisc/nm-rdisc-private.h | 39 +- src/rdisc/nm-rdisc.c | 196 +- src/rdisc/nm-rdisc.h | 9 +- src/rdisc/tests/Makefile.am | 7 +- src/rdisc/tests/Makefile.in | 25 +- src/rdisc/tests/test-rdisc-fake.c | 34 +- src/rdisc/tests/test-rdisc-linux.c | 15 +- src/settings/nm-agent-manager.c | 1388 ++- src/settings/nm-agent-manager.h | 57 +- src/settings/nm-inotify-helper.c | 4 +- src/settings/nm-inotify-helper.h | 4 +- src/settings/nm-secret-agent.c | 609 +- src/settings/nm-secret-agent.h | 58 +- src/settings/nm-settings-connection.c | 1078 ++- src/settings/nm-settings-connection.h | 44 +- src/settings/nm-settings-plugin.c | 179 + src/settings/nm-settings-plugin.h | 161 + src/settings/nm-settings.c | 1017 ++- src/settings/nm-settings.h | 16 +- src/settings/nm-system-config-interface.c | 216 - src/settings/nm-system-config-interface.h | 166 - src/settings/plugins/Makefile.am | 6 +- src/settings/plugins/Makefile.in | 31 +- src/settings/plugins/README | 33 + src/settings/plugins/example/Makefile.am | 33 - src/settings/plugins/example/Makefile.in | 779 -- src/settings/plugins/example/README | 35 - src/settings/plugins/example/common.h | 45 - .../plugins/example/nm-example-connection.c | 189 - .../plugins/example/nm-example-connection.h | 55 - src/settings/plugins/example/plugin.c | 858 -- src/settings/plugins/example/plugin.h | 55 - src/settings/plugins/example/reader.c | 47 - src/settings/plugins/example/writer.c | 56 - src/settings/plugins/ibft/Makefile.am | 7 +- src/settings/plugins/ibft/Makefile.in | 25 +- src/settings/plugins/ibft/plugin.c | 90 +- src/settings/plugins/ibft/plugin.h | 24 +- src/settings/plugins/ibft/reader.c | 5 +- src/settings/plugins/ibft/reader.h | 3 +- src/settings/plugins/ibft/tests/Makefile.am | 7 +- src/settings/plugins/ibft/tests/Makefile.in | 25 +- src/settings/plugins/ibft/tests/test-ibft.c | 2 +- src/settings/plugins/ifcfg-rh/Makefile.am | 35 +- src/settings/plugins/ifcfg-rh/Makefile.in | 71 +- src/settings/plugins/ifcfg-rh/common.h | 2 +- .../plugins/ifcfg-rh/nm-ifcfg-connection.c | 32 +- src/settings/plugins/ifcfg-rh/nm-ifcfg-rh.conf | 1 - src/settings/plugins/ifcfg-rh/nm-ifcfg-rh.xml | 1 - src/settings/plugins/ifcfg-rh/plugin.c | 711 +- src/settings/plugins/ifcfg-rh/plugin.h | 24 +- src/settings/plugins/ifcfg-rh/reader.c | 238 +- src/settings/plugins/ifcfg-rh/reader.h | 2 +- src/settings/plugins/ifcfg-rh/shvar.c | 80 +- src/settings/plugins/ifcfg-rh/shvar.h | 7 +- src/settings/plugins/ifcfg-rh/tests/Makefile.am | 7 +- src/settings/plugins/ifcfg-rh/tests/Makefile.in | 25 +- .../ifcfg-rh/tests/network-scripts/Makefile.am | 7 + .../ifcfg-rh/tests/network-scripts/Makefile.in | 25 +- .../tests/network-scripts/ifcfg-test-bridge-main | 2 +- .../tests/network-scripts/ifcfg-test-dns-options | 15 + .../tests/network-scripts/ifcfg-test-vlan-flags-1 | 14 + .../tests/network-scripts/ifcfg-test-vlan-flags-2 | 11 + .../ifcfg-test-wifi-mac-random-always | 7 + .../ifcfg-test-wifi-mac-random-default | 6 + .../ifcfg-test-wifi-mac-random-missing | 6 + .../ifcfg-test-wifi-mac-random-never | 6 + .../tests/network-scripts/ifcfg-test-wired-static | 1 + .../ifcfg-test-wired-static-bootproto | 1 + .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 472 +- src/settings/plugins/ifcfg-rh/utils.c | 3 +- src/settings/plugins/ifcfg-rh/utils.h | 3 +- src/settings/plugins/ifcfg-rh/writer.c | 166 +- src/settings/plugins/ifcfg-rh/writer.h | 4 +- src/settings/plugins/ifcfg-suse/Makefile.am | 20 - src/settings/plugins/ifcfg-suse/Makefile.in | 819 -- src/settings/plugins/ifcfg-suse/plugin.c | 312 - src/settings/plugins/ifcfg-suse/plugin.h | 50 - src/settings/plugins/ifnet/Makefile.am | 6 +- src/settings/plugins/ifnet/Makefile.in | 24 +- src/settings/plugins/ifnet/connection_parser.c | 5 +- src/settings/plugins/ifnet/net_parser.c | 4 +- src/settings/plugins/ifnet/net_parser.h | 2 +- src/settings/plugins/ifnet/net_utils.c | 50 +- src/settings/plugins/ifnet/net_utils.h | 6 +- src/settings/plugins/ifnet/nm-ifnet-connection.c | 11 +- src/settings/plugins/ifnet/plugin.c | 201 +- src/settings/plugins/ifnet/plugin.h | 24 +- src/settings/plugins/ifnet/tests/Makefile.am | 23 +- src/settings/plugins/ifnet/tests/Makefile.in | 446 +- src/settings/plugins/ifnet/tests/hostname | 2 - src/settings/plugins/ifnet/tests/test-ifnet.c | 398 + src/settings/plugins/ifnet/tests/test_all.c | 488 -- src/settings/plugins/ifnet/wpa_parser.c | 4 +- src/settings/plugins/ifnet/wpa_parser.h | 2 +- src/settings/plugins/ifupdown/Makefile.am | 6 +- src/settings/plugins/ifupdown/Makefile.in | 24 +- src/settings/plugins/ifupdown/interface_parser.c | 2 +- src/settings/plugins/ifupdown/interface_parser.h | 2 +- .../plugins/ifupdown/nm-ifupdown-connection.c | 4 +- .../plugins/ifupdown/nm-ifupdown-connection.h | 1 + src/settings/plugins/ifupdown/parser.c | 4 +- src/settings/plugins/ifupdown/plugin.c | 252 +- src/settings/plugins/ifupdown/plugin.h | 24 +- src/settings/plugins/ifupdown/tests/Makefile.am | 6 +- src/settings/plugins/ifupdown/tests/Makefile.in | 24 +- .../plugins/ifupdown/tests/test-ifupdown.c | 13 +- src/settings/plugins/keyfile/Makefile.am | 10 +- src/settings/plugins/keyfile/Makefile.in | 28 +- src/settings/plugins/keyfile/common.h | 32 - .../plugins/keyfile/nm-keyfile-connection.c | 30 +- src/settings/plugins/keyfile/plugin.c | 395 +- src/settings/plugins/keyfile/plugin.h | 20 +- src/settings/plugins/keyfile/reader.c | 2 +- src/settings/plugins/keyfile/reader.h | 3 +- src/settings/plugins/keyfile/tests/Makefile.am | 8 +- src/settings/plugins/keyfile/tests/Makefile.in | 28 +- .../keyfile/tests/keyfiles/ATT_Data_Connect_Plain | 3 + .../plugins/keyfile/tests/keyfiles/Makefile.in | 18 +- .../keyfile/tests/keyfiles/Test_Bridge_Main | 1 + src/settings/plugins/keyfile/tests/test-keyfile.c | 174 +- src/settings/plugins/keyfile/utils.c | 25 +- src/settings/plugins/keyfile/utils.h | 7 +- src/settings/plugins/keyfile/writer.c | 65 +- src/settings/plugins/keyfile/writer.h | 4 +- src/supplicant-manager/nm-supplicant-config.c | 514 +- src/supplicant-manager/nm-supplicant-config.h | 19 +- src/supplicant-manager/nm-supplicant-interface.c | 414 +- src/supplicant-manager/nm-supplicant-interface.h | 30 +- src/supplicant-manager/nm-supplicant-manager.c | 36 +- src/supplicant-manager/nm-supplicant-manager.h | 2 +- .../nm-supplicant-settings-verify.c | 2 +- src/supplicant-manager/nm-supplicant-types.h | 20 + src/supplicant-manager/tests/Makefile.am | 9 +- src/supplicant-manager/tests/Makefile.in | 27 +- src/supplicant-manager/tests/certs/Makefile.in | 18 +- .../tests/test-supplicant-config.c | 52 +- src/systemd/nm-sd-adapt.c | 237 + src/systemd/nm-sd-adapt.h | 152 + src/systemd/src/basic/alloc-util.c | 87 + src/systemd/src/basic/alloc-util.h | 111 + src/systemd/src/basic/async.h | 29 + src/systemd/src/basic/escape.c | 493 ++ src/systemd/src/basic/escape.h | 55 + src/systemd/src/basic/fd-util.c | 366 + src/systemd/src/basic/fd-util.h | 77 + src/systemd/src/basic/fileio.c | 1261 +++ src/systemd/src/basic/fileio.h | 86 + src/systemd/src/basic/fs-util.c | 526 ++ src/systemd/src/basic/fs-util.h | 79 + src/systemd/src/basic/hashmap.c | 1871 ++++ src/systemd/src/basic/hashmap.h | 417 + src/systemd/src/basic/hexdecoct.c | 702 ++ src/systemd/src/basic/hexdecoct.h | 57 + src/systemd/src/basic/hostname-util.c | 230 + src/systemd/src/basic/hostname-util.h | 44 + src/systemd/src/basic/in-addr-util.c | 360 + src/systemd/src/basic/in-addr-util.h | 58 + src/systemd/src/basic/io-util.c | 268 + src/systemd/src/basic/io-util.h | 81 + src/systemd/src/basic/list.h | 186 + src/systemd/src/basic/log.h | 246 + src/systemd/src/basic/macro.h | 379 + src/systemd/src/basic/mempool.c | 108 + src/systemd/src/basic/mempool.h | 51 + src/systemd/src/basic/parse-util.c | 542 ++ src/systemd/src/basic/parse-util.h | 99 + src/systemd/src/basic/path-util.c | 813 ++ src/systemd/src/basic/path-util.h | 115 + src/systemd/src/basic/prioq.c | 324 + src/systemd/src/basic/prioq.h | 47 + src/systemd/src/basic/random-util.c | 140 + src/systemd/src/basic/random-util.h | 41 + src/systemd/src/basic/refcnt.h | 38 + src/systemd/src/basic/set.h | 137 + src/systemd/src/basic/siphash24.c | 193 + src/systemd/src/basic/siphash24.h | 23 + src/systemd/src/basic/socket-util.h | 141 + src/systemd/src/basic/sparse-endian.h | 90 + src/systemd/src/basic/string-table.c | 38 + src/systemd/src/basic/string-table.h | 91 + src/systemd/src/basic/string-util.c | 813 ++ src/systemd/src/basic/string-util.h | 188 + src/systemd/src/basic/strv.c | 879 ++ src/systemd/src/basic/strv.h | 177 + src/systemd/src/basic/time-util.c | 1154 +++ src/systemd/src/basic/time-util.h | 131 + src/systemd/src/basic/umask-util.h | 50 + src/systemd/src/basic/unaligned.h | 115 + src/systemd/src/basic/utf8.c | 405 + src/systemd/src/basic/utf8.h | 61 + src/systemd/src/basic/util.c | 813 ++ src/systemd/src/basic/util.h | 186 + src/systemd/src/libsystemd-network/arp-util.c | 156 + src/systemd/src/libsystemd-network/arp-util.h | 36 + .../src/libsystemd-network/dhcp-identifier.c | 116 + .../src/libsystemd-network/dhcp-identifier.h | 67 + src/systemd/src/libsystemd-network/dhcp-internal.h | 72 + .../src/libsystemd-network/dhcp-lease-internal.h | 106 + src/systemd/src/libsystemd-network/dhcp-network.c | 237 + src/systemd/src/libsystemd-network/dhcp-option.c | 272 + src/systemd/src/libsystemd-network/dhcp-packet.c | 193 + src/systemd/src/libsystemd-network/dhcp-protocol.h | 159 + .../src/libsystemd-network/dhcp6-internal.h | 84 + .../src/libsystemd-network/dhcp6-lease-internal.h | 78 + src/systemd/src/libsystemd-network/dhcp6-network.c | 93 + src/systemd/src/libsystemd-network/dhcp6-option.c | 416 + .../src/libsystemd-network/dhcp6-protocol.h | 152 + src/systemd/src/libsystemd-network/lldp-internal.c | 364 + src/systemd/src/libsystemd-network/lldp-internal.h | 95 + src/systemd/src/libsystemd-network/lldp-network.c | 87 + src/systemd/src/libsystemd-network/lldp-network.h | 29 + src/systemd/src/libsystemd-network/lldp-port.c | 120 + src/systemd/src/libsystemd-network/lldp-port.h | 73 + src/systemd/src/libsystemd-network/lldp-tlv.c | 642 ++ src/systemd/src/libsystemd-network/lldp-tlv.h | 98 + src/systemd/src/libsystemd-network/lldp.h | 130 + .../src/libsystemd-network/network-internal.c | 560 ++ .../src/libsystemd-network/network-internal.h | 85 + .../src/libsystemd-network/sd-dhcp-client.c | 1781 ++++ src/systemd/src/libsystemd-network/sd-dhcp-lease.c | 1145 +++ .../src/libsystemd-network/sd-dhcp6-client.c | 1309 +++ .../src/libsystemd-network/sd-dhcp6-lease.c | 414 + src/systemd/src/libsystemd-network/sd-ipv4acd.c | 529 ++ src/systemd/src/libsystemd-network/sd-ipv4ll.c | 366 + src/systemd/src/libsystemd-network/sd-lldp.c | 760 ++ src/systemd/src/libsystemd/sd-id128/sd-id128.c | 233 + src/systemd/src/shared/dns-domain.c | 1249 +++ src/systemd/src/shared/dns-domain.h | 107 + src/systemd/src/systemd/_sd-common.h | 87 + src/systemd/src/systemd/sd-dhcp-client.h | 86 + src/systemd/src/systemd/sd-dhcp-lease.h | 67 + src/systemd/src/systemd/sd-dhcp6-client.h | 81 + src/systemd/src/systemd/sd-dhcp6-lease.h | 56 + src/systemd/src/systemd/sd-event.h | 142 + src/systemd/src/systemd/sd-id128.h | 119 + src/systemd/src/systemd/sd-ipv4acd.h | 64 + src/systemd/src/systemd/sd-ipv4ll.h | 64 + src/systemd/src/systemd/sd-lldp.h | 91 + src/systemd/src/systemd/sd-ndisc.h | 88 + src/tests/Makefile.am | 33 +- src/tests/Makefile.in | 83 +- src/tests/config/Makefile.am | 12 +- src/tests/config/Makefile.in | 30 +- src/tests/config/NetworkManager.conf | 16 + src/tests/config/conf.d/20-config-enable-1.conf | 5 + src/tests/config/global-dns-invalid.conf | 9 + src/tests/config/nm-test-device.h | 2 +- src/tests/config/test-config.c | 498 +- src/tests/test-dcb.c | 12 +- src/tests/test-general-with-expect.c | 5 +- src/tests/test-general.c | 315 +- src/tests/test-ip4-config.c | 28 +- src/tests/test-ip6-config.c | 19 +- src/tests/test-resolvconf-capture.c | 114 +- src/tests/test-route-manager.c | 19 +- src/tests/test-utils.c | 63 + src/tests/test-wired-defname.c | 14 +- src/vpn-manager/nm-vpn-connection.c | 1915 ++-- src/vpn-manager/nm-vpn-connection.h | 41 +- src/vpn-manager/nm-vpn-manager.c | 285 +- src/vpn-manager/nm-vpn-manager.h | 7 +- src/vpn-manager/nm-vpn-service.c | 385 - src/vpn-manager/nm-vpn-service.h | 63 - tools/Makefile.in | 18 +- tools/check-exports.sh | 4 +- tools/test-networkmanager-service.py | 203 +- valgrind.suppressions | 46 +- vapi/Makefile.am | 2 + vapi/Makefile.in | 20 +- 1297 files changed, 325543 insertions(+), 199696 deletions(-) delete mode 100644 callouts/nm-avahi-autoipd-action.c delete mode 100644 callouts/nm-avahi-autoipd.conf create mode 100644 callouts/tests/dispatcher-external create mode 100644 docs/libnm/html/NMDeviceIPTunnel.html create mode 100644 docs/libnm/html/NMDeviceMacvlan.html create mode 100644 docs/libnm/html/NMDeviceTun.html create mode 100644 docs/libnm/html/NMDeviceVxlan.html create mode 100644 docs/libnm/html/NMSettingIPTunnel.html create mode 100644 docs/libnm/html/NMSettingMacvlan.html create mode 100644 docs/libnm/html/NMSettingTun.html create mode 100644 docs/libnm/html/NMSettingVxlan.html delete mode 100644 docs/libnm/html/NMVpnEditor.html create mode 100644 docs/libnm/html/NMVpnEditorPlugin.html create mode 100644 examples/lua/Makefile.am create mode 100644 examples/lua/Makefile.in create mode 100644 examples/lua/lgi/Makefile.am create mode 100644 examples/lua/lgi/Makefile.in create mode 100755 examples/lua/lgi/add-connection.lua create mode 100755 examples/lua/lgi/change-vpn-username.lua create mode 100755 examples/lua/lgi/deactivate-all.lua create mode 100755 examples/lua/lgi/get-basic-nm-info.lua create mode 100755 examples/lua/lgi/get-ips.lua create mode 100755 examples/lua/lgi/list-connections.lua create mode 100755 examples/lua/lgi/list-devices.lua create mode 100755 examples/lua/lgi/show-wifi-networks.lua delete mode 100755 examples/python/dbus/add-system-wifi-connection.py create mode 100755 examples/python/dbus/add-wifi-eap-connection.py create mode 100755 examples/python/dbus/add-wifi-psk-connection.py create mode 100755 examples/python/dbus/create-bond.py create mode 100755 examples/python/dbus/wifi-active-ap.py create mode 100755 examples/python/dbus/wifi-hotspot.py create mode 100644 examples/python/gi/README create mode 100755 examples/python/gi/deactivate-all.py create mode 100644 examples/python/python-networkmanager/Makefile.am create mode 100644 examples/python/python-networkmanager/Makefile.in create mode 100644 examples/python/python-networkmanager/README delete mode 100644 include/Makefile.am delete mode 100644 include/Makefile.in delete mode 100644 include/gsystem-local-alloc.h delete mode 100644 include/nm-dbus-glib-types.h delete mode 100644 include/nm-glib-compat.h delete mode 100644 include/nm-gvaluearray-compat.h delete mode 100644 include/nm-macros-internal.h delete mode 100644 include/nm-test-utils.h delete mode 100644 include/nm-version-macros.h delete mode 100644 include/nm-version-macros.h.in delete mode 100644 initscript/Arch/networkmanager.in delete mode 100755 initscript/Debian/NetworkManager.in delete mode 100644 initscript/Mandriva/networkmanager.in delete mode 100755 initscript/RedHat/NetworkManager.in delete mode 100644 initscript/SUSE/networkmanager.in delete mode 100644 initscript/Slackware/rc.networkmanager.in delete mode 100644 initscript/linexa/networkmanager.in delete mode 100644 introspection/nm-device-gre.xml create mode 100644 introspection/nm-device-ip-tunnel.xml create mode 100644 libnm-core/nm-core-types-internal.h create mode 100644 libnm-core/nm-dbus-utils.c create mode 100644 libnm-core/nm-setting-ip-tunnel.c create mode 100644 libnm-core/nm-setting-ip-tunnel.h create mode 100644 libnm-core/nm-setting-macvlan.c create mode 100644 libnm-core/nm-setting-macvlan.h create mode 100644 libnm-core/nm-setting-tun.c create mode 100644 libnm-core/nm-setting-tun.h create mode 100644 libnm-core/nm-setting-vxlan.c create mode 100644 libnm-core/nm-setting-vxlan.h create mode 100644 libnm-core/nm-vpn-editor-plugin.c create mode 100644 libnm-core/nm-vpn-editor-plugin.h create mode 100644 libnm-core/nm-vpn-plugin-info.c create mode 100644 libnm-core/nm-vpn-plugin-info.h delete mode 100644 libnm-glib/tests/common.c delete mode 100644 libnm-glib/tests/common.h create mode 100644 libnm-util/nm-dbus-glib-types.h create mode 100644 libnm-util/nm-gvaluearray-compat.h create mode 100644 libnm/nm-device-ip-tunnel.c create mode 100644 libnm/nm-device-ip-tunnel.h create mode 100644 libnm/nm-device-macvlan.c create mode 100644 libnm/nm-device-macvlan.h create mode 100644 libnm/nm-device-tun.c create mode 100644 libnm/nm-device-tun.h create mode 100644 libnm/nm-device-vxlan.c create mode 100644 libnm/nm-device-vxlan.h delete mode 100644 libnm/nm-vpn-editor-plugin.c delete mode 100644 libnm/nm-vpn-editor-plugin.h create mode 100644 libnm/nm-vpn-editor.c create mode 100644 libnm/nm-vpn-editor.h create mode 100644 libnm/nm-vpn-service-plugin.c create mode 100644 libnm/nm-vpn-service-plugin.h delete mode 100644 libnm/tests/common.c delete mode 100644 libnm/tests/common.h delete mode 100644 man/NetworkManager.8 delete mode 100644 man/NetworkManager.conf.5 create mode 100644 man/NetworkManager.conf.xml create mode 100644 man/NetworkManager.xml delete mode 100644 man/nmcli-examples.5 create mode 100644 man/nmcli-examples.xml create mode 100644 shared/Makefile.am create mode 100644 shared/Makefile.in create mode 100644 shared/gsystem-local-alloc.h create mode 100644 shared/nm-dbus-compat.h create mode 100644 shared/nm-default.h create mode 100644 shared/nm-glib.h create mode 100644 shared/nm-macros-internal.h create mode 100644 shared/nm-test-libnm-utils.h create mode 100644 shared/nm-test-utils-impl.c create mode 100644 shared/nm-test-utils.h create mode 100644 shared/nm-version-macros.h create mode 100644 shared/nm-version-macros.h.in create mode 100644 src/devices/Makefile.am create mode 100644 src/devices/Makefile.in delete mode 100644 src/devices/adsl/nm-adsl-enum-types.c delete mode 100644 src/devices/adsl/nm-adsl-enum-types.h delete mode 100644 src/devices/adsl/nm-device-adsl-glue.h delete mode 100644 src/devices/bluetooth/nm-device-bt-glue.h delete mode 100644 src/devices/nm-device-gre.c delete mode 100644 src/devices/nm-device-gre.h create mode 100644 src/devices/nm-device-ip-tunnel.c create mode 100644 src/devices/nm-device-ip-tunnel.h create mode 100644 src/devices/nm-lldp-listener.c create mode 100644 src/devices/nm-lldp-listener.h delete mode 100644 src/devices/team/nm-device-team-glue.h delete mode 100644 src/devices/team/nm-team-enum-types.c delete mode 100644 src/devices/team/nm-team-enum-types.h create mode 100644 src/devices/tests/Makefile.am create mode 100644 src/devices/tests/Makefile.in create mode 100644 src/devices/tests/test-lldp.c delete mode 100644 src/devices/wifi/nm-device-olpc-mesh-glue.h delete mode 100644 src/devices/wifi/nm-device-wifi-glue.h delete mode 100644 src/devices/wifi/nm-wifi-enum-types.c delete mode 100644 src/devices/wifi/nm-wifi-enum-types.h delete mode 100644 src/devices/wimax/Makefile.am delete mode 100644 src/devices/wimax/Makefile.in delete mode 100644 src/devices/wimax/exports.ver delete mode 100644 src/devices/wimax/iwmxsdk.c delete mode 100644 src/devices/wimax/iwmxsdk.h delete mode 100644 src/devices/wimax/nm-device-wimax.c delete mode 100644 src/devices/wimax/nm-device-wimax.h delete mode 100644 src/devices/wimax/nm-wimax-factory.c delete mode 100644 src/devices/wimax/nm-wimax-nsp.c delete mode 100644 src/devices/wimax/nm-wimax-nsp.h delete mode 100644 src/devices/wimax/nm-wimax-types.h delete mode 100644 src/devices/wimax/nm-wimax-util.c delete mode 100644 src/devices/wimax/nm-wimax-util.h delete mode 100644 src/devices/wwan/nm-device-modem-glue.h delete mode 100644 src/dhcp-manager/nm-dhcp-helper.conf delete mode 100644 src/dhcp-manager/systemd-dhcp/nm-sd-adapt.c delete mode 100644 src/dhcp-manager/systemd-dhcp/nm-sd-adapt.h delete mode 100644 src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-internal.h delete mode 100644 src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-lease-internal.h delete mode 100644 src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-network.c delete mode 100644 src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-option.c delete mode 100644 src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-packet.c delete mode 100644 src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp-protocol.h delete mode 100644 src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-internal.h delete mode 100644 src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-lease-internal.h delete mode 100644 src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-network.c delete mode 100644 src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-option.c delete mode 100644 src/dhcp-manager/systemd-dhcp/src/libsystemd-network/dhcp6-protocol.h delete mode 100644 src/dhcp-manager/systemd-dhcp/src/libsystemd-network/network-internal.c delete mode 100644 src/dhcp-manager/systemd-dhcp/src/libsystemd-network/network-internal.h delete mode 100644 src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp-client.c delete mode 100644 src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp-lease.c delete mode 100644 src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp6-client.c delete mode 100644 src/dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp6-lease.c delete mode 100644 src/dhcp-manager/systemd-dhcp/src/shared/async.h delete mode 100644 src/dhcp-manager/systemd-dhcp/src/shared/fileio.c delete mode 100644 src/dhcp-manager/systemd-dhcp/src/shared/fileio.h delete mode 100644 src/dhcp-manager/systemd-dhcp/src/shared/in-addr-util.c delete mode 100644 src/dhcp-manager/systemd-dhcp/src/shared/in-addr-util.h delete mode 100644 src/dhcp-manager/systemd-dhcp/src/shared/list.h delete mode 100644 src/dhcp-manager/systemd-dhcp/src/shared/macro.h delete mode 100644 src/dhcp-manager/systemd-dhcp/src/shared/refcnt.h delete mode 100644 src/dhcp-manager/systemd-dhcp/src/shared/siphash24.c delete mode 100644 src/dhcp-manager/systemd-dhcp/src/shared/siphash24.h delete mode 100644 src/dhcp-manager/systemd-dhcp/src/shared/socket-util.h delete mode 100644 src/dhcp-manager/systemd-dhcp/src/shared/sparse-endian.h delete mode 100644 src/dhcp-manager/systemd-dhcp/src/shared/strv.c delete mode 100644 src/dhcp-manager/systemd-dhcp/src/shared/strv.h delete mode 100644 src/dhcp-manager/systemd-dhcp/src/shared/time-util.c delete mode 100644 src/dhcp-manager/systemd-dhcp/src/shared/time-util.h delete mode 100644 src/dhcp-manager/systemd-dhcp/src/shared/unaligned.h delete mode 100644 src/dhcp-manager/systemd-dhcp/src/shared/utf8.c delete mode 100644 src/dhcp-manager/systemd-dhcp/src/shared/utf8.h delete mode 100644 src/dhcp-manager/systemd-dhcp/src/shared/util.c delete mode 100644 src/dhcp-manager/systemd-dhcp/src/shared/util.h delete mode 100644 src/dhcp-manager/systemd-dhcp/src/systemd/_sd-common.h delete mode 100644 src/dhcp-manager/systemd-dhcp/src/systemd/sd-dhcp-client.h delete mode 100644 src/dhcp-manager/systemd-dhcp/src/systemd/sd-dhcp-lease.h delete mode 100644 src/dhcp-manager/systemd-dhcp/src/systemd/sd-dhcp6-client.h delete mode 100644 src/dhcp-manager/systemd-dhcp/src/systemd/sd-dhcp6-lease.h delete mode 100644 src/dhcp-manager/systemd-dhcp/src/systemd/sd-event.h delete mode 100644 src/dhcp-manager/systemd-dhcp/src/systemd/sd-id128.h delete mode 100644 src/nm-access-point-glue.h delete mode 100644 src/nm-active-connection-glue.h delete mode 100644 src/nm-agent-manager-glue.h create mode 100644 src/nm-audit-manager.c create mode 100644 src/nm-audit-manager.h create mode 100644 src/nm-bus-manager.c create mode 100644 src/nm-bus-manager.h delete mode 100644 src/nm-dbus-manager.c delete mode 100644 src/nm-dbus-manager.h delete mode 100644 src/nm-device-bond-glue.h delete mode 100644 src/nm-device-bridge-glue.h delete mode 100644 src/nm-device-ethernet-glue.h delete mode 100644 src/nm-device-generic-glue.h delete mode 100644 src/nm-device-glue.h delete mode 100644 src/nm-device-gre-glue.h delete mode 100644 src/nm-device-infiniband-glue.h delete mode 100644 src/nm-device-macvlan-glue.h delete mode 100644 src/nm-device-tun-glue.h delete mode 100644 src/nm-device-veth-glue.h delete mode 100644 src/nm-device-vlan-glue.h delete mode 100644 src/nm-device-vxlan-glue.h delete mode 100644 src/nm-dhcp4-config-glue.h delete mode 100644 src/nm-dhcp6-config-glue.h create mode 100644 src/nm-exported-object.c create mode 100644 src/nm-exported-object.h delete mode 100644 src/nm-ip4-config-glue.h delete mode 100644 src/nm-ip6-config-glue.h delete mode 100644 src/nm-manager-glue.h delete mode 100644 src/nm-ppp-manager-glue.h delete mode 100644 src/nm-properties-changed-signal.c delete mode 100644 src/nm-properties-changed-signal.h delete mode 100644 src/nm-session-monitor-ck.c delete mode 100644 src/nm-session-monitor-null.c delete mode 100644 src/nm-session-monitor-systemd.c create mode 100644 src/nm-session-monitor.c delete mode 100644 src/nm-session-utils.c delete mode 100644 src/nm-session-utils.h delete mode 100644 src/nm-settings-connection-glue.h delete mode 100644 src/nm-settings-glue.h delete mode 100644 src/nm-vpn-connection-glue.h create mode 100644 src/settings/nm-settings-plugin.c create mode 100644 src/settings/nm-settings-plugin.h delete mode 100644 src/settings/nm-system-config-interface.c delete mode 100644 src/settings/nm-system-config-interface.h create mode 100644 src/settings/plugins/README delete mode 100644 src/settings/plugins/example/Makefile.am delete mode 100644 src/settings/plugins/example/Makefile.in delete mode 100644 src/settings/plugins/example/README delete mode 100644 src/settings/plugins/example/common.h delete mode 100644 src/settings/plugins/example/nm-example-connection.c delete mode 100644 src/settings/plugins/example/nm-example-connection.h delete mode 100644 src/settings/plugins/example/plugin.c delete mode 100644 src/settings/plugins/example/plugin.h delete mode 100644 src/settings/plugins/example/reader.c delete mode 100644 src/settings/plugins/example/writer.c create mode 100644 src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-dns-options create mode 100644 src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-vlan-flags-1 create mode 100644 src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-vlan-flags-2 create mode 100644 src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-mac-random-always create mode 100644 src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-mac-random-default create mode 100644 src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-mac-random-missing create mode 100644 src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wifi-mac-random-never delete mode 100644 src/settings/plugins/ifcfg-suse/Makefile.am delete mode 100644 src/settings/plugins/ifcfg-suse/Makefile.in delete mode 100644 src/settings/plugins/ifcfg-suse/plugin.c delete mode 100644 src/settings/plugins/ifcfg-suse/plugin.h delete mode 100644 src/settings/plugins/ifnet/tests/hostname create mode 100644 src/settings/plugins/ifnet/tests/test-ifnet.c delete mode 100644 src/settings/plugins/ifnet/tests/test_all.c delete mode 100644 src/settings/plugins/keyfile/common.h create mode 100644 src/systemd/nm-sd-adapt.c create mode 100644 src/systemd/nm-sd-adapt.h create mode 100644 src/systemd/src/basic/alloc-util.c create mode 100644 src/systemd/src/basic/alloc-util.h create mode 100644 src/systemd/src/basic/async.h create mode 100644 src/systemd/src/basic/escape.c create mode 100644 src/systemd/src/basic/escape.h create mode 100644 src/systemd/src/basic/fd-util.c create mode 100644 src/systemd/src/basic/fd-util.h create mode 100644 src/systemd/src/basic/fileio.c create mode 100644 src/systemd/src/basic/fileio.h create mode 100644 src/systemd/src/basic/fs-util.c create mode 100644 src/systemd/src/basic/fs-util.h create mode 100644 src/systemd/src/basic/hashmap.c create mode 100644 src/systemd/src/basic/hashmap.h create mode 100644 src/systemd/src/basic/hexdecoct.c create mode 100644 src/systemd/src/basic/hexdecoct.h create mode 100644 src/systemd/src/basic/hostname-util.c create mode 100644 src/systemd/src/basic/hostname-util.h create mode 100644 src/systemd/src/basic/in-addr-util.c create mode 100644 src/systemd/src/basic/in-addr-util.h create mode 100644 src/systemd/src/basic/io-util.c create mode 100644 src/systemd/src/basic/io-util.h create mode 100644 src/systemd/src/basic/list.h create mode 100644 src/systemd/src/basic/log.h create mode 100644 src/systemd/src/basic/macro.h create mode 100644 src/systemd/src/basic/mempool.c create mode 100644 src/systemd/src/basic/mempool.h create mode 100644 src/systemd/src/basic/parse-util.c create mode 100644 src/systemd/src/basic/parse-util.h create mode 100644 src/systemd/src/basic/path-util.c create mode 100644 src/systemd/src/basic/path-util.h create mode 100644 src/systemd/src/basic/prioq.c create mode 100644 src/systemd/src/basic/prioq.h create mode 100644 src/systemd/src/basic/random-util.c create mode 100644 src/systemd/src/basic/random-util.h create mode 100644 src/systemd/src/basic/refcnt.h create mode 100644 src/systemd/src/basic/set.h create mode 100644 src/systemd/src/basic/siphash24.c create mode 100644 src/systemd/src/basic/siphash24.h create mode 100644 src/systemd/src/basic/socket-util.h create mode 100644 src/systemd/src/basic/sparse-endian.h create mode 100644 src/systemd/src/basic/string-table.c create mode 100644 src/systemd/src/basic/string-table.h create mode 100644 src/systemd/src/basic/string-util.c create mode 100644 src/systemd/src/basic/string-util.h create mode 100644 src/systemd/src/basic/strv.c create mode 100644 src/systemd/src/basic/strv.h create mode 100644 src/systemd/src/basic/time-util.c create mode 100644 src/systemd/src/basic/time-util.h create mode 100644 src/systemd/src/basic/umask-util.h create mode 100644 src/systemd/src/basic/unaligned.h create mode 100644 src/systemd/src/basic/utf8.c create mode 100644 src/systemd/src/basic/utf8.h create mode 100644 src/systemd/src/basic/util.c create mode 100644 src/systemd/src/basic/util.h create mode 100644 src/systemd/src/libsystemd-network/arp-util.c create mode 100644 src/systemd/src/libsystemd-network/arp-util.h create mode 100644 src/systemd/src/libsystemd-network/dhcp-identifier.c create mode 100644 src/systemd/src/libsystemd-network/dhcp-identifier.h create mode 100644 src/systemd/src/libsystemd-network/dhcp-internal.h create mode 100644 src/systemd/src/libsystemd-network/dhcp-lease-internal.h create mode 100644 src/systemd/src/libsystemd-network/dhcp-network.c create mode 100644 src/systemd/src/libsystemd-network/dhcp-option.c create mode 100644 src/systemd/src/libsystemd-network/dhcp-packet.c create mode 100644 src/systemd/src/libsystemd-network/dhcp-protocol.h create mode 100644 src/systemd/src/libsystemd-network/dhcp6-internal.h create mode 100644 src/systemd/src/libsystemd-network/dhcp6-lease-internal.h create mode 100644 src/systemd/src/libsystemd-network/dhcp6-network.c create mode 100644 src/systemd/src/libsystemd-network/dhcp6-option.c create mode 100644 src/systemd/src/libsystemd-network/dhcp6-protocol.h create mode 100644 src/systemd/src/libsystemd-network/lldp-internal.c create mode 100644 src/systemd/src/libsystemd-network/lldp-internal.h create mode 100644 src/systemd/src/libsystemd-network/lldp-network.c create mode 100644 src/systemd/src/libsystemd-network/lldp-network.h create mode 100644 src/systemd/src/libsystemd-network/lldp-port.c create mode 100644 src/systemd/src/libsystemd-network/lldp-port.h create mode 100644 src/systemd/src/libsystemd-network/lldp-tlv.c create mode 100644 src/systemd/src/libsystemd-network/lldp-tlv.h create mode 100644 src/systemd/src/libsystemd-network/lldp.h create mode 100644 src/systemd/src/libsystemd-network/network-internal.c create mode 100644 src/systemd/src/libsystemd-network/network-internal.h create mode 100644 src/systemd/src/libsystemd-network/sd-dhcp-client.c create mode 100644 src/systemd/src/libsystemd-network/sd-dhcp-lease.c create mode 100644 src/systemd/src/libsystemd-network/sd-dhcp6-client.c create mode 100644 src/systemd/src/libsystemd-network/sd-dhcp6-lease.c create mode 100644 src/systemd/src/libsystemd-network/sd-ipv4acd.c create mode 100644 src/systemd/src/libsystemd-network/sd-ipv4ll.c create mode 100644 src/systemd/src/libsystemd-network/sd-lldp.c create mode 100644 src/systemd/src/libsystemd/sd-id128/sd-id128.c create mode 100644 src/systemd/src/shared/dns-domain.c create mode 100644 src/systemd/src/shared/dns-domain.h create mode 100644 src/systemd/src/systemd/_sd-common.h create mode 100644 src/systemd/src/systemd/sd-dhcp-client.h create mode 100644 src/systemd/src/systemd/sd-dhcp-lease.h create mode 100644 src/systemd/src/systemd/sd-dhcp6-client.h create mode 100644 src/systemd/src/systemd/sd-dhcp6-lease.h create mode 100644 src/systemd/src/systemd/sd-event.h create mode 100644 src/systemd/src/systemd/sd-id128.h create mode 100644 src/systemd/src/systemd/sd-ipv4acd.h create mode 100644 src/systemd/src/systemd/sd-ipv4ll.h create mode 100644 src/systemd/src/systemd/sd-lldp.h create mode 100644 src/systemd/src/systemd/sd-ndisc.h create mode 100644 src/tests/config/conf.d/20-config-enable-1.conf create mode 100644 src/tests/config/global-dns-invalid.conf create mode 100644 src/tests/test-utils.c delete mode 100644 src/vpn-manager/nm-vpn-service.c delete mode 100644 src/vpn-manager/nm-vpn-service.h diff --git a/Makefile.am b/Makefile.am index 7f66e4ff..a79bddca 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,12 +2,10 @@ include $(GLIB_MAKEFILE) SUBDIRS = \ . \ - include \ + shared \ introspection \ libnm-core \ libnm \ - libnm-util \ - libnm-glib \ src \ callouts \ clients \ @@ -15,9 +13,17 @@ SUBDIRS = \ policy \ data \ po \ - docs \ man \ - examples \ + examples + +if WITH_LEGACY_LIBRARIES +SUBDIRS += \ + libnm-util \ + libnm-glib +endif + +SUBDIRS += \ + docs \ vapi @GNOME_CODE_COVERAGE_RULES@ @@ -40,7 +46,6 @@ DISTCHECK_CONFIGURE_FLAGS = \ --with-udev-dir=$$dc_install_base/lib/udev \ --with-wext=no \ --enable-ifcfg-rh \ - --enable-ifcfg-suse \ --enable-ifupdown \ --enable-ifnet @@ -62,6 +67,6 @@ pkgconfig_DATA = NetworkManager.pc CLEANFILES = cscope.in.out cscope.out cscope.po.out cscope: - cscope -b -q -R -Iinclude -ssrc -slibnm-core -slibnm -slibnm-glib -slibnm-util -sclients; + cscope -b -q -R -sshared -ssrc -slibnm-core -slibnm -slibnm-glib -slibnm-util -sclients; .PHONY: cscope diff --git a/Makefile.glib b/Makefile.glib index 626b946c..87b7f823 100644 --- a/Makefile.glib +++ b/Makefile.glib @@ -85,7 +85,7 @@ $(1).h: $(1).h.stamp $(1).c.stamp: $(_glib_enum_types_h_sources) Makefile $$(_GLIB_V_GEN) $$(GLIB_MKENUMS) \ - --fhead "/* Generated by glib-mkenums. Do not edit */\n\n#include \"$(notdir $(1)).h\"\n" \ + --fhead "/* Generated by glib-mkenums. Do not edit */\n\n#include \"config.h\"\n\n#include \"$(notdir $(1)).h\"\n" \ $$(GLIB_MKENUMS_C_FLAGS) \ $$($(_glib_enum_types_prefix)_MKENUMS_C_FLAGS) \ --fhead "$$(foreach f,$$(filter-out Makefile,$$(^F)),\n#include \"$$(f)\")\n\n" \ diff --git a/Makefile.in b/Makefile.in index 749a36f7..2a294c11 100644 --- a/Makefile.in +++ b/Makefile.in @@ -88,6 +88,10 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +@WITH_LEGACY_LIBRARIES_TRUE@am__append_1 = \ +@WITH_LEGACY_LIBRARIES_TRUE@ libnm-util \ +@WITH_LEGACY_LIBRARIES_TRUE@ libnm-glib + subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_readline.m4 \ @@ -111,12 +115,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = initscript/RedHat/NetworkManager \ - initscript/Debian/NetworkManager \ - initscript/Slackware/rc.networkmanager \ - initscript/SUSE/networkmanager initscript/Arch/networkmanager \ - initscript/Mandriva/networkmanager \ - initscript/linexa/networkmanager NetworkManager.pc +CONFIG_CLEAN_FILES = NetworkManager.pc CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -203,7 +202,9 @@ am__define_uniq_tagged_files = \ ETAGS = etags CTAGS = ctags CSCOPE = cscope -DIST_SUBDIRS = $(SUBDIRS) +DIST_SUBDIRS = . shared introspection libnm-core libnm src callouts \ + clients tools policy data po man examples libnm-util \ + libnm-glib docs vapi am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/NetworkManager.pc.in \ $(srcdir)/config.h.in $(top_srcdir)/build-aux/compile \ $(top_srcdir)/build-aux/config.guess \ @@ -212,18 +213,11 @@ am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/NetworkManager.pc.in \ $(top_srcdir)/build-aux/install-sh \ $(top_srcdir)/build-aux/ltmain.sh \ $(top_srcdir)/build-aux/missing \ - $(top_srcdir)/build-aux/tap-driver.sh \ - $(top_srcdir)/initscript/Arch/networkmanager.in \ - $(top_srcdir)/initscript/Debian/NetworkManager.in \ - $(top_srcdir)/initscript/Mandriva/networkmanager.in \ - $(top_srcdir)/initscript/RedHat/NetworkManager.in \ - $(top_srcdir)/initscript/SUSE/networkmanager.in \ - $(top_srcdir)/initscript/Slackware/rc.networkmanager.in \ - $(top_srcdir)/initscript/linexa/networkmanager.in ABOUT-NLS \ - AUTHORS COPYING ChangeLog INSTALL NEWS README TODO \ - build-aux/compile build-aux/config.guess \ - build-aux/config.rpath build-aux/config.sub build-aux/depcomp \ - build-aux/install-sh build-aux/ltmain.sh build-aux/missing + $(top_srcdir)/build-aux/tap-driver.sh ABOUT-NLS AUTHORS \ + COPYING ChangeLog INSTALL NEWS README TODO build-aux/compile \ + build-aux/config.guess build-aux/config.rpath \ + build-aux/config.sub build-aux/install-sh build-aux/ltmain.sh \ + build-aux/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -260,8 +254,8 @@ am__relativize = \ done; \ reldir="$$dir2" GZIP_ENV = --best -DIST_ARCHIVES = $(distdir).tar.bz2 -DIST_TARGETS = dist-bzip2 +DIST_ARCHIVES = $(distdir).tar.xz +DIST_TARGETS = dist-xz distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' @@ -281,7 +275,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -293,8 +286,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -304,6 +295,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -358,16 +350,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -404,6 +393,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -432,7 +423,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -447,6 +437,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -507,6 +499,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -514,6 +507,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -529,26 +523,8 @@ with_dhcpcd = @with_dhcpcd@ with_netconfig = @with_netconfig@ with_resolvconf = @with_resolvconf@ with_valgrind = @with_valgrind@ -SUBDIRS = \ - . \ - include \ - introspection \ - libnm-core \ - libnm \ - libnm-util \ - libnm-glib \ - src \ - callouts \ - clients \ - tools \ - policy \ - data \ - po \ - docs \ - man \ - examples \ - vapi - +SUBDIRS = . shared introspection libnm-core libnm src callouts clients \ + tools policy data po man examples $(am__append_1) docs vapi EXTRA_DIST = \ CONTRIBUTING \ NetworkManager.pc.in \ @@ -567,7 +543,6 @@ DISTCHECK_CONFIGURE_FLAGS = \ --with-udev-dir=$$dc_install_base/lib/udev \ --with-wext=no \ --enable-ifcfg-rh \ - --enable-ifcfg-suse \ --enable-ifupdown \ --enable-ifnet @@ -627,20 +602,6 @@ $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) distclean-hdr: -rm -f config.h stamp-h1 -initscript/RedHat/NetworkManager: $(top_builddir)/config.status $(top_srcdir)/initscript/RedHat/NetworkManager.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -initscript/Debian/NetworkManager: $(top_builddir)/config.status $(top_srcdir)/initscript/Debian/NetworkManager.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -initscript/Slackware/rc.networkmanager: $(top_builddir)/config.status $(top_srcdir)/initscript/Slackware/rc.networkmanager.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -initscript/SUSE/networkmanager: $(top_builddir)/config.status $(top_srcdir)/initscript/SUSE/networkmanager.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -initscript/Arch/networkmanager: $(top_builddir)/config.status $(top_srcdir)/initscript/Arch/networkmanager.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -initscript/Mandriva/networkmanager: $(top_builddir)/config.status $(top_srcdir)/initscript/Mandriva/networkmanager.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -initscript/linexa/networkmanager: $(top_builddir)/config.status $(top_srcdir)/initscript/linexa/networkmanager.in - cd $(top_builddir) && $(SHELL) ./config.status $@ NetworkManager.pc: $(top_builddir)/config.status $(srcdir)/NetworkManager.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ @@ -844,6 +805,7 @@ distdir: $(DISTFILES) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) + dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) @@ -851,7 +813,6 @@ dist-bzip2: distdir dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) - dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) @@ -1107,7 +1068,7 @@ include $(GLIB_MAKEFILE) dist: dist-check-setting-docs cscope: - cscope -b -q -R -Iinclude -ssrc -slibnm-core -slibnm -slibnm-glib -slibnm-util -sclients; + cscope -b -q -R -sshared -ssrc -slibnm-core -slibnm -slibnm-glib -slibnm-util -sclients; .PHONY: cscope diff --git a/NEWS b/NEWS index 1f6b10d1..2cfd2d56 100644 --- a/NEWS +++ b/NEWS @@ -1,76 +1,143 @@ -=============================================== -NetworkManager-1.0.10 -Overview of changes since NetworkManager-1.0.8 -=============================================== +============================================ +NetworkManager-1.2 +Overview of changes since NetworkManager-1.0 +============================================ This is a new stable release of NetworkManager. Notable changes include: -* Added support for handling VPN secrets to nmtui and nmcli agent. +* Added an option to enable use of random MAC addresses for Wi-Fi access + point scanning (defaults to disabled). Controlled with + 'wifi.mac-address-randomization' property (MAC_ADDRESS_RANDOMIZATION key in + ifcfg files). -* Fixed a regression that caused NetworkManager to ignore external deletion of - a device with master. +* Wi-Fi scanning now utilizes wpa_supplicant's AP list. -* Fixed glitches with older versions of glib (prior to 2.36.0). +* Added support for Wi-Fi powersave, configured with POWERSAVE key in ifcfg + files. -* Fixed build with most recent versions of libsoup. +* Added support for creation of more types of software devices: tun & tap, + maxvlan, vxlan and ip tunnels (ipip, gre, sit, isatap, vti, ip6ip6, ipip6, + ip6gre and vti6). -* Fixed busy retry loop on non-transient errors from wpa_supplicant. +* The software devices (bond, bridge, vlan, team, ...) can now be stacked + arbitrarily. The nmcli interface for creating master-slave relationships + has been significantly improved by the use of 'master' argument to + all link types. -* Improvements to testing infrastructure. +* RFC7217 stable privacy addressing is now used by default to protect from + address-based host tracking. The IPv6 addressing mode is configured with + IPV6_ADDR_GEN_MODE key in ifcfg files. -* Updates to German, Galician, Occitan, Turkish, Ukrainian, Brazilian, Swedish, - Polish and Italian translations. +* Improved route management code to avoid clases between conflicting + routes in multiple connections. -=============================================== -NetworkManager-1.0.8 -Overview of changes since NetworkManager-1.0.6 -=============================================== +* Refactored platform code resulting in more robust interface to platform, + less overhead and reduced memory footprint. -This is a new stable release of NetworkManager. Notable changes include: +* Improved interoperability with other network management tools. The + externally created software devices are not managed until they're + activated. + +* The Device instances now exist for all software connections and the platform + devices are now only created when the device is activated. This makes it + possible for connections with device of same name not to clash unless + they're activated concurrently. The links are now not unnecessarily present + unless the connection is active, avoiding pollution of the link name space. + +* NetworkManager now correctly manages connectivity in namespace-based + containers such as LXC and Docker. + +* Support for configuring ethernet Wake-On-Lan has been added. + +* Added LLDP listener functionality and related CLI client commands. Enabled via + LLDP option in ifcfg files. + +* CLI secret agent has been extended with support for VPN secrets. + +* The command line client now utilizes colors for its output. + +* The command line client now sorts the devices and properties for better + clarity. + +* Numerous impovement to Bash command completion for nmcli. -* MTU indicated by a VPN gateway is now properly applied. +* NetworkManager relies on less external libraries. The use of dbus-glib + has been replaced with gio's native D-Bus support and libnl-route is no + longer used. -* Fixed MSS setting when MTU changes. +* Dependency on avahi-autoipd has been dropped. Native IPv4 link-local + addressing configuration based on systemd network library is now used + instead. -* The default route is properly restored on device disconnect. +* Hostname is now managed via systemd-hostnamed on systemd-based systems. -* Build with older toolchains has been fixed. +* Management of resolv.conf management can be changed at runtime, private + resolv.conf is always written in /run. + +* DNS options in resolv.conf are now honored. + +* Updated version of systemd network library used for internal DHCP and + IPv4 link-local support. + +* Support for event logging via audit subsystem has been added. + +* Support for native logging via systemd-journald has been added taking + advantage of its structured logging. + +* Live reconfiguration in IP configuration after changing the settings without + reactivation of the device with "nmcli device reapply" command and via + D-Bus API. + +* The API for VPN plugins now supports multiple simultaneous connections. + Most popular VPN plugins have been updated to support this functionality. + +* The libnm library now provides API to access VPN service definitions. + +* Fair amount of bugs was fixed and robustness was generally improved. + +* New DHCP_FQDN key in ifcfg files to configure the full FQDN to be sent to + the DHCP servers. + +* Added multicast_snooping option to BRIDGING_OPTS ifcfg key. + +The following features were backported to 1.0.x releases from 1.0.0 to 1.0.8 +are also present in NetworkManager-1.2: + + +* Added support for handling VPN secrets to nmtui and nmcli agent. * The team devices can now properly be enslaved to bridges. * Failed DHCP attempts for assumed connections are now retried after - a timeout. + a timeout. Configured with DHCP_TIMEOUT ifcfg option. * Default wired connection is now created after udev registers the device. * Support for Bluetooth DUN devices with Bluez 5 has been fixed. -* The ipv6.ignore-auto-dns property is now properly honored making it - possible to override automatically obtained name servers. +* The 'ipv6.ignore-auto-dns' property is now properly honored making it + possible to override automatically obtained name servers. * Invalid permanent MAC adddresses as reported by some devices are now - ignored. + ignored. * Device links reported by more recent versions of Linux kernel that reside - in different network namespaces are no longer confused with links in - the namespace NetworkManager runs in. + in different network namespaces are no longer confused with links in + the namespace NetworkManager runs in. * MAC address changes of VLANs enslaved to a bond are now properly - propagated to the master device. + propagated to the master device. * Fixed error handling for teaming devices with invalid configuration. * Wi-Fi AP list is now updated correctly after AP mode has been used. -* Management of a device is not attempted until the device has been - registered with udev. - * The error handling for VPN secret agents is now significantly more robust. * Detection of s390 CTC devices now works properly. -* A GATEWAY property in /etc/sysconfig/network now no longer affects - non-static connections. +* A GATEWAY key in in /etc/sysconfig/network now no longer affects + non-static connections. * Added support for IPv6-only VPN connections. @@ -80,31 +147,19 @@ This is a new stable release of NetworkManager. Notable changes include: * nmtui is now able to ignore automatically configured routes. -* Numerous bash shell autocompletion fixes for nmcli. - * Allow setting IPv6 and PPP settings for GDM and CDMA connections via - nmcli. + nmcli. * Added support for adding ADSL connections in nmcli. -* Numerous crash fixes. - -* Updates to Swedish, Italian and Polish translations. - -=============================================== -NetworkManager-1.0.6 -Overview of changes since NetworkManager-1.0.4 -=============================================== - -This is a new stable release of NetworkManager. Notable changes include: - * Improved capture portal detection. * Default route through WiFi connection is now preferred to Mobile Broadband if both are available. * Expose a flag to determine whether a particular connection is metered - via API and client tools. + via API and client tools. Configurable in ifcfg with CONNECTION_METERED + key. * Add support for locking connections to a channel within a particular band. @@ -113,15 +168,6 @@ This is a new stable release of NetworkManager. Notable changes include: * Allow overriding the MTU for team device. -* Usual pile of bug fixes and robustness improvements. - -=============================================== -NetworkManager-1.0.4 -Overview of changes since NetworkManager-1.0.2 -=============================================== - -This is a new stable release of NetworkManager. Notable changes include: - * The MTU setting from an IPv6 neighbor discovery Router Advertisements is now ignored if applying it would result in invalid configuration. @@ -158,7 +204,8 @@ This is a new stable release of NetworkManager. Notable changes include: * Activating a Bond, Bridge or Team device can now optionally activate the slave connections as well. The behavior is controlled with - 'connection.autoconnect-slaves' property. + 'connection.autoconnect-slaves' property and AUTOCONNECT-SLAVES key in + ifcfg files.. * The platform support code has been refactored, resulting in better scalability in large configurations. @@ -170,57 +217,57 @@ This is a new stable release of NetworkManager. Notable changes include: in place instead of overriding it. The behavior is controlled with 'ipv4.never-default' and 'ipv6.never-default' properties. -* Multiple crasher and memory leak bugs in the daemon were fixed. - -* Multiple bugs that could cause the client tools to hang or crash were fixed. - * nmcli allows multiple devices for 'nmcli device disconnect/delete'. * Firewall zone is added to firewalld for device-based VPN connections too. -=============================================== -NetworkManager-1.0.2 -Overview of changes since NetworkManager-1.0 -=============================================== - -This is a new stable release of NetworkManager. Notable changes include: - * Wi-Fi devices now indicate support for 2GHz and 5GHz frequencies + * "nmcli device" output now indicates physical port ID + * New config items added to the 'ifcfg-rh' plugin: - IPV4_ROUTE_METRIC and IPV6_ROUTE_METRIC - DEVTIMEOUT - IPADDR and PREFIX are now supported for specifying address ranges of shared IPv4 connections + * Dispatcher scripts now get a CONNECTION_FILENAME variable with the path to the configuration file for the connection + * An example dispatcher script that is able to apply complex routing rules (such as setting up policy-based routing) for 'ifcfg-rh' connections was added to examples/dispatcher/. + * 'mode' key of Bond device options property now accepts numeric values + * Connection attempts for devices without carrier on startup now wait for carrier to appear within a short timeout instead of failing immediately. This makes system startup more robust. + * Bridge connectivity is now properly restored on resume from suspend + * The D-Bus name is acquired earlier during the daemon startup. This makes it possible for the systemd service manager to optimize the service startup so that services that require networking are activated sooner contributing to faster system start up time. + * A lot of memory leak problems were fixed, resulting in reduced memory usage. Many of them were discovered as a result of improvements in use of Valgrind in the testing infrastructure. + * Management of 'teamd' daemon instances for Team devices is now more robust. + * The 'dnsmasq' daemon respawns when it terminates and it is configured for management of DNS resolver configuration + * Hostnames that are not fully qualified are no longer sent to a DHCPv6 server for a dynamic DNS update + * Connection UUIDs are now checked for uniqueness when connection configurations are read + * Receipt of a NDP Router Advertisement can no longer lower the IPv6 hop limit (CVE-2015-2924) -* Many other bugs were fixed -* Updates to Telugu, Turkish, Polish, German, Gujarati, Italian and Russian - translations =============================================== NetworkManager-1.0 diff --git a/TODO b/TODO index 11331030..96dc81b7 100644 --- a/TODO +++ b/TODO @@ -347,9 +347,9 @@ connection process. the best route to go for desktop use-cases as well. Instead of bringing all available connections up, only bring up the "best" connection at any given time based on the current priority list (which is rougly Ethernet > WiFi > -3G/Bluetooth/WiMAX). However, to ensure seamless connectivity, when one -connection begins to degrade, the next-best connection should be started before -the current one is terminated, such that there is a small amount of overlap. +3G/Bluetooth). However, to ensure seamless connectivity, when one connection +begins to degrade, the next-best connection should be started before the +current one is terminated, such that there is a small amount of overlap. 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 diff --git a/autogen.sh b/autogen.sh index 5ec9a5aa..7f976685 100755 --- a/autogen.sh +++ b/autogen.sh @@ -15,8 +15,8 @@ PKG_NAME=NetworkManager (test -f $srcdir/configure.ac \ && test -f $srcdir/src/main.c) || { - echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" - echo " top-level $PKG_NAME directory" + printf "**Error**: Directory "\`$srcdir\'" does not look like the" >&2 + echo " top-level $PKG_NAME directory" >&2 exit 1 } diff --git a/callouts/Makefile.am b/callouts/Makefile.am index 2f9fc71d..6440a4de 100644 --- a/callouts/Makefile.am +++ b/callouts/Makefile.am @@ -1,12 +1,11 @@ SUBDIRS = . tests AM_CPPFLAGS = \ - -I${top_srcdir}/include \ - -I${top_builddir}/include \ + -I${top_srcdir}/shared \ + -I${top_builddir}/shared \ -I${top_srcdir}/libnm-core \ -I${top_builddir}/libnm-core \ $(GLIB_CFLAGS) \ - $(DBUS_CFLAGS) \ -DNETWORKMANAGER_COMPILATION \ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ -DNMCONFDIR=\"$(nmconfdir)\" \ @@ -23,20 +22,10 @@ noinst_LTLIBRARIES = \ dbusservicedir = $(DBUS_SYS_DIR) dbusservice_DATA = \ - nm-dispatcher.conf \ - nm-avahi-autoipd.conf + nm-dispatcher.conf libexec_PROGRAMS = \ - nm-dispatcher \ - nm-avahi-autoipd.action - - -nm_avahi_autoipd_action_SOURCES = \ - nm-avahi-autoipd-action.c - -nm_avahi_autoipd_action_LDADD = \ - $(DBUS_LIBS) \ - $(GLIB_LIBS) + nm-dispatcher nm_dispatcher_SOURCES = \ @@ -106,6 +95,7 @@ install-data-hook: $(mkinstalldirs) -m 0755 $(DESTDIR)$(dispatcherdir) $(mkinstalldirs) -m 0755 $(DESTDIR)$(dispatcherdir)/pre-down.d $(mkinstalldirs) -m 0755 $(DESTDIR)$(dispatcherdir)/pre-up.d + $(mkinstalldirs) -m 0755 $(DESTDIR)$(dispatcherdir)/no-wait.d CLEANFILES = $(nodist_libnmdbus_dispatcher_la_SOURCES) $(dbusactivation_DATA) diff --git a/callouts/Makefile.in b/callouts/Makefile.in index 5a4458b4..2fa3d996 100644 --- a/callouts/Makefile.in +++ b/callouts/Makefile.in @@ -90,8 +90,7 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -libexec_PROGRAMS = nm-dispatcher$(EXEEXT) \ - nm-avahi-autoipd.action$(EXEEXT) +libexec_PROGRAMS = nm-dispatcher$(EXEEXT) subdir = callouts ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_readline.m4 \ @@ -134,12 +133,6 @@ libtest_dispatcher_envp_la_OBJECTS = \ am__installdirs = "$(DESTDIR)$(libexecdir)" \ "$(DESTDIR)$(dbusactivationdir)" "$(DESTDIR)$(dbusservicedir)" PROGRAMS = $(libexec_PROGRAMS) -am_nm_avahi_autoipd_action_OBJECTS = \ - nm-avahi-autoipd-action.$(OBJEXT) -nm_avahi_autoipd_action_OBJECTS = \ - $(am_nm_avahi_autoipd_action_OBJECTS) -nm_avahi_autoipd_action_DEPENDENCIES = $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) am_nm_dispatcher_OBJECTS = nm-dispatcher.$(OBJEXT) \ nm-dispatcher-utils.$(OBJEXT) nm_dispatcher_OBJECTS = $(am_nm_dispatcher_OBJECTS) @@ -180,10 +173,9 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(nodist_libnmdbus_dispatcher_la_SOURCES) \ - $(libtest_dispatcher_envp_la_SOURCES) \ - $(nm_avahi_autoipd_action_SOURCES) $(nm_dispatcher_SOURCES) + $(libtest_dispatcher_envp_la_SOURCES) $(nm_dispatcher_SOURCES) DIST_SOURCES = $(libtest_dispatcher_envp_la_SOURCES) \ - $(nm_avahi_autoipd_action_SOURCES) $(nm_dispatcher_SOURCES) + $(nm_dispatcher_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ @@ -296,7 +288,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -308,8 +299,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -319,6 +308,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -373,16 +363,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -419,6 +406,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -447,7 +436,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -462,6 +450,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -522,6 +512,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -529,6 +520,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -546,12 +538,11 @@ with_resolvconf = @with_resolvconf@ with_valgrind = @with_valgrind@ SUBDIRS = . tests AM_CPPFLAGS = \ - -I${top_srcdir}/include \ - -I${top_builddir}/include \ + -I${top_srcdir}/shared \ + -I${top_builddir}/shared \ -I${top_srcdir}/libnm-core \ -I${top_builddir}/libnm-core \ $(GLIB_CFLAGS) \ - $(DBUS_CFLAGS) \ -DNETWORKMANAGER_COMPILATION \ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ -DNMCONFDIR=\"$(nmconfdir)\" \ @@ -568,15 +559,7 @@ noinst_LTLIBRARIES = libtest-dispatcher-envp.la \ libnmdbus-dispatcher.la dbusservicedir = $(DBUS_SYS_DIR) dbusservice_DATA = \ - nm-dispatcher.conf \ - nm-avahi-autoipd.conf - -nm_avahi_autoipd_action_SOURCES = \ - nm-avahi-autoipd-action.c - -nm_avahi_autoipd_action_LDADD = \ - $(DBUS_LIBS) \ - $(GLIB_LIBS) + nm-dispatcher.conf nm_dispatcher_SOURCES = \ nm-dispatcher.c \ @@ -727,10 +710,6 @@ clean-libexecPROGRAMS: echo " rm -f" $$list; \ rm -f $$list -nm-avahi-autoipd.action$(EXEEXT): $(nm_avahi_autoipd_action_OBJECTS) $(nm_avahi_autoipd_action_DEPENDENCIES) $(EXTRA_nm_avahi_autoipd_action_DEPENDENCIES) - @rm -f nm-avahi-autoipd.action$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(nm_avahi_autoipd_action_OBJECTS) $(nm_avahi_autoipd_action_LDADD) $(LIBS) - nm-dispatcher$(EXEEXT): $(nm_dispatcher_OBJECTS) $(nm_dispatcher_DEPENDENCIES) $(EXTRA_nm_dispatcher_DEPENDENCIES) @rm -f nm-dispatcher$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nm_dispatcher_OBJECTS) $(nm_dispatcher_LDADD) $(LIBS) @@ -743,7 +722,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnmdbus_dispatcher_la-nmdbus-dispatcher.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtest_dispatcher_envp_la-nm-dispatcher-utils.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-avahi-autoipd-action.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-dispatcher-utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-dispatcher.Po@am__quote@ @@ -1140,6 +1118,7 @@ install-data-hook: $(mkinstalldirs) -m 0755 $(DESTDIR)$(dispatcherdir) $(mkinstalldirs) -m 0755 $(DESTDIR)$(dispatcherdir)/pre-down.d $(mkinstalldirs) -m 0755 $(DESTDIR)$(dispatcherdir)/pre-up.d + $(mkinstalldirs) -m 0755 $(DESTDIR)$(dispatcherdir)/no-wait.d # 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/callouts/nm-avahi-autoipd-action.c b/callouts/nm-avahi-autoipd-action.c deleted file mode 100644 index b28dae5d..00000000 --- a/callouts/nm-avahi-autoipd-action.c +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* NetworkManager -- Network link manager - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Copyright 2008, 2014 Red Hat, Inc. - */ - -#include "config.h" - -#include -#include - -#include - -#define NM_AVAHI_AUTOIPD_DBUS_SERVICE "org.freedesktop.nm_avahi_autoipd" -#define NM_AVAHI_AUTOIPD_DBUS_INTERFACE "org.freedesktop.nm_avahi_autoipd" - -static void -on_name_acquired (GDBusConnection *connection, - const gchar *name, - gpointer loop) -{ - g_main_loop_quit (loop); -} - -static void -on_name_lost (GDBusConnection *connection, - const gchar *name, - gpointer user_data) -{ - g_printerr ("Error: Could not acquire the NM autoipd service."); - exit (1); -} - -int -main (int argc, char *argv[]) -{ - GDBusConnection *connection; - char *event, *iface, *address; - GMainLoop *loop; - GError *error = NULL; - -#if !GLIB_CHECK_VERSION (2, 35, 0) - g_type_init (); -#endif - - if (argc != 4) { - g_printerr ("Error: expected 3 arguments (event, interface, address).\n"); - exit (1); - } - - event = argv[1]; - iface = argv[2]; - address = argv[3] ? argv[3] : ""; - - if (!event || !iface || !strlen (event) || !strlen (iface)) { - g_printerr ("Error: unexpected arguments received from avahi-autoipd.\n"); - exit (1); - } - - /* Get a connection to the system bus */ - connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error); - if (error) { - char *remote_error = g_dbus_error_get_remote_error (error); - - g_dbus_error_strip_remote_error (error); - g_printerr ("Error: could not get the system bus. Make sure " - "the message bus daemon is running! Message: (%s) %s\n", - remote_error, error->message); - g_free (remote_error); - g_error_free (error); - return 1; - } - - /* Acquire the bus name */ - loop = g_main_loop_new (NULL, FALSE); - g_bus_own_name_on_connection (connection, - NM_AVAHI_AUTOIPD_DBUS_SERVICE, - 0, - on_name_acquired, - on_name_lost, - loop, NULL); - g_main_loop_run (loop); - g_main_loop_unref (loop); - - /* Send the signal */ - if (!g_dbus_connection_emit_signal (connection, - NULL, - "/", - NM_AVAHI_AUTOIPD_DBUS_INTERFACE, - "Event", - g_variant_new ("(sss)", - event, - iface, - address), - &error)) { - g_dbus_error_strip_remote_error (error); - g_printerr ("Error: Could not send autoipd Event signal: %s\n", error->message); - g_error_free (error); - return 1; - } - - if (!g_dbus_connection_flush_sync (connection, NULL, &error)) { - g_dbus_error_strip_remote_error (error); - g_printerr ("Error: Could not flush D-Bus connection: %s\n", error->message); - g_error_free (error); - return 1; - } - - g_object_unref (connection); - return 0; -} - diff --git a/callouts/nm-avahi-autoipd.conf b/callouts/nm-avahi-autoipd.conf deleted file mode 100644 index 485ab429..00000000 --- a/callouts/nm-avahi-autoipd.conf +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - diff --git a/callouts/nm-dispatcher-api.h b/callouts/nm-dispatcher-api.h index 9b2c3b32..d702ba68 100644 --- a/callouts/nm-dispatcher-api.h +++ b/callouts/nm-dispatcher-api.h @@ -21,10 +21,7 @@ #define NMD_SCRIPT_DIR_DEFAULT NMCONFDIR "/dispatcher.d" #define NMD_SCRIPT_DIR_PRE_UP NMD_SCRIPT_DIR_DEFAULT "/pre-up.d" #define NMD_SCRIPT_DIR_PRE_DOWN NMD_SCRIPT_DIR_DEFAULT "/pre-down.d" - -/* dbus-glib types for dispatcher call return value (used by src/nm-dispatcher.c) */ -#define DISPATCHER_TYPE_RESULT (dbus_g_type_get_struct ("GValueArray", G_TYPE_STRING, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_INVALID)) -#define DISPATCHER_TYPE_RESULT_ARRAY (dbus_g_type_get_collection ("GPtrArray", DISPATCHER_TYPE_RESULT)) +#define NMD_SCRIPT_DIR_NO_WAIT NMD_SCRIPT_DIR_DEFAULT "/no-wait.d" #define NM_DISPATCHER_DBUS_SERVICE "org.freedesktop.nm_dispatcher" #define NM_DISPATCHER_DBUS_INTERFACE "org.freedesktop.nm_dispatcher" @@ -32,6 +29,7 @@ #define NMD_CONNECTION_PROPS_PATH "path" #define NMD_CONNECTION_PROPS_FILENAME "filename" +#define NMD_CONNECTION_PROPS_EXTERNAL "external" #define NMD_DEVICE_PROPS_INTERFACE "interface" #define NMD_DEVICE_PROPS_IP_INTERFACE "ip-interface" diff --git a/callouts/nm-dispatcher-utils.c b/callouts/nm-dispatcher-utils.c index e7a6f6a2..6079d019 100644 --- a/callouts/nm-dispatcher-utils.c +++ b/callouts/nm-dispatcher-utils.c @@ -22,7 +22,6 @@ #include -#include #include #include @@ -30,6 +29,7 @@ #include #include +#include "nm-default.h" #include "nm-dispatcher-api.h" #include "nm-utils.h" @@ -331,30 +331,46 @@ nm_dispatcher_utils_construct_envp (const char *action, const char *vpn_ip_iface, GVariant *vpn_ip4_props, GVariant *vpn_ip6_props, - char **out_iface) + char **out_iface, + const char **out_error_message) { const char *iface = NULL, *ip_iface = NULL; - const char *uuid = NULL, *id = NULL, *path; + const char *uuid = NULL, *id = NULL, *path = NULL; const char *filename = NULL; + gboolean external; NMDeviceState dev_state = NM_DEVICE_STATE_UNKNOWN; GVariant *value; char **envp = NULL, *path_item; GSList *items = NULL, *iter; guint i; GVariant *con_setting; + const char *error_message_backup; + + if (!out_error_message) + out_error_message = &error_message_backup; g_return_val_if_fail (action != NULL, NULL); g_return_val_if_fail (out_iface != NULL, NULL); g_return_val_if_fail (*out_iface == NULL, NULL); /* Hostname changes don't require a device nor contain a connection */ - if (!strcmp (action, "hostname")) + if (!strcmp (action, NMD_ACTION_HOSTNAME)) goto done; - /* config filename */ + /* Connection properties */ + if (!g_variant_lookup (connection_props, NMD_CONNECTION_PROPS_PATH, "&o", &path)) { + *out_error_message = "Missing or invalid required value " NMD_CONNECTION_PROPS_PATH "!"; + return NULL; + } + items = g_slist_prepend (items, g_strdup_printf ("CONNECTION_DBUS_PATH=%s", path)); + + if (g_variant_lookup (connection_props, NMD_CONNECTION_PROPS_EXTERNAL, "b", &external) && external) + items = g_slist_prepend (items, g_strdup ("CONNECTION_EXTERNAL=1")); + if (g_variant_lookup (connection_props, NMD_CONNECTION_PROPS_FILENAME, "&s", &filename)) items = g_slist_prepend (items, g_strdup_printf ("CONNECTION_FILENAME=%s", filename)); + /* Canonicalize the VPN interface name; "" is used when passing it through * D-Bus so make sure that's fixed up here. */ @@ -363,7 +379,7 @@ nm_dispatcher_utils_construct_envp (const char *action, /* interface name */ if (!g_variant_lookup (device_props, NMD_DEVICE_PROPS_INTERFACE, "&s", &iface)) { - g_warning ("Missing or invalid required value " NMD_DEVICE_PROPS_INTERFACE "!"); + *out_error_message = "Missing or invalid required value " NMD_DEVICE_PROPS_INTERFACE "!"; return NULL; } if (!*iface) @@ -373,7 +389,7 @@ nm_dispatcher_utils_construct_envp (const char *action, value = g_variant_lookup_value (device_props, NMD_DEVICE_PROPS_IP_INTERFACE, NULL); if (value) { if (!g_variant_is_of_type (value, G_VARIANT_TYPE_STRING)) { - g_warning ("Invalid value " NMD_DEVICE_PROPS_IP_INTERFACE "!"); + *out_error_message = "Invalid value " NMD_DEVICE_PROPS_IP_INTERFACE "!"; return NULL; } g_variant_unref (value); @@ -382,14 +398,14 @@ nm_dispatcher_utils_construct_envp (const char *action, /* Device type */ if (!g_variant_lookup (device_props, NMD_DEVICE_PROPS_TYPE, "u", NULL)) { - g_warning ("Missing or invalid required value " NMD_DEVICE_PROPS_TYPE "!"); + *out_error_message = "Missing or invalid required value " NMD_DEVICE_PROPS_TYPE "!"; return NULL; } /* Device state */ value = g_variant_lookup_value (device_props, NMD_DEVICE_PROPS_STATE, G_VARIANT_TYPE_UINT32); if (!value) { - g_warning ("Missing or invalid required value " NMD_DEVICE_PROPS_STATE "!"); + *out_error_message = "Missing or invalid required value " NMD_DEVICE_PROPS_STATE "!"; return NULL; } dev_state = g_variant_get_uint32 (value); @@ -397,25 +413,25 @@ nm_dispatcher_utils_construct_envp (const char *action, /* device itself */ if (!g_variant_lookup (device_props, NMD_DEVICE_PROPS_PATH, "o", NULL)) { - g_warning ("Missing or invalid required value " NMD_DEVICE_PROPS_PATH "!"); + *out_error_message = "Missing or invalid required value " NMD_DEVICE_PROPS_PATH "!"; return NULL; } /* UUID and ID */ con_setting = g_variant_lookup_value (connection_dict, NM_SETTING_CONNECTION_SETTING_NAME, NM_VARIANT_TYPE_SETTING); if (!con_setting) { - g_warning ("Failed to read connection setting"); + *out_error_message = "Failed to read connection setting"; return NULL; } if (!g_variant_lookup (con_setting, NM_SETTING_CONNECTION_UUID, "&s", &uuid)) { - g_warning ("Connection hash did not contain the UUID"); + *out_error_message = "Connection hash did not contain the UUID"; g_variant_unref (con_setting); return NULL; } if (!g_variant_lookup (con_setting, NM_SETTING_CONNECTION_ID, "&s", &id)) { - g_warning ("Connection hash did not contain the ID"); + *out_error_message = "Connection hash did not contain the ID"; g_variant_unref (con_setting); return NULL; } @@ -462,6 +478,7 @@ nm_dispatcher_utils_construct_envp (const char *action, envp[i] = (char *) iter->data; g_slist_free (items); + *out_error_message = NULL; return envp; } diff --git a/callouts/nm-dispatcher-utils.h b/callouts/nm-dispatcher-utils.h index 665a0d4e..40a0d41f 100644 --- a/callouts/nm-dispatcher-utils.h +++ b/callouts/nm-dispatcher-utils.h @@ -21,7 +21,7 @@ #ifndef __NETWORKMANAGER_DISPATCHER_UTILS_H__ #define __NETWORKMANAGER_DISPATCHER_UTILS_H__ -#include +#include "nm-default.h" char ** nm_dispatcher_utils_construct_envp (const char *action, @@ -35,7 +35,8 @@ nm_dispatcher_utils_construct_envp (const char *action, const char *vpn_ip_iface, GVariant *vpn_ip4_props, GVariant *vpn_ip6_props, - char **out_iface); + char **out_iface, + const char **out_error_message); #endif /* __NETWORKMANAGER_DISPATCHER_UTILS_H__ */ diff --git a/callouts/nm-dispatcher.c b/callouts/nm-dispatcher.c index 09eb0d3a..a635e216 100644 --- a/callouts/nm-dispatcher.c +++ b/callouts/nm-dispatcher.c @@ -32,13 +32,13 @@ #include #include -#include #include - +#include "nm-default.h" #include "nm-dispatcher-api.h" #include "nm-dispatcher-utils.h" -#include "nm-glib-compat.h" +#include "nm-macros-internal.h" +#include "gsystem-local-alloc.h" #include "nmdbus-dispatcher.h" @@ -46,6 +46,7 @@ static GMainLoop *loop = NULL; static gboolean debug = FALSE; static gboolean persist = FALSE; static guint quit_id; +static guint request_id_counter = 0; typedef struct Request Request; @@ -56,7 +57,8 @@ typedef struct { NMDBusDispatcher *dbus_dispatcher; Request *current_request; - GQueue *pending_requests; + GQueue *requests_waiting; + gint num_requests_pending; } Handler; typedef struct { @@ -91,7 +93,7 @@ handle_action (NMDBusDispatcher *dbus_dispatcher, static void handler_init (Handler *h) { - h->pending_requests = g_queue_new (); + h->requests_waiting = g_queue_new (); h->dbus_dispatcher = nmdbus_dispatcher_skeleton_new (); g_signal_connect (h->dbus_dispatcher, "handle-action", G_CALLBACK (handle_action), h); @@ -102,7 +104,7 @@ handler_class_init (HandlerClass *h_class) { } -static void dispatch_one_script (Request *request); +static gboolean dispatch_one_script (Request *request); typedef struct { Request *request; @@ -111,11 +113,17 @@ typedef struct { GPid pid; DispatchResult result; char *error; + gboolean wait; + gboolean dispatched; + guint watch_id; + guint timeout_id; } ScriptInfo; struct Request { Handler *handler; + guint request_id; + GDBusMethodInvocation *context; char *action; char *iface; @@ -124,11 +132,61 @@ struct Request { GPtrArray *scripts; /* list of ScriptInfo */ guint idx; - - guint script_watch_id; - guint script_timeout_id; + gint num_scripts_done; + gint num_scripts_nowait; }; +/*****************************************************************************/ + +#define __LOG_print(print_cmd, _request, _script, ...) \ + G_STMT_START { \ + nm_assert ((_request) && (!(_script) || (_script)->request == (_request))); \ + print_cmd ("#%u '%s'%s%s%s%s%s%s: " _NM_UTILS_MACRO_FIRST (__VA_ARGS__), \ + (_request)->request_id, \ + (_request)->action, \ + (_request)->iface ? " [" : "", \ + (_request)->iface ? (_request)->iface : "", \ + (_request)->iface ? "]" : "", \ + (_script) ? ", \"" : "", \ + (_script) ? (_script)->script : "", \ + (_script) ? "\"" : "" \ + _NM_UTILS_MACRO_REST (__VA_ARGS__)); \ + } G_STMT_END + +#define _LOG(_request, _script, log_always, print_cmd, ...) \ + G_STMT_START { \ + const Request *__request = (_request); \ + const ScriptInfo *__script = (_script); \ + \ + if (!__request) \ + __request = __script->request; \ + nm_assert (__request && (!__script || __script->request == __request)); \ + if ((log_always) || __request->debug) { \ + if (FALSE) { \ + /* g_message() alone does not warn about invalid format. Add a dummy printf() statement to + * get a compiler warning about wrong format. */ \ + __LOG_print (printf, __request, __script, __VA_ARGS__); \ + } \ + __LOG_print (print_cmd, __request, __script, __VA_ARGS__); \ + } \ + } G_STMT_END + +static gboolean +_LOG_R_D_enabled (const Request *request) +{ + return request->debug; +} + +#define _LOG_R_D(_request, ...) _LOG(_request, NULL, FALSE, g_message, __VA_ARGS__) +#define _LOG_R_I(_request, ...) _LOG(_request, NULL, TRUE, g_message, __VA_ARGS__) +#define _LOG_R_W(_request, ...) _LOG(_request, NULL, TRUE, g_warning, __VA_ARGS__) + +#define _LOG_S_D(_script, ...) _LOG(NULL, _script, FALSE, g_message, __VA_ARGS__) +#define _LOG_S_I(_script, ...) _LOG(NULL, _script, TRUE, g_message, __VA_ARGS__) +#define _LOG_S_W(_script, ...) _LOG(NULL, _script, TRUE, g_warning, __VA_ARGS__) + +/*****************************************************************************/ + static void script_info_free (gpointer ptr) { @@ -136,17 +194,22 @@ script_info_free (gpointer ptr) g_free (info->script); g_free (info->error); - g_free (info); + g_slice_free (ScriptInfo, info); } static void request_free (Request *request) { + g_assert_cmpuint (request->num_scripts_done, ==, request->scripts->len); + g_assert_cmpuint (request->num_scripts_nowait, ==, 0); + g_free (request->action); g_free (request->iface); g_strfreev (request->envp); if (request->scripts) g_ptr_array_free (request->scripts, TRUE); + + g_slice_free (Request, request); } static gboolean @@ -156,65 +219,79 @@ quit_timeout_cb (gpointer user_data) return FALSE; } -static void -quit_timeout_cancel (void) -{ - if (quit_id) { - g_source_remove (quit_id); - quit_id = 0; - } -} - static void quit_timeout_reschedule (void) { - quit_timeout_cancel (); - if (!persist) + if (!persist) { + nm_clear_g_source (&quit_id); quit_id = g_timeout_add_seconds (10, quit_timeout_cb, NULL); + } } -static void -start_request (Request *request) +/** + * next_request: + * + * @h: the handler + * @request: (allow-none): the request to set as next. If %NULL, dequeue the next + * waiting request. Otherwise, try to set the given request. + * + * Sets the currently active request (@current_request). The current request + * is a request that has at least on "wait" script, because requests that only + * consist of "no-wait" scripts are handled right away and not enqueued to + * @requests_waiting nor set as @current_request. + * + * Returns: %TRUE, if there was currently not request in process and it set + * a new request as current. + */ +static gboolean +next_request (Handler *h, Request *request) { - if (request->iface) - g_message ("Dispatching action '%s' for %s", request->action, request->iface); - else - g_message ("Dispatching action '%s'", request->action); + if (request) { + if (h->current_request) { + g_queue_push_tail (h->requests_waiting, request); + return FALSE; + } + } else { + /* when calling next_request() without explicit @request, we always + * forcefully clear @current_request. That one is certainly + * handled already. */ + h->current_request = NULL; - request->handler->current_request = request; - dispatch_one_script (request); -} + request = g_queue_pop_head (h->requests_waiting); + if (!request) + return FALSE; + } -static void -next_request (Handler *h) -{ - Request *request = g_queue_pop_head (h->pending_requests); + _LOG_R_I (request, "start running ordered scripts..."); - if (request) { - start_request (request); - return; - } + h->current_request = request; - h->current_request = NULL; - quit_timeout_reschedule (); + return TRUE; } -static gboolean -next_script (gpointer user_data) +/** + * complete_request: + * @request: the request + * + * Checks if all the scripts for the request have terminated and in such case + * it sends the D-Bus response and releases the request resources. + * + * It also decreases @num_requests_pending and possibly does quit_timeout_reschedule(). + */ +static void +complete_request (Request *request) { - Request *request = user_data; - Handler *h = request->handler; GVariantBuilder results; GVariant *ret; guint i; + Handler *handler = request->handler; - request->idx++; - if (request->idx < request->scripts->len) { - dispatch_one_script (request); - return FALSE; - } + nm_assert (request); + + /* Are there still pending scripts? Then do nothing (for now). */ + if (request->num_scripts_done < request->scripts->len) + return; - /* All done */ g_variant_builder_init (&results, G_VARIANT_TYPE ("a(sus)")); for (i = 0; i < request->scripts->len; i++) { ScriptInfo *script = g_ptr_array_index (request->scripts, i); @@ -228,16 +305,87 @@ next_script (gpointer user_data) ret = g_variant_new ("(a(sus))", &results); g_dbus_method_invocation_return_value (request->context, ret); - if (request->debug) { - if (request->iface) - g_message ("Dispatch '%s' on %s complete", request->action, request->iface); - else - g_message ("Dispatch '%s' complete", request->action); - } + _LOG_R_D (request, "completed (%u scripts)", request->scripts->len); + + if (handler->current_request == request) + handler->current_request = NULL; + request_free (request); - next_request (h); - return FALSE; + g_assert_cmpuint (handler->num_requests_pending, >, 0); + if (--handler->num_requests_pending <= 0) { + nm_assert (!handler->current_request && !g_queue_peek_head (handler->requests_waiting)); + quit_timeout_reschedule (); + } +} + +static void +complete_script (ScriptInfo *script) +{ + Handler *handler; + Request *request; + gboolean wait = script->wait; + + request = script->request; + + if (wait) { + /* for "wait" scripts, try to schedule the next blocking script. + * If that is successful, return (as we must wait for its completion). */ + if (dispatch_one_script (request)) + return; + } + + handler = request->handler; + + nm_assert (!wait || handler->current_request == request); + + /* Try to complete the request. @request will be possibly free'd, + * making @script and @request a dangling pointer. */ + complete_request (request); + + if (!wait) { + /* this was a "no-wait" script. We either completed the request, + * or there is nothing to do. Especially, there is no need to + * queue the next_request() -- because no-wait scripts don't block + * requests. However, if this was the last "no-wait" script and + * there are "wait" scripts ready to run, launch them. + */ + if ( handler->current_request == request + && handler->current_request->num_scripts_nowait == 0) { + + if (dispatch_one_script (handler->current_request)) + return; + + complete_request (handler->current_request); + } else + return; + } else { + /* if the script is a "wait" script, we already tried above to + * dispatch the next script. As we didn't do that, it means we + * just completed the last script of @request and we can continue + * with the next request... + * + * Also, it cannot be that there is another request currently being + * processed because only requests with "wait" scripts can become + * @current_request. As there can only be one "wait" script running + * at any time, it means complete_request() above completed @request. */ + nm_assert (!handler->current_request); + } + + while (next_request (handler, NULL)) { + request = handler->current_request; + + if (dispatch_one_script (request)) + return; + + /* Try to complete the request. It will be either completed + * now, or when all pending "no-wait" scripts return. */ + complete_request (request); + + /* We can immediately start next_request(), because our current + * @request has obviously no more "wait" scripts either. + * Repeat... */ + } } static void @@ -248,9 +396,11 @@ script_watch_cb (GPid pid, gint status, gpointer user_data) g_assert (pid == script->pid); - script->request->script_watch_id = 0; - g_source_remove (script->request->script_timeout_id); - script->request->script_timeout_id = 0; + script->watch_id = 0; + nm_clear_g_source (&script->timeout_id); + script->request->num_scripts_done++; + if (!script->wait) + script->request->num_scripts_nowait--; if (WIFEXITED (status)) { err = WEXITSTATUS (status); @@ -272,15 +422,15 @@ script_watch_cb (GPid pid, gint status, gpointer user_data) } if (script->result == DISPATCH_RESULT_SUCCESS) { - if (script->request->debug) - g_message ("Script '%s' complete", script->script); + _LOG_S_D (script, "complete"); } else { script->result = DISPATCH_RESULT_FAILED; - g_warning ("%s", script->error); + _LOG_S_W (script, "complete: failed with %s", script->error); } g_spawn_close_pid (script->pid); - next_script (script->request); + + complete_script (script); } static gboolean @@ -288,11 +438,13 @@ script_timeout_cb (gpointer user_data) { ScriptInfo *script = user_data; - g_source_remove (script->request->script_watch_id); - script->request->script_watch_id = 0; - script->request->script_timeout_id = 0; + script->timeout_id = 0; + nm_clear_g_source (&script->watch_id); + script->request->num_scripts_done++; + if (!script->wait) + script->request->num_scripts_nowait--; - g_warning ("Script '%s' took too long; killing it.", script->script); + _LOG_S_W (script, "complete: timeout (kill script)"); kill (script->pid, SIGKILL); again: @@ -305,7 +457,9 @@ again: script->result = DISPATCH_RESULT_TIMEOUT; g_spawn_close_pid (script->pid); - g_idle_add (next_script, script->request); + + complete_script (script); + return FALSE; } @@ -366,34 +520,58 @@ check_filename (const char *file_name) #define SCRIPT_TIMEOUT 600 /* 10 minutes */ -static void -dispatch_one_script (Request *request) +static gboolean +script_dispatch (ScriptInfo *script) { GError *error = NULL; gchar *argv[4]; - ScriptInfo *script = g_ptr_array_index (request->scripts, request->idx); + Request *request = script->request; + + if (script->dispatched) + return FALSE; + + script->dispatched = TRUE; argv[0] = script->script; - argv[1] = request->iface ? request->iface : "none"; + argv[1] = request->iface + ? request->iface + : (!strcmp (request->action, NMD_ACTION_HOSTNAME) ? "none" : ""); argv[2] = request->action; argv[3] = NULL; - if (request->debug) - g_message ("Running script '%s'", script->script); + _LOG_S_D (script, "run script%s", script->wait ? "" : " (no-wait)"); - if (g_spawn_async ("/", argv, request->envp, G_SPAWN_DO_NOT_REAP_CHILD, NULL, request, &script->pid, &error)) { - request->script_watch_id = g_child_watch_add (script->pid, (GChildWatchFunc) script_watch_cb, script); - request->script_timeout_id = g_timeout_add_seconds (SCRIPT_TIMEOUT, script_timeout_cb, script); + if (g_spawn_async ("/", argv, request->envp, G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, &script->pid, &error)) { + script->watch_id = g_child_watch_add (script->pid, (GChildWatchFunc) script_watch_cb, script); + script->timeout_id = g_timeout_add_seconds (SCRIPT_TIMEOUT, script_timeout_cb, script); + if (!script->wait) + request->num_scripts_nowait++; + return TRUE; } else { - g_warning ("Failed to execute script '%s': (%d) %s", - script->script, error->code, error->message); + _LOG_S_W (script, "complete: failed to execute script: %s (%d)", + error->message, error->code); script->result = DISPATCH_RESULT_EXEC_FAILED; script->error = g_strdup (error->message); + request->num_scripts_done++; g_clear_error (&error); + return FALSE; + } +} - /* Try the next script */ - g_idle_add (next_script, request); +static gboolean +dispatch_one_script (Request *request) +{ + if (request->num_scripts_nowait > 0) + return TRUE; + + while (request->idx < request->scripts->len) { + ScriptInfo *script; + + script = g_ptr_array_index (request->scripts, request->idx++); + if (script_dispatch (script)) + return TRUE; } + return FALSE; } static GSList * @@ -415,7 +593,7 @@ find_scripts (const char *str_action) dirname = NMD_SCRIPT_DIR_DEFAULT; if (!(dir = g_dir_open (dirname, 0, &error))) { - g_message ("Failed to open dispatcher directory '%s': (%d) %s", + g_message ("find-scripts: Failed to open dispatcher directory '%s': (%d) %s", dirname, error->code, error->message); g_error_free (error); return NULL; @@ -434,11 +612,11 @@ find_scripts (const char *str_action) err = stat (path, &st); if (err) - g_warning ("Failed to stat '%s': %d", path, err); + g_warning ("find-scripts: Failed to stat '%s': %d", path, err); else if (S_ISDIR (st.st_mode)) ; /* silently skip. */ else if (!check_permissions (&st, &err_msg)) - g_warning ("Cannot execute '%s': %s", path, err_msg); + g_warning ("find-scripts: Cannot execute '%s': %s", path, err_msg); else { /* success */ sorted = g_slist_insert_sorted (sorted, path, (GCompareFunc) g_strcmp0); @@ -451,6 +629,34 @@ find_scripts (const char *str_action) return sorted; } +static gboolean +script_must_wait (const char *path) +{ + gs_free char *link = NULL; + gs_free char *dir = NULL; + gs_free char *real = NULL; + char *tmp; + + link = g_file_read_link (path, NULL); + if (link) { + if (!g_path_is_absolute (link)) { + dir = g_path_get_dirname (path); + tmp = g_build_path ("/", dir, link, NULL); + g_free (link); + g_free (dir); + link = tmp; + } + + dir = g_path_get_dirname (link); + real = realpath (dir, NULL); + + if (real && !strcmp (real, NMD_SCRIPT_DIR_NO_WAIT)) + return FALSE; + } + + return TRUE; +} + static gboolean handle_action (NMDBusDispatcher *dbus_dispatcher, GDBusMethodInvocation *context, @@ -473,21 +679,13 @@ handle_action (NMDBusDispatcher *dbus_dispatcher, GSList *iter; Request *request; char **p; - char *iface = NULL; + guint i, num_nowait = 0; + const char *error_message = NULL; sorted_scripts = find_scripts (str_action); - if (!sorted_scripts) { - GVariant *results; - - results = g_variant_new_array (G_VARIANT_TYPE ("(sus)"), NULL, 0); - g_dbus_method_invocation_return_value (context, g_variant_new ("(@a(sus))", results)); - return TRUE; - } - - quit_timeout_cancel (); - - request = g_malloc0 (sizeof (*request)); + request = g_slice_new0 (Request); + request->request_id = ++request_id_counter; request->handler = h; request->debug = request_debug || debug; request->context = context; @@ -504,31 +702,88 @@ handle_action (NMDBusDispatcher *dbus_dispatcher, vpn_ip_iface, vpn_ip4_props, vpn_ip6_props, - &iface); - - if (request->debug) { - g_message ("------------ Action ID %p '%s' Interface %s Environment ------------", - context, str_action, iface ? iface : "(none)"); - for (p = request->envp; *p; p++) - g_message (" %s", *p); - g_message ("\n"); - } - - request->iface = g_strdup (iface); + &request->iface, + &error_message); request->scripts = g_ptr_array_new_full (5, script_info_free); for (iter = sorted_scripts; iter; iter = g_slist_next (iter)) { - ScriptInfo *s = g_malloc0 (sizeof (*s)); + ScriptInfo *s; + + s = g_slice_new0 (ScriptInfo); s->request = request; s->script = iter->data; + s->wait = script_must_wait (s->script); g_ptr_array_add (request->scripts, s); } g_slist_free (sorted_scripts); - if (h->current_request) - g_queue_push_tail (h->pending_requests, request); - else - start_request (request); + _LOG_R_I (request, "new request (%u scripts)", request->scripts->len); + if ( _LOG_R_D_enabled (request) + && request->envp) { + for (p = request->envp; *p; p++) + _LOG_R_D (request, "environment: %s", *p); + } + + if (error_message || request->scripts->len == 0) { + GVariant *results; + + if (error_message) + _LOG_R_W (request, "completed: invalid request: %s", error_message); + else + _LOG_R_I (request, "completed: no scripts"); + + results = g_variant_new_array (G_VARIANT_TYPE ("(sus)"), NULL, 0); + g_dbus_method_invocation_return_value (context, g_variant_new ("(@a(sus))", results)); + request->num_scripts_done = request->scripts->len; + request_free (request); + return TRUE; + } + + nm_clear_g_source (&quit_id); + + h->num_requests_pending++; + + for (i = 0; i < request->scripts->len; i++) { + ScriptInfo *s = g_ptr_array_index (request->scripts, i); + + if (!s->wait) { + script_dispatch (s); + num_nowait++; + } + } + + if (num_nowait < request->scripts->len) { + /* The request has at least one wait script. + * Try next_request() to schedule the request for + * execution. This either enqueues the request or + * sets it as h->current_request. */ + if (next_request (h, request)) { + /* @request is now @current_request. Go ahead and + * schedule the first wait script. */ + if (!dispatch_one_script (request)) { + /* If that fails, we might be already finished with the + * request. Try complete_request(). */ + complete_request (request); + + if (next_request (h, NULL)) { + /* As @request was successfully scheduled as next_request(), there is no + * other request in queue that can be scheduled afterwards. Assert against + * that, but call next_request() to clear current_request. */ + g_assert_not_reached (); + } + } + } + } else { + /* The request contains only no-wait scripts. Try to complete + * the request right away (we might have failed to schedule any + * of the scripts). It will be either completed now, or later + * when the pending scripts return. + * We don't enqueue it to h->requests_waiting. + * There is no need to handle next_request(), because @request is + * not the current request anyway and does not interfere with requests + * that have any "wait" scripts. */ + complete_request (request); + } return TRUE; } @@ -571,7 +826,7 @@ log_handler (const gchar *log_domain, const gchar *message, gpointer ignored) { - int syslog_priority; + int syslog_priority; switch (log_level) { case G_LOG_LEVEL_ERROR: @@ -603,7 +858,7 @@ static void logging_setup (void) { openlog (G_LOG_DOMAIN, LOG_CONS, LOG_DAEMON); - g_log_set_handler (G_LOG_DOMAIN, + g_log_set_handler (G_LOG_DOMAIN, G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION, log_handler, NULL); @@ -645,16 +900,14 @@ main (int argc, char **argv) g_option_context_add_main_entries (opt_ctx, entries, NULL); if (!g_option_context_parse (opt_ctx, &argc, &argv, &error)) { - g_warning ("%s\n", error->message); + g_warning ("Error parsing command line arguments: %s", error->message); g_error_free (error); return 1; } g_option_context_free (opt_ctx); -#if !GLIB_CHECK_VERSION (2, 35, 0) - g_type_init (); -#endif + nm_g_type_init (); g_unix_signal_add (SIGTERM, signal_handler, GINT_TO_POINTER (SIGTERM)); g_unix_signal_add (SIGINT, signal_handler, GINT_TO_POINTER (SIGINT)); @@ -691,12 +944,11 @@ main (int argc, char **argv) NULL, NULL); g_object_unref (bus); - if (!persist) - quit_id = g_timeout_add_seconds (10, quit_timeout_cb, NULL); + quit_timeout_reschedule (); g_main_loop_run (loop); - g_queue_free (handler->pending_requests); + g_queue_free (handler->requests_waiting); g_object_unref (handler); if (!debug) diff --git a/callouts/tests/Makefile.am b/callouts/tests/Makefile.am index 394fedab..ee3f647d 100644 --- a/callouts/tests/Makefile.am +++ b/callouts/tests/Makefile.am @@ -1,8 +1,8 @@ if ENABLE_TESTS AM_CPPFLAGS = \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ + -I$(top_srcdir)/shared \ + -I$(top_builddir)/shared \ -I$(top_srcdir)/libnm-core \ -I$(top_builddir)/libnm-core \ -I$(top_srcdir)/callouts \ @@ -10,8 +10,7 @@ AM_CPPFLAGS = \ -DNETWORKMANAGER_COMPILATION \ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ -DSRCDIR=\"$(abs_srcdir)\" \ - $(GLIB_CFLAGS) \ - $(DBUS_CFLAGS) + $(GLIB_CFLAGS) noinst_PROGRAMS = \ test-dispatcher-envp @@ -24,8 +23,7 @@ test_dispatcher_envp_SOURCES = \ test_dispatcher_envp_LDADD = \ $(top_builddir)/libnm/libnm.la \ $(top_builddir)/callouts/libtest-dispatcher-envp.la \ - $(GLIB_LIBS) \ - $(DBUS_LIBS) + $(GLIB_LIBS) ########################################### @@ -36,6 +34,7 @@ endif EXTRA_DIST= \ dispatcher-down \ + dispatcher-external \ dispatcher-up \ dispatcher-vpn-down \ dispatcher-vpn-up diff --git a/callouts/tests/Makefile.in b/callouts/tests/Makefile.in index f3cb7386..eeaf70d6 100644 --- a/callouts/tests/Makefile.in +++ b/callouts/tests/Makefile.in @@ -121,7 +121,7 @@ am__DEPENDENCIES_1 = @ENABLE_TESTS_TRUE@test_dispatcher_envp_DEPENDENCIES = \ @ENABLE_TESTS_TRUE@ $(top_builddir)/libnm/libnm.la \ @ENABLE_TESTS_TRUE@ $(top_builddir)/callouts/libtest-dispatcher-envp.la \ -@ENABLE_TESTS_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@ENABLE_TESTS_TRUE@ $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @@ -408,7 +408,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -420,8 +419,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -431,6 +428,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -485,16 +483,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -531,6 +526,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -559,7 +556,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -574,6 +570,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -634,6 +632,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -641,6 +640,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -657,8 +657,8 @@ with_netconfig = @with_netconfig@ with_resolvconf = @with_resolvconf@ with_valgrind = @with_valgrind@ @ENABLE_TESTS_TRUE@AM_CPPFLAGS = \ -@ENABLE_TESTS_TRUE@ -I$(top_srcdir)/include \ -@ENABLE_TESTS_TRUE@ -I$(top_builddir)/include \ +@ENABLE_TESTS_TRUE@ -I$(top_srcdir)/shared \ +@ENABLE_TESTS_TRUE@ -I$(top_builddir)/shared \ @ENABLE_TESTS_TRUE@ -I$(top_srcdir)/libnm-core \ @ENABLE_TESTS_TRUE@ -I$(top_builddir)/libnm-core \ @ENABLE_TESTS_TRUE@ -I$(top_srcdir)/callouts \ @@ -666,8 +666,7 @@ with_valgrind = @with_valgrind@ @ENABLE_TESTS_TRUE@ -DNETWORKMANAGER_COMPILATION \ @ENABLE_TESTS_TRUE@ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ @ENABLE_TESTS_TRUE@ -DSRCDIR=\"$(abs_srcdir)\" \ -@ENABLE_TESTS_TRUE@ $(GLIB_CFLAGS) \ -@ENABLE_TESTS_TRUE@ $(DBUS_CFLAGS) +@ENABLE_TESTS_TRUE@ $(GLIB_CFLAGS) ####### dispatcher envp ####### @@ -677,11 +676,11 @@ with_valgrind = @with_valgrind@ @ENABLE_TESTS_TRUE@test_dispatcher_envp_LDADD = \ @ENABLE_TESTS_TRUE@ $(top_builddir)/libnm/libnm.la \ @ENABLE_TESTS_TRUE@ $(top_builddir)/callouts/libtest-dispatcher-envp.la \ -@ENABLE_TESTS_TRUE@ $(GLIB_LIBS) \ -@ENABLE_TESTS_TRUE@ $(DBUS_LIBS) +@ENABLE_TESTS_TRUE@ $(GLIB_LIBS) EXTRA_DIST = \ dispatcher-down \ + dispatcher-external \ dispatcher-up \ dispatcher-vpn-down \ dispatcher-vpn-up diff --git a/callouts/tests/dispatcher-down b/callouts/tests/dispatcher-down index da97d3f6..f766595c 100644 --- a/callouts/tests/dispatcher-down +++ b/callouts/tests/dispatcher-down @@ -14,6 +14,7 @@ path=/org/freedesktop/NetworkManager/Devices/0 [env] PATH= CONNECTION_UUID=3fd2a33a-d81b-423f-ae99-e6baba742311 +CONNECTION_DBUS_PATH=/org/freedesktop/NetworkManager/Connections/5 CONNECTION_ID=Random Connection CONNECTION_FILENAME=/callouts/tests/dispatcher-down DEVICE_IFACE=wlan0 diff --git a/callouts/tests/dispatcher-external b/callouts/tests/dispatcher-external new file mode 100644 index 00000000..5430bec2 --- /dev/null +++ b/callouts/tests/dispatcher-external @@ -0,0 +1,33 @@ +[main] +action=up +expected-iface=virbr0 +uuid=92bbc2fb-7304-46be-8ebb-6093dbe19a6a +id=virbr0 +external=1 + +[device] +state=100 +ip-interface=virbr0 +type=13 +interface=virbr0 +path=/org/freedesktop/NetworkManager/Devices/0 + +[ip4] +addresses=192.168.122.1/24 0.0.0.0 +domains= +gateway=0.0.0.0 + +[env] +PATH= +CONNECTION_UUID=92bbc2fb-7304-46be-8ebb-6093dbe19a6a +CONNECTION_DBUS_PATH=/org/freedesktop/NetworkManager/Connections/5 +CONNECTION_FILENAME=/callouts/tests/dispatcher-external +CONNECTION_ID=virbr0 +CONNECTION_EXTERNAL=1 +DEVICE_IFACE=virbr0 +DEVICE_IP_IFACE=virbr0 +IP4_NUM_ADDRESSES=1 +IP4_ADDRESS_0=192.168.122.1/24 0.0.0.0 +IP4_GATEWAY=0.0.0.0 +IP4_NUM_ROUTES=0 + diff --git a/callouts/tests/dispatcher-up b/callouts/tests/dispatcher-up index 78cfadad..463409e2 100644 --- a/callouts/tests/dispatcher-up +++ b/callouts/tests/dispatcher-up @@ -33,6 +33,7 @@ domains=hsd1.mn.comcast.net. [env] PATH= CONNECTION_UUID=3fd2a33a-d81b-423f-ae99-e6baba742311 +CONNECTION_DBUS_PATH=/org/freedesktop/NetworkManager/Connections/5 CONNECTION_ID=Random Connection CONNECTION_FILENAME=/callouts/tests/dispatcher-up DEVICE_IFACE=wlan0 diff --git a/callouts/tests/dispatcher-vpn-down b/callouts/tests/dispatcher-vpn-down index eb4dc2ca..18267f84 100644 --- a/callouts/tests/dispatcher-vpn-down +++ b/callouts/tests/dispatcher-vpn-down @@ -33,6 +33,7 @@ domains=hsd1.mn.comcast.net. [env] PATH= CONNECTION_UUID=355653c0-34d3-4777-ad25-f9a498b7ef8e +CONNECTION_DBUS_PATH=/org/freedesktop/NetworkManager/Connections/5 CONNECTION_ID=Random Connection CONNECTION_FILENAME=/callouts/tests/dispatcher-vpn-down DEVICE_IFACE=wlan0 diff --git a/callouts/tests/dispatcher-vpn-up b/callouts/tests/dispatcher-vpn-up index 8ae78a31..181ecb53 100644 --- a/callouts/tests/dispatcher-vpn-up +++ b/callouts/tests/dispatcher-vpn-up @@ -33,6 +33,7 @@ domains=hsd1.mn.comcast.net. [env] PATH= CONNECTION_UUID=355653c0-34d3-4777-ad25-f9a498b7ef8e +CONNECTION_DBUS_PATH=/org/freedesktop/NetworkManager/Connections/5 CONNECTION_ID=Random Connection CONNECTION_FILENAME=/callouts/tests/dispatcher-vpn-up DEVICE_IFACE=wlan0 diff --git a/callouts/tests/test-dispatcher-envp.c b/callouts/tests/test-dispatcher-envp.c index 6ae3fab0..27f088f6 100644 --- a/callouts/tests/test-dispatcher-envp.c +++ b/callouts/tests/test-dispatcher-envp.c @@ -23,13 +23,14 @@ #include #include #include -#include -#include +#include "nm-default.h" #include "nm-core-internal.h" #include "nm-dispatcher-utils.h" #include "nm-dispatcher-api.h" +#include "nm-test-utils.h" + /*******************************************/ static gboolean @@ -81,13 +82,21 @@ parse_main (GKeyFile *kf, g_variant_builder_init (&props, G_VARIANT_TYPE ("a{sv}")); g_variant_builder_add (&props, "{sv}", - "connection-path", + NMD_CONNECTION_PROPS_PATH, g_variant_new_object_path ("/org/freedesktop/NetworkManager/Connections/5")); + /* Strip out the non-fixed portion of the filename */ filename = strstr (filename, "/callouts"); g_variant_builder_add (&props, "{sv}", "filename", g_variant_new_string (filename)); + + if (g_key_file_get_boolean (kf, "main", "external", NULL)) { + g_variant_builder_add (&props, "{sv}", + "external", + g_variant_new_boolean (TRUE)); + } + *out_con_props = g_variant_builder_end (&props); return TRUE; @@ -449,6 +458,7 @@ test_generic (const char *file, const char *override_vpn_ip_iface) char *expected_iface = NULL; char *action = NULL; char *out_iface = NULL; + const char *error_message = NULL; GHashTable *expected_env = NULL; GError *error = NULL; gboolean success; @@ -488,7 +498,13 @@ test_generic (const char *file, const char *override_vpn_ip_iface) override_vpn_ip_iface ? override_vpn_ip_iface : vpn_ip_iface, vpn_ip4_props, vpn_ip6_props, - &out_iface); + &out_iface, + &error_message); + + g_assert ((!denv && error_message) || (denv && !error_message)); + + if (error_message) + g_warning ("%s", error_message); /* Print out environment for now */ #ifdef DEBUG @@ -580,6 +596,12 @@ test_vpn_down (void) test_generic ("dispatcher-vpn-down", NULL); } +static void +test_external (void) +{ + test_generic ("dispatcher-external", NULL); +} + static void test_up_empty_vpn_iface (void) { @@ -591,19 +613,18 @@ test_up_empty_vpn_iface (void) /*******************************************/ +NMTST_DEFINE (); + int main (int argc, char **argv) { - g_test_init (&argc, &argv, NULL); - -#if !GLIB_CHECK_VERSION (2, 35, 0) - g_type_init (); -#endif + nmtst_init (&argc, &argv, TRUE); g_test_add_func ("/dispatcher/up", test_up); g_test_add_func ("/dispatcher/down", test_down); g_test_add_func ("/dispatcher/vpn_up", test_vpn_up); g_test_add_func ("/dispatcher/vpn_down", test_vpn_down); + g_test_add_func ("/dispatcher/external", test_external); g_test_add_func ("/dispatcher/up_empty_vpn_iface", test_up_empty_vpn_iface); diff --git a/clients/Makefile.am b/clients/Makefile.am index 8316dcc0..9c30eea1 100644 --- a/clients/Makefile.am +++ b/clients/Makefile.am @@ -1,8 +1,8 @@ SUBDIRS = cli tui AM_CPPFLAGS = \ - -I${top_srcdir}/include \ - -I$(top_builddir)/include \ + -I${top_srcdir}/shared \ + -I$(top_builddir)/shared \ -I${top_srcdir}/libnm-core \ -I${top_builddir}/libnm-core \ -I${top_srcdir}/libnm \ diff --git a/clients/Makefile.in b/clients/Makefile.in index a281fd13..243cd149 100644 --- a/clients/Makefile.in +++ b/clients/Makefile.in @@ -242,7 +242,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -254,8 +253,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -265,6 +262,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -319,16 +317,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -365,6 +360,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -393,7 +390,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -408,6 +404,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -468,6 +466,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -475,6 +474,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -492,8 +492,8 @@ with_resolvconf = @with_resolvconf@ with_valgrind = @with_valgrind@ SUBDIRS = cli tui AM_CPPFLAGS = \ - -I${top_srcdir}/include \ - -I$(top_builddir)/include \ + -I${top_srcdir}/shared \ + -I$(top_builddir)/shared \ -I${top_srcdir}/libnm-core \ -I${top_builddir}/libnm-core \ -I${top_srcdir}/libnm \ diff --git a/clients/cli/Makefile.am b/clients/cli/Makefile.am index 2f394098..dfcb1e96 100644 --- a/clients/cli/Makefile.am +++ b/clients/cli/Makefile.am @@ -1,11 +1,13 @@ +if BUILD_NMCLI + bin_PROGRAMS = \ nmcli AM_CPPFLAGS = \ -I${top_srcdir} \ -I${top_builddir} \ - -I${top_srcdir}/include \ - -I$(top_builddir)/include \ + -I${top_srcdir}/shared \ + -I$(top_builddir)/shared \ -I${top_srcdir}/libnm-core \ -I${top_builddir}/libnm-core \ -I${top_srcdir}/libnm \ @@ -14,9 +16,7 @@ AM_CPPFLAGS = \ $(GLIB_CFLAGS) \ -DG_LOG_DOMAIN=\""nmcli"\" \ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ - -DNMCLI_LOCALEDIR=\"$(datadir)/locale\" \ - -DNMCONFDIR=\"$(nmconfdir)\" \ - -DNMLIBDIR=\"$(libdir)\" + -DNMCLI_LOCALEDIR=\"$(datadir)/locale\" nmcli_SOURCES = \ agent.c \ @@ -75,3 +75,5 @@ uninstall-hook: rm -f $(DESTDIR)$(completiondir)/nmcli EXTRA_DIST += nmcli-completion + +endif diff --git a/clients/cli/Makefile.in b/clients/cli/Makefile.in index 2abbf580..9aa4aa49 100644 --- a/clients/cli/Makefile.in +++ b/clients/cli/Makefile.in @@ -88,10 +88,10 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -bin_PROGRAMS = nmcli$(EXEEXT) -@WITH_POLKIT_AGENT_TRUE@am__append_1 = $(POLKIT_CFLAGS) -@WITH_POLKIT_AGENT_TRUE@am__append_2 = $(srcdir)/../common/nm-polkit-listener.c $(srcdir)/../common/nm-polkit-listener.h -@WITH_POLKIT_AGENT_TRUE@am__append_3 = $(POLKIT_LIBS) +@BUILD_NMCLI_TRUE@bin_PROGRAMS = nmcli$(EXEEXT) +@BUILD_NMCLI_TRUE@@WITH_POLKIT_AGENT_TRUE@am__append_1 = $(POLKIT_CFLAGS) +@BUILD_NMCLI_TRUE@@WITH_POLKIT_AGENT_TRUE@am__append_2 = $(srcdir)/../common/nm-polkit-listener.c $(srcdir)/../common/nm-polkit-listener.h +@BUILD_NMCLI_TRUE@@WITH_POLKIT_AGENT_TRUE@am__append_3 = $(POLKIT_LIBS) subdir = clients/cli ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_readline.m4 \ @@ -126,17 +126,21 @@ am__nmcli_SOURCES_DIST = agent.c agent.h common.c common.h \ $(srcdir)/../common/nm-vpn-helpers.h \ $(srcdir)/../common/nm-polkit-listener.c \ $(srcdir)/../common/nm-polkit-listener.h -@WITH_POLKIT_AGENT_TRUE@am__objects_1 = nm-polkit-listener.$(OBJEXT) -am_nmcli_OBJECTS = agent.$(OBJEXT) common.$(OBJEXT) \ - connections.$(OBJEXT) devices.$(OBJEXT) general.$(OBJEXT) \ - settings.$(OBJEXT) nmcli.$(OBJEXT) utils.$(OBJEXT) \ - polkit-agent.$(OBJEXT) nm-secret-agent-simple.$(OBJEXT) \ - nm-vpn-helpers.$(OBJEXT) $(am__objects_1) +@BUILD_NMCLI_TRUE@@WITH_POLKIT_AGENT_TRUE@am__objects_1 = nm-polkit-listener.$(OBJEXT) +@BUILD_NMCLI_TRUE@am_nmcli_OBJECTS = agent.$(OBJEXT) common.$(OBJEXT) \ +@BUILD_NMCLI_TRUE@ connections.$(OBJEXT) devices.$(OBJEXT) \ +@BUILD_NMCLI_TRUE@ general.$(OBJEXT) settings.$(OBJEXT) \ +@BUILD_NMCLI_TRUE@ nmcli.$(OBJEXT) utils.$(OBJEXT) \ +@BUILD_NMCLI_TRUE@ polkit-agent.$(OBJEXT) \ +@BUILD_NMCLI_TRUE@ nm-secret-agent-simple.$(OBJEXT) \ +@BUILD_NMCLI_TRUE@ nm-vpn-helpers.$(OBJEXT) $(am__objects_1) nmcli_OBJECTS = $(am_nmcli_OBJECTS) am__DEPENDENCIES_1 = -@WITH_POLKIT_AGENT_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) -nmcli_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(top_builddir)/libnm/libnm.la $(am__DEPENDENCIES_2) +@BUILD_NMCLI_TRUE@@WITH_POLKIT_AGENT_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) +@BUILD_NMCLI_TRUE@nmcli_DEPENDENCIES = $(am__DEPENDENCIES_1) \ +@BUILD_NMCLI_TRUE@ $(am__DEPENDENCIES_1) \ +@BUILD_NMCLI_TRUE@ $(top_builddir)/libnm/libnm.la \ +@BUILD_NMCLI_TRUE@ $(am__DEPENDENCIES_2) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @@ -219,7 +223,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -231,8 +234,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -242,6 +243,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -296,16 +298,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -342,6 +341,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -370,7 +371,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -385,6 +385,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -445,6 +447,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -452,6 +455,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -467,30 +471,36 @@ with_dhcpcd = @with_dhcpcd@ with_netconfig = @with_netconfig@ with_resolvconf = @with_resolvconf@ with_valgrind = @with_valgrind@ -AM_CPPFLAGS = -I${top_srcdir} -I${top_builddir} \ - -I${top_srcdir}/include -I$(top_builddir)/include \ - -I${top_srcdir}/libnm-core -I${top_builddir}/libnm-core \ - -I${top_srcdir}/libnm -I${top_builddir}/libnm \ - -I${top_srcdir}/clients/common $(GLIB_CFLAGS) \ - -DG_LOG_DOMAIN=\""nmcli"\" \ - -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ - -DNMCLI_LOCALEDIR=\"$(datadir)/locale\" \ - -DNMCONFDIR=\"$(nmconfdir)\" -DNMLIBDIR=\"$(libdir)\" \ - $(am__append_1) -nmcli_SOURCES = agent.c agent.h common.c common.h connections.c \ - connections.h devices.c devices.h general.c general.h \ - settings.c settings.h nmcli.c nmcli.h utils.c utils.h \ - polkit-agent.c polkit-agent.h \ - $(srcdir)/../common/nm-secret-agent-simple.c \ - $(srcdir)/../common/nm-secret-agent-simple.h \ - $(srcdir)/../common/nm-vpn-helpers.c \ - $(srcdir)/../common/nm-vpn-helpers.h $(NULL) $(am__append_2) -nmcli_LDADD = $(GLIB_LIBS) $(READLINE_LIBS) \ - $(top_builddir)/libnm/libnm.la $(am__append_3) -@BUILD_SETTING_DOCS_TRUE@BUILT_SOURCES = settings-docs.c -@BUILD_SETTING_DOCS_TRUE@CLEANFILES = settings-docs.c -EXTRA_DIST = settings-docs.c settings-docs.xsl nmcli-completion -completiondir = $(datadir)/bash-completion/completions +@BUILD_NMCLI_TRUE@AM_CPPFLAGS = -I${top_srcdir} -I${top_builddir} \ +@BUILD_NMCLI_TRUE@ -I${top_srcdir}/shared \ +@BUILD_NMCLI_TRUE@ -I$(top_builddir)/shared \ +@BUILD_NMCLI_TRUE@ -I${top_srcdir}/libnm-core \ +@BUILD_NMCLI_TRUE@ -I${top_builddir}/libnm-core \ +@BUILD_NMCLI_TRUE@ -I${top_srcdir}/libnm \ +@BUILD_NMCLI_TRUE@ -I${top_builddir}/libnm \ +@BUILD_NMCLI_TRUE@ -I${top_srcdir}/clients/common \ +@BUILD_NMCLI_TRUE@ $(GLIB_CFLAGS) -DG_LOG_DOMAIN=\""nmcli"\" \ +@BUILD_NMCLI_TRUE@ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ +@BUILD_NMCLI_TRUE@ -DNMCLI_LOCALEDIR=\"$(datadir)/locale\" \ +@BUILD_NMCLI_TRUE@ $(am__append_1) +@BUILD_NMCLI_TRUE@nmcli_SOURCES = agent.c agent.h common.c common.h \ +@BUILD_NMCLI_TRUE@ connections.c connections.h devices.c \ +@BUILD_NMCLI_TRUE@ devices.h general.c general.h settings.c \ +@BUILD_NMCLI_TRUE@ settings.h nmcli.c nmcli.h utils.c utils.h \ +@BUILD_NMCLI_TRUE@ polkit-agent.c polkit-agent.h \ +@BUILD_NMCLI_TRUE@ $(srcdir)/../common/nm-secret-agent-simple.c \ +@BUILD_NMCLI_TRUE@ $(srcdir)/../common/nm-secret-agent-simple.h \ +@BUILD_NMCLI_TRUE@ $(srcdir)/../common/nm-vpn-helpers.c \ +@BUILD_NMCLI_TRUE@ $(srcdir)/../common/nm-vpn-helpers.h $(NULL) \ +@BUILD_NMCLI_TRUE@ $(am__append_2) +@BUILD_NMCLI_TRUE@nmcli_LDADD = $(GLIB_LIBS) $(READLINE_LIBS) \ +@BUILD_NMCLI_TRUE@ $(top_builddir)/libnm/libnm.la \ +@BUILD_NMCLI_TRUE@ $(am__append_3) +@BUILD_NMCLI_TRUE@@BUILD_SETTING_DOCS_TRUE@BUILT_SOURCES = settings-docs.c +@BUILD_NMCLI_TRUE@@BUILD_SETTING_DOCS_TRUE@CLEANFILES = settings-docs.c +@BUILD_NMCLI_TRUE@EXTRA_DIST = settings-docs.c settings-docs.xsl \ +@BUILD_NMCLI_TRUE@ nmcli-completion +@BUILD_NMCLI_TRUE@completiondir = $(datadir)/bash-completion/completions all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am @@ -790,6 +800,8 @@ maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +@BUILD_NMCLI_FALSE@install-data-hook: +@BUILD_NMCLI_FALSE@uninstall-hook: clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am @@ -883,15 +895,15 @@ uninstall-am: uninstall-binPROGRAMS .PRECIOUS: Makefile -@BUILD_SETTING_DOCS_TRUE@settings-docs.c: settings-docs.xsl $(top_builddir)/libnm/nm-property-docs.xml -@BUILD_SETTING_DOCS_TRUE@ $(AM_V_GEN) xsltproc --output $@ $^ +@BUILD_NMCLI_TRUE@@BUILD_SETTING_DOCS_TRUE@settings-docs.c: settings-docs.xsl $(top_builddir)/libnm/nm-property-docs.xml +@BUILD_NMCLI_TRUE@@BUILD_SETTING_DOCS_TRUE@ $(AM_V_GEN) xsltproc --output $@ $^ -install-data-hook: - $(mkinstalldirs) $(DESTDIR)$(completiondir) - $(INSTALL_DATA) $(srcdir)/nmcli-completion $(DESTDIR)$(completiondir)/nmcli +@BUILD_NMCLI_TRUE@install-data-hook: +@BUILD_NMCLI_TRUE@ $(mkinstalldirs) $(DESTDIR)$(completiondir) +@BUILD_NMCLI_TRUE@ $(INSTALL_DATA) $(srcdir)/nmcli-completion $(DESTDIR)$(completiondir)/nmcli -uninstall-hook: - rm -f $(DESTDIR)$(completiondir)/nmcli +@BUILD_NMCLI_TRUE@uninstall-hook: +@BUILD_NMCLI_TRUE@ rm -f $(DESTDIR)$(completiondir)/nmcli # 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/clients/cli/agent.c b/clients/cli/agent.c index 1695ed59..c4ff3f9e 100644 --- a/clients/cli/agent.c +++ b/clients/cli/agent.c @@ -21,8 +21,6 @@ #include "config.h" -#include -#include #include #include #include @@ -30,6 +28,7 @@ #include #include +#include "nm-default.h" #include "common.h" #include "utils.h" #include "nm-secret-agent-simple.h" @@ -145,7 +144,7 @@ do_agent_secret (NmCli *nmc, int argc, char **argv) nmc->secret_agent = nm_secret_agent_simple_new ("nmcli-agent"); if (nmc->secret_agent) { /* We keep running */ - nmc->should_wait = TRUE; + nmc->should_wait++; nm_secret_agent_simple_enable (NM_SECRET_AGENT_SIMPLE (nmc->secret_agent), NULL); g_signal_connect (nmc->secret_agent, "request-secrets", G_CALLBACK (secrets_requested), nmc); @@ -172,7 +171,7 @@ do_agent_polkit (NmCli *nmc, int argc, char **argv) g_error_free (error); } else { /* We keep running */ - nmc->should_wait = TRUE; + nmc->should_wait++; g_print (_("nmcli successfully registered as a polkit agent.\n")); } diff --git a/clients/cli/common.c b/clients/cli/common.c index 86f91d58..daacce7c 100644 --- a/clients/cli/common.c +++ b/clients/cli/common.c @@ -21,59 +21,58 @@ #include "config.h" -#include -#include #include #include #include +#include +#include #include #include -#include "nm-glib-compat.h" - +#include "nm-default.h" #include "nm-vpn-helpers.h" #include "common.h" #include "utils.h" /* Available fields for IPv4 group */ NmcOutputField nmc_fields_ip4_config[] = { - {"GROUP", N_("GROUP"), 15}, /* 0 */ - {"ADDRESS", N_("ADDRESS"), 68}, /* 1 */ - {"GATEWAY", N_("GATEWAY"), 0}, /* 2 */ - {"ROUTE", N_("ROUTE"), 68}, /* 3 */ - {"DNS", N_("DNS"), 35}, /* 4 */ - {"DOMAIN", N_("DOMAIN"), 35}, /* 5 */ - {"WINS", N_("WINS"), 20}, /* 6 */ - {NULL, NULL, 0} + {"GROUP", N_("GROUP")}, /* 0 */ + {"ADDRESS", N_("ADDRESS")}, /* 1 */ + {"GATEWAY", N_("GATEWAY")}, /* 2 */ + {"ROUTE", N_("ROUTE")}, /* 3 */ + {"DNS", N_("DNS")}, /* 4 */ + {"DOMAIN", N_("DOMAIN")}, /* 5 */ + {"WINS", N_("WINS")}, /* 6 */ + {NULL, NULL} }; #define NMC_FIELDS_IP4_CONFIG_ALL "GROUP,ADDRESS,GATEWAY,ROUTE,DNS,DOMAIN,WINS" /* Available fields for DHCPv4 group */ NmcOutputField nmc_fields_dhcp4_config[] = { - {"GROUP", N_("GROUP"), 15}, /* 0 */ - {"OPTION", N_("OPTION"), 80}, /* 1 */ - {NULL, NULL, 0} + {"GROUP", N_("GROUP")}, /* 0 */ + {"OPTION", N_("OPTION")}, /* 1 */ + {NULL, NULL} }; #define NMC_FIELDS_DHCP4_CONFIG_ALL "GROUP,OPTION" /* Available fields for IPv6 group */ NmcOutputField nmc_fields_ip6_config[] = { - {"GROUP", N_("GROUP"), 15}, /* 0 */ - {"ADDRESS", N_("ADDRESS"), 95}, /* 1 */ - {"GATEWAY", N_("GATEWAY"), 0}, /* 2 */ - {"ROUTE", N_("ROUTE"), 95}, /* 3 */ - {"DNS", N_("DNS"), 60}, /* 4 */ - {"DOMAIN", N_("DOMAIN"), 35}, /* 5 */ - {NULL, NULL, 0} + {"GROUP", N_("GROUP")}, /* 0 */ + {"ADDRESS", N_("ADDRESS")}, /* 1 */ + {"GATEWAY", N_("GATEWAY")}, /* 2 */ + {"ROUTE", N_("ROUTE")}, /* 3 */ + {"DNS", N_("DNS")}, /* 4 */ + {"DOMAIN", N_("DOMAIN")}, /* 5 */ + {NULL, NULL} }; #define NMC_FIELDS_IP6_CONFIG_ALL "GROUP,ADDRESS,GATEWAY,ROUTE,DNS,DOMAIN" /* Available fields for DHCPv6 group */ NmcOutputField nmc_fields_dhcp6_config[] = { - {"GROUP", N_("GROUP"), 15}, /* 0 */ - {"OPTION", N_("OPTION"), 80}, /* 1 */ - {NULL, NULL, 0} + {"GROUP", N_("GROUP")}, /* 0 */ + {"OPTION", N_("OPTION")}, /* 1 */ + {NULL, NULL} }; #define NMC_FIELDS_DHCP6_CONFIG_ALL "GROUP,OPTION" @@ -1009,6 +1008,7 @@ get_secrets_from_user (const char *request_id, const char *msg, NMConnection *connection, gboolean ask, + gboolean echo_on, GHashTable *pwds_hash, GPtrArray *secrets) { @@ -1039,7 +1039,7 @@ get_secrets_from_user (const char *request_id, } } g_print ("%s\n", msg); - pwd = nmc_readline ("%s (%s): ", secret->name, secret->prop_name); + pwd = nmc_readline_echo (echo_on, "%s (%s): ", secret->name, secret->prop_name); if (!pwd) pwd = g_strdup (""); } else { @@ -1099,7 +1099,7 @@ nmc_secrets_requested (NMSecretAgentSimple *agent, } success = get_secrets_from_user (request_id, title, msg, connection, nmc->in_editor || nmc->ask, - nmc->pwds_hash, secrets); + nmc->show_secrets, nmc->pwds_hash, secrets); if (success) nm_secret_agent_simple_response (agent, request_id, secrets); else { @@ -1109,9 +1109,32 @@ nmc_secrets_requested (NMSecretAgentSimple *agent, nm_secret_agent_old_unregister (nmc->secret_agent, NULL, NULL); g_clear_object (&nmc->secret_agent); } - } + } } +char * +nmc_unique_connection_name (const GPtrArray *connections, const char *try_name) +{ + NMConnection *connection; + const char *name; + char *new_name; + unsigned int num = 1; + int i = 0; + + new_name = g_strdup (try_name); + while (i < connections->len) { + connection = NM_CONNECTION (connections->pdata[i]); + + name = nm_connection_get_id (connection); + if (g_strcmp0 (new_name, name) == 0) { + g_free (new_name); + new_name = g_strdup_printf ("%s-%d", try_name, num++); + i = 0; + } else + i++; + } + return new_name; +} /** * nmc_cleanup_readline: @@ -1152,29 +1175,12 @@ nmc_set_in_readline (gboolean in_readline) /* Global variable defined in nmcli.c */ extern NmCli nm_cli; -/** - * nmc_readline: - * @prompt_fmt: prompt to print (telling user what to enter). It is standard - * printf() format string - * @...: a list of arguments according to the @prompt_fmt format string - * - * Wrapper around libreadline's readline() function. - * If user pressed Ctrl-C, readline() is called again (if not in editor and - * line is empty, nmcli will quit). - * If user pressed Ctrl-D on empty line, nmcli will quit. - * - * Returns: the user provided string. In case the user entered empty string, - * this function returns NULL. - */ -char * -nmc_readline (const char *prompt_fmt, ...) -{ - va_list args; - char *prompt, *str; - va_start (args, prompt_fmt); - prompt = g_strdup_vprintf (prompt_fmt, args); - va_end (args); +static char * +nmc_readline_helper (const char *prompt) +{ + char *str; + int b; readline_mark: /* We are in readline -> Ctrl-C should not quit nmcli */ @@ -1183,6 +1189,13 @@ readline_mark: /* We are outside readline -> Ctrl-C should quit nmcli */ nmc_set_in_readline (FALSE); + /* Check for an I/O error by attempting to peek into the input buffer. + * Readline just inserts newlines when errors occur so we need to check ourselves. */ + if (ioctl (0, FIONREAD, &b) == -1) { + g_free (str); + str = NULL; + } + /* Add string to the history */ if (str && *str) add_history (str); @@ -1215,7 +1228,6 @@ readline_mark: sleep (3); } } - g_free (prompt); /* Return NULL, not empty string */ if (str && *str == '\0') { @@ -1225,6 +1237,76 @@ readline_mark: return str; } +/** + * nmc_readline: + * @prompt_fmt: prompt to print (telling user what to enter). It is standard + * printf() format string + * @...: a list of arguments according to the @prompt_fmt format string + * + * Wrapper around libreadline's readline() function. + * If user pressed Ctrl-C, readline() is called again (if not in editor and + * line is empty, nmcli will quit). + * If user pressed Ctrl-D on empty line, nmcli will quit. + * + * Returns: the user provided string. In case the user entered empty string, + * this function returns NULL. + */ +char * +nmc_readline (const char *prompt_fmt, ...) +{ + va_list args; + char *prompt, *str; + + va_start (args, prompt_fmt); + prompt = g_strdup_vprintf (prompt_fmt, args); + va_end (args); + + str = nmc_readline_helper (prompt); + + g_free (prompt); + + return str; +} + +/** + * nmc_readline_echo: + * + * The same as nmc_readline() except it can disable echoing of input characters if @echo_on is %FALSE. + * nmc_readline(TRUE, ...) == nmc_readline(...) + */ +char * +nmc_readline_echo (gboolean echo_on, const char *prompt_fmt, ...) +{ + va_list args; + char *prompt, *str; + struct termios termios_orig, termios_new; + + va_start (args, prompt_fmt); + prompt = g_strdup_vprintf (prompt_fmt, args); + va_end (args); + + /* Disable echoing characters */ + if (!echo_on) { + tcgetattr (STDIN_FILENO, &termios_orig); + termios_new = termios_orig; + termios_new.c_lflag &= ~(ECHO); + tcsetattr (STDIN_FILENO, TCSADRAIN, &termios_new); + } + + str = nmc_readline_helper (prompt); + + g_free (prompt); + + /* Restore original terminal settings */ + if (!echo_on) { + tcsetattr (STDIN_FILENO, TCSADRAIN, &termios_orig); + /* New line - setting ECHONL | ICANON did not help */ + fprintf (stdout, "\n"); + } + + return str; +} + /** * nmc_rl_gen_func_basic: * @text: text to complete @@ -1270,3 +1352,46 @@ nmc_rl_set_deftext (void) return 0; } +/** + * nmc_parse_lldp_capabilities: + * @value: the capabilities value + * + * Parses LLDP capabilities flags + * + * Returns: a newly allocated string containing capabilities names separated by commas. + */ +char * +nmc_parse_lldp_capabilities (guint value) +{ + /* IEEE Std 802.1AB-2009 - Table 8.4 */ + const char *names[] = { "other", "repeater", "mac-bridge", "wlan-access-point", + "router", "telephone", "docsis-cable-device", "station-only", + "c-vlan-component", "s-vlan-component", "tpmr" }; + gboolean first = TRUE; + GString *str; + int i; + + if (!value) + return g_strdup ("none"); + + str = g_string_new (""); + + for (i = 0; i < G_N_ELEMENTS (names); i++) { + if (value & (1 << i)) { + if (!first) + g_string_append_c (str, ','); + + first = FALSE; + value &= ~(1 << i); + g_string_append (str, names[i]); + } + } + + if (value) { + if (!first) + g_string_append_c (str, ','); + g_string_append (str, "reserved"); + } + + return g_string_free (str, FALSE); +} diff --git a/clients/cli/common.h b/clients/cli/common.h index bb3f44e8..26459e4b 100644 --- a/clients/cli/common.h +++ b/clients/cli/common.h @@ -57,8 +57,12 @@ void nmc_secrets_requested (NMSecretAgentSimple *agent, GPtrArray *secrets, gpointer user_data); +char *nmc_unique_connection_name (const GPtrArray *connections, + const char *try_name); + void nmc_cleanup_readline (void); char *nmc_readline (const char *prompt_fmt, ...) G_GNUC_PRINTF (1, 2); +char *nmc_readline_echo (gboolean echo_on, const char *prompt_fmt, ...) G_GNUC_PRINTF (2, 3); char *nmc_rl_gen_func_basic (const char *text, int state, const char **words); gboolean nmc_get_in_readline (void); void nmc_set_in_readline (gboolean in_readline); @@ -67,4 +71,6 @@ void nmc_set_in_readline (gboolean in_readline); extern char *nmc_rl_pre_input_deftext; int nmc_rl_set_deftext (void); +char *nmc_parse_lldp_capabilities (guint value); + #endif /* NMC_COMMON_H */ diff --git a/clients/cli/connections.c b/clients/cli/connections.c index e5aaa658..9ab926a0 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -14,13 +14,11 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright 2010 - 2014 Red Hat, Inc. + * Copyright 2010 - 2015 Red Hat, Inc. */ #include "config.h" -#include -#include #include #include #include @@ -31,12 +29,14 @@ #include #include +#include "nm-default.h" #include "utils.h" #include "common.h" #include "settings.h" #include "connections.h" #include "nm-secret-agent-simple.h" #include "polkit-agent.h" +#include "nm-vpn-helpers.h" /* define some prompts for connection editor */ #define EDITOR_PROMPT_SETTING _("Setting name? ") @@ -46,32 +46,45 @@ /* define some other prompts */ #define PROMPT_CON_TYPE _("Connection type: ") #define PROMPT_VPN_TYPE _("VPN type: ") -#define PROMPT_BOND_MASTER _("Bond master: ") -#define PROMPT_TEAM_MASTER _("Team master: ") -#define PROMPT_BRIDGE_MASTER _("Bridge master: ") +#define PROMPT_MASTER _("Master: ") #define PROMPT_CONNECTION _("Connection (name, UUID, or path): ") +#define PROMPT_VPN_CONNECTION _("VPN connection (name, UUID, or path): ") #define PROMPT_CONNECTIONS _("Connection(s) (name, UUID, or path): ") - -static const char *nmc_known_vpns[] = - { "openvpn", "vpnc", "pptp", "openconnect", "openswan", "libreswan", - "ssh", "l2tp", "iodine", NULL }; +#define PROMPT_ACTIVE_CONNECTIONS _("Connection(s) (name, UUID, path or apath): ") +#define PROMPT_IP_TUNNEL_MODE _("Tunnel mode: ") +#define PROMPT_MACVLAN_MODE _("MACVLAN mode: ") + +static const char *nmc_known_vpns[] = { + "openvpn", + "vpnc", + "pptp", + "openconnect", + "openswan", + "libreswan", + "strongswan", + "ssh", + "l2tp", + "iodine", + "fortisslvpn", + NULL +}; /* Available fields for 'connection show' */ static NmcOutputField nmc_fields_con_show[] = { - {"NAME", N_("NAME"), 25}, /* 0 */ - {"UUID", N_("UUID"), 38}, /* 1 */ - {"TYPE", N_("TYPE"), 17}, /* 2 */ - {"TIMESTAMP", N_("TIMESTAMP"), 12}, /* 3 */ - {"TIMESTAMP-REAL", N_("TIMESTAMP-REAL"), 34}, /* 4 */ - {"AUTOCONNECT", N_("AUTOCONNECT"), 13}, /* 5 */ - {"AUTOCONNECT-PRIORITY", N_("AUTOCONNECT-PRIORITY"), 10}, /* 6 */ - {"READONLY", N_("READONLY"), 10}, /* 7 */ - {"DBUS-PATH", N_("DBUS-PATH"), 42}, /* 8 */ - {"ACTIVE", N_("ACTIVE"), 10}, /* 9 */ - {"DEVICE", N_("DEVICE"), 10}, /* 10 */ - {"STATE", N_("STATE"), 12}, /* 11 */ - {"ACTIVE-PATH", N_("ACTIVE-PATH"), 51}, /* 12 */ - {NULL, NULL, 0} + {"NAME", N_("NAME")}, /* 0 */ + {"UUID", N_("UUID")}, /* 1 */ + {"TYPE", N_("TYPE")}, /* 2 */ + {"TIMESTAMP", N_("TIMESTAMP")}, /* 3 */ + {"TIMESTAMP-REAL", N_("TIMESTAMP-REAL")}, /* 4 */ + {"AUTOCONNECT", N_("AUTOCONNECT")}, /* 5 */ + {"AUTOCONNECT-PRIORITY", N_("AUTOCONNECT-PRIORITY")}, /* 6 */ + {"READONLY", N_("READONLY")}, /* 7 */ + {"DBUS-PATH", N_("DBUS-PATH")}, /* 8 */ + {"ACTIVE", N_("ACTIVE")}, /* 9 */ + {"DEVICE", N_("DEVICE")}, /* 10 */ + {"STATE", N_("STATE")}, /* 11 */ + {"ACTIVE-PATH", N_("ACTIVE-PATH")}, /* 12 */ + {NULL, NULL} }; #define NMC_FIELDS_CON_SHOW_ALL "NAME,UUID,TYPE,TIMESTAMP,TIMESTAMP-REAL,AUTOCONNECT,AUTOCONNECT-PRIORITY,READONLY,DBUS-PATH,"\ "ACTIVE,DEVICE,STATE,ACTIVE-PATH" @@ -106,6 +119,10 @@ extern NmcOutputField nmc_fields_setting_bridge_port[]; extern NmcOutputField nmc_fields_setting_team[]; extern NmcOutputField nmc_fields_setting_team_port[]; extern NmcOutputField nmc_fields_setting_dcb[]; +extern NmcOutputField nmc_fields_setting_tun[]; +extern NmcOutputField nmc_fields_setting_ip_tunnel[]; +extern NmcOutputField nmc_fields_setting_macvlan[]; +extern NmcOutputField nmc_fields_setting_vxlan[]; /* Available settings for 'connection show ' - profile part */ static NmcOutputField nmc_fields_settings_names[] = { @@ -134,6 +151,10 @@ static NmcOutputField nmc_fields_settings_names[] = { SETTING_FIELD (NM_SETTING_TEAM_SETTING_NAME, nmc_fields_setting_team + 1), /* 22 */ SETTING_FIELD (NM_SETTING_TEAM_PORT_SETTING_NAME, nmc_fields_setting_team_port + 1), /* 23 */ SETTING_FIELD (NM_SETTING_DCB_SETTING_NAME, nmc_fields_setting_dcb + 1), /* 24 */ + SETTING_FIELD (NM_SETTING_TUN_SETTING_NAME, nmc_fields_setting_tun + 1), /* 25 */ + SETTING_FIELD (NM_SETTING_IP_TUNNEL_SETTING_NAME, nmc_fields_setting_ip_tunnel + 1), /* 26 */ + SETTING_FIELD (NM_SETTING_MACVLAN_SETTING_NAME, nmc_fields_setting_macvlan + 1), /* 27 */ + SETTING_FIELD (NM_SETTING_VXLAN_SETTING_NAME, nmc_fields_setting_vxlan + 1), /* 28 */ {NULL, NULL, 0, NULL, NULL, FALSE, FALSE, 0} }; #define NMC_FIELDS_SETTINGS_NAMES_ALL_X NM_SETTING_CONNECTION_SETTING_NAME","\ @@ -159,31 +180,30 @@ static NmcOutputField nmc_fields_settings_names[] = { NM_SETTING_BRIDGE_PORT_SETTING_NAME","\ NM_SETTING_TEAM_SETTING_NAME","\ NM_SETTING_TEAM_PORT_SETTING_NAME"," \ - NM_SETTING_DCB_SETTING_NAME -#if WITH_WIMAX -#define NMC_FIELDS_SETTINGS_NAMES_ALL NMC_FIELDS_SETTINGS_NAMES_ALL_X","\ - NM_SETTING_WIMAX_SETTING_NAME -#else + NM_SETTING_DCB_SETTING_NAME"," \ + NM_SETTING_TUN_SETTING_NAME"," \ + NM_SETTING_IP_TUNNEL_SETTING_NAME"," \ + NM_SETTING_MACVLAN_SETTING_NAME"," \ + NM_SETTING_VXLAN_SETTING_NAME #define NMC_FIELDS_SETTINGS_NAMES_ALL NMC_FIELDS_SETTINGS_NAMES_ALL_X -#endif /* Active connection data */ /* Available fields for GENERAL group */ static NmcOutputField nmc_fields_con_active_details_general[] = { - {"GROUP", N_("GROUP"), 9}, /* 0 */ - {"NAME", N_("NAME"), 25}, /* 1 */ - {"UUID", N_("UUID"), 38}, /* 2 */ - {"DEVICES", N_("DEVICES"), 10}, /* 3 */ - {"STATE", N_("STATE"), 12}, /* 4 */ - {"DEFAULT", N_("DEFAULT"), 8}, /* 5 */ - {"DEFAULT6", N_("DEFAULT6"), 9}, /* 6 */ - {"SPEC-OBJECT", N_("SPEC-OBJECT"), 10}, /* 7 */ - {"VPN", N_("VPN"), 5}, /* 8 */ - {"DBUS-PATH", N_("DBUS-PATH"), 51}, /* 9 */ - {"CON-PATH", N_("CON-PATH"), 44}, /* 10 */ - {"ZONE", N_("ZONE"), 15}, /* 11 */ - {"MASTER-PATH", N_("MASTER-PATH"), 44}, /* 12 */ - {NULL, NULL, 0} + {"GROUP", N_("GROUP")}, /* 0 */ + {"NAME", N_("NAME")}, /* 1 */ + {"UUID", N_("UUID")}, /* 2 */ + {"DEVICES", N_("DEVICES")}, /* 3 */ + {"STATE", N_("STATE")}, /* 4 */ + {"DEFAULT", N_("DEFAULT")}, /* 5 */ + {"DEFAULT6", N_("DEFAULT6")}, /* 6 */ + {"SPEC-OBJECT", N_("SPEC-OBJECT")}, /* 7 */ + {"VPN", N_("VPN")}, /* 8 */ + {"DBUS-PATH", N_("DBUS-PATH")}, /* 9 */ + {"CON-PATH", N_("CON-PATH")}, /* 10 */ + {"ZONE", N_("ZONE")}, /* 11 */ + {"MASTER-PATH", N_("MASTER-PATH")}, /* 12 */ + {NULL, NULL} }; #define NMC_FIELDS_CON_ACTIVE_DETAILS_GENERAL_ALL "GROUP,NAME,UUID,DEVICES,STATE,DEFAULT,DEFAULT6,"\ "VPN,ZONE,DBUS-PATH,CON-PATH,SPEC-OBJECT,MASTER-PATH" @@ -192,14 +212,14 @@ static NmcOutputField nmc_fields_con_active_details_general[] = { /* Available fields for VPN group */ static NmcOutputField nmc_fields_con_active_details_vpn[] = { - {"GROUP", N_("GROUP"), 9}, /* 0 */ - {"TYPE", N_("TYPE"), 15}, /* 1 */ - {"USERNAME", N_("USERNAME"), 15}, /* 2 */ - {"GATEWAY", N_("GATEWAY"), 25}, /* 3 */ - {"BANNER", N_("BANNER"), 120}, /* 4 */ - {"VPN-STATE", N_("VPN-STATE"), 40}, /* 5 */ - {"CFG", N_("CFG"), 120}, /* 6 */ - {NULL, NULL, 0} + {"GROUP", N_("GROUP")}, /* 0 */ + {"TYPE", N_("TYPE")}, /* 1 */ + {"USERNAME", N_("USERNAME")}, /* 2 */ + {"GATEWAY", N_("GATEWAY")}, /* 3 */ + {"BANNER", N_("BANNER")}, /* 4 */ + {"VPN-STATE", N_("VPN-STATE")}, /* 5 */ + {"CFG", N_("CFG")}, /* 6 */ + {NULL, NULL} }; #define NMC_FIELDS_CON_ACTIVE_DETAILS_VPN_ALL "GROUP,TYPE,USERNAME,GATEWAY,BANNER,VPN-STATE,CFG" @@ -251,21 +271,22 @@ static void usage (void) { g_printerr (_("Usage: nmcli connection { COMMAND | help }\n\n" - "COMMAND := { show | up | down | add | modify | edit | delete | reload | load }\n\n" - " show [--active] [[--show-secrets] [id | uuid | path | apath] ] ...\n\n" -#if WITH_WIMAX - " up [[id | uuid | path] ] [ifname ] [ap ] [nsp ] [passwd-file ]\n\n" -#else + "COMMAND := { show | up | down | add | modify | edit | delete | monitor | reload | load }\n\n" + " show [--active] [--order ]\n" + " show [--active] [id | uuid | path | apath] ...\n\n" " up [[id | uuid | path] ] [ifname ] [ap ] [passwd-file ]\n\n" -#endif " down [id | uuid | path | apath] ...\n\n" - " add COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS\n\n" + " add COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS SLAVE_OPTIONS IP_OPTIONS [-- ([+|-]. )+]\n\n" " modify [--temporary] [id | uuid | path] ([+|-]. )+\n\n" + " clone [--temporary] [id | uuid | path ] \n\n" " edit [id | uuid | path] \n" " edit [type ] [con-name ]\n\n" " delete [id | uuid | path] \n\n" + " monitor [id | uuid | path] ...\n\n" " reload\n\n" - " load [ ... ]\n\n")); + " load [ ... ]\n\n" + " import [--temporary] type file \n\n" + " export [id | uuid | path] []\n\n")); } static void @@ -273,20 +294,20 @@ usage_connection_show (void) { g_printerr (_("Usage: nmcli connection show { ARGUMENTS | help }\n" "\n" - "ARGUMENTS := [--active]\n" + "ARGUMENTS := [--active] [--order ]\n" "\n" "List in-memory and on-disk connection profiles, some of which may also be\n" "active if a device is using that connection profile. Without a parameter, all\n" "profiles are listed. When --active option is specified, only the active\n" - "profiles are shown.\n" + "profiles are shown. --order allows custom connection ordering (see manual page).\n" "\n" - "ARGUMENTS := [--active] [--show-secrets] [id | uuid | path | apath] ...\n" + "ARGUMENTS := [--active] [id | uuid | path | apath] ...\n" "\n" "Show details for specified connections. By default, both static configuration\n" "and active connection data are displayed. It is possible to filter the output\n" "using global '--fields' option. Refer to the manual page for more information.\n" "When --active option is specified, only the active profiles are taken into\n" - "account. --show-secrets option will reveal associated secrets as well.\n")); + "account. Use global --show-secrets option to reveal associated secrets as well.\n")); } static void @@ -327,13 +348,15 @@ usage_connection_add (void) { g_printerr (_("Usage: nmcli connection add { ARGUMENTS | help }\n" "\n" - "ARGUMENTS := COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS\n\n" + "ARGUMENTS := COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS SLAVE_OPTIONS IP_OPTIONS [-- ([+|-]. )+]\n\n" " COMMON_OPTIONS:\n" " type \n" " ifname | \"*\"\n" " [con-name ]\n" - " [autoconnect yes|no]\n\n" - " [save yes|no]\n\n" + " [autoconnect yes|no]\n" + " [save yes|no]\n" + " [master ]\n" + " [slave-type ]\n\n" " TYPE_SPECIFIC_OPTIONS:\n" " ethernet: [mac ]\n" " [cloned-mac ]\n" @@ -362,7 +385,7 @@ usage_connection_add (void) " [p-key ]\n\n" " bluetooth: [addr ]\n" " [bt-type panu|dun-gsm|dun-cdma]\n\n" - " vlan: dev \n" + " vlan: dev \n" " id \n" " [flags ]\n" " [ingress ]\n" @@ -387,6 +410,7 @@ usage_connection_add (void) " [hello-time <1-10>]\n" " [max-age <6-40>]\n" " [ageing-time <0-1000000>]\n" + " [multicast-snooping yes|no]\n" " [mac ]\n\n" " bridge-slave: master \n" " [priority <0-63>]\n" @@ -401,6 +425,31 @@ usage_connection_add (void) " protocol pppoa|pppoe|ipoatm\n" " [password ]\n" " [encapsulation vcmux|llc]\n\n" + " tun: mode tun|tap\n" + " [owner ]\n" + " [group ]\n" + " [pi yes|no]\n" + " [vnet-hdr yes|no]\n" + " [multi-queue yes|no]\n\n" + " ip-tunnel: mode ipip|gre|sit|isatap|vti|ip6ip6|ipip6|ip6gre|vti6\n" + " remote \n" + " [local ]\n" + " [dev ]\n\n" + " macvlan: dev \n" + " mode vepa|bridge|private|passthru|source\n" + " [tap yes|no]\n\n" + " vxlan: id \n" + " remote \n" + " [local ]\n" + " [dev ]\n" + " [source-port-min <0-65535>]\n" + " [source-port-max <0-65535>]\n" + " [destination-port <0-65535>]\n\n" + " SLAVE_OPTIONS:\n" + " bridge: [priority <0-63>]\n" + " [path-cost <1-65535>]\n" + " [hairpin yes|no]\n\n" + " team: [config |]\n\n" " IP_OPTIONS:\n" " [ip4 ] [gw4 ]\n" " [ip6 ] [gw6 ]\n\n")); @@ -429,6 +478,18 @@ usage_connection_modify (void) "nmcli con mod bond0 -bond.options downdelay\n\n")); } +static void +usage_connection_clone (void) +{ + g_printerr (_("Usage: nmcli connection clone { ARGUMENTS | help }\n" + "\n" + "ARGUMENTS := [--temporary] [id | uuid | path] \n" + "\n" + "Clone an existing connection profile. The newly created connection will be\n" + "the exact copy of the , except the uuid property (will be generated) and\n" + "id (provided as argument).\n\n")); +} + static void usage_connection_edit (void) { @@ -455,6 +516,18 @@ usage_connection_delete (void) "The profile is identified by its name, UUID or D-Bus path.\n\n")); } +static void +usage_connection_monitor (void) +{ + g_printerr (_("Usage: nmcli connection monitor { ARGUMENTS | help }\n" + "\n" + "ARGUMENTS := [id | uuid | path] ...\n" + "\n" + "Monitor connection profile activity.\n" + "This command prints a line whenever the specified connection changes.\n" + "Monitors all connection profiles in case none is specified.\n\n")); +} + static void usage_connection_reload (void) { @@ -475,6 +548,30 @@ usage_connection_load (void) "state.\n\n")); } +static void +usage_connection_import (void) +{ + g_printerr (_("Usage: nmcli connection import { ARGUMENTS | help }\n" + "\n" + "ARGUMENTS := [--temporary] type file \n" + "\n" + "Import an external/foreign configuration as a NetworkManager connection profile.\n" + "The type of the input file is specified by type option.\n" + "Only VPN configurations are supported at the moment. The configuration\n" + "is imported by NetworkManager VPN plugins.\n\n")); +} + +static void +usage_connection_export (void) +{ + g_printerr (_("Usage: nmcli connection export { ARGUMENTS | help }\n" + "\n" + "ARGUMENTS := [id | uuid | path] []\n" + "\n" + "Export a connection. Only VPN connections are supported at the moment.\n" + "The data are directed to standard output or to a file if a name is given.\n\n")); +} + static gboolean usage_connection_second_level (const char *cmd) { @@ -490,14 +587,22 @@ usage_connection_second_level (const char *cmd) usage_connection_add (); else if (matches (cmd, "modify") == 0) usage_connection_modify (); + else if (matches (cmd, "clone") == 0) + usage_connection_clone (); else if (matches (cmd, "edit") == 0) usage_connection_edit (); else if (matches (cmd, "delete") == 0) usage_connection_delete (); + else if (matches (cmd, "monitor") == 0) + usage_connection_monitor (); else if (matches (cmd, "reload") == 0) usage_connection_reload (); else if (matches (cmd, "load") == 0) usage_connection_load (); + else if (matches (cmd, "import") == 0) + usage_connection_import (); + else if (matches (cmd, "export") == 0) + usage_connection_export (); else ret = FALSE; return ret; @@ -769,10 +874,8 @@ find_active_connection (const GPtrArray *active_cons, } static void -fill_output_connection (gpointer data, gpointer user_data, gboolean active_only) +fill_output_connection (NMConnection *connection, NmCli *nmc, gboolean active_only) { - NMConnection *connection = (NMConnection *) data; - NmCli *nmc = (NmCli *) user_data; NMSettingConnection *s_con; guint64 timestamp; time_t timestamp_real; @@ -783,6 +886,7 @@ fill_output_connection (gpointer data, gpointer user_data, gboolean active_only) NMActiveConnection *ac = NULL; const char *ac_path = NULL; const char *ac_state = NULL; + NMActiveConnectionState ac_state_int = NM_ACTIVE_CONNECTION_STATE_UNKNOWN; char *ac_dev = NULL; s_con = nm_connection_get_setting_connection (connection); @@ -794,7 +898,8 @@ fill_output_connection (gpointer data, gpointer user_data, gboolean active_only) if (ac) { ac_path = nm_object_get_path (NM_OBJECT (ac)); - ac_state = active_connection_state_to_string (nm_active_connection_get_state (ac)); + ac_state_int = nm_active_connection_get_state (ac); + ac_state = active_connection_state_to_string (ac_state_int); ac_dev = get_ac_device_string (ac); } @@ -811,6 +916,16 @@ fill_output_connection (gpointer data, gpointer user_data, gboolean active_only) arr = nmc_dup_fields_array (nmc_fields_con_show, sizeof (nmc_fields_con_show), 0); + /* Show active connections in color */ + if (ac) { + if (ac_state_int == NM_ACTIVE_CONNECTION_STATE_ACTIVATING) + set_val_color_all (arr, NMC_TERM_COLOR_YELLOW); + else if (ac_state_int == NM_ACTIVE_CONNECTION_STATE_ACTIVATED) + set_val_color_all (arr, NMC_TERM_COLOR_GREEN); + else if (ac_state_int > NM_ACTIVE_CONNECTION_STATE_ACTIVATED) + set_val_color_all (arr, NMC_TERM_COLOR_RED); + } + set_val_strc (arr, 0, nm_setting_connection_get_id (s_con)); set_val_strc (arr, 1, nm_setting_connection_get_uuid (s_con)); set_val_strc (arr, 2, nm_setting_connection_get_connection_type (s_con)); @@ -834,8 +949,9 @@ fill_output_connection_for_invisible (NMActiveConnection *ac, NmCli *nmc) NmcOutputField *arr; const char *ac_path = NULL; const char *ac_state = NULL; - char *ac_dev = NULL; + char *name, *ac_dev = NULL; + name = g_strdup_printf (" %s", nm_active_connection_get_id (ac)); ac_path = nm_object_get_path (NM_OBJECT (ac)); ac_state = active_connection_state_to_string (nm_active_connection_get_state (ac)); ac_dev = get_ac_device_string (ac); @@ -843,7 +959,8 @@ fill_output_connection_for_invisible (NMActiveConnection *ac, NmCli *nmc) arr = nmc_dup_fields_array (nmc_fields_con_show, sizeof (nmc_fields_con_show), 0); - set_val_strc (arr, 0, nm_active_connection_get_id (ac)); + + set_val_str (arr, 0, name); set_val_strc (arr, 1, nm_active_connection_get_uuid (ac)); set_val_strc (arr, 2, nm_active_connection_get_connection_type (ac)); set_val_strc (arr, 3, NULL); @@ -857,6 +974,8 @@ fill_output_connection_for_invisible (NMActiveConnection *ac, NmCli *nmc) set_val_strc (arr, 11, ac_state); set_val_strc (arr, 12, ac_path); + set_val_color_fmt_all (arr, NMC_TERM_FORMAT_DIM); + g_ptr_array_add (nmc->output_data, arr); } @@ -933,36 +1052,6 @@ fill_output_active_connection (NMActiveConnection *active, g_string_free (dev_str, FALSE); } -static void -fill_output_for_all_invisible (NmCli *nmc) -{ - const GPtrArray *acons; - int a, c; - - g_return_if_fail (nmc != NULL); - - acons = nm_client_get_active_connections (nmc->client); - for (a = 0; a < acons->len; a++) { - gboolean found = FALSE; - NMActiveConnection *acon = g_ptr_array_index (acons, a); - const char *a_uuid = nm_active_connection_get_uuid (acon); - - for (c = 0; c < nmc->connections->len; c++) { - NMConnection *con = g_ptr_array_index (nmc->connections, c); - const char *c_uuid = nm_connection_get_uuid (con); - - if (strcmp (a_uuid, c_uuid) == 0) { - found = TRUE; - break; - } - } - - /* Active connection is not in connections list */ - if (!found) - fill_output_connection_for_invisible (acon, nmc); - } -} - typedef struct { char **array; guint32 idx; @@ -1346,14 +1435,174 @@ split_required_fields_for_con_show (const char *input, return success; } +typedef enum { + NMC_SORT_ACTIVE = 1, + NMC_SORT_ACTIVE_INV = -1, + NMC_SORT_NAME = 2, + NMC_SORT_NAME_INV = -2, + NMC_SORT_TYPE = 3, + NMC_SORT_TYPE_INV = -3, + NMC_SORT_PATH = 4, + NMC_SORT_PATH_INV = -4, +} NmcSortOrder; + +typedef struct { + NmCli *nmc; + const GArray *order; +} NmcSortInfo; + +static int +compare_connections (gconstpointer a, gconstpointer b, gpointer user_data) +{ + NMConnection *ca = *(NMConnection **)a; + NMConnection *cb = *(NMConnection **)b; + NMActiveConnection *aca, *acb; + NmcSortInfo *info = (NmcSortInfo *) user_data; + GArray *default_order = NULL; + const GArray *order; + NmcSortOrder item; + int cmp = 0, i; + const char *tmp1, *tmp2; + unsigned long tmp1_int, tmp2_int; + + if (info->order ) + order = info->order; + else { + NmcSortOrder def[] = { NMC_SORT_ACTIVE, NMC_SORT_NAME, NMC_SORT_PATH }; + int num = G_N_ELEMENTS (def); + default_order = g_array_sized_new (FALSE, FALSE, sizeof (NmcSortOrder), num); + g_array_append_vals (default_order, def, num); + order = default_order; + } + + for (i = 0; i < order->len; i++) { + item = g_array_index (order, NmcSortOrder, i); + switch (item) { + case NMC_SORT_ACTIVE: + case NMC_SORT_ACTIVE_INV: + aca = get_ac_for_connection (nm_client_get_active_connections (info->nmc->client), ca); + acb = get_ac_for_connection (nm_client_get_active_connections (info->nmc->client), cb); + cmp = (aca && !acb) ? -1 : (!aca && acb) ? 1 : 0; + if (item == NMC_SORT_ACTIVE_INV) + cmp = -(cmp); + break; + case NMC_SORT_TYPE: + case NMC_SORT_TYPE_INV: + cmp = g_strcmp0 (nm_connection_get_connection_type (ca), + nm_connection_get_connection_type (cb)); + if (item == NMC_SORT_TYPE_INV) + cmp = -(cmp); + break; + case NMC_SORT_NAME: + case NMC_SORT_NAME_INV: + cmp = g_strcmp0 (nm_connection_get_id (ca), + nm_connection_get_id (cb)); + if (item == NMC_SORT_NAME_INV) + cmp = -(cmp); + break; + case NMC_SORT_PATH: + case NMC_SORT_PATH_INV: + tmp1 = nm_connection_get_path (ca); + tmp2 = nm_connection_get_path (cb); + tmp1 = tmp1 ? strrchr (tmp1, '/') : "0"; + tmp2 = tmp2 ? strrchr (tmp2, '/') : "0"; + nmc_string_to_uint (tmp1 ? tmp1+1 : "0", FALSE, 0, 0, &tmp1_int); + nmc_string_to_uint (tmp2 ? tmp2+1 : "0", FALSE, 0, 0, &tmp2_int); + cmp = (int) tmp1_int - tmp2_int; + if (item == NMC_SORT_PATH_INV) + cmp = -(cmp); + break; + default: + cmp = 0; + break; + } + if (cmp != 0) + goto end; + } +end: + if (default_order) + g_array_unref (default_order); + return cmp; +} + +static GPtrArray * +sort_connections (const GPtrArray *cons, NmCli *nmc, const GArray *order) +{ + GPtrArray *sorted; + int i; + NmcSortInfo compare_info; + + compare_info.nmc = nmc; + compare_info.order = order; + + sorted = g_ptr_array_sized_new (cons->len); + for (i = 0; cons && i < cons->len; i++) + g_ptr_array_add (sorted, cons->pdata[i]); + g_ptr_array_sort_with_data (sorted, compare_connections, &compare_info); + return sorted; +} + +static int +compare_ac_connections (gconstpointer a, gconstpointer b, gpointer user_data) +{ + NMActiveConnection *ca = *(NMActiveConnection **)a; + NMActiveConnection *cb = *(NMActiveConnection **)b; + int cmp; + + /* Sort states first */ + cmp = nm_active_connection_get_state (cb) - nm_active_connection_get_state (ca); + if (cmp != 0) + return cmp; + + cmp = g_strcmp0 (nm_active_connection_get_id (ca), + nm_active_connection_get_id (cb)); + if (cmp != 0) + return cmp; + + return g_strcmp0 (nm_active_connection_get_connection_type (ca), + nm_active_connection_get_connection_type (cb)); +} + +static GPtrArray * +get_invisible_active_connections (NmCli *nmc) +{ + const GPtrArray *acons; + GPtrArray *invisibles; + int a, c; + + g_return_val_if_fail (nmc != NULL, NULL); + + invisibles = g_ptr_array_new (); + acons = nm_client_get_active_connections (nmc->client); + for (a = 0; a < acons->len; a++) { + gboolean found = FALSE; + NMActiveConnection *acon = g_ptr_array_index (acons, a); + const char *a_uuid = nm_active_connection_get_uuid (acon); + + for (c = 0; c < nmc->connections->len; c++) { + NMConnection *con = g_ptr_array_index (nmc->connections, c); + const char *c_uuid = nm_connection_get_uuid (con); + + if (strcmp (a_uuid, c_uuid) == 0) { + found = TRUE; + break; + } + } + /* Active connection is not in connections array, add it to */ + if (!found) + g_ptr_array_add (invisibles, acon); + } + g_ptr_array_sort_with_data (invisibles, compare_ac_connections, NULL); + return invisibles; +} + static NMCResultCode do_connections_show (NmCli *nmc, gboolean active_only, gboolean show_secrets, - int argc, char **argv) + const GArray *order, int argc, char **argv) { GError *err = NULL; char *profile_flds = NULL, *active_flds = NULL; - - nmc->should_wait = FALSE; + GPtrArray *invisibles, *sorted_cons; if (argc == 0) { char *fields_str; @@ -1385,13 +1634,19 @@ do_connections_show (NmCli *nmc, gboolean active_only, gboolean show_secrets, arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_MAIN_HEADER_ADD | NMC_OF_FLAG_FIELD_NAMES); g_ptr_array_add (nmc->output_data, arr); - /* Add values */ - for (i = 0; i < nmc->connections->len; i++) { - NMConnection *con = NM_CONNECTION (nmc->connections->pdata[i]); - fill_output_connection (con, nmc, active_only); - } - /* Some active connections may not be in connection list, show them here. */ - fill_output_for_all_invisible (nmc); + /* There might be active connections not present in connection list + * (e.g. private connections of a different user). Show them as well. */ + invisibles = get_invisible_active_connections (nmc); + for (i = 0; i < invisibles->len; i++) + fill_output_connection_for_invisible (invisibles->pdata[i], nmc); + g_ptr_array_free (invisibles, FALSE); + + /* Sort the connections and fill the output data */ + sorted_cons = sort_connections (nmc->connections, nmc, order); + for (i = 0; i < sorted_cons->len; i++) + fill_output_connection (sorted_cons->pdata[i], nmc, active_only); + g_ptr_array_free (sorted_cons, FALSE); + print_data (nmc); /* Print all data */ } else { gboolean new_line = FALSE; @@ -1643,26 +1898,6 @@ find_device_for_connection (NmCli *nmc, g_free (bssid_up); } -#if WITH_WIMAX - if ( found_device - && nsp - && !strcmp (con_type, NM_SETTING_WIMAX_SETTING_NAME) - && NM_IS_DEVICE_WIMAX (dev)) { - const GPtrArray *nsps = nm_device_wimax_get_nsps (NM_DEVICE_WIMAX (dev)); - found_device = NULL; /* Mark as not found; set to the device again later, only if NSP matches */ - - for (j = 0; j < nsps->len; j++) { - NMWimaxNsp *candidate_nsp = g_ptr_array_index (nsps, j); - const char *candidate_name = nm_wimax_nsp_get_name (candidate_nsp); - - if (!strcmp (nsp, candidate_name)) { - found_device = dev; - *spec_object = nm_object_get_path (NM_OBJECT (candidate_nsp)); - break; - } - } - } -#endif } if (found_device) { @@ -2187,17 +2422,6 @@ do_connection_up (NmCli *nmc, int argc, char **argv) ap = *argv; } -#if WITH_WIMAX - else if (strcmp (*argv, "nsp") == 0) { - if (next_arg (&argc, &argv) != 0) { - g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1)); - nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; - goto error; - } - - nsp = *argv; - } -#endif else if (strcmp (*argv, "passwd-file") == 0) { if (next_arg (&argc, &argv) != 0) { g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1)); @@ -2220,13 +2444,14 @@ do_connection_up (NmCli *nmc, int argc, char **argv) * and we can follow activation progress. */ nmc->nowait_flag = (nmc->timeout == 0); - nmc->should_wait = TRUE; + nmc->should_wait++; if (!nmc_activate_connection (nmc, connection, ifname, ap, nsp, pwds, activate_connection_cb, &error)) { g_string_printf (nmc->return_text, _("Error: %s."), error ? error->message : _("unknown error")); nmc->return_value = error ? error->code : NMC_RESULT_ERROR_CON_ACTIVATION; g_clear_error (&error); + nmc->should_wait--; goto error; } @@ -2234,10 +2459,7 @@ do_connection_up (NmCli *nmc, int argc, char **argv) if (nmc->print_output == NMC_PRINT_PRETTY) progress_id = g_timeout_add (120, progress_cb, _("preparing")); - g_free (line); - return nmc->return_value; error: - nmc->should_wait = FALSE; g_free (line); return nmc->return_value; } @@ -2327,7 +2549,6 @@ do_connection_down (NmCli *nmc, int argc, char **argv) ConnectionCbInfo *info = NULL; const GPtrArray *active_cons; GSList *queue = NULL, *iter; - char *line = NULL; char **arg_arr = NULL; char **arg_ptr = argv; int arg_num = argc; @@ -2338,7 +2559,7 @@ do_connection_down (NmCli *nmc, int argc, char **argv) if (argc == 0) { if (nmc->ask) { - line = nmc_readline (PROMPT_CONNECTIONS); + char *line = nmc_readline (PROMPT_ACTIVE_CONNECTIONS); nmc_string_to_arg_array (line, NULL, TRUE, &arg_arr, &arg_num); g_free (line); arg_ptr = arg_arr; @@ -2393,7 +2614,7 @@ do_connection_down (NmCli *nmc, int argc, char **argv) queue = g_slist_reverse (queue); if (nmc->timeout > 0) { - nmc->should_wait = TRUE; + nmc->should_wait++; info = g_slice_new0 (ConnectionCbInfo); info->nmc = nmc; @@ -2596,6 +2817,40 @@ static const NameItem nmc_bridge_slave_settings [] = { { NULL, NULL, NULL, FALSE } }; +static const NameItem nmc_tun_settings [] = { + { NM_SETTING_CONNECTION_SETTING_NAME, NULL, NULL, TRUE }, + { NM_SETTING_TUN_SETTING_NAME, NULL, NULL, TRUE }, + { NM_SETTING_WIRED_SETTING_NAME, "ethernet", NULL, FALSE }, + { NM_SETTING_IP4_CONFIG_SETTING_NAME, NULL, NULL, FALSE }, + { NM_SETTING_IP6_CONFIG_SETTING_NAME, NULL, NULL, FALSE }, + { NULL, NULL, NULL, FALSE } +}; + +static const NameItem nmc_ip_tunnel_settings [] = { + { NM_SETTING_CONNECTION_SETTING_NAME, NULL, NULL, TRUE }, + { NM_SETTING_IP_TUNNEL_SETTING_NAME, NULL, NULL, TRUE }, + { NM_SETTING_IP4_CONFIG_SETTING_NAME, NULL, NULL, FALSE }, + { NM_SETTING_IP6_CONFIG_SETTING_NAME, NULL, NULL, FALSE }, + { NULL, NULL, NULL, FALSE } +}; + +static const NameItem nmc_macvlan_settings [] = { + { NM_SETTING_CONNECTION_SETTING_NAME, NULL, NULL, TRUE }, + { NM_SETTING_WIRED_SETTING_NAME, "ethernet", NULL, FALSE }, + { NM_SETTING_MACVLAN_SETTING_NAME, NULL, NULL, TRUE }, + { NM_SETTING_IP4_CONFIG_SETTING_NAME, NULL, NULL, FALSE }, + { NM_SETTING_IP6_CONFIG_SETTING_NAME, NULL, NULL, FALSE }, + { NULL, NULL, NULL, FALSE } +}; + +static const NameItem nmc_vxlan_settings [] = { + { NM_SETTING_CONNECTION_SETTING_NAME, NULL, NULL, TRUE }, + { NM_SETTING_VXLAN_SETTING_NAME, NULL, NULL, TRUE }, + { NM_SETTING_WIRED_SETTING_NAME, "ethernet", NULL, FALSE }, + { NM_SETTING_IP4_CONFIG_SETTING_NAME, NULL, NULL, FALSE }, + { NM_SETTING_IP6_CONFIG_SETTING_NAME, NULL, NULL, FALSE }, + { NULL, NULL, NULL, FALSE } +}; /* Available connection types */ static const NameItem nmc_valid_connection_types[] = { @@ -2618,6 +2873,10 @@ static const NameItem nmc_valid_connection_types[] = { { "bond-slave", NULL, nmc_bond_slave_settings }, { "team-slave", NULL, nmc_team_slave_settings }, { "bridge-slave", NULL, nmc_bridge_slave_settings }, + { NM_SETTING_TUN_SETTING_NAME, NULL, nmc_tun_settings }, + { NM_SETTING_IP_TUNNEL_SETTING_NAME, NULL, nmc_ip_tunnel_settings }, + { NM_SETTING_MACVLAN_SETTING_NAME, NULL, nmc_macvlan_settings }, + { NM_SETTING_VXLAN_SETTING_NAME, NULL, nmc_vxlan_settings }, { NULL, NULL, NULL } }; @@ -2850,6 +3109,20 @@ check_infiniband_p_key (const char *p_key, guint32 *p_key_int, GError **error) return TRUE; } +static gboolean +check_user_group_id (const char *id, GError **error) +{ + unsigned long int value; + + if (!nmc_string_to_uint (id, FALSE, 0, 0, &value)) { + g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: '%s' is not a valid UID/GID."), id); + return FALSE; + } + + return TRUE; +} + /** * check_valid_enumeration: * @str: string to check against string array @strings @@ -2935,6 +3208,15 @@ check_adsl_encapsulation (char **encapsulation, GError **error) return check_valid_enumeration (encapsulation, modes, "encapsulation", _("ADSL encapsulation"), error); } +/* Checks TUN mode. */ +static gboolean +check_tun_mode (char **mode, GError **error) +{ + const char *modes[] = { "tun", "tap", NULL }; + + return check_valid_enumeration (mode, modes, "mode", _("TUN device mode"), error); +} + static gboolean check_and_convert_vlan_flags (const char *flags, guint32 *flags_int, GError **error) { @@ -3070,27 +3352,31 @@ _strip_master_prefix (const char *master, const char *(**func)(NMConnection *)) return master; } -/* verify_master_for_slave: +/* normalized_master_for_slave: * @connections: list af all connections * @master: UUID, ifname or ID of the master connection - * @type: virtual connection type (bond, team, bridge, ...) + * @type: virtual connection type (bond, team, bridge, ...) or %NULL + * @out_type: type of the connection that matched * - * Check whether master is a valid interface name, UUID or ID of some @type connection. + * Check whether master is a valid interface name, UUID or ID of some connection, + * possibly of a specified @type. * First UUID and ifname are checked. If they don't match, ID is checked * and replaced by UUID on a match. * * Returns: identifier of master connection if found, %NULL otherwise */ static const char * -verify_master_for_slave (const GPtrArray *connections, - const char *master, - const char *type) +normalized_master_for_slave (const GPtrArray *connections, + const char *master, + const char *type, + const char **out_type) { NMConnection *connection; NMSettingConnection *s_con; - const char *con_type, *id, *uuid, *ifname; + const char *con_type = NULL, *id, *uuid, *ifname; int i; const char *found_by_id = NULL; + const char *out_type_by_id = NULL; const char *out_master = NULL; const char *(*func) (NMConnection *) = NULL; @@ -3103,11 +3389,13 @@ verify_master_for_slave (const GPtrArray *connections, s_con = nm_connection_get_setting_connection (connection); g_assert (s_con); con_type = nm_setting_connection_get_connection_type (s_con); - if (g_strcmp0 (con_type, type) != 0) + if (type && g_strcmp0 (con_type, type) != 0) continue; if (func) { /* There was a prefix; only compare to that type. */ if (g_strcmp0 (master, func (connection)) == 0) { + if (out_type) + *out_type = con_type; if (func == nm_connection_get_id) out_master = nm_connection_get_uuid (connection); else @@ -3121,13 +3409,31 @@ verify_master_for_slave (const GPtrArray *connections, if ( g_strcmp0 (master, uuid) == 0 || g_strcmp0 (master, ifname) == 0) { out_master = master; + if (out_type) + *out_type = con_type; break; } - if (!found_by_id && g_strcmp0 (master, id) == 0) + if (!found_by_id && g_strcmp0 (master, id) == 0) { + out_type_by_id = con_type; found_by_id = uuid; + } } } - return out_master ? out_master : found_by_id; + + if (!out_master) { + out_master = found_by_id; + if (out_type) + *out_type = out_type_by_id; + } + + if (!out_master) { + g_print (_("Warning: master='%s' doesn't refer to any existing profile.\n"), master); + out_master = master; + if (out_type) + *out_type = type; + } + + return out_master; } static gboolean @@ -3393,7 +3699,7 @@ do_questionnaire_wimax (char **mac) } static void -do_questionnaire_pppoe (char **password, char **service, char **mtu, char **mac) +do_questionnaire_pppoe (gboolean echo, char **password, char **service, char **mtu, char **mac) { gboolean once_more; GError *error = NULL; @@ -3403,7 +3709,7 @@ do_questionnaire_pppoe (char **password, char **service, char **mtu, char **mac) return; if (!*password) - *password = nmc_readline (_("Password [none]: ")); + *password = nmc_readline_echo (echo, _("Password [none]: ")); if (!*service) *service = nmc_readline (_("Service [none]: ")); @@ -3432,7 +3738,7 @@ do_questionnaire_pppoe (char **password, char **service, char **mtu, char **mac) } static void -do_questionnaire_mobile (char **user, char **password) +do_questionnaire_mobile (gboolean echo, char **user, char **password) { /* Ask for optional 'gsm' or 'cdma' arguments. */ if (!want_provide_opt_args (_("mobile broadband"), 2)) @@ -3441,7 +3747,7 @@ do_questionnaire_mobile (char **user, char **password) if (!*user) *user = nmc_readline (_("Username [none]: ")); if (!*password) - *password = nmc_readline (_("Password [none]: ")); + *password = nmc_readline_echo (echo, _("Password [none]: ")); } #define WORD_PANU "panu" @@ -3548,7 +3854,7 @@ do_questionnaire_bond (char **mode, char **primary, char **miimon, GError *error = NULL; /* Ask for optional 'bond' arguments. */ - if (!want_provide_opt_args (_("bond"), 7)) + if (!want_provide_opt_args (_("bond"), 5)) return; if (!*mode) { @@ -3705,14 +4011,14 @@ do_questionnaire_team_slave (char **config) static void do_questionnaire_bridge (char **stp, char **priority, char **fwd_delay, char **hello_time, - char **max_age, char **ageing_time, char **mac) + char **max_age, char **ageing_time, char **mcast_snoop, char **mac) { unsigned long tmp; gboolean once_more; GError *error = NULL; /* Ask for optional 'bridge' arguments. */ - if (!want_provide_opt_args (_("bridge"), 7)) + if (!want_provide_opt_args (_("bridge"), 8)) return; if (!*stp) { @@ -3790,6 +4096,20 @@ do_questionnaire_bridge (char **stp, char **priority, char **fwd_delay, char **h } } while (once_more); } + if (!*mcast_snoop) { + gboolean mcast_snoop_bool; + do { + *mcast_snoop = nmc_readline (_("Enable IGMP snooping %s"), prompt_yes_no (TRUE, ":")); + *mcast_snoop = *mcast_snoop ? *mcast_snoop : g_strdup ("yes"); + normalize_yes_no (mcast_snoop); + once_more = !nmc_string_to_bool (*mcast_snoop, &mcast_snoop_bool, &error); + if (once_more) { + g_print (_("Error: 'multicast-snooping': %s.\n"), error->message); + g_clear_error (&error); + g_free (*mcast_snoop); + } + } while (once_more); + } if (!*mac) { do { *mac = nmc_get_user_input (_("MAC [none]: ")); @@ -3904,7 +4224,7 @@ do_questionnaire_olpc (char **channel, char **dhcp_anycast) #define PROMPT_ADSL_ENCAP "(" NM_SETTING_ADSL_ENCAPSULATION_VCMUX "/" NM_SETTING_ADSL_ENCAPSULATION_LLC ") [none]: " static void -do_questionnaire_adsl (char **password, char **encapsulation) +do_questionnaire_adsl (gboolean echo, char **password, char **encapsulation) { gboolean once_more; GError *error = NULL; @@ -3914,7 +4234,7 @@ do_questionnaire_adsl (char **password, char **encapsulation) return; if (!*password) - *password = nmc_readline (_("Password [none]: ")); + *password = nmc_readline_echo (echo, _("Password [none]: ")); if (!*encapsulation) { do { @@ -3929,6 +4249,111 @@ do_questionnaire_adsl (char **password, char **encapsulation) } } +static void +do_questionnaire_macvlan (char **tap) +{ + gboolean once_more; + GError *error = NULL; + + /* Ask for optional 'macvlan' arguments. */ + if (!want_provide_opt_args (_("macvlan"), 1)) + return; + + if (!*tap) { + gboolean tap_bool; + do { + *tap = nmc_readline (_("Tap %s"), prompt_yes_no (FALSE, ":")); + *tap = *tap ? *tap : g_strdup ("yes"); + normalize_yes_no (tap); + once_more = !nmc_string_to_bool (*tap, &tap_bool, &error); + if (once_more) { + g_print (_("Error: 'tap': %s.\n"), error->message); + g_clear_error (&error); + g_free (*tap); + } + } while (once_more); + } +} + +static void +do_questionnaire_vxlan (char **parent, char **local, char **src_port_min, + char **src_port_max, char **dst_port) +{ + unsigned long tmp; + gboolean once_more; + + /* Ask for optional 'vxlan' arguments. */ + if (!want_provide_opt_args (_("VXLAN"), 5)) + return; + + if (!*parent) { + do { + *parent = nmc_readline (_("Parent device [none]: ")); + once_more = *parent + && !nm_utils_is_uuid (*parent) + && !nm_utils_iface_valid_name (*parent); + if (once_more) { + g_print (_("Error: 'dev': '%s' is neither UUID nor interface name.\n"), + *parent); + g_free (*parent); + } + } while (once_more); + } + + if (!*local) { + do { + *local = nmc_readline (_("Local address [none]: ")); + once_more = *local + && !nm_utils_ipaddr_valid (AF_INET, *local) + && !nm_utils_ipaddr_valid (AF_INET6, *local); + if (once_more) { + g_print (_("Error: 'local': '%s' is not a valid IP address.\n"), + *local); + g_free (*local); + } + } while (once_more); + } + + if (!*src_port_min) { + do { + *src_port_min = nmc_readline (_("Minimum source port [0]: ")); + *src_port_min = *src_port_min ? *src_port_min : g_strdup ("0"); + once_more = !nmc_string_to_uint (*src_port_min, TRUE, 0, 65535, &tmp); + if (once_more) { + g_print (_("Error: 'source-port-min': '%s' is not a valid number <0-65535>.\n"), + *src_port_min); + g_free (*src_port_min); + } + } while (once_more); + } + + if (!*src_port_max) { + do { + *src_port_max = nmc_readline (_("Maximum source port [0]: ")); + *src_port_max = *src_port_max ? *src_port_max : g_strdup ("0"); + once_more = !nmc_string_to_uint (*src_port_max, TRUE, 0, 65535, &tmp); + if (once_more) { + g_print (_("Error: 'source-port-max': '%s' is not a valid number <0-65535>.\n"), + *src_port_max); + g_free (*src_port_max); + } + } while (once_more); + } + + if (!*dst_port) { + do { + *dst_port = nmc_readline (_("Destination port [8472]: ")); + *dst_port = *dst_port ? *dst_port : g_strdup ("8472"); + once_more = !nmc_string_to_uint (*dst_port, TRUE, 0, 65535, &tmp); + if (once_more) { + g_print (_("Error: 'destination-port': '%s' is not a valid number <0-65535>.\n"), + *dst_port); + g_free (*dst_port); + } + } while (once_more); + } +} + static gboolean split_address (char* str, char **ip, char **rest) { @@ -4054,20 +4479,349 @@ do_questionnaire_ip (NMConnection *connection) maybe_ask_for_gateway (connection, AF_INET6); } -static gboolean -complete_connection_by_type (NMConnection *connection, - const char *con_type, - const GPtrArray *all_connections, - gboolean ask, - int argc, - char **argv, - GError **error) +static NMSetting * +is_setting_valid (NMConnection *connection, const NameItem *valid_settings, char *setting) { - NMSettingConnection *s_con; - NMSettingGeneric *s_generic; - NMSettingWired *s_wired; - NMSettingInfiniband *s_infiniband; - NMSettingWireless *s_wifi; + const char *setting_name; + + if (!(setting_name = check_valid_name (setting, valid_settings, NULL))) + return NULL; + return nm_connection_get_setting_by_name (connection, setting_name); +} + +static char * +is_property_valid (NMSetting *setting, const char *property, GError **error) +{ + char **valid_props = NULL; + const char *prop_name; + char *ret; + + valid_props = nmc_setting_get_valid_properties (setting); + prop_name = nmc_string_is_valid (property, (const char **) valid_props, error); + ret = g_strdup (prop_name); + g_strfreev (valid_props); + return ret; +} + +#define WORD_TUN "tun" +#define WORD_TAP "tap" +#define PROMPT_TUN_MODE "(" WORD_TUN "/" WORD_TAP ") [" WORD_TUN "]: " +static void +do_questionnaire_tun (char **user, char **group, + char **pi, char **vnet_hdr, char **multi_queue) +{ + gboolean once_more; + GError *error = NULL; + gboolean b; + + /* Ask for optional 'tun' arguments. */ + if (!want_provide_opt_args (_("Tun"), 5)) + return; + + if (!*user) { + do { + *user = nmc_readline (_("User ID [none]: ")); + if (!*user) + break; + once_more = !check_user_group_id (*user, &error); + if (once_more) { + g_print ("%s\n", error->message); + g_clear_error (&error); + g_free (*user); + } + } while (once_more); + } + if (!*group) { + do { + *group = nmc_readline (_("Group ID [none]: ")); + if (!*group) + break; + once_more = !check_user_group_id (*group, &error); + if (once_more) { + g_print ("%s\n", error->message); + g_clear_error (&error); + g_free (*group); + } + } while (once_more); + } + + if (!*pi) { + do { + *pi = nmc_readline (_("Enable PI %s"), prompt_yes_no (FALSE, ":")); + *pi = *pi ? *pi : g_strdup ("no"); + normalize_yes_no (pi); + once_more = !nmc_string_to_bool (*pi, &b, &error); + if (once_more) { + g_print (_("Error: 'pi': %s.\n"), error->message); + g_clear_error (&error); + g_free (*pi); + } + } while (once_more); + } + if (!*vnet_hdr) { + do { + *vnet_hdr = nmc_readline (_("Enable VNET header %s"), prompt_yes_no (FALSE, ":")); + *vnet_hdr = *vnet_hdr ? *vnet_hdr : g_strdup ("no"); + normalize_yes_no (vnet_hdr); + once_more = !nmc_string_to_bool (*vnet_hdr, &b, &error); + if (once_more) { + g_print (_("Error: 'vnet-hdr': %s.\n"), error->message); + g_clear_error (&error); + g_free (*vnet_hdr); + } + } while (once_more); + } + if (!*multi_queue) { + do { + *multi_queue = nmc_readline (_("Enable multi queue %s"), prompt_yes_no (FALSE, ":")); + *multi_queue = *multi_queue ? *multi_queue : g_strdup ("no"); + normalize_yes_no (multi_queue); + once_more = !nmc_string_to_bool (*multi_queue, &b, &error); + if (once_more) { + g_print (_("Error: 'multi-queue': %s.\n"), error->message); + g_clear_error (&error); + g_free (*multi_queue); + } + } while (once_more); + } +} + +static void +do_questionnaire_ip_tunnel (char **local, char **parent) +{ + gboolean once_more; + + /* Ask for optional 'ip-tunnel' arguments. */ + if (!want_provide_opt_args (_("IP Tunnel"), 2)) + return; + + if (!*local) { + do { + *local = nmc_readline (_("Local endpoint [none]: ")); + if (!*local) + break; + once_more = !nm_utils_ipaddr_valid (AF_INET, *local) + && !nm_utils_ipaddr_valid (AF_INET6, *local); + if (once_more) { + g_print (_("Error: 'local': '%s' is not valid; must be an IP address\n"), + *local); + g_free (*local); + } + } while (once_more); + } + + if (!*parent) { + do { + *parent = nmc_readline (_("Parent device [none]: ")); + once_more = *parent + && !nm_utils_is_uuid (*parent) + && !nm_utils_iface_valid_name (*parent); + if (once_more) { + g_print (_("Error: 'dev': '%s' is neither UUID nor interface name.\n"), + *parent); + g_free (*parent); + } + } while (once_more); + } +} + +static gboolean +read_connection_properties (NMConnection *connection, + int argc, + char **argv, + GError **error) +{ + NMSetting *setting; + NMSettingConnection *s_con; + const char *con_type; + const char *s_dot_p; + const char *value; + char **strv = NULL; + const char *setting_name; + gboolean append = FALSE; + gboolean remove = FALSE; + gboolean success = FALSE; + GError *local = NULL; + + s_con = nm_connection_get_setting_connection (connection); + g_assert (s_con); + con_type = nm_setting_connection_get_connection_type (s_con); + + /* Go through arguments and set properties */ + while (argc) { + gs_free char *property_name = NULL; + + s_dot_p = *argv; + next_arg (&argc, &argv); + value = *argv; + next_arg (&argc, &argv); + + if (!s_dot_p) { + g_set_error_literal (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: . argument is missing.")); + goto finish; + } + if (!value) { + g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: value for '%s' is missing."), s_dot_p); + goto finish; + } + /* Empty string will reset the value to default */ + if (value[0] == '\0') + value = NULL; + + if (s_dot_p[0] == '+') { + s_dot_p++; + append = TRUE; + } else if (s_dot_p[0] == '-') { + s_dot_p++; + remove = TRUE; + } + + strv = g_strsplit (s_dot_p, ".", 2); + if (g_strv_length (strv) != 2) { + g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: invalid . '%s'."), s_dot_p); + goto finish; + } + + setting_name = check_valid_name (strv[0], get_valid_settings_array (con_type), &local); + if (!setting_name) { + g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: invalid or not allowed setting '%s': %s."), + strv[0], local->message); + g_clear_error (&local); + goto finish; + } + setting = nm_connection_get_setting_by_name (connection, setting_name); + if (!setting) { + setting = nmc_setting_new_for_name (setting_name); + if (!setting) { + /* This should really not happen */ + g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_UNKNOWN, + _("Error: don't know how to create '%s' setting."), + setting_name); + goto finish; + } + nm_connection_add_setting (connection, setting); + } + + property_name = is_property_valid (setting, strv[1], &local); + if (!property_name) { + g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: invalid property '%s': %s."), + strv[1], local->message); + g_clear_error (&local); + goto finish; + } + + if (!remove) { + /* Set/add value */ + if (!append) + nmc_setting_reset_property (setting, property_name, NULL); + if (!nmc_setting_set_property (setting, property_name, value, &local)) { + g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: failed to modify %s.%s: %s."), + strv[0], strv[1], local->message); + g_clear_error (&local); + goto finish; + } + } else { + /* Remove value + * - either empty: remove whole value + * - or specified by index <0-n>: remove item at the index + * - or option name: remove item with the option name + */ + if (value) { + unsigned long idx; + if (nmc_string_to_uint (value, TRUE, 0, G_MAXUINT32, &idx)) + nmc_setting_remove_property_option (setting, property_name, NULL, idx, &local); + else + nmc_setting_remove_property_option (setting, property_name, value, 0, &local); + if (local) { + g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: failed to remove a value from %s.%s: %s."), + strv[0], strv[1], local->message); + g_clear_error (&local); + goto finish; + } + } else + nmc_setting_reset_property (setting, property_name, NULL); + } + + g_strfreev (strv); + strv = NULL; + } + + success = TRUE; +finish: + if (strv) + g_strfreev (strv); + return success; +} + +static gboolean +complete_slave (NMSettingConnection *s_con, + const GPtrArray *all_connections, + const char *slave_type, + const char *master, + const char *type, + gboolean ask, + GError **error) +{ + char *master_ask = NULL; + const char *checked_master = NULL; + + if (type) + g_print (_("Warning: 'type' is ignored. " + "Use 'nmcli connection add \"%s\" ...' instead."), + type); + + if (nm_setting_connection_get_master (s_con)) { + /* Master already set. */ + if (master) { + g_set_error_literal (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: redundant 'master' option.")); + return FALSE; + } + return TRUE; + } + + if (!master && ask) + master = master_ask = nmc_readline (PROMPT_MASTER); + if (!master) { + g_set_error_literal (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: 'master' is required.")); + return FALSE; + } + /* Verify master argument */ + checked_master = normalized_master_for_slave (all_connections, master, slave_type, NULL); + + /* Change properties in 'connection' setting */ + g_object_set (s_con, + NM_SETTING_CONNECTION_MASTER, checked_master, + NULL); + + g_free (master_ask); + + return TRUE; +} + +static gboolean +complete_connection_by_type (NMConnection *connection, + const char *con_type, + const GPtrArray *all_connections, + gboolean ask, + gboolean show_secrets, + int argc, + char **argv, + GError **error) +{ + NMSettingConnection *s_con; + NMSettingGeneric *s_generic; + NMSettingWired *s_wired; + NMSettingInfiniband *s_infiniband; + NMSettingWireless *s_wifi; NMSettingWimax *s_wimax; NMSettingPppoe *s_pppoe; NMSettingGsm *s_gsm; @@ -4082,6 +4836,11 @@ complete_connection_by_type (NMConnection *connection, NMSettingVpn *s_vpn; NMSettingOlpcMesh *s_olpc_mesh; NMSettingAdsl *s_adsl; + NMSettingTun *s_tun; + NMSettingIPTunnel *s_ip_tunnel; + NMSettingMacvlan *s_macvlan; + NMSettingVxlan *s_vxlan; + const char *slave_type; g_return_val_if_fail (error == NULL || *error == NULL, FALSE); @@ -4376,7 +5135,7 @@ cleanup_wimax: mtu = g_strdup (mtu_c); mac = g_strdup (mac_c); if (ask) - do_questionnaire_pppoe (&password, &service, &mtu, &mac); + do_questionnaire_pppoe (show_secrets, &password, &service, &mtu, &mac); if (!check_and_convert_mtu (mtu, &mtu_int, error)) goto cleanup_pppoe; @@ -4446,7 +5205,7 @@ cleanup_pppoe: user = g_strdup (user_c); password = g_strdup (password_c); if (ask) - do_questionnaire_mobile (&user, &password); + do_questionnaire_mobile (show_secrets, &user, &password); if (is_gsm) { g_object_set (s_con, NM_SETTING_CONNECTION_TYPE, NM_SETTING_GSM_SETTING_NAME, NULL); @@ -4571,7 +5330,7 @@ cleanup_bt: const char *mtu_c = NULL; char *mtu = NULL; guint32 mtu_int; - GByteArray *addr_array = NULL; + gboolean valid_mac = FALSE; nmc_arg_t exp_args[] = { {"dev", TRUE, &parent, !ask}, {"id", TRUE, &vlan_id, !ask}, {"flags", TRUE, &flags_c, FALSE}, @@ -4606,7 +5365,7 @@ cleanup_bt: } } - if ( !(addr_array = nm_utils_hwaddr_atoba (parent, ETH_ALEN)) + if ( !(valid_mac = nm_utils_hwaddr_valid (parent, ETH_ALEN)) && !nm_utils_is_uuid (parent) && !nm_utils_iface_valid_name (parent)) { g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, @@ -4637,18 +5396,18 @@ cleanup_bt: nm_connection_add_setting (connection, NM_SETTING (s_vlan)); /* Add 'wired' setting if necessary */ - if (mtu || addr_array) { + if (mtu || valid_mac) { s_wired = (NMSettingWired *) nm_setting_wired_new (); nm_connection_add_setting (connection, NM_SETTING (s_wired)); if (mtu) g_object_set (s_wired, NM_SETTING_WIRED_MTU, mtu_int, NULL); - if (addr_array) - g_object_set (s_wired, NM_SETTING_WIRED_MAC_ADDRESS, addr_array, NULL); + if (valid_mac) + g_object_set (s_wired, NM_SETTING_WIRED_MAC_ADDRESS, parent, NULL); } /* Set 'vlan' properties */ - if (!addr_array) + if (!valid_mac) g_object_set (s_vlan, NM_SETTING_VLAN_PARENT, parent, NULL); g_object_set (s_vlan, NM_SETTING_VLAN_ID, id, NULL); @@ -4666,8 +5425,6 @@ cleanup_vlan: g_free (flags); g_free (ingress); g_free (egress); - if (addr_array) - g_byte_array_free (addr_array, TRUE); g_free (parent_ask); g_free (vlan_id_ask); g_strfreev (ingress_arr); @@ -4786,41 +5543,10 @@ cleanup_bond: return FALSE; } else if (!strcmp (con_type, "bond-slave")) { - /* Build up the settings required for 'bond-slave' */ - const char *master = NULL; - char *master_ask = NULL; - const char *checked_master = NULL; - const char *type = NULL; - nmc_arg_t exp_args[] = { {"master", TRUE, &master, !ask}, - {"type", TRUE, &type, FALSE}, - {NULL} }; - - /* Set global variables for use in TAB completion */ - nmc_tab_completion.con_type = NM_SETTING_BOND_SETTING_NAME; - - if (!nmc_parse_args (exp_args, TRUE, &argc, &argv, error)) - return FALSE; - - if (!master && ask) - master = master_ask = nmc_readline (PROMPT_BOND_MASTER); - if (!master) { - g_set_error_literal (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, - _("Error: 'master' is required.")); - return FALSE; - } - /* Verify master argument */ - checked_master = verify_master_for_slave (all_connections, master, NM_SETTING_BOND_SETTING_NAME); - if (!checked_master) - g_print (_("Warning: master='%s' doesn't refer to any existing profile.\n"), master); - - if (type) - g_print (_("Warning: 'type' is currently ignored. " - "We only support ethernet slaves for now.\n")); /* Change properties in 'connection' setting */ g_object_set (s_con, NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRED_SETTING_NAME, - NM_SETTING_CONNECTION_MASTER, checked_master ? checked_master : _strip_master_prefix (master, NULL), NM_SETTING_CONNECTION_SLAVE_TYPE, NM_SETTING_BOND_SETTING_NAME, NULL); @@ -4828,8 +5554,6 @@ cleanup_bond: s_wired = (NMSettingWired *) nm_setting_wired_new (); nm_connection_add_setting (connection, NM_SETTING (s_wired)); - g_free (master_ask); - } else if (!strcmp (con_type, NM_SETTING_TEAM_SETTING_NAME)) { /* Build up the settings required for 'team' */ gboolean success = FALSE; @@ -4879,63 +5603,10 @@ cleanup_team: return FALSE; } else if (!strcmp (con_type, "team-slave")) { - /* Build up the settings required for 'team-slave' */ - gboolean success = FALSE; - const char *master = NULL; - char *master_ask = NULL; - const char *checked_master = NULL; - const char *type = NULL; - const char *config_c = NULL; - char *config = NULL; - char *json = NULL; - nmc_arg_t exp_args[] = { {"master", TRUE, &master, !ask}, - {"type", TRUE, &type, FALSE}, - {"config", TRUE, &config_c, FALSE}, - {NULL} }; - - /* Set global variables for use in TAB completion */ - nmc_tab_completion.con_type = NM_SETTING_TEAM_SETTING_NAME; - - if (!nmc_parse_args (exp_args, TRUE, &argc, &argv, error)) - return FALSE; - - if (!master && ask) - master = master_ask = nmc_readline (PROMPT_TEAM_MASTER); - if (!master) { - g_set_error_literal (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, - _("Error: 'master' is required.")); - return FALSE; - } - /* Verify master argument */ - checked_master = verify_master_for_slave (all_connections, master, NM_SETTING_TEAM_SETTING_NAME); - if (!checked_master) - g_print (_("Warning: master='%s' doesn't refer to any existing profile.\n"), master); - - /* Also ask for all optional arguments if '--ask' is specified. */ - config = g_strdup (config_c); - if (ask) - do_questionnaire_team_slave (&config); - - if (type) - g_print (_("Warning: 'type' is currently ignored. " - "We only support ethernet slaves for now.\n")); - - /* Add 'team-port' setting */ - s_team_port = (NMSettingTeamPort *) nm_setting_team_port_new (); - nm_connection_add_setting (connection, NM_SETTING (s_team_port)); - - if (!nmc_team_check_config (config, &json, error)) { - g_prefix_error (error, _("Error: ")); - goto cleanup_team_slave; - } - - /* Set team-port options */ - g_object_set (s_team_port, NM_SETTING_TEAM_PORT_CONFIG, json, NULL); /* Change properties in 'connection' setting */ g_object_set (s_con, NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRED_SETTING_NAME, - NM_SETTING_CONNECTION_MASTER, checked_master ? checked_master : _strip_master_prefix (master, NULL), NM_SETTING_CONNECTION_SLAVE_TYPE, NM_SETTING_TEAM_SETTING_NAME, NULL); @@ -4943,14 +5614,6 @@ cleanup_team: s_wired = (NMSettingWired *) nm_setting_wired_new (); nm_connection_add_setting (connection, NM_SETTING (s_wired)); - success = TRUE; -cleanup_team_slave: - g_free (master_ask); - g_free (config); - g_free (json); - if (!success) - return FALSE; - } else if (!strcmp (con_type, NM_SETTING_BRIDGE_SETTING_NAME)) { /* Build up the settings required for 'bridge' */ gboolean success = FALSE; @@ -4967,7 +5630,9 @@ cleanup_team_slave: char *max_age = NULL; const char *ageing_time_c = NULL; char *ageing_time = NULL; - gboolean stp_bool; + const char *mcast_snoop_c = NULL; + char *mcast_snoop = NULL; + gboolean stp_bool, mcast_snoop_bool; unsigned long stp_prio_int, fwd_delay_int, hello_time_int, max_age_int, ageing_time_int; const char *mac_c = NULL; @@ -4978,6 +5643,7 @@ cleanup_team_slave: {"hello-time", TRUE, &hello_time_c, FALSE}, {"max-age", TRUE, &max_age_c, FALSE}, {"ageing-time", TRUE, &ageing_time_c, FALSE}, + {"multicast-snooping", TRUE, &mcast_snoop_c, FALSE}, {"mac", TRUE, &mac_c, FALSE}, {NULL} }; @@ -4991,10 +5657,11 @@ cleanup_team_slave: hello_time = g_strdup (hello_time_c); max_age = g_strdup (max_age_c); ageing_time = g_strdup (ageing_time_c); + mcast_snoop = g_strdup (mcast_snoop_c); mac = g_strdup (mac_c); if (ask) do_questionnaire_bridge (&stp, &priority, &fwd_delay, &hello_time, - &max_age, &ageing_time, &mac); + &max_age, &ageing_time, &mcast_snoop, &mac); /* Generate ifname if conneciton doesn't have one */ ifname = nm_setting_connection_get_interface_name (s_con); @@ -5016,6 +5683,15 @@ cleanup_team_slave: goto cleanup_bridge; } } + if (mcast_snoop) { + GError *tmp_err = NULL; + if (!nmc_string_to_bool (mcast_snoop, &mcast_snoop_bool, &tmp_err)) { + g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: 'multicast-snooping': %s."), tmp_err->message); + g_clear_error (&tmp_err); + goto cleanup_bridge; + } + } /* Add 'bond' setting */ /* Must be done *before* bridge_prop_string_to_uint() so that the type is known */ @@ -5058,6 +5734,8 @@ cleanup_team_slave: g_object_set (s_bridge, NM_SETTING_BRIDGE_MAX_AGE, max_age_int, NULL); if (ageing_time) g_object_set (s_bridge, NM_SETTING_BRIDGE_AGEING_TIME, ageing_time_int, NULL); + if (mcast_snoop) + g_object_set (s_bridge, NM_SETTING_BRIDGE_MULTICAST_SNOOPING, mcast_snoop_bool, NULL); if (mac) g_object_set (s_bridge, NM_SETTING_BRIDGE_MAC_ADDRESS, mac, NULL); @@ -5069,88 +5747,16 @@ cleanup_bridge: g_free (hello_time); g_free (max_age); g_free (ageing_time); + g_free (mcast_snoop); g_free (mac); if (!success) return FALSE; } else if (!strcmp (con_type, "bridge-slave")) { - /* Build up the settings required for 'bridge-slave' */ - gboolean success = FALSE; - const char *master = NULL; - char *master_ask = NULL; - const char *checked_master = NULL; - const char *type = NULL; - const char *priority_c = NULL; - char *priority = NULL; - const char *path_cost_c = NULL; - char *path_cost = NULL; - const char *hairpin_c = NULL; - char *hairpin = NULL; - unsigned long prio_int, path_cost_int; - gboolean hairpin_bool; - nmc_arg_t exp_args[] = { {"master", TRUE, &master, !ask}, - {"type", TRUE, &type, FALSE}, - {"priority", TRUE, &priority_c, FALSE}, - {"path-cost", TRUE, &path_cost_c, FALSE}, - {"hairpin", TRUE, &hairpin_c, FALSE}, - {NULL} }; - - /* Set global variables for use in TAB completion */ - nmc_tab_completion.con_type = NM_SETTING_BRIDGE_SETTING_NAME; - - if (!nmc_parse_args (exp_args, TRUE, &argc, &argv, error)) - return FALSE; - - if (!master && ask) - master = master_ask = nmc_readline (PROMPT_BRIDGE_MASTER); - if (!master) { - g_set_error_literal (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, - _("Error: 'master' is required.")); - return FALSE; - } - /* Verify master argument */ - checked_master = verify_master_for_slave (all_connections, master, NM_SETTING_BRIDGE_SETTING_NAME); - if (!checked_master) - g_print (_("Warning: master='%s' doesn't refer to any existing profile.\n"), master); - - if (type) - g_print (_("Warning: 'type' is currently ignored. " - "We only support ethernet slaves for now.\n")); - - /* Add 'bridge-port' setting */ - /* Must be done *before* bridge_prop_string_to_uint() so that the type is known */ - s_bridge_port = (NMSettingBridgePort *) nm_setting_bridge_port_new (); - nm_connection_add_setting (connection, NM_SETTING (s_bridge_port)); - - /* Also ask for all optional arguments if '--ask' is specified. */ - priority = g_strdup (priority_c); - path_cost = g_strdup (path_cost_c); - hairpin = g_strdup (hairpin_c); - if (ask) - do_questionnaire_bridge_slave (&priority, &path_cost, &hairpin); - - if (priority) - if (!bridge_prop_string_to_uint (priority, "priority", NM_TYPE_SETTING_BRIDGE_PORT, - NM_SETTING_BRIDGE_PORT_PRIORITY, &prio_int, error)) - goto cleanup_bridge_slave; - if (path_cost) - if (!bridge_prop_string_to_uint (path_cost, "path-cost", NM_TYPE_SETTING_BRIDGE_PORT, - NM_SETTING_BRIDGE_PORT_PATH_COST, &path_cost_int, error)) - goto cleanup_bridge_slave; - if (hairpin) { - GError *tmp_err = NULL; - if (!nmc_string_to_bool (hairpin, &hairpin_bool, &tmp_err)) { - g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, - _("Error: 'hairpin': %s."), tmp_err->message); - g_clear_error (&tmp_err); - goto cleanup_bridge_slave; - } - } /* Change properties in 'connection' setting */ g_object_set (s_con, NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRED_SETTING_NAME, - NM_SETTING_CONNECTION_MASTER, checked_master ? checked_master : _strip_master_prefix (master, NULL), NM_SETTING_CONNECTION_SLAVE_TYPE, NM_SETTING_BRIDGE_SETTING_NAME, NULL); @@ -5158,22 +5764,6 @@ cleanup_bridge: s_wired = (NMSettingWired *) nm_setting_wired_new (); nm_connection_add_setting (connection, NM_SETTING (s_wired)); - if (priority) - g_object_set (s_bridge_port, NM_SETTING_BRIDGE_PORT_PRIORITY, prio_int, NULL); - if (path_cost) - g_object_set (s_bridge_port, NM_SETTING_BRIDGE_PORT_PATH_COST, path_cost_int, NULL); - if (hairpin) - g_object_set (s_bridge_port, NM_SETTING_BRIDGE_PORT_HAIRPIN_MODE, hairpin_bool, NULL); - - success = TRUE; -cleanup_bridge_slave: - g_free (master_ask); - g_free (priority); - g_free (path_cost); - g_free (hairpin); - if (!success) - return FALSE; - } else if (!strcmp (con_type, NM_SETTING_VPN_SETTING_NAME)) { /* Build up the settings required for 'vpn' */ gboolean success = FALSE; @@ -5335,7 +5925,7 @@ cleanup_olpc: password = g_strdup (password_c); encapsulation = g_strdup (encapsulation_c); if (ask) - do_questionnaire_adsl (&password, &encapsulation); + do_questionnaire_adsl (show_secrets, &password, &encapsulation); if (!check_adsl_encapsulation (&encapsulation, error)) goto cleanup_adsl; @@ -5357,6 +5947,457 @@ cleanup_adsl: g_free (password); g_free (protocol_ask); g_free (encapsulation); + + if (!success) + return FALSE; + + } else if (!strcmp (con_type, NM_SETTING_MACVLAN_SETTING_NAME)) { + /* Build up the settings required for 'macvlan' */ + gboolean success = FALSE; + const char *parent = NULL; + char *parent_ask = NULL; + const char *mode = NULL; + char *mode_ask = NULL; + const char *tap_c = NULL; + char *tap = NULL; + NMSettingMacvlanMode mode_enum; + gboolean valid_mac = FALSE; + gboolean tap_bool = FALSE; + nmc_arg_t exp_args[] = { {"dev", TRUE, &parent, !ask}, + {"mode", TRUE, &mode, !ask}, + {"tap", TRUE, &tap_c, FALSE}, + {NULL} }; + + if (!nmc_parse_args (exp_args, FALSE, &argc, &argv, error)) + return FALSE; + + if (!parent && ask) + parent = parent_ask = nmc_readline (_("MACVLAN parent device or connection UUID: ")); + if (!parent) { + g_set_error_literal (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: 'dev' is required.")); + return FALSE; + } + + if ( !(valid_mac = nm_utils_hwaddr_valid (parent, ETH_ALEN)) + && !nm_utils_is_uuid (parent) + && !nm_utils_iface_valid_name (parent)) { + g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: 'dev': '%s' is neither UUID, interface name, nor MAC."), + parent); + goto cleanup_macvlan; + } + + if (!mode && ask) + mode = mode_ask = nmc_readline (PROMPT_MACVLAN_MODE); + if (!mode) { + g_set_error_literal (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: 'mode' is required.")); + return FALSE; + } + + if (!nm_utils_enum_from_str (nm_setting_macvlan_mode_get_type(), mode, (int *) &mode_enum, NULL)) { + g_set_error_literal (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: 'mode' is not valid.")); + return FALSE; + } + + /* Also ask for all optional arguments if '--ask' is specified. */ + tap = g_strdup (tap_c); + if (ask) + do_questionnaire_macvlan (&tap); + + if (tap) { + GError *tmp_err = NULL; + if (!nmc_string_to_bool (tap, &tap_bool, &tmp_err)) { + g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: 'tap': %s."), tmp_err->message); + g_clear_error (&tmp_err); + goto cleanup_macvlan; + } + } + + /* Add 'macvlan' setting */ + s_macvlan = (NMSettingMacvlan *) nm_setting_macvlan_new (); + nm_connection_add_setting (connection, NM_SETTING (s_macvlan)); + + /* Add 'wired' setting if necessary */ + if (valid_mac) { + s_wired = (NMSettingWired *) nm_setting_wired_new (); + nm_connection_add_setting (connection, NM_SETTING (s_wired)); + g_object_set (s_wired, NM_SETTING_WIRED_MAC_ADDRESS, parent, NULL); + } + + /* Set 'macvlan' properties */ + if (!valid_mac) + g_object_set (s_macvlan, NM_SETTING_MACVLAN_PARENT, parent, NULL); + g_object_set (s_macvlan, NM_SETTING_MACVLAN_MODE, mode_enum, NULL); + g_object_set (s_macvlan, NM_SETTING_MACVLAN_TAP, tap_bool, NULL); + + success = TRUE; +cleanup_macvlan: + g_free (parent_ask); + g_free (mode_ask); + g_free (tap); + + if (!success) + return FALSE; + + } else if (!strcmp (con_type, NM_SETTING_TUN_SETTING_NAME)) { + /* Build up the settings required for 'tun' */ + gboolean success = FALSE; + const char *mode_c = NULL; + char *mode_ask = NULL, *mode = NULL; + NMSettingTunMode mode_enum; + const char *owner_c = NULL, *group_c = NULL; + char *owner = NULL, *group = NULL; + const char *pi_c = NULL, *vnet_hdr_c = NULL, *multi_queue_c = NULL; + char *pi = NULL, *vnet_hdr = NULL, *multi_queue = NULL; + gboolean pi_bool, vnet_hdr_bool, multi_queue_bool; + nmc_arg_t exp_args[] = { {"mode", TRUE, &mode_c, !ask}, + {"owner", TRUE, &owner_c, FALSE}, + {"group", TRUE, &group_c, FALSE}, + {"pi", TRUE, &pi_c, FALSE}, + {"vnet-hdr", TRUE, &vnet_hdr_c, FALSE}, + {"multi-queue", TRUE, &multi_queue_c, FALSE}, + {NULL} }; + + if (!nmc_parse_args (exp_args, FALSE, &argc, &argv, error)) + return FALSE; + + if (!mode_c && ask) { + mode_ask = nmc_readline (_("Mode %s"), PROMPT_TUN_MODE); + mode_ask = mode_ask ? mode_ask : g_strdup ("tun"); + mode_c = mode_ask; + } + if (!mode_c) { + g_set_error_literal (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: 'mode' is required.")); + goto cleanup_tun; + } + mode = g_strdup (mode_c); + if (!check_tun_mode (&mode, error)) + goto cleanup_tun; + + if (owner && !check_user_group_id (owner, error)) + goto cleanup_tun; + if (group && !check_user_group_id (group, error)) + goto cleanup_tun; + + owner = g_strdup (owner_c); + group = g_strdup (group_c); + pi = g_strdup (pi_c); + vnet_hdr = g_strdup (vnet_hdr_c); + multi_queue = g_strdup (multi_queue_c); + if (ask) + do_questionnaire_tun (&owner, &group, &pi, &vnet_hdr, &multi_queue); + + if (pi) { + GError *tmp_err = NULL; + + if (!nmc_string_to_bool (pi, &pi_bool, &tmp_err)) { + g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: 'pi': %s."), tmp_err->message); + g_clear_error (&tmp_err); + goto cleanup_tun; + } + } + + if (vnet_hdr) { + GError *tmp_err = NULL; + + if (!nmc_string_to_bool (vnet_hdr, &vnet_hdr_bool, &tmp_err)) { + g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: 'vnet-hdr': %s."), tmp_err->message); + g_clear_error (&tmp_err); + goto cleanup_tun; + } + } + + if (multi_queue) { + GError *tmp_err = NULL; + + if (!nmc_string_to_bool (multi_queue, &multi_queue_bool, &tmp_err)) { + g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: 'multi-queue': %s."), tmp_err->message); + g_clear_error (&tmp_err); + goto cleanup_tun; + } + } + /* Add 'tun' setting */ + s_tun = (NMSettingTun *) nm_setting_tun_new (); + nm_connection_add_setting (connection, NM_SETTING (s_tun)); + mode_enum = !strcmp (mode, "tun") ? NM_SETTING_TUN_MODE_TUN : NM_SETTING_TUN_MODE_TAP; + + g_object_set (s_tun, + NM_SETTING_TUN_MODE, mode_enum, + NM_SETTING_TUN_OWNER, owner, + NM_SETTING_TUN_GROUP, group, + NULL); + if (pi) + g_object_set (s_tun, NM_SETTING_TUN_PI, pi_bool, NULL); + if (vnet_hdr) + g_object_set (s_tun, NM_SETTING_TUN_VNET_HDR, vnet_hdr_bool, NULL); + if (multi_queue) + g_object_set (s_tun, NM_SETTING_TUN_MULTI_QUEUE, multi_queue_bool, NULL); + + success = TRUE; +cleanup_tun: + g_free (mode_ask); + g_free (mode); + g_free (owner); + g_free (group); + g_free (pi); + g_free (vnet_hdr); + g_free (multi_queue); + if (!success) + return FALSE; + + } else if (!strcmp (con_type, NM_SETTING_IP_TUNNEL_SETTING_NAME)) { + /* Build up the settings required for 'ip-tunnel' */ + const char *mode_c = NULL, *local_c = NULL, *remote_c = NULL; + char *mode_ask = NULL, *remote_ask = NULL, *local = NULL; + const char *parent_c = NULL; + char *parent = NULL; + gboolean success = FALSE; + NMIPTunnelMode mode_enum; + nmc_arg_t exp_args[] = { {"mode", TRUE, &mode_c, !ask}, + {"local", TRUE, &local_c, FALSE}, + {"remote", TRUE, &remote_c, !ask}, + {"dev", TRUE, &parent_c, FALSE}, + {NULL} }; + + if (!nmc_parse_args (exp_args, FALSE, &argc, &argv, error)) + return FALSE; + + if (!mode_c && ask) + mode_c = mode_ask = nmc_readline (PROMPT_IP_TUNNEL_MODE); + if (!mode_c) { + g_set_error_literal (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: 'mode' is required.")); + goto cleanup_tunnel; + } + + if (!nm_utils_enum_from_str (nm_ip_tunnel_mode_get_type (), + mode_c, (int *) &mode_enum, NULL)) { + gs_free const char **values = NULL; + gs_free char *values_str = NULL; + + values = nm_utils_enum_get_values (nm_ip_tunnel_mode_get_type (), + NM_IP_TUNNEL_MODE_UKNOWN + 1, + G_MAXINT); + values_str = g_strjoinv (",", (char **) values); + g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: 'mode': '%s' is not valid, use one of %s"), + mode_c, values_str); + goto cleanup_tunnel; + } + + if (!remote_c && ask) + remote_c = remote_ask = nmc_readline (_("Remote endpoint: ")); + if (!remote_c) { + g_set_error_literal (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: 'remote' is required.")); + goto cleanup_tunnel; + } + + if ( !nm_utils_ipaddr_valid (AF_INET, remote_c) + && !nm_utils_ipaddr_valid (AF_INET6, remote_c)) { + g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: 'remote': '%s' is not valid; must be an IP address"), + remote_c); + goto cleanup_tunnel; + } + + local = g_strdup (local_c); + parent = g_strdup (parent_c); + if (ask) + do_questionnaire_ip_tunnel (&local, &parent); + + if ( local + && !nm_utils_ipaddr_valid (AF_INET, local) + && !nm_utils_ipaddr_valid (AF_INET6, local)) { + g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: 'local': '%s' is not valid; must be an IP address"), + local); + goto cleanup_tunnel; + } + + if (parent) { + if ( !nm_utils_is_uuid (parent) + && !nm_utils_iface_valid_name (parent)) { + g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: 'dev': '%s' is neither UUID nor interface name."), + parent); + goto cleanup_tunnel; + } + } + + /* Add 'tunnel' setting */ + s_ip_tunnel = (NMSettingIPTunnel *) nm_setting_ip_tunnel_new (); + nm_connection_add_setting (connection, NM_SETTING (s_ip_tunnel)); + + /* Set 'tunnel' properties */ + g_object_set (s_ip_tunnel, NM_SETTING_IP_TUNNEL_MODE, mode_enum, NULL); + g_object_set (s_ip_tunnel, NM_SETTING_IP_TUNNEL_REMOTE, remote_c, NULL); + if (local) + g_object_set (s_ip_tunnel, NM_SETTING_IP_TUNNEL_LOCAL, local, NULL); + if (parent) + g_object_set (s_ip_tunnel, NM_SETTING_IP_TUNNEL_PARENT, parent, NULL); + + /* Set default values for IPv6 tunnels */ + if (nm_utils_ipaddr_valid (AF_INET6, remote_c)) { + g_object_set (s_ip_tunnel, NM_SETTING_IP_TUNNEL_TOS, 64, NULL); + g_object_set (s_ip_tunnel, NM_SETTING_IP_TUNNEL_ENCAPSULATION_LIMIT, 4, NULL); + } + + success = TRUE; +cleanup_tunnel: + g_free (remote_ask); + g_free (mode_ask); + g_free (parent); + g_free (local); + if (!success) + return FALSE; + + } else if (!strcmp (con_type, NM_SETTING_VXLAN_SETTING_NAME)) { + /* Build up the settings required for 'vxlan' */ + gboolean success = FALSE; + char *id_ask = NULL; + const char *id = NULL; + char *remote_ask = NULL; + const char *remote = NULL; + const char *parent_c = NULL, *local_c = NULL; + const char *src_port_min_c = NULL, *src_port_max_c = NULL; + const char *dst_port_c = NULL; + char *parent = NULL, *local = NULL; + char *src_port_min = NULL, *src_port_max = NULL, *dst_port = NULL; + unsigned long int vni; + unsigned long sport_min = G_MAXULONG, sport_max = G_MAXULONG; + unsigned long dport = G_MAXULONG; + nmc_arg_t exp_args[] = { {"id", TRUE, &id, !ask}, + {"remote", TRUE, &remote, !ask}, + {"dev", TRUE, &parent_c, FALSE}, + {"local", TRUE, &local_c, FALSE}, + {"source-port-min", TRUE, &src_port_min_c, FALSE}, + {"source-port-max", TRUE, &src_port_max_c, FALSE}, + {"destination-port", TRUE, &dst_port_c, FALSE}, + {NULL} }; + + if (!nmc_parse_args (exp_args, FALSE, &argc, &argv, error)) + return FALSE; + + if (!id && ask) + id = id_ask = nmc_readline (_("VXLAN ID: ")); + if (!id) { + g_set_error_literal (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: 'id' is required.")); + goto cleanup_vxlan; + } + + if (!remote && ask) + remote = remote_ask = nmc_readline (_("Remote: ")); + if (!remote) { + g_set_error_literal (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: 'remote' is required.")); + goto cleanup_vxlan; + } + + if (!nmc_string_to_uint (id, TRUE, 0, (1UL << 24) - 1, &vni)) { + g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: 'id': '%s' is not valid; use <0-16777215>."), id); + goto cleanup_vxlan; + } + + parent = g_strdup (parent_c); + local = g_strdup (local_c); + src_port_min = g_strdup (src_port_min_c); + src_port_max = g_strdup (src_port_max_c); + dst_port = g_strdup (dst_port_c); + + if (ask) + do_questionnaire_vxlan (&parent, &local, &src_port_min, &src_port_max, &dst_port); + + if (parent) { + if ( !nm_utils_is_uuid (parent) + && !nm_utils_iface_valid_name (parent)) { + g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: 'dev': '%s' is neither UUID nor interface name."), + parent); + goto cleanup_vxlan; + } + } + + if ( !nm_utils_ipaddr_valid (AF_INET, remote) + && !nm_utils_ipaddr_valid (AF_INET6, remote)) { + g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: 'remote': '%s' is not a valid IP address"), + remote); + goto cleanup_vxlan; + } + + if (local) { + if ( !nm_utils_ipaddr_valid (AF_INET, local) + && !nm_utils_ipaddr_valid (AF_INET6, local)) { + g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: 'local': '%s' is not a valid IP address"), + local); + goto cleanup_vxlan; + } + } + + if (src_port_min) { + if (!nmc_string_to_uint (src_port_min, TRUE, 0, 65535, &sport_min)) { + g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: 'source-port-min': %s is not valid; use <0-65535>."), + src_port_min); + goto cleanup_vxlan; + } + } + + if (src_port_max) { + if (!nmc_string_to_uint (src_port_max, TRUE, 0, 65535, &sport_max)) { + g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: 'source-port-max': %s is not valid; use <0-65535>."), + src_port_max); + goto cleanup_vxlan; + } + } + + if (dst_port) { + if (!nmc_string_to_uint (dst_port, TRUE, 0, 65535, &dport)) { + g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: 'destination-port': %s is not valid; use <0-65535>."), + dst_port); + goto cleanup_vxlan; + } + } + + /* Add 'vxlan' setting */ + s_vxlan = (NMSettingVxlan *) nm_setting_vxlan_new (); + nm_connection_add_setting (connection, NM_SETTING (s_vxlan)); + + g_object_set (s_vxlan, NM_SETTING_VXLAN_ID, (guint) vni, NULL); + g_object_set (s_vxlan, NM_SETTING_VXLAN_REMOTE, remote, NULL); + g_object_set (s_vxlan, NM_SETTING_VXLAN_LOCAL, local, NULL); + g_object_set (s_vxlan, NM_SETTING_VXLAN_PARENT, parent, NULL); + + if (sport_min != G_MAXULONG) + g_object_set (s_vxlan, NM_SETTING_VXLAN_SOURCE_PORT_MIN, sport_min, NULL); + if (sport_max != G_MAXULONG) + g_object_set (s_vxlan, NM_SETTING_VXLAN_SOURCE_PORT_MAX, sport_max, NULL); + if (dport != G_MAXULONG) + g_object_set (s_vxlan, NM_SETTING_VXLAN_DESTINATION_PORT, dport, NULL); + + success = TRUE; + +cleanup_vxlan: + g_free (id_ask); + g_free (remote_ask); + g_free (parent); + g_free (local); + g_free (src_port_min); + g_free (src_port_max); if (!success) return FALSE; @@ -5371,11 +6412,146 @@ cleanup_adsl: return FALSE; } - /* Read and add IP configuration */ - if ( strcmp (con_type, "bond-slave") != 0 - && strcmp (con_type, "team-slave") != 0 - && strcmp (con_type, "bridge-slave") != 0) { + slave_type = nm_setting_connection_get_slave_type (s_con); + if (slave_type) { + + /* Set global variables for use in TAB completion */ + nmc_tab_completion.con_type = (char *)slave_type; + + if (!strcmp (slave_type, NM_SETTING_TEAM_SETTING_NAME)) { + /* Build up the settings required for 'team-slave' */ + gboolean success = FALSE; + const char *master = NULL; + char *master_ask = NULL; + const char *type = NULL; + const char *config_c = NULL; + char *config = NULL; + char *json = NULL; + nmc_arg_t exp_args[] = { {"master", TRUE, &master, FALSE}, + {"type", TRUE, &type, FALSE}, + {"config", TRUE, &config_c, FALSE}, + {NULL} }; + + if (!nmc_parse_args (exp_args, FALSE, &argc, &argv, error)) + return FALSE; + + if (!complete_slave (s_con, all_connections, slave_type, master, type, ask, error)) + return FALSE; + + /* Also ask for all optional arguments if '--ask' is specified. */ + config = g_strdup (config_c); + if (ask) + do_questionnaire_team_slave (&config); + + /* Add 'team-port' setting */ + s_team_port = (NMSettingTeamPort *) nm_setting_team_port_new (); + nm_connection_add_setting (connection, NM_SETTING (s_team_port)); + + if (!nmc_team_check_config (config, &json, error)) { + g_prefix_error (error, _("Error: ")); + goto cleanup_team_slave; + } + /* Set team-port options */ + g_object_set (s_team_port, NM_SETTING_TEAM_PORT_CONFIG, json, NULL); + + success = TRUE; +cleanup_team_slave: + g_free (master_ask); + g_free (config); + g_free (json); + if (!success) + return FALSE; + + } else if (!strcmp (slave_type, NM_SETTING_BRIDGE_SETTING_NAME)) { + /* Build up the settings required for 'bridge-slave' */ + gboolean success = FALSE; + const char *master = NULL; + char *master_ask = NULL; + const char *type = NULL; + const char *priority_c = NULL; + char *priority = NULL; + const char *path_cost_c = NULL; + char *path_cost = NULL; + const char *hairpin_c = NULL; + char *hairpin = NULL; + unsigned long prio_int, path_cost_int; + gboolean hairpin_bool; + nmc_arg_t exp_args[] = { {"master", TRUE, &master, FALSE}, + {"type", TRUE, &type, FALSE}, + {"priority", TRUE, &priority_c, FALSE}, + {"path-cost", TRUE, &path_cost_c, FALSE}, + {"hairpin", TRUE, &hairpin_c, FALSE}, + {NULL} }; + + if (!nmc_parse_args (exp_args, FALSE, &argc, &argv, error)) + return FALSE; + + if (!complete_slave (s_con, all_connections, slave_type, master, type, ask, error)) + return FALSE; + + /* Add 'bridge-port' setting */ + /* Must be done *before* bridge_prop_string_to_uint() so that the type is known */ + s_bridge_port = (NMSettingBridgePort *) nm_setting_bridge_port_new (); + nm_connection_add_setting (connection, NM_SETTING (s_bridge_port)); + + /* Also ask for all optional arguments if '--ask' is specified. */ + priority = g_strdup (priority_c); + path_cost = g_strdup (path_cost_c); + hairpin = g_strdup (hairpin_c); + if (ask) + do_questionnaire_bridge_slave (&priority, &path_cost, &hairpin); + + if (priority) + if (!bridge_prop_string_to_uint (priority, "priority", NM_TYPE_SETTING_BRIDGE_PORT, + NM_SETTING_BRIDGE_PORT_PRIORITY, &prio_int, error)) + goto cleanup_bridge_slave; + if (path_cost) + if (!bridge_prop_string_to_uint (path_cost, "path-cost", NM_TYPE_SETTING_BRIDGE_PORT, + NM_SETTING_BRIDGE_PORT_PATH_COST, &path_cost_int, error)) + goto cleanup_bridge_slave; + if (hairpin) { + GError *tmp_err = NULL; + if (!nmc_string_to_bool (hairpin, &hairpin_bool, &tmp_err)) { + g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, + _("Error: 'hairpin': %s."), tmp_err->message); + g_clear_error (&tmp_err); + goto cleanup_bridge_slave; + } + } + + if (priority) + g_object_set (s_bridge_port, NM_SETTING_BRIDGE_PORT_PRIORITY, prio_int, NULL); + if (path_cost) + g_object_set (s_bridge_port, NM_SETTING_BRIDGE_PORT_PATH_COST, path_cost_int, NULL); + if (hairpin) + g_object_set (s_bridge_port, NM_SETTING_BRIDGE_PORT_HAIRPIN_MODE, hairpin_bool, NULL); + + success = TRUE; +cleanup_bridge_slave: + g_free (master_ask); + g_free (priority); + g_free (path_cost); + g_free (hairpin); + if (!success) + return FALSE; + } else { + /* Slave types without any specific settings ('bond-slave') */ + const char *master = NULL; + const char *type = NULL; + nmc_arg_t exp_args[] = { {"master", TRUE, &master, FALSE}, + {"type", TRUE, &type, FALSE}, + {NULL} }; + + if (!nmc_parse_args (exp_args, FALSE, &argc, &argv, error)) + return FALSE; + + if (!complete_slave (s_con, all_connections, slave_type, master, type, ask, error)) + return FALSE; + } + + } else { + /* Read and add IP configuration */ NMIPAddress *ip4addr = NULL, *ip6addr = NULL; const char *ip4 = NULL, *gw4 = NULL, *ip6 = NULL, *gw6 = NULL; nmc_arg_t exp_args[] = { {"ip4", TRUE, &ip4, FALSE}, {"gw4", TRUE, &gw4, FALSE}, @@ -5391,8 +6567,8 @@ cleanup_adsl: ip4 = gw4 = ip6 = gw6 = NULL; - if (!nmc_parse_args (exp_args, TRUE, &argc, &argv, error)) - return FALSE; + if (!nmc_parse_args (exp_args, TRUE, &argc, &argv, NULL)) + break; /* coverity[dead_error_begin] */ if (ip4) { @@ -5466,31 +6642,19 @@ cleanup_adsl: do_questionnaire_ip (connection); } - return TRUE; -} + if (argc) { + /* Set extra connection properties. */ + nmc_arg_t exp_args[] = { {"--", FALSE, NULL, TRUE}, + {NULL} }; -static char * -unique_connection_name (const GPtrArray *connections, const char *try_name) -{ - NMConnection *connection; - const char *name; - char *new_name; - unsigned int num = 1; - int i = 0; - - new_name = g_strdup (try_name); - while (i < connections->len) { - connection = NM_CONNECTION (connections->pdata[i]); + if (!nmc_parse_args (exp_args, FALSE, &argc, &argv, error)) + return FALSE; - name = nm_connection_get_id (connection); - if (g_strcmp0 (new_name, name) == 0) { - g_free (new_name); - new_name = g_strdup_printf ("%s-%d", try_name, num++); - i = 0; - } else - i++; + if (!read_connection_properties (connection, argc, argv, error)) + return FALSE; } - return new_name; + + return TRUE; } typedef struct { @@ -5610,6 +6774,35 @@ gen_func_adsl_encap (const char *text, int state) return nmc_rl_gen_func_basic (text, state, words); } +static char * +gen_func_tun_mode (const char *text, int state) +{ + const char *words[] = { "tun", "tap", NULL }; + return nmc_rl_gen_func_basic (text, state, words); +} + +static char * +gen_func_ip_tunnel_mode (const char *text, int state) +{ + gs_free const char **words = NULL; + + words = nm_utils_enum_get_values (nm_ip_tunnel_mode_get_type (), + NM_IP_TUNNEL_MODE_UKNOWN + 1, + G_MAXINT); + return nmc_rl_gen_func_basic (text, state, words); +} + +static char * +gen_func_macvlan_mode (const char *text, int state) +{ + gs_free const char **words = NULL; + + words = nm_utils_enum_get_values (nm_setting_macvlan_mode_get_type(), + NM_SETTING_MACVLAN_MODE_UNKNOWN + 1, + G_MAXINT); + return nmc_rl_gen_func_basic (text, state, words); +} + static char * gen_func_master_ifnames (const char *text, int state) { @@ -5679,9 +6872,7 @@ nmcli_con_add_tab_completion (const char *text, int start, int end) generator_func = gen_connection_types; else if (g_strcmp0 (rl_prompt, PROMPT_VPN_TYPE) == 0) generator_func = gen_func_vpn_types; - else if ( g_strcmp0 (rl_prompt, PROMPT_BOND_MASTER) == 0 - || g_strcmp0 (rl_prompt, PROMPT_TEAM_MASTER) == 0 - || g_strcmp0 (rl_prompt, PROMPT_BRIDGE_MASTER) == 0) + else if (g_strcmp0 (rl_prompt, PROMPT_MASTER) == 0) generator_func = gen_func_master_ifnames; else if ( g_str_has_suffix (rl_prompt, prompt_yes_no (TRUE, NULL)) || g_str_has_suffix (rl_prompt, prompt_yes_no (TRUE, ":")) @@ -5702,6 +6893,12 @@ nmcli_con_add_tab_completion (const char *text, int start, int end) generator_func = gen_func_adsl_proto; else if (g_str_has_suffix (rl_prompt, PROMPT_ADSL_ENCAP)) generator_func = gen_func_adsl_encap; + else if (g_str_has_suffix (rl_prompt, PROMPT_TUN_MODE)) + generator_func = gen_func_tun_mode; + else if (g_str_has_suffix (rl_prompt, PROMPT_IP_TUNNEL_MODE)) + generator_func = gen_func_ip_tunnel_mode; + else if (g_str_has_suffix (rl_prompt, PROMPT_MACVLAN_MODE)) + generator_func = gen_func_macvlan_mode; if (generator_func) match_array = rl_completion_matches (text, generator_func); @@ -5726,6 +6923,9 @@ do_connection_add (NmCli *nmc, int argc, char **argv) gboolean ifname_mandatory = TRUE; const char *save = NULL; gboolean save_bool = TRUE; + const char *master = NULL; + const char *checked_master = NULL; + const char *slave_type = NULL; AddConnectionInfo *info = NULL; const char *setting_name; GError *error = NULL; @@ -5734,6 +6934,8 @@ do_connection_add (NmCli *nmc, int argc, char **argv) {"autoconnect", TRUE, &autoconnect, FALSE}, {"ifname", TRUE, &ifname, FALSE}, {"save", TRUE, &save, FALSE}, + {"master", TRUE, &master, FALSE}, + {"slave-type", TRUE, &slave_type, FALSE}, {NULL} }; rl_attempted_completion_function = (rl_completion_func_t *) nmcli_con_add_tab_completion; @@ -5836,15 +7038,22 @@ do_connection_add (NmCli *nmc, int argc, char **argv) char *try_name = ifname ? g_strdup_printf ("%s-%s", get_name_alias (setting_name, nmc_valid_connection_types), ifname) : g_strdup (get_name_alias (setting_name, nmc_valid_connection_types)); - default_name = unique_connection_name (nmc->connections, try_name); + default_name = nmc_unique_connection_name (nmc->connections, try_name); g_free (try_name); } + + if (master) + /* Verify master argument */ + checked_master = normalized_master_for_slave (nmc->connections, master, slave_type, &slave_type); + g_object_set (s_con, NM_SETTING_CONNECTION_ID, default_name, NM_SETTING_CONNECTION_UUID, uuid, NM_SETTING_CONNECTION_TYPE, setting_name, NM_SETTING_CONNECTION_AUTOCONNECT, auto_bool, NM_SETTING_CONNECTION_INTERFACE_NAME, ifname, + NM_SETTING_CONNECTION_MASTER, checked_master, + NM_SETTING_CONNECTION_SLAVE_TYPE, slave_type, NULL); g_free (uuid); g_free (default_name); @@ -5854,6 +7063,7 @@ do_connection_add (NmCli *nmc, int argc, char **argv) setting_name, nmc->connections, nmc->ask, + nmc->show_secrets, argc, argv, &error)) { @@ -5863,7 +7073,7 @@ do_connection_add (NmCli *nmc, int argc, char **argv) goto error; } - nmc->should_wait = TRUE; + nmc->should_wait++; info = g_malloc0 (sizeof (AddConnectionInfo)); info->nmc = nmc; @@ -5887,7 +7097,6 @@ error: g_free (type_ask); g_free (ifname_ask); - nmc->should_wait = FALSE; return nmc->return_value; } @@ -5945,7 +7154,8 @@ gen_cmd_nmcli (const char *text, int state) static char * gen_cmd_nmcli_prompt_color (const char *text, int state) { - const char *words[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", NULL }; + const char *words[] = { "normal", "black", "red", "green", "yellow", + "blue", "magenta", "cyan", "white", NULL }; return nmc_rl_gen_func_basic (text, state, words); } @@ -6134,33 +7344,59 @@ gen_compat_devices (const char *text, int state) return ret; } -static char * -gen_vpn_uuids (const char *text, int state) +static const char ** +_create_vpn_array (const GPtrArray *connections, gboolean uuid) { - const GPtrArray *connections = nmc_tab_completion.nmc->connections; - int c, u = 0; - const char **uuids; - char *ret; + int c, idx = 0; + const char **array; if (connections->len < 1) return NULL; - uuids = g_new (const char *, connections->len + 1); + array = g_new (const char *, connections->len + 1); for (c = 0; c < connections->len; c++) { NMConnection *connection = NM_CONNECTION (connections->pdata[c]); const char *type = nm_connection_get_connection_type (connection); if (g_strcmp0 (type, NM_SETTING_VPN_SETTING_NAME) == 0) - uuids[u++] = nm_connection_get_uuid (connection); + array[idx++] = uuid ? nm_connection_get_uuid (connection) : nm_connection_get_id (connection); } - uuids[u] = NULL; + array[idx] = NULL; + return array; +} - ret = nmc_rl_gen_func_basic (text, state, uuids); +static char * +gen_vpn_uuids (const char *text, int state) +{ + const GPtrArray *connections = nm_cli.connections; + const char **uuids; + char *ret; + if (connections->len < 1) + return NULL; + + uuids = _create_vpn_array (connections, TRUE); + ret = nmc_rl_gen_func_basic (text, state, uuids); g_free (uuids); return ret; } +static char * +gen_vpn_ids (const char *text, int state) +{ + const GPtrArray *connections = nm_cli.connections; + const char **ids; + char *ret; + + if (connections->len < 1) + return NULL; + + ids = _create_vpn_array (connections, FALSE); + ret = nmc_rl_gen_func_basic (text, state, ids); + g_free (ids); + return ret; +} + static rl_compentry_func_t * get_gen_func_cmd_nmcli (const char *str) { @@ -6321,14 +7557,44 @@ extract_setting_and_property (const char *prompt, const char *line, } } - if (setting) - *setting = sett; - else - g_free (sett); - if (property) - *property = prop; + if (setting) + *setting = sett; + else + g_free (sett); + if (property) + *property = prop; + else + g_free (prop); +} + +static void +get_setting_and_property (const char *prompt, const char *line, + NMSetting **setting_out, char**property_out) +{ + const NameItem *valid_settings_arr; + const char *setting_name; + NMSetting *setting = NULL; + char *property = NULL; + char *sett = NULL, *prop = NULL; + + extract_setting_and_property (prompt, line, &sett, &prop); + if (sett) { + valid_settings_arr = get_valid_settings_array (nmc_tab_completion.con_type); + setting_name = check_valid_name (sett, valid_settings_arr, NULL); + setting = nmc_setting_new_for_name (setting_name); + } else + setting = nmc_tab_completion.setting ? g_object_ref (nmc_tab_completion.setting) : NULL; + + if (setting && prop) + property = is_property_valid (setting, prop, NULL); else - g_free (prop); + property = g_strdup (nmc_tab_completion.property); + + *setting_out = setting; + *property_out = property; + + g_free (sett); + g_free (prop); } static gboolean @@ -6384,38 +7650,21 @@ should_complete_vpn_uuids (const char *prompt, const char *line) return _get_and_check_property (prompt, line, uuid_properties, NULL, NULL); } -static char *is_property_valid (NMSetting *setting, const char *property, GError **error); static const char ** get_allowed_property_values (void) { - const NameItem *valid_settings_arr; - const char *setting_name; - NMSetting *setting = NULL; - char *property = NULL; - char *sett = NULL, *prop = NULL; + NMSetting *setting; + char *property; const char **avals = NULL; - extract_setting_and_property (rl_prompt, rl_line_buffer, &sett, &prop); - if (sett) { - valid_settings_arr = get_valid_settings_array (nmc_tab_completion.con_type); - setting_name = check_valid_name (sett, valid_settings_arr, NULL); - setting = nmc_setting_new_for_name (setting_name); - } else - setting = nmc_tab_completion.setting ? g_object_ref (nmc_tab_completion.setting) : NULL; - - if (setting && prop) - property = is_property_valid (setting, prop, NULL); - else - property = g_strdup (nmc_tab_completion.property); - + get_setting_and_property (rl_prompt, rl_line_buffer, &setting, &property); if (setting && property) avals = nmc_setting_get_property_allowed_values (setting, property); - g_free (sett); - g_free (prop); if (setting) g_object_unref (setting); g_free (property); + return avals; } @@ -6440,6 +7689,39 @@ should_complete_property_values (const char *prompt, const char *line, gboolean return get_allowed_property_values () != NULL; } +//FIXME: this helper should go to libnm later +static gboolean +_setting_property_is_boolean (NMSetting *setting, const char *property_name) +{ + GParamSpec *pspec; + + g_return_val_if_fail (NM_IS_SETTING (setting), FALSE); + g_return_val_if_fail (property_name, FALSE); + + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (setting), property_name); + if (pspec && pspec->value_type == G_TYPE_BOOLEAN) + return TRUE; + return FALSE; +} + +static gboolean +should_complete_boolean (const char *prompt, const char *line) +{ + NMSetting *setting; + char *property; + gboolean is_boolean = FALSE; + + get_setting_and_property (prompt, line, &setting, &property); + if (setting && property) + is_boolean = _setting_property_is_boolean (setting, property); + + if (setting) + g_object_unref (setting); + g_free (property); + + return is_boolean; +} + static char * gen_property_values (const char *text, int state) { @@ -6466,11 +7748,8 @@ nmcli_editor_tab_completion (const char *text, int start, int end) { char **match_array = NULL; const char *line = rl_line_buffer; - const char *prompt = rl_prompt; rl_compentry_func_t *generator_func = NULL; - gboolean copy_char; - const char *p1; - char *p2, *prompt_tmp; + char *prompt_tmp; char *word = NULL; size_t n1; int num; @@ -6488,19 +7767,7 @@ nmcli_editor_tab_completion (const char *text, int start, int end) rl_complete_with_tilde_expansion = 1; /* Filter out possible ANSI color escape sequences */ - p1 = prompt; - p2 = prompt_tmp = g_strdup (prompt); - copy_char = TRUE; - while (*p1) { - if (*p1 == '\33') - copy_char = FALSE; - if (copy_char) - *p2++ = *p1; - if (!copy_char && *p1 == 'm') - copy_char = TRUE; - p1++; - } - *p2 = '\0'; + prompt_tmp = nmc_filter_out_colors ((const char *) rl_prompt); /* Find the first non-space character */ n1 = strspn (line, " \t"); @@ -6546,7 +7813,8 @@ nmcli_editor_tab_completion (const char *text, int start, int end) } else if ( should_complete_property_values (NULL, line, &multi) && (num == 3 || multi)) { generator_func = gen_property_values; - } + } else if (should_complete_boolean (NULL, line) && num == 3) + generator_func = gen_func_bool_values; } } else if ( ( should_complete_cmd (line, end, "remove", &num, NULL) || should_complete_cmd (line, end, "describe", &num, NULL)) @@ -6592,7 +7860,8 @@ nmcli_editor_tab_completion (const char *text, int start, int end) } else if ( should_complete_property_values (prompt_tmp, NULL, &multi) && (num <= 2 || multi)) { generator_func = gen_property_values; - } + } else if (should_complete_boolean (prompt_tmp, NULL) && num <= 2) + generator_func = gen_func_bool_values; } if (should_complete_cmd (line, end, "print", &num, NULL) && num <= 2) generator_func = gen_cmd_print2; @@ -6882,10 +8151,15 @@ editor_main_help (const char *command) case NMC_EDITOR_MAIN_CMD_NMCLI: g_print (_("nmcli [ ] :: nmcli configuration\n\n" "Configures nmcli. The following options are available:\n" - "status-line yes | no [default: no]\n" - "save-confirmation yes | no [default: yes]\n" - "show-secrets yes | no [default: no]\n" - "prompt-color <0-8> [default: 0]\n" + "status-line yes | no [default: no]\n" + "save-confirmation yes | no [default: yes]\n" + "show-secrets yes | no [default: no]\n" + "prompt-color | <0-8> [default: 0]\n" + "%s" /* color table description */ + "\n" + "Examples: nmcli> nmcli status-line yes\n" + " nmcli> nmcli save-confirmation no\n" + " nmcli> nmcli prompt-color 3\n"), " 0 = normal\n" " 1 = \33[30mblack\33[0m\n" " 2 = \33[31mred\33[0m\n" @@ -6894,11 +8168,7 @@ editor_main_help (const char *command) " 5 = \33[34mblue\33[0m\n" " 6 = \33[35mmagenta\33[0m\n" " 7 = \33[36mcyan\33[0m\n" - " 8 = \33[37mwhite\33[0m\n" - "\n" - "Examples: nmcli> nmcli status-line yes\n" - " nmcli> nmcli save-confirmation no\n" - " nmcli> nmcli prompt-color 3\n")); + " 8 = \33[37mwhite\33[0m\n"); break; case NMC_EDITOR_MAIN_CMD_QUIT: g_print (_("quit :: exit nmcli\n\n" @@ -7308,7 +8578,8 @@ property_edit_submenu (NmCli *nmc, /* Set global variable for use in TAB completion */ nmc_tab_completion.property = prop_name; - prompt = nmc_colorize (nmc->editor_prompt_color, "nmcli %s.%s> ", + prompt = nmc_colorize (nmc, nmc->editor_prompt_color, NMC_TERM_FORMAT_NORMAL, + "nmcli %s.%s> ", nm_setting_get_name (curr_setting), prop_name); while (cmd_property_loop) { @@ -7510,30 +8781,6 @@ split_editor_main_cmd_args (const char *str, char **setting, char **property, ch g_strfreev (args); } -static NMSetting * -is_setting_valid (NMConnection *connection, const NameItem *valid_settings, char *setting) -{ - const char *setting_name; - - if (!(setting_name = check_valid_name (setting, valid_settings, NULL))) - return NULL; - return nm_connection_get_setting_by_name (connection, setting_name); -} - -static char * -is_property_valid (NMSetting *setting, const char *property, GError **error) -{ - char **valid_props = NULL; - const char *prop_name; - char *ret; - - valid_props = nmc_setting_get_valid_properties (setting); - prop_name = nmc_string_is_valid (property, (const char **) valid_props, error); - ret = g_strdup (prop_name); - g_strfreev (valid_props); - return ret; -} - static NMSetting * create_setting_by_name (const char *name, const NameItem *valid_settings) { @@ -7659,13 +8906,14 @@ typedef struct { } NmcEditorMenuContext; static void -menu_switch_to_level0 (NmcEditorMenuContext *menu_ctx, +menu_switch_to_level0 (NmCli *nmc, + NmcEditorMenuContext *menu_ctx, const char *prompt, NmcTermColor prompt_color) { menu_ctx->level = 0; g_free (menu_ctx->main_prompt); - menu_ctx->main_prompt = nmc_colorize (prompt_color, "%s", prompt); + menu_ctx->main_prompt = nmc_colorize (nmc, prompt_color, NMC_TERM_FORMAT_NORMAL, "%s", prompt); menu_ctx->curr_setting = NULL; g_strfreev (menu_ctx->valid_props); menu_ctx->valid_props = NULL; @@ -7674,14 +8922,16 @@ menu_switch_to_level0 (NmcEditorMenuContext *menu_ctx, } static void -menu_switch_to_level1 (NmcEditorMenuContext *menu_ctx, +menu_switch_to_level1 (NmCli *nmc, + NmcEditorMenuContext *menu_ctx, NMSetting *setting, const char *setting_name, NmcTermColor prompt_color) { menu_ctx->level = 1; g_free (menu_ctx->main_prompt); - menu_ctx->main_prompt = nmc_colorize (prompt_color, "nmcli %s> ", setting_name); + menu_ctx->main_prompt = nmc_colorize (nmc, prompt_color, NMC_TERM_FORMAT_NORMAL, + "nmcli %s> ", setting_name); menu_ctx->curr_setting = setting; g_strfreev (menu_ctx->valid_props); menu_ctx->valid_props = nmc_setting_get_valid_properties (menu_ctx->curr_setting); @@ -7715,7 +8965,8 @@ editor_menu_main (NmCli *nmc, NMConnection *connection, const char *connection_t g_print (_("You may edit the following settings: %s\n"), valid_settings_str); menu_ctx.level = 0; - menu_ctx.main_prompt = nmc_colorize (nmc->editor_prompt_color, BASE_PROMPT); + menu_ctx.main_prompt = nmc_colorize (nmc, nmc->editor_prompt_color, NMC_TERM_FORMAT_NORMAL, + BASE_PROMPT); menu_ctx.curr_setting = NULL; menu_ctx.valid_props = NULL; menu_ctx.valid_props_str = NULL; @@ -7873,7 +9124,7 @@ editor_menu_main (NmCli *nmc, NMConnection *connection, const char *connection_t nmc_tab_completion.setting = setting; /* Switch to level 1 */ - menu_switch_to_level1 (&menu_ctx, setting, setting_name, nmc->editor_prompt_color); + menu_switch_to_level1 (nmc, &menu_ctx, setting, setting_name, nmc->editor_prompt_color); if (!cmd_arg_s) { g_print (_("You may edit the following properties: %s\n"), menu_ctx.valid_props_str); @@ -7947,7 +9198,7 @@ editor_menu_main (NmCli *nmc, NMConnection *connection, const char *connection_t connection_remove_setting (connection, ss); if (ss == menu_ctx.curr_setting) { /* If we removed the setting we are in, go up */ - menu_switch_to_level0 (&menu_ctx, BASE_PROMPT, nmc->editor_prompt_color); + menu_switch_to_level0 (nmc, &menu_ctx, BASE_PROMPT, nmc->editor_prompt_color); nmc_tab_completion.setting = NULL; /* for TAB completion */ } } else { @@ -7970,7 +9221,7 @@ editor_menu_main (NmCli *nmc, NMConnection *connection, const char *connection_t /* coverity[copy_paste_error] - suppress Coverity COPY_PASTE_ERROR defect */ if (ss == menu_ctx.curr_setting) { /* If we removed the setting we are in, go up */ - menu_switch_to_level0 (&menu_ctx, BASE_PROMPT, nmc->editor_prompt_color); + menu_switch_to_level0 (nmc, &menu_ctx, BASE_PROMPT, nmc->editor_prompt_color); nmc_tab_completion.setting = NULL; /* for TAB completion */ } } else @@ -8269,7 +9520,7 @@ editor_menu_main (NmCli *nmc, NMConnection *connection, const char *connection_t } nmc->nowait_flag = FALSE; - nmc->should_wait = TRUE; + nmc->should_wait++; nmc->print_output = NMC_PRINT_PRETTY; if (!nmc_activate_connection (nmc, NM_CONNECTION (rem_con), ifname, ap_nsp, ap_nsp, NULL, activate_connection_editor_cb, &tmp_err)) { @@ -8312,7 +9563,7 @@ editor_menu_main (NmCli *nmc, NMConnection *connection, const char *connection_t case NMC_EDITOR_MAIN_CMD_BACK: /* Go back (up) an the menu */ if (menu_ctx.level == 1) { - menu_switch_to_level0 (&menu_ctx, BASE_PROMPT, nmc->editor_prompt_color); + menu_switch_to_level0 (nmc, &menu_ctx, BASE_PROMPT, nmc->editor_prompt_color); nmc_tab_completion.setting = NULL; /* for TAB completion */ } break; @@ -8348,18 +9599,21 @@ editor_menu_main (NmCli *nmc, NMConnection *connection, const char *connection_t } else nmc->editor_show_secrets = bb; } else if (cmd_arg_p && matches (cmd_arg_p, "prompt-color") == 0) { - unsigned long color; - if (!nmc_string_to_uint (cmd_arg_v ? g_strstrip (cmd_arg_v) : "X", - TRUE, 0, 8, &color)) - g_print (_("Error: bad color number: '%s'; use <0-8>\n"), - cmd_arg_v ? cmd_arg_v : ""); - else { + GError *tmp_err = NULL; + NmcTermColor color; + color = nmc_term_color_parse_string (cmd_arg_v ? g_strstrip (cmd_arg_v) : " ", &tmp_err); + if (tmp_err) { + g_print (_("Error: bad color: %s\n"), tmp_err->message); + g_clear_error (&tmp_err); + } else { nmc->editor_prompt_color = color; g_free (menu_ctx.main_prompt); if (menu_ctx.level == 0) - menu_ctx.main_prompt = nmc_colorize (nmc->editor_prompt_color, BASE_PROMPT); + menu_ctx.main_prompt = nmc_colorize (nmc, nmc->editor_prompt_color, NMC_TERM_FORMAT_NORMAL, + BASE_PROMPT); else - menu_ctx.main_prompt = nmc_colorize (nmc->editor_prompt_color, "nmcli %s> ", + menu_ctx.main_prompt = nmc_colorize (nmc, nmc->editor_prompt_color, NMC_TERM_FORMAT_NORMAL, + "nmcli %s> ", nm_setting_get_name (menu_ctx.curr_setting)); } } else if (!cmd_arg_p) { @@ -8696,8 +9950,8 @@ do_connection_edit (NmCli *nmc, int argc, char **argv) if (con_name) default_name = g_strdup (con_name); else - default_name = unique_connection_name (nmc->connections, - get_name_alias (connection_type, nmc_valid_connection_types)); + default_name = nmc_unique_connection_name (nmc->connections, + get_name_alias (connection_type, nmc_valid_connection_types)); g_object_set (s_con, NM_SETTING_CONNECTION_ID, default_name, @@ -8740,14 +9994,14 @@ do_connection_edit (NmCli *nmc, int argc, char **argv) g_object_unref (connection); g_free (nmc_tab_completion.con_type); - nmc->should_wait = TRUE; + nmc->should_wait++; return nmc->return_value; error: g_assert (!connection); g_free (type_ask); - nmc->should_wait = FALSE; + nmc->should_wait++; return nmc->return_value; } @@ -8785,21 +10039,11 @@ do_connection_modify (NmCli *nmc, { NMConnection *connection = NULL; NMRemoteConnection *rc = NULL; - NMSetting *setting; - NMSettingConnection *s_con; - const char *con_type; const char *name; const char *selector = NULL; - const char *s_dot_p; - const char *value; - char **strv = NULL; - const char *setting_name; - char *property_name = NULL; - gboolean append = FALSE; - gboolean remove = FALSE; GError *error = NULL; - nmc->should_wait = FALSE; + nmc->return_value = NMC_RESULT_SUCCESS; if (argc == 0) { g_string_printf (nmc->return_text, _("Error: No arguments provided.")); @@ -8838,9 +10082,6 @@ do_connection_modify (NmCli *nmc, nmc->return_value = NMC_RESULT_ERROR_NOT_FOUND; goto finish; } - s_con = nm_connection_get_setting_connection (NM_CONNECTION (rc)); - g_assert (s_con); - con_type = nm_setting_connection_get_connection_type (s_con); if (next_arg (&argc, &argv) != 0) { g_string_printf (nmc->return_text, _("Error: . argument is missing.")); @@ -8848,116 +10089,163 @@ do_connection_modify (NmCli *nmc, goto finish; } - /* Go through arguments and set properties */ - while (argc) { - s_dot_p = *argv; - next_arg (&argc, &argv); - value = *argv; - next_arg (&argc, &argv); + if (!read_connection_properties (NM_CONNECTION (rc), argc, argv, &error)) { + g_string_assign (nmc->return_text, error->message); + nmc->return_value = error->code; + g_clear_error (&error); + goto finish; + } - if (!s_dot_p) { - g_string_printf (nmc->return_text, _("Error: . argument is missing.")); - nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; - goto finish; - } - if (!value) { - g_string_printf (nmc->return_text, _("Error: value for '%s' is missing."), s_dot_p); - nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; - goto finish; - } - /* Empty string will reset the value to default */ - if (value[0] == '\0') - value = NULL; + update_connection (!temporary, rc, modify_connection_cb, nmc); - if (s_dot_p[0] == '+') { - s_dot_p++; - append = TRUE; - } else if (s_dot_p[0] == '-') { - s_dot_p++; - remove = TRUE; - } + nmc->should_wait++; +finish: + return nmc->return_value; +} - strv = g_strsplit (s_dot_p, ".", 2); - if (g_strv_length (strv) != 2) { - g_string_printf (nmc->return_text, _("Error: invalid . '%s'."), - s_dot_p); - nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; - goto finish; - } +typedef struct { + NmCli *nmc; + char *orig_id; + char *orig_uuid; + char *con_id; +} CloneConnectionInfo; - setting_name = check_valid_name (strv[0], get_valid_settings_array (con_type), &error); - if (!setting_name) { - g_string_printf (nmc->return_text, _("Error: invalid or not allowed setting '%s': %s."), - strv[0], error->message); +static void +clone_connection_cb (GObject *client, + GAsyncResult *result, + gpointer user_data) +{ + CloneConnectionInfo *info = (CloneConnectionInfo *) user_data; + NmCli *nmc = info->nmc; + NMRemoteConnection *connection; + GError *error = NULL; + + connection = nm_client_add_connection_finish (NM_CLIENT (client), result, &error); + if (error) { + g_string_printf (nmc->return_text, + _("Error: Failed to add '%s' connection: %s"), + info->con_id, error->message); + g_error_free (error); + nmc->return_value = NMC_RESULT_ERROR_CON_ACTIVATION; + } else { + g_print (_("%s (%s) cloned as %s (%s).\n"), + info->orig_id, + info->orig_uuid, + nm_connection_get_id (NM_CONNECTION (connection)), + nm_connection_get_uuid (NM_CONNECTION (connection))); + g_object_unref (connection); + } + + g_free (info->con_id); + g_free (info->orig_id); + g_free (info->orig_uuid); + g_slice_free (CloneConnectionInfo, info); + quit (); +} + +static NMCResultCode +do_connection_clone (NmCli *nmc, gboolean temporary, int argc, char **argv) +{ + NMConnection *connection = NULL; + NMConnection *new_connection = NULL; + NMSettingConnection *s_con; + CloneConnectionInfo *info; + const char *name; + const char *new_name; + char *name_ask = NULL; + char *new_name_ask = NULL; + const char *selector = NULL; + char *uuid; + + if (argc == 0) { + if (nmc->ask) { + name = name_ask = nmc_readline (PROMPT_CONNECTION); + new_name = new_name_ask = nmc_readline (_("New connection name: ")); + } else { + g_string_printf (nmc->return_text, _("Error: No arguments provided.")); nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; goto finish; } - setting = nm_connection_get_setting_by_name (NM_CONNECTION (rc), setting_name); - if (!setting) { - setting = nmc_setting_new_for_name (setting_name); - if (!setting) { - /* This should really not happen */ - g_string_printf (nmc->return_text, - "Error: don't know how to create '%s' setting.", - setting_name); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + } else { + if ( strcmp (*argv, "id") == 0 + || strcmp (*argv, "uuid") == 0 + || strcmp (*argv, "path") == 0) { + + selector = *argv; + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), + selector); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; goto finish; } - nm_connection_add_setting (NM_CONNECTION (rc), setting); } - - property_name = is_property_valid (setting, strv[1], &error); - if (!property_name) { - g_string_printf (nmc->return_text, _("Error: invalid property '%s': %s."), - strv[1], error->message); + name = *argv; + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: argument is missing.")); nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; goto finish; } - - if (!remove) { - /* Set/add value */ - if (!append) - nmc_setting_reset_property (setting, property_name, NULL); - if (!nmc_setting_set_property (setting, property_name, value, &error)) { - g_string_printf (nmc->return_text, _("Error: failed to modify %s.%s: %s."), - strv[0], strv[1], error->message); - nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; - goto finish; - } - } else { - /* Remove value - * - either empty: remove whole value - * - or specified by index <0-n>: remove item at the index - * - or option name: remove item with the option name - */ - if (value) { - unsigned long idx; - if (nmc_string_to_uint (value, TRUE, 0, G_MAXUINT32, &idx)) - nmc_setting_remove_property_option (setting, property_name, NULL, idx, &error); - else - nmc_setting_remove_property_option (setting, property_name, value, 0, &error); - if (error) { - g_string_printf (nmc->return_text, _("Error: failed to remove a value from %s.%s: %s."), - strv[0], strv[1], error->message); - nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; - goto finish; - } - } else - nmc_setting_reset_property (setting, property_name, NULL); + new_name = *argv; + if (next_arg (&argc, &argv) == 0) { + g_string_printf (nmc->return_text, _("Error: unexpected extra argument '%s'."), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto finish; } + } - g_strfreev (strv); - strv = NULL; + if (!name) { + g_string_printf (nmc->return_text, _("Error: connection ID is missing.")); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto finish; + } + if (!new_name) { + g_string_printf (nmc->return_text, _("Error: argument is missing.")); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto finish; } - update_connection (!temporary, rc, modify_connection_cb, nmc); + connection = nmc_find_connection (nmc->connections, selector, name, NULL); + if (!connection) { + g_string_printf (nmc->return_text, _("Error: Unknown connection '%s'."), name); + nmc->return_value = NMC_RESULT_ERROR_NOT_FOUND; + goto finish; + } + + /* Copy the connection */ + new_connection = nm_simple_connection_new_clone (connection); + + s_con = nm_connection_get_setting_connection (new_connection); + g_assert (s_con); + uuid = nm_utils_uuid_generate (); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, new_name, + NM_SETTING_CONNECTION_UUID, uuid, + NULL); + g_free (uuid); + + /* Merge secrets into the new connection */ + update_secrets_in_connection (NM_REMOTE_CONNECTION (connection), new_connection); + + info = g_slice_new0 (CloneConnectionInfo); + info->nmc = nmc; + info->orig_id = g_strdup (nm_connection_get_id (connection)); + info->orig_uuid = g_strdup (nm_connection_get_uuid (connection)); + info->con_id = g_strdup (nm_connection_get_id (new_connection)); + /* Add the new cloned connection to NetworkManager */ + add_new_connection (!temporary, + nmc->client, + new_connection, + clone_connection_cb, + info); + + nmc->should_wait = TRUE; finish: - nmc->should_wait = (nmc->return_value == NMC_RESULT_SUCCESS); - g_free (property_name); - if (strv) - g_strfreev (strv); - g_clear_error (&error); + if (new_connection) + g_object_unref (new_connection); + g_free (name_ask); + g_free (new_name_ask); + return nmc->return_value; } @@ -9057,7 +10345,7 @@ do_connection_delete (NmCli *nmc, int argc, char **argv) info->timeout_id = g_timeout_add_seconds (nmc->timeout, connection_op_timeout_cb, info); nmc->nowait_flag = (nmc->timeout == 0); - nmc->should_wait = TRUE; + nmc->should_wait++; g_signal_connect (nmc->client, NM_CLIENT_CONNECTION_REMOVED, G_CALLBACK (connection_removed_cb), info); @@ -9079,13 +10367,108 @@ finish: return nmc->return_value; } +static void +connection_changed (NMConnection *connection, NmCli *nmc) +{ + g_print (_("%s: connection profile changed\n"), nm_connection_get_id (connection)); +} + +static void +connection_watch (NmCli *nmc, NMConnection *connection) +{ + nmc->should_wait++; + g_signal_connect (connection, NM_CONNECTION_CHANGED, G_CALLBACK (connection_changed), nmc); +} + +static void +connection_unwatch (NmCli *nmc, NMConnection *connection) +{ + if (g_signal_handlers_disconnect_by_func (connection, G_CALLBACK (connection_changed), nmc)) + nmc->should_wait--; + + /* Terminate if all the watched connections disappeared. */ + if (!nmc->should_wait) + quit (); +} + +static void +connection_added (NMClient *client, NMRemoteConnection *con, NmCli *nmc) +{ + NMConnection *connection = NM_CONNECTION (con); + + g_print (_("%s: connection profile created\n"), nm_connection_get_id (connection)); + connection_watch (nmc, connection); +} + +static void +connection_removed (NMClient *client, NMRemoteConnection *con, NmCli *nmc) +{ + NMConnection *connection = NM_CONNECTION (con); + + g_print (_("%s: connection profile removed\n"), nm_connection_get_id (connection)); + connection_unwatch (nmc, connection); +} + +static NMCResultCode +do_connection_monitor (NmCli *nmc, int argc, char **argv) +{ + if (argc == 0) { + /* No connections specified. Monitor all. */ + int i; + + nmc->connections = nm_client_get_connections (nmc->client); + for (i = 0; i < nmc->connections->len; i++) + connection_watch (nmc, g_ptr_array_index (nmc->connections, i)); + + /* We'll watch the connection additions too, never exit. */ + nmc->should_wait++; + g_signal_connect (nmc->client, NM_CLIENT_CONNECTION_ADDED, G_CALLBACK (connection_added), nmc); + } else { + /* Look up the specified connections and watch them. */ + NMConnection *connection; + char **arg_ptr = argv; + int arg_num = argc; + int pos = 0; + + do { + const char *selector = NULL; + + if ( strcmp (*arg_ptr, "id") == 0 + || strcmp (*arg_ptr, "uuid") == 0 + || strcmp (*arg_ptr, "path") == 0) { + selector = *arg_ptr; + if (next_arg (&arg_num, &arg_ptr) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), selector); + return NMC_RESULT_ERROR_USER_INPUT; + } + } + + connection = nmc_find_connection (nmc->connections, selector, *arg_ptr, &pos); + if (connection) { + connection_watch (nmc, connection); + } else { + g_printerr (_("Error: unknown connection '%s'\n"), *arg_ptr); + g_string_printf (nmc->return_text, _("Error: not all connections found.")); + return NMC_RESULT_ERROR_NOT_FOUND; + } + + /* Take next argument (if there's no other connection of the same name) */ + if (!pos) + next_arg (&arg_num, &arg_ptr); + } while (arg_num > 0); + } + + g_signal_connect (nmc->client, NM_CLIENT_CONNECTION_REMOVED, G_CALLBACK (connection_removed), nmc); + + return NMC_RESULT_SUCCESS; +} + static NMCResultCode do_connection_reload (NmCli *nmc, int argc, char **argv) { GError *error = NULL; nmc->return_value = NMC_RESULT_SUCCESS; - nmc->should_wait = FALSE; if (!nm_client_reload_connections (nmc->client, NULL, &error)) { g_string_printf (nmc->return_text, _("Error: failed to reload connections: %s."), @@ -9105,7 +10488,6 @@ do_connection_load (NmCli *nmc, int argc, char **argv) int i; nmc->return_value = NMC_RESULT_SUCCESS; - nmc->should_wait = FALSE; if (argc == 0) { g_string_printf (nmc->return_text, _("Error: No connection specified.")); @@ -9136,6 +10518,236 @@ do_connection_load (NmCli *nmc, int argc, char **argv) return nmc->return_value; } +// FIXME: change the text when non-VPN connection types are supported +#define PROMPT_IMPORT_TYPE PROMPT_VPN_TYPE +#define PROMPT_IMPORT_FILE _("File to import: ") + +static NMCResultCode +do_connection_import (NmCli *nmc, gboolean temporary, int argc, char **argv) +{ + GError *error = NULL; + const char *type = NULL, *filename = NULL; + char *type_ask = NULL, *filename_ask = NULL; + AddConnectionInfo *info; + NMConnection *connection = NULL; + NMVpnEditorPlugin *plugin; + + if (argc == 0) { + if (nmc->ask) { + type_ask = nmc_readline (PROMPT_IMPORT_TYPE); + filename_ask = nmc_readline (PROMPT_IMPORT_FILE); + type = type_ask = type_ask ? g_strstrip (type_ask) : NULL; + filename = filename_ask = filename_ask ? g_strstrip (filename_ask) : NULL; + } else { + g_string_printf (nmc->return_text, _("Error: No arguments provided.")); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto finish; + } + } + + while (argc > 0) { + if (strcmp (*argv, "type") == 0) { + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1)); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto finish; + } + if (!type) + type = *argv; + else + g_printerr (_("Warning: 'type' already specified, ignoring extra one.\n")); + + } else if (strcmp (*argv, "file") == 0) { + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1)); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto finish; + } + if (!filename) + filename = *argv; + else + g_printerr (_("Warning: 'file' already specified, ignoring extra one.\n")); + } else { + g_string_printf (nmc->return_text, _("Unknown parameter: %s"), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto finish; + } + + argc--; + argv++; + } + + if (!type) { + g_string_printf (nmc->return_text, _("Error: 'type' argument is required.")); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto finish; + } + if (!filename) { + g_string_printf (nmc->return_text, _("Error: 'file' argument is required.")); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto finish; + } + + /* Import VPN configuration */ + plugin = nm_vpn_get_plugin_by_service (type, &error); + if (!plugin) { + g_string_printf (nmc->return_text, _("Error: failed to load VPN plugin: %s."), + error->message); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto finish; + } + + connection = nm_vpn_editor_plugin_import (plugin, filename, &error); + if (!connection) { + g_string_printf (nmc->return_text, _("Error: failed to import '%s': %s."), + filename, error->message); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto finish; + } + + info = g_malloc0 (sizeof (AddConnectionInfo)); + info->nmc = nmc; + info->con_name = g_strdup (nm_connection_get_id (connection)); + + /* Add the new imported connection to NetworkManager */ + add_new_connection (!temporary, + nmc->client, + connection, + add_connection_cb, + info); + + nmc->should_wait = TRUE; +finish: + if (connection) + g_object_unref (connection); + g_clear_error (&error); + g_free (type_ask); + g_free (filename_ask); + return nmc->return_value; +} + +static NMCResultCode +do_connection_export (NmCli *nmc, int argc, char **argv) +{ + NMConnection *connection = NULL; + const char *name; + const char *out_name = NULL; + char *name_ask = NULL; + char *out_name_ask = NULL; + const char *path = NULL; + const char *selector = NULL; + const char *type = NULL; + NMVpnEditorPlugin *plugin; + GError *error = NULL; + char tmpfile[] = "/tmp/nmcli-export-temp-XXXXXX"; + + if (argc == 0) { + if (nmc->ask) { + name_ask = nmc_readline (PROMPT_VPN_CONNECTION); + name = name_ask = name_ask ? g_strstrip (name_ask) : NULL; + out_name = out_name_ask = nmc_readline (_("Output file name: ")); + } else { + g_string_printf (nmc->return_text, _("Error: No arguments provided.")); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto finish; + } + } else { + if ( strcmp (*argv, "id") == 0 + || strcmp (*argv, "uuid") == 0 + || strcmp (*argv, "path") == 0) { + + selector = *argv; + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), + selector); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto finish; + } + } + name = *argv; + if (next_arg (&argc, &argv) == 0) + out_name = *argv; + + if (next_arg (&argc, &argv) == 0) { + g_string_printf (nmc->return_text, _("Error: unknown extra argument: '%s'."), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto finish; + } + } + + if (!name) { + g_string_printf (nmc->return_text, _("Error: connection ID is missing.")); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto finish; + } + connection = nmc_find_connection (nmc->connections, selector, name, NULL); + if (!connection) { + g_string_printf (nmc->return_text, _("Error: Unknown connection '%s'."), name); + nmc->return_value = NMC_RESULT_ERROR_NOT_FOUND; + goto finish; + } + + type = nm_connection_get_connection_type (connection); + if (g_strcmp0 (type, NM_SETTING_VPN_SETTING_NAME) != 0) { + g_string_printf (nmc->return_text, _("Error: the connection is not VPN.")); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto finish; + } + type = nm_setting_vpn_get_service_type (nm_connection_get_setting_vpn (connection)); + + /* Export VPN configuration */ + plugin = nm_vpn_get_plugin_by_service (type, &error); + if (!plugin) { + g_string_printf (nmc->return_text, _("Error: failed to load VPN plugin: %s."), + error->message); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto finish; + } + + if (out_name) + path = out_name; + else { + int fd; + fd = g_mkstemp (tmpfile); + if (fd == -1) { + g_string_printf (nmc->return_text, _("Error: failed to create temporary file %s."), tmpfile); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto finish; + } + close (fd); + path = tmpfile; + } + + if (!nm_vpn_editor_plugin_export (plugin, path, connection, &error)) { + g_string_printf (nmc->return_text, _("Error: failed to export '%s': %s."), + nm_connection_get_id (connection), error ? error->message : "(unknown)"); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto finish; + } + + /* No output file -> copy data to stdout */ + if (!out_name) { + char *contents = NULL; + gsize len = 0; + if (!g_file_get_contents (path, &contents, &len, &error)) { + g_string_printf (nmc->return_text, _("Error: failed to read temporary file '%s': %s."), + path, error->message); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto finish; + } + g_print ("%s", contents); + g_free (contents); + } + +finish: + if (!out_name && path) + unlink (path); + g_clear_error (&error); + g_free (name_ask); + g_free (out_name_ask); + return nmc->return_value; +} + typedef struct { NmCli *nmc; @@ -9189,6 +10801,32 @@ gen_func_connection_names (const char *text, int state) return ret; } +static char * +gen_func_active_connection_names (const char *text, int state) +{ + int i; + const GPtrArray *acs; + const char **connections; + char *ret; + + if (!nm_cli.client) + return NULL; + + acs = nm_client_get_active_connections (nm_cli.client); + if (!acs || acs->len == 0) + return NULL; + + connections = g_new (const char *, acs->len + 1); + for (i = 0; i < acs->len; i++) + connections[i] = nm_active_connection_get_id (acs->pdata[i]); + connections[i] = NULL; + + ret = nmc_rl_gen_func_basic (text, state, connections); + + g_free (connections); + return ret; +} + static char ** nmcli_con_tab_completion (const char *text, int start, int end) { @@ -9208,6 +10846,15 @@ nmcli_con_tab_completion (const char *text, int start, int end) generator_func = gen_func_connection_names; } else if (g_strcmp0 (rl_prompt, PROMPT_CONNECTIONS) == 0) { generator_func = gen_func_connection_names; + } else if (g_strcmp0 (rl_prompt, PROMPT_ACTIVE_CONNECTIONS) == 0) { + generator_func = gen_func_active_connection_names; + } else if (g_strcmp0 (rl_prompt, PROMPT_IMPORT_TYPE) == 0) { + generator_func = gen_func_vpn_types; + } else if (g_strcmp0 (rl_prompt, PROMPT_IMPORT_FILE) == 0) { + rl_attempted_completion_over = 0; + rl_complete_with_tilde_expansion = 1; + } else if (g_strcmp0 (rl_prompt, PROMPT_VPN_CONNECTION) == 0) { + generator_func = gen_vpn_ids; } if (generator_func) @@ -9216,6 +10863,66 @@ nmcli_con_tab_completion (const char *text, int start, int end) return match_array; } +static GArray * +parse_preferred_connection_order (const char *order, GError **error) +{ + char **strv, **iter; + const char *str; + GArray *order_arr; + NmcSortOrder val; + gboolean inverse, unique; + int i; + + strv = nmc_strsplit_set (order, ":", -1); + if (!strv || !*strv) { + g_set_error (error, NMCLI_ERROR, 0, + _("incorrect string '%s' of '--order' option"), order); + g_strfreev (strv); + return NULL; + } + + order_arr = g_array_sized_new (FALSE, FALSE, sizeof (NmcSortOrder), 4); + for (iter = strv; iter && *iter; iter++) { + str = *iter; + inverse = FALSE; + if (str[0] == '-') + inverse = TRUE; + if (str[0] == '+' || str[0] == '-') + str++; + + if (matches (str, "active") == 0) + val = inverse ? NMC_SORT_ACTIVE_INV : NMC_SORT_ACTIVE; + else if (matches (str, "name") == 0) + val = inverse ? NMC_SORT_NAME_INV : NMC_SORT_NAME; + else if (matches (str, "type") == 0) + val = inverse ? NMC_SORT_TYPE_INV : NMC_SORT_TYPE; + else if (matches (str, "path") == 0) + val = inverse ? NMC_SORT_PATH_INV : NMC_SORT_PATH; + else { + g_array_unref (order_arr); + order_arr = NULL; + g_set_error (error, NMCLI_ERROR, 0, + _("incorrect item '%s' in '--order' option"), *iter); + break; + } + /* Check for duplicates and ignore them. */ + unique = TRUE; + for (i = 0; i < order_arr->len; i++) { + if (abs (g_array_index (order_arr, NmcSortOrder, i)) - abs (val) == 0) { + unique = FALSE; + break; + } + } + + /* Value is ok and unique, add it to the array */ + if (unique) + g_array_append_val (order_arr, val); + } + + g_strfreev (strv); + return order_arr; +} + /* Entry point function for connections-related commands: 'nmcli connection' */ NMCResultCode do_connections (NmCli *nmc, int argc, char **argv) @@ -9258,26 +10965,43 @@ do_connections (NmCli *nmc, int argc, char **argv) if (argc == 0) { if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) goto opt_error; - nmc->return_value = do_connections_show (nmc, FALSE, FALSE, argc, argv); + nmc->return_value = do_connections_show (nmc, FALSE, FALSE, NULL, argc, argv); } else { if (matches (*argv, "show") == 0) { gboolean active = FALSE; gboolean show_secrets = FALSE; + GArray *order = NULL; int i; next_arg (&argc, &argv); /* check connection show options [--active] [--show-secrets] */ - for (i = 0; i < 2; i++) { + for (i = 0; i < 3; i++) { if (!active && nmc_arg_is_option (*argv, "active")) { active = TRUE; next_arg (&argc, &argv); } + /* --show-secrets is deprecated in favour of global --show-secrets */ + /* Keep it here for backwards compatibility */ if (!show_secrets && nmc_arg_is_option (*argv, "show-secrets")) { show_secrets = TRUE; next_arg (&argc, &argv); } + if (!order && nmc_arg_is_option (*argv, "order")) { + if (next_arg (&argc, &argv) != 0) { + g_set_error_literal (&error, NMCLI_ERROR, 0, + _("'--order' argument is missing")); + goto opt_error; + } + order = parse_preferred_connection_order (*argv, &error); + if (error) + goto opt_error; + next_arg (&argc, &argv); + } } - nmc->return_value = do_connections_show (nmc, active, show_secrets, argc, argv); + show_secrets = nmc->show_secrets || show_secrets; + nmc->return_value = do_connections_show (nmc, active, show_secrets, order, argc, argv); + if (order) + g_array_unref (order); } else if (matches(*argv, "up") == 0) { nmc->return_value = do_connection_up (nmc, argc-1, argv+1); } else if (matches(*argv, "down") == 0) { @@ -9285,7 +11009,7 @@ do_connections (NmCli *nmc, int argc, char **argv) } else if (matches(*argv, "add") == 0) { nmc->return_value = do_connection_add (nmc, argc-1, argv+1); } else if (matches(*argv, "edit") == 0) { - nmc->should_wait = TRUE; + nmc->should_wait++; editor_thread_data.nmc = nmc; editor_thread_data.argc = argc - 1; editor_thread_data.argv = argv + 1; @@ -9293,6 +11017,8 @@ do_connections (NmCli *nmc, int argc, char **argv) g_thread_unref (editor_thread); } else if (matches(*argv, "delete") == 0) { nmc->return_value = do_connection_delete (nmc, argc-1, argv+1); + } else if (matches(*argv, "monitor") == 0) { + nmc->return_value = do_connection_monitor (nmc, argc-1, argv+1); } else if (matches(*argv, "reload") == 0) { nmc->return_value = do_connection_reload (nmc, argc-1, argv+1); } else if (matches(*argv, "load") == 0) { @@ -9306,6 +11032,26 @@ do_connections (NmCli *nmc, int argc, char **argv) next_arg (&argc, &argv); } nmc->return_value = do_connection_modify (nmc, temporary, argc, argv); + } else if (matches (*argv, "clone") == 0) { + gboolean temporary = FALSE; + + next_arg (&argc, &argv); + if (nmc_arg_is_option (*argv, "temporary")) { + temporary = TRUE; + next_arg (&argc, &argv); + } + nmc->return_value = do_connection_clone (nmc, temporary, argc, argv); + } else if (matches(*argv, "import") == 0) { + gboolean temporary = FALSE; + + next_arg (&argc, &argv); + if (nmc_arg_is_option (*argv, "temporary")) { + temporary = TRUE; + next_arg (&argc, &argv); + } + nmc->return_value = do_connection_import (nmc, temporary, argc, argv); + } else if (matches(*argv, "export") == 0) { + nmc->return_value = do_connection_export (nmc, argc-1, argv+1); } else { usage (); g_string_printf (nmc->return_text, _("Error: '%s' is not valid 'connection' command."), *argv); @@ -9321,3 +11067,9 @@ opt_error: g_error_free (error); return nmc->return_value; } + +void +monitor_connections (NmCli *nmc) +{ + do_connection_monitor (nmc, 0, NULL); +} diff --git a/clients/cli/connections.h b/clients/cli/connections.h index c7368597..c158b634 100644 --- a/clients/cli/connections.h +++ b/clients/cli/connections.h @@ -24,4 +24,6 @@ NMCResultCode do_connections (NmCli *nmc, int argc, char **argv); +void monitor_connections (NmCli *nmc); + #endif /* NMC_CONNECTIONS_H */ diff --git a/clients/cli/devices.c b/clients/cli/devices.c index 70c8d5d5..c1df7fee 100644 --- a/clients/cli/devices.c +++ b/clients/cli/devices.c @@ -25,9 +25,7 @@ #include #include -#include -#include - +#include "nm-default.h" #include "nm-secret-agent-simple.h" #include "polkit-agent.h" #include "utils.h" @@ -40,14 +38,14 @@ /* Available fields for 'device status' */ static NmcOutputField nmc_fields_dev_status[] = { - {"DEVICE", N_("DEVICE"), 10}, /* 0 */ - {"TYPE", N_("TYPE"), 17}, /* 1 */ - {"STATE", N_("STATE"), 13}, /* 2 */ - {"DBUS-PATH", N_("DBUS-PATH"), 43}, /* 3 */ - {"CONNECTION", N_("CONNECTION"), 20}, /* 4 */ - {"CON-UUID", N_("CON-UUID"), 38}, /* 5 */ - {"CON-PATH", N_("CON-PATH"), 51}, /* 6 */ - {NULL, NULL, 0} + {"DEVICE", N_("DEVICE")}, /* 0 */ + {"TYPE", N_("TYPE")}, /* 1 */ + {"STATE", N_("STATE")}, /* 2 */ + {"DBUS-PATH", N_("DBUS-PATH")}, /* 3 */ + {"CONNECTION", N_("CONNECTION")}, /* 4 */ + {"CON-UUID", N_("CON-UUID")}, /* 5 */ + {"CON-PATH", N_("CON-PATH")}, /* 6 */ + {NULL, NULL} }; #define NMC_FIELDS_DEV_STATUS_ALL "DEVICE,TYPE,STATE,DBUS-PATH,CONNECTION,CON-UUID,CON-PATH" #define NMC_FIELDS_DEV_STATUS_COMMON "DEVICE,TYPE,STATE,CONNECTION" @@ -55,117 +53,119 @@ static NmcOutputField nmc_fields_dev_status[] = { /* Available fields for 'device show' - GENERAL part */ static NmcOutputField nmc_fields_dev_show_general[] = { - {"NAME", N_("NAME"), 10}, /* 0 */ - {"DEVICE", N_("DEVICE"), 10}, /* 1 */ - {"TYPE", N_("TYPE"), 17}, /* 2 */ - {"NM-TYPE", N_("NM-TYPE"), 17}, /* 3 */ - {"VENDOR", N_("VENDOR"), 20}, /* 4 */ - {"PRODUCT", N_("PRODUCT"), 50}, /* 5 */ - {"DRIVER", N_("DRIVER"), 9}, /* 6 */ - {"DRIVER-VERSION", N_("DRIVER-VERSION"), 18}, /* 7 */ - {"FIRMWARE-VERSION", N_("FIRMWARE-VERSION"), 18}, /* 8 */ - {"HWADDR", N_("HWADDR"), 19}, /* 9 */ - {"MTU", N_("MTU"), 10}, /* 10 */ - {"STATE", N_("STATE"), 14}, /* 11 */ - {"REASON", N_("REASON"), 25}, /* 12 */ - {"UDI", N_("UDI"), 64}, /* 13 */ - {"IP-IFACE", N_("IP-IFACE"), 10}, /* 14 */ - {"IS-SOFTWARE", N_("IS-SOFTWARE"), 15}, /* 15 */ - {"NM-MANAGED", N_("NM-MANAGED"), 15}, /* 16 */ - {"AUTOCONNECT", N_("AUTOCONNECT"), 15}, /* 17 */ - {"FIRMWARE-MISSING", N_("FIRMWARE-MISSING"), 18}, /* 18 */ - {"PHYS-PORT-ID", N_("PHYS-PORT-ID"), 18}, /* 19 */ - {"CONNECTION", N_("CONNECTION"), 20}, /* 20 */ - {"CON-UUID", N_("CON-UUID"), 38}, /* 21 */ - {"CON-PATH", N_("CON-PATH"), 51}, /* 22 */ - {"METERED", N_("METERED"), 10}, /* 23 */ - {NULL, NULL, 0} + {"NAME", N_("NAME")}, /* 0 */ + {"DEVICE", N_("DEVICE")}, /* 1 */ + {"TYPE", N_("TYPE")}, /* 2 */ + {"NM-TYPE", N_("NM-TYPE")}, /* 3 */ + {"VENDOR", N_("VENDOR")}, /* 4 */ + {"PRODUCT", N_("PRODUCT")}, /* 5 */ + {"DRIVER", N_("DRIVER")}, /* 6 */ + {"DRIVER-VERSION", N_("DRIVER-VERSION")}, /* 7 */ + {"FIRMWARE-VERSION", N_("FIRMWARE-VERSION")}, /* 8 */ + {"HWADDR", N_("HWADDR")}, /* 9 */ + {"MTU", N_("MTU")}, /* 10 */ + {"STATE", N_("STATE")}, /* 11 */ + {"REASON", N_("REASON")}, /* 12 */ + {"UDI", N_("UDI")}, /* 13 */ + {"IP-IFACE", N_("IP-IFACE")}, /* 14 */ + {"IS-SOFTWARE", N_("IS-SOFTWARE")}, /* 15 */ + {"NM-MANAGED", N_("NM-MANAGED")}, /* 16 */ + {"AUTOCONNECT", N_("AUTOCONNECT")}, /* 17 */ + {"FIRMWARE-MISSING", N_("FIRMWARE-MISSING")}, /* 18 */ + {"NM-PLUGIN-MISSING", N_("NM-PLUGIN-MISSING")}, /* 19 */ + {"PHYS-PORT-ID", N_("PHYS-PORT-ID")}, /* 20 */ + {"CONNECTION", N_("CONNECTION")}, /* 21 */ + {"CON-UUID", N_("CON-UUID")}, /* 22 */ + {"CON-PATH", N_("CON-PATH")}, /* 23 */ + {"METERED", N_("METERED")}, /* 24 */ + {NULL, NULL} }; #define NMC_FIELDS_DEV_SHOW_GENERAL_ALL "NAME,DEVICE,TYPE,NM-TYPE,VENDOR,PRODUCT,DRIVER,DRIVER-VERSION,FIRMWARE-VERSION,HWADDR,MTU,"\ - "STATE,REASON,UDI,IP-IFACE,IS-SOFTWARE,NM-MANAGED,AUTOCONNECT,FIRMWARE-MISSING,PHYS-PORT-ID,"\ - "CONNECTION,CON-UUID,CON-PATH,METERED" + "STATE,REASON,UDI,IP-IFACE,IS-SOFTWARE,NM-MANAGED,AUTOCONNECT,FIRMWARE-MISSING,NM-PLUGIN-MISSING,"\ + "PHYS-PORT-ID,CONNECTION,CON-UUID,CON-PATH,METERED" #define NMC_FIELDS_DEV_SHOW_GENERAL_COMMON "NAME,DEVICE,TYPE,VENDOR,PRODUCT,DRIVER,HWADDR,STATE" /* Available fields for 'device show' - CONNECTIONS part */ static NmcOutputField nmc_fields_dev_show_connections[] = { - {"NAME", N_("NAME"), 10}, /* 0 */ - {"AVAILABLE-CONNECTION-PATHS", N_("AVAILABLE-CONNECTION-PATHS"), 80}, /* 1 */ - {"AVAILABLE-CONNECTIONS", N_("AVAILABLE-CONNECTIONS"), 80}, /* 2 */ - {NULL, NULL, 0} + {"NAME", N_("NAME")}, /* 0 */ + {"AVAILABLE-CONNECTION-PATHS", N_("AVAILABLE-CONNECTION-PATHS")}, /* 1 */ + {"AVAILABLE-CONNECTIONS", N_("AVAILABLE-CONNECTIONS")}, /* 2 */ + {NULL, NULL} }; #define NMC_FIELDS_DEV_SHOW_CONNECTIONS_ALL "AVAILABLE-CONNECTION-PATHS,AVAILABLE-CONNECTIONS" #define NMC_FIELDS_DEV_SHOW_CONNECTIONS_COMMON "AVAILABLE-CONNECTION-PATHS,AVAILABLE-CONNECTIONS" /* Available fields for 'device show' - CAPABILITIES part */ static NmcOutputField nmc_fields_dev_show_cap[] = { - {"NAME", N_("NAME"), 13}, /* 0 */ - {"CARRIER-DETECT", N_("CARRIER-DETECT"), 16}, /* 1 */ - {"SPEED", N_("SPEED"), 10}, /* 2 */ - {"IS-SOFTWARE", N_("IS-SOFTWARE"), 12}, /* 3 */ - {NULL, NULL, 0} + {"NAME", N_("NAME")}, /* 0 */ + {"CARRIER-DETECT", N_("CARRIER-DETECT")}, /* 1 */ + {"SPEED", N_("SPEED")}, /* 2 */ + {"IS-SOFTWARE", N_("IS-SOFTWARE")}, /* 3 */ + {NULL, NULL} }; #define NMC_FIELDS_DEV_SHOW_CAP_ALL "NAME,CARRIER-DETECT,SPEED,IS-SOFTWARE" #define NMC_FIELDS_DEV_SHOW_CAP_COMMON "NAME,CARRIER-DETECT,SPEED,IS-SOFTWARE" /* Available fields for 'device show' - wired properties part */ static NmcOutputField nmc_fields_dev_show_wired_prop[] = { - {"NAME", N_("NAME"), 18}, /* 0 */ - {"CARRIER", N_("CARRIER"), 10}, /* 1 */ - {NULL, NULL, 0} + {"NAME", N_("NAME")}, /* 0 */ + {"CARRIER", N_("CARRIER")}, /* 1 */ + {"S390-SUBCHANNELS", N_("S390-SUBCHANNELS")}, /* 2 */ + {NULL, NULL} }; -#define NMC_FIELDS_DEV_SHOW_WIRED_PROP_ALL "NAME,CARRIER" -#define NMC_FIELDS_DEV_SHOW_WIRED_PROP_COMMON "NAME,CARRIER" +#define NMC_FIELDS_DEV_SHOW_WIRED_PROP_ALL "NAME,CARRIER,S390-SUBCHANNELS" +#define NMC_FIELDS_DEV_SHOW_WIRED_PROP_COMMON "NAME,CARRIER,S390-SUBCHANNELS" /* Available fields for 'device show' - wireless properties part */ static NmcOutputField nmc_fields_dev_show_wifi_prop[] = { - {"NAME", N_("NAME"), 18}, /* 0 */ - {"WEP", N_("WEP"), 5}, /* 1 */ - {"WPA", N_("WPA"), 5}, /* 2 */ - {"WPA2", N_("WPA2"), 6}, /* 3 */ - {"TKIP", N_("TKIP"), 6}, /* 4 */ - {"CCMP", N_("CCMP"), 6}, /* 5 */ - {"AP", N_("AP"), 6}, /* 6 */ - {"ADHOC", N_("ADHOC"), 6}, /* 7 */ - {"2GHZ", N_("2GHZ"), 10}, /* 8 */ - {"5GHZ", N_("5GHZ"), 10}, /* 9 */ - {NULL, NULL, 0} + {"NAME", N_("NAME")}, /* 0 */ + {"WEP", N_("WEP")}, /* 1 */ + {"WPA", N_("WPA")}, /* 2 */ + {"WPA2", N_("WPA2")}, /* 3 */ + {"TKIP", N_("TKIP")}, /* 4 */ + {"CCMP", N_("CCMP")}, /* 5 */ + {"AP", N_("AP")}, /* 6 */ + {"ADHOC", N_("ADHOC")}, /* 7 */ + {"2GHZ", N_("2GHZ")}, /* 8 */ + {"5GHZ", N_("5GHZ")}, /* 9 */ + {NULL, NULL} }; #define NMC_FIELDS_DEV_SHOW_WIFI_PROP_ALL "NAME,WEP,WPA,WPA2,TKIP,CCMP,AP,ADHOC,2GHZ,5GHZ" #define NMC_FIELDS_DEV_SHOW_WIFI_PROP_COMMON "NAME,WEP,WPA,WPA2,TKIP,CCMP,AP,ADHOC" /* Available fields for 'device show' - wimax properties part */ static NmcOutputField nmc_fields_dev_show_wimax_prop[] = { - {"NAME", N_("NAME"), 18}, /* 0 */ - {"CTR-FREQ", N_("CTR-FREQ"), 7}, /* 1 */ - {"RSSI", N_("RSSI"), 5}, /* 2 */ - {"CINR", N_("CINR"), 5}, /* 3 */ - {"TX-POW", N_("TX-POW"), 5}, /* 4 */ - {"BSID", N_("BSID"), 18}, /* 5 */ - {NULL, NULL, 0} + {"NAME", N_("NAME")}, /* 0 */ + {"CTR-FREQ", N_("CTR-FREQ")}, /* 1 */ + {"RSSI", N_("RSSI")}, /* 2 */ + {"CINR", N_("CINR")}, /* 3 */ + {"TX-POW", N_("TX-POW")}, /* 4 */ + {"BSID", N_("BSID")}, /* 5 */ + {NULL, NULL} }; #define NMC_FIELDS_DEV_SHOW_WIMAX_PROP_ALL "NAME,CTR-FREQ,RSSI,CINR,TX-POW,BSID" #define NMC_FIELDS_DEV_SHOW_WIMAX_PROP_COMMON "NAME,CTR-FREQ,RSSI,CINR,TX-POW,BSID" /* Available fields for 'device wifi list' */ static NmcOutputField nmc_fields_dev_wifi_list[] = { - {"NAME", N_("NAME"), 15}, /* 0 */ - {"SSID", N_("SSID"), 33}, /* 1 */ - {"SSID-HEX", N_("SSID-HEX"), 66}, /* 2 */ - {"BSSID", N_("BSSID"), 19}, /* 3 */ - {"MODE", N_("MODE"), 16}, /* 4 */ - {"CHAN", N_("CHAN"), 6}, /* 5 */ - {"FREQ", N_("FREQ"), 10}, /* 6 */ - {"RATE", N_("RATE"), 10}, /* 7 */ - {"SIGNAL", N_("SIGNAL"), 8}, /* 8 */ - {"BARS", N_("BARS"), 6}, /* 9 */ - {"SECURITY", N_("SECURITY"), 10}, /* 10 */ - {"WPA-FLAGS", N_("WPA-FLAGS"), 25}, /* 11 */ - {"RSN-FLAGS", N_("RSN-FLAGS"), 25}, /* 12 */ - {"DEVICE", N_("DEVICE"), 10}, /* 13 */ - {"ACTIVE", N_("ACTIVE"), 8}, /* 14 */ - {"IN-USE", N_("*"), 1}, /* 15 */ - {"DBUS-PATH", N_("DBUS-PATH"), 46}, /* 16 */ - {NULL, NULL, 0} + {"NAME", N_("NAME")}, /* 0 */ + {"SSID", N_("SSID")}, /* 1 */ + {"SSID-HEX", N_("SSID-HEX")}, /* 2 */ + {"BSSID", N_("BSSID")}, /* 3 */ + {"MODE", N_("MODE")}, /* 4 */ + {"CHAN", N_("CHAN")}, /* 5 */ + {"FREQ", N_("FREQ")}, /* 6 */ + {"RATE", N_("RATE")}, /* 7 */ + {"SIGNAL", N_("SIGNAL")}, /* 8 */ + {"BARS", N_("BARS")}, /* 9 */ + {"SECURITY", N_("SECURITY")}, /* 10 */ + {"WPA-FLAGS", N_("WPA-FLAGS")}, /* 11 */ + {"RSN-FLAGS", N_("RSN-FLAGS")}, /* 12 */ + {"DEVICE", N_("DEVICE")}, /* 13 */ + {"ACTIVE", N_("ACTIVE")}, /* 14 */ + {"IN-USE", N_("*")}, /* 15 */ + {"DBUS-PATH", N_("DBUS-PATH")}, /* 16 */ + {NULL, NULL} }; #define NMC_FIELDS_DEV_WIFI_LIST_ALL "SSID,SSID-HEX,BSSID,MODE,CHAN,FREQ,RATE,SIGNAL,BARS,SECURITY,"\ "WPA-FLAGS,RSN-FLAGS,DEVICE,ACTIVE,IN-USE,DBUS-PATH" @@ -174,14 +174,14 @@ static NmcOutputField nmc_fields_dev_wifi_list[] = { /* Available fields for 'device wimax list' */ static NmcOutputField nmc_fields_dev_wimax_list[] = { - {"NAME", N_("NAME"), 15}, /* 0 */ - {"NSP", N_("NSP"), 33}, /* 1 */ - {"SIGNAL", N_("SIGNAL"), 8}, /* 2 */ - {"TYPE", N_("TYPE"), 16}, /* 3 */ - {"DEVICE", N_("DEVICE"), 10}, /* 4 */ - {"ACTIVE", N_("ACTIVE"), 8}, /* 5 */ - {"DBUS-PATH", N_("DBUS-PATH"), 46}, /* 6 */ - {NULL, NULL, 0} + {"NAME", N_("NAME")}, /* 0 */ + {"NSP", N_("NSP")}, /* 1 */ + {"SIGNAL", N_("SIGNAL")}, /* 2 */ + {"TYPE", N_("TYPE")}, /* 3 */ + {"DEVICE", N_("DEVICE")}, /* 4 */ + {"ACTIVE", N_("ACTIVE")}, /* 5 */ + {"DBUS-PATH", N_("DBUS-PATH")}, /* 6 */ + {NULL, NULL} }; #define NMC_FIELDS_DEV_WIMAX_LIST_ALL "NSP,SIGNAL,TYPE,DEVICE,ACTIVE,DBUS-PATH" #define NMC_FIELDS_DEV_WIMAX_LIST_COMMON "NSP,SIGNAL,TYPE,DEVICE,ACTIVE" @@ -189,28 +189,28 @@ static NmcOutputField nmc_fields_dev_wimax_list[] = { /* Available fields for 'device show' - BOND, TEAM, BRIDGE part */ static NmcOutputField nmc_fields_dev_show_master_prop[] = { - {"NAME", N_("NAME"), 18}, /* 0 */ - {"SLAVES", N_("SLAVES"), 20}, /* 1 */ - {NULL, NULL, 0} + {"NAME", N_("NAME")}, /* 0 */ + {"SLAVES", N_("SLAVES")}, /* 1 */ + {NULL, NULL} }; #define NMC_FIELDS_DEV_SHOW_MASTER_PROP_ALL "NAME,SLAVES" #define NMC_FIELDS_DEV_SHOW_MASTER_PROP_COMMON "NAME,SLAVES" /* Available fields for 'device show' - VLAN part */ static NmcOutputField nmc_fields_dev_show_vlan_prop[] = { - {"NAME", N_("NAME"), 18}, /* 0 */ - {"PARENT", N_("PARENT"), 10}, /* 1 */ - {"ID", N_("ID"), 5}, /* 2 */ - {NULL, NULL, 0} + {"NAME", N_("NAME")}, /* 0 */ + {"PARENT", N_("PARENT")}, /* 1 */ + {"ID", N_("ID")}, /* 2 */ + {NULL, NULL} }; #define NMC_FIELDS_DEV_SHOW_VLAN_PROP_ALL "NAME,PARENT,ID" #define NMC_FIELDS_DEV_SHOW_VLAN_PROP_COMMON "NAME,PARENT,ID" /* Available fields for 'device show' - BLUETOOTH part */ static NmcOutputField nmc_fields_dev_show_bluetooth[] = { - {"NAME", N_("NAME"), 0}, /* 0 */ - {"CAPABILITIES", N_("CAPABILITIES"), 0}, /* 1 */ - {NULL, NULL, 0} + {"NAME", N_("NAME")}, /* 0 */ + {"CAPABILITIES", N_("CAPABILITIES")}, /* 1 */ + {NULL, NULL} }; #define NMC_FIELDS_DEV_SHOW_BLUETOOTH_ALL "NAME,CAPABILITIES" #define NMC_FIELDS_DEV_SHOW_BLUETOOTH_COMMON "NAME,CAPABILITIES" @@ -242,18 +242,36 @@ static NmcOutputField nmc_fields_dev_show_sections[] = { {"CONNECTIONS", N_("CONNECTIONS"), 0, nmc_fields_dev_show_connections + 1 }, /* 16 */ {NULL, NULL, 0, NULL } }; -#if WITH_WIMAX -#define NMC_FIELDS_DEV_SHOW_SECTIONS_ALL "GENERAL,CAPABILITIES,BOND,TEAM,BRIDGE,VLAN,WIFI-PROPERTIES,AP,WIRED-PROPERTIES,"\ - "WIMAX-PROPERTIES,NSP,BLUETOOTH,CONNECTIONS,IP4,DHCP4,IP6,DHCP6" -#define NMC_FIELDS_DEV_SHOW_SECTIONS_COMMON "GENERAL.DEVICE,GENERAL.TYPE,GENERAL.HWADDR,GENERAL.MTU,GENERAL.STATE,"\ - "GENERAL.CONNECTION,GENERAL.CON-PATH,WIRED-PROPERTIES,IP4,IP6" -#else #define NMC_FIELDS_DEV_SHOW_SECTIONS_ALL "GENERAL,CAPABILITIES,BOND,TEAM,BRIDGE,VLAN,WIFI-PROPERTIES,AP,WIRED-PROPERTIES,"\ "BLUETOOTH,CONNECTIONS,IP4,DHCP4,IP6,DHCP6" #define NMC_FIELDS_DEV_SHOW_SECTIONS_COMMON "GENERAL.DEVICE,GENERAL.TYPE,GENERAL.HWADDR,GENERAL.MTU,GENERAL.STATE,"\ "GENERAL.CONNECTION,GENERAL.CON-PATH,WIRED-PROPERTIES,IP4,IP6" -#endif +/* Available fields for 'device lldp' */ +static NmcOutputField nmc_fields_dev_lldp_list[] = { + {"NAME", N_("NAME")}, /* 0 */ + {"DEVICE", N_("DEVICE")}, /* 1 */ + {"CHASSIS-ID", N_("CHASSIS-ID")}, /* 2 */ + {"PORT-ID", N_("PORT-ID")}, /* 3 */ + {"PORT-DESCRIPTION", N_("PORT-DESCRIPTION")}, /* 4 */ + {"SYSTEM-NAME", N_("SYSTEM-NAME")}, /* 5 */ + {"SYSTEM-DESCRIPTION", N_("SYSTEM-DESCRIPTION")}, /* 6 */ + {"SYSTEM-CAPABILITIES", N_("SYSTEM-CAPABILITIES")}, /* 7 */ + {"IEEE-802-1-PVID", N_("IEEE-802-1-PVID")}, /* 8 */ + {"IEEE-802-1-PPVID", N_("IEEE-802-1-PPVID")}, /* 9 */ + {"IEEE-802-1-PPVID-FLAGS", N_("IEEE-802-1-PPVID-FLAGS")}, /* 10 */ + {"IEEE-802-1-VID", N_("IEEE-802-1-VID")}, /* 11 */ + {"IEEE-802-1-VLAN-NAME", N_("IEEE-802-1-VLAN-NAME")}, /* 12 */ + {"DESTINATION", N_("DESTINATION")}, /* 13 */ + {"CHASSIS-ID-TYPE", N_("CHASSIS-ID-TYPE")}, /* 14 */ + {"PORT-ID-TYPE", N_("PORT-ID-TYPE")}, /* 15 */ + {NULL, NULL} +}; +#define NMC_FIELDS_DEV_LLDP_LIST_ALL "DEVICE,CHASSIS-ID,PORT-ID,PORT-DESCRIPTION,SYSTEM-NAME,SYSTEM-DESCRIPTION," \ + "SYSTEM-CAPABILITIES,IEEE-802-1-PVID,IEEE-802-1-PPVID,IEEE-802-1-PPVID-FLAGS," \ + "IEEE-802-1-VID,IEEE-802-1-VLAN-NAME,DESTINATION,CHASSIS-ID-TYPE,PORT-ID-TYPE" +#define NMC_FIELDS_DEV_LLDP_LIST_COMMON "DEVICE,CHASSIS-ID,PORT-ID,PORT-DESCRIPTION,SYSTEM-NAME,SYSTEM-DESCRIPTION," \ + "SYSTEM-CAPABILITIES" /* glib main loop variable - defined in nmcli.c */ extern GMainLoop *loop; @@ -264,23 +282,21 @@ static void usage (void) { g_printerr (_("Usage: nmcli device { COMMAND | help }\n\n" -#if WITH_WIMAX - "COMMAND := { status | show | connect | disconnect | delete | wifi | wimax }\n\n" -#else - "COMMAND := { status | show | connect | disconnect | delete | wifi }\n\n" -#endif + "COMMAND := { status | show | connect | reapply | disconnect | delete | monitor | wifi | lldp }\n\n" " status\n\n" " show []\n\n" + " set [ifname] [autoconnect yes|no] [managed yes|no]\n\n" " connect \n\n" + " reapply ...\n\n" " disconnect ...\n\n" " delete ...\n\n" + " monitor ...\n\n" " wifi [list [ifname ] [bssid ]]\n\n" " wifi connect <(B)SSID> [password ] [wep-key-type key|phrase] [ifname ]\n" " [bssid ] [name ] [private yes|no] [hidden yes|no]\n\n" + " wifi hotspot [ifname ] [con-name ] [ssid ] [band a|bg] [channel ] [password ]\n\n" " wifi rescan [ifname ] [[ssid ] ...]\n\n" -#if WITH_WIMAX - " wimax [list [ifname ] [nsp ]]\n\n" -#endif + " lldp [list [ifname ]]\n\n" )); } @@ -322,6 +338,17 @@ usage_device_connect (void) "It will also consider connections that are not set to auto-connect.\n\n")); } +static void +usage_device_reapply (void) +{ + g_printerr (_("Usage: nmcli device reapply { ARGUMENTS | help }\n" + "\n" + "ARGUMENTS := ...\n" + "\n" + "Attempts to update device with changes to the currently active connection\n" + "made since it was last applied.\n\n")); +} + static void usage_device_disconnect (void) { @@ -347,6 +374,31 @@ usage_device_delete (void) "command.\n\n")); } +static void +usage_device_set (void) +{ + g_printerr (_("Usage: nmcli device set { ARGUMENTS | help }\n" + "\n" + "ARGUMENTS := DEVICE { PROPERTY [ PROPERTY ... ] }\n" + "DEVICE := [ifname] \n" + "PROPERTY := { autoconnect { yes | no } |\n" + " { managed { yes | no }\n" + "\n" + "Modify device properties.\n\n")); +} + +static void +usage_device_monitor (void) +{ + g_printerr (_("Usage: nmcli device monitor { ARGUMENTS | help }\n" + "\n" + "ARGUMENTS := [] ...\n" + "\n" + "Monitor device activity.\n" + "This command prints a line whenever the specified devices change state.\n" + "Monitors all devices in case no interface is specified.\n\n")); +} + static void usage_device_wifi (void) { @@ -371,6 +423,19 @@ usage_device_wifi (void) "only open, WEP and WPA-PSK networks are supported at the moment. It is also\n" "assumed that IP configuration is obtained via DHCP.\n" "\n" + "ARGUMENTS := wifi hotspot [ifname ] [con-name ] [ssid ]\n" + " [band a|bg] [channel ] [password ]\n" + "\n" + "Create a Wi-Fi hotspot. Use 'connection down' or 'device disconnect'\n" + "to stop the hotspot.\n" + "Parameters of the hotspot can be influenced by the optional parameters:\n" + "ifname - Wi-Fi device to use\n" + "con-name - name of the created hotspot connection profile\n" + "ssid - SSID of the hotspot\n" + "band - Wi-Fi band to use\n" + "channel - Wi-Fi channel to use\n" + "password - password to use for the hotspot\n" + "\n" "ARGUMENTS := rescan [ifname ] [[ssid ] ...]\n" "\n" "Request that NetworkManager immediately re-scan for available access points.\n" @@ -381,20 +446,16 @@ usage_device_wifi (void) "use 'nmcli device wifi list' for that.\n\n")); } -#if WITH_WIMAX static void -usage_device_wimax (void) +usage_device_lldp (void) { - g_printerr (_("Usage: nmcli device wimax { ARGUMENTS | help }\n" + g_printerr (_("Usage: nmcli device lldp { ARGUMENTS | help }\n" "\n" - "Perform operation on WiMAX devices.\n" + "ARGUMENTS := [list [ifname ]]\n" "\n" - "ARGUMENTS := [list [ifname ] [nsp ]]\n" - "\n" - "List available WiMAX NSPs. The 'ifname' and 'nsp' options can be used to\n" - "list networks for a particular interface, or with a specific NSP.\n\n")); + "List neighboring devices discovered through LLDP. The 'ifname' option can be\n" + "used to list neighbors for a particular interface.\n\n")); } -#endif /* quit main loop */ static void @@ -445,6 +506,117 @@ get_devices_sorted (NMClient *client) return sorted; } +static GSList * +device_list (NmCli *nmc, int argc, char **argv) +{ + int arg_num = argc; + char **arg_arr = NULL; + char **arg_ptr = argv; + NMDevice **devices; + GSList *queue = NULL; + NMDevice *device; + int i; + + if (argc == 0) { + if (nmc->ask) { + char *line = nmc_readline (PROMPT_INTERFACES); + nmc_string_to_arg_array (line, NULL, FALSE, &arg_arr, &arg_num); + g_free (line); + arg_ptr = arg_arr; + } + if (arg_num == 0) { + g_string_printf (nmc->return_text, _("Error: No interface specified.")); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + } + + devices = get_devices_sorted (nmc->client); + while (arg_num > 0) { + device = NULL; + for (i = 0; devices[i]; i++) { + if (!g_strcmp0 (nm_device_get_iface (devices[i]), *arg_ptr)) { + device = devices[i]; + break; + } + } + + if (device) { + if (!g_slist_find (queue, device)) + queue = g_slist_prepend (queue, device); + else + g_printerr (_("Warning: argument '%s' is duplicated.\n"), *arg_ptr); + } else { + g_printerr (_("Error: Device '%s' not found.\n"), *arg_ptr); + g_string_printf (nmc->return_text, _("Error: not all devices found.")); + nmc->return_value = NMC_RESULT_ERROR_NOT_FOUND; + } + + /* Take next argument */ + next_arg (&arg_num, &arg_ptr); + } + g_free (devices); + +error: + g_strfreev (arg_arr); + + return queue; +} + +static int +compare_aps (gconstpointer a, gconstpointer b, gpointer user_data) +{ + NMAccessPoint *apa = *(NMAccessPoint **)a; + NMAccessPoint *apb = *(NMAccessPoint **)b; + int cmp; + + cmp = nm_access_point_get_strength (apb) - nm_access_point_get_strength (apa); + if (cmp != 0) + return cmp; + + cmp = nm_access_point_get_frequency (apa) - nm_access_point_get_frequency (apb); + if (cmp != 0) + return cmp; + + return nm_access_point_get_max_bitrate (apb) - nm_access_point_get_max_bitrate (apa); +} + +static GPtrArray * +sort_access_points (const GPtrArray *aps) +{ + GPtrArray *sorted; + int i; + + sorted = g_ptr_array_sized_new (aps->len); + for (i = 0; aps && i < aps->len; i++) + g_ptr_array_add (sorted, aps->pdata[i]); + g_ptr_array_sort_with_data (sorted, compare_aps, NULL); + return sorted; +} + +typedef struct { + NmcTermColor color; + NmcTermFormat color_fmt; +} ColorInfo; + +static ColorInfo +wifi_signal_to_color (guint8 strength) +{ + ColorInfo color_info = { NMC_TERM_COLOR_NORMAL, NMC_TERM_FORMAT_NORMAL }; + + if (strength > 80) + color_info.color = NMC_TERM_COLOR_GREEN; + else if (strength > 55) + color_info.color = NMC_TERM_COLOR_YELLOW; + else if (strength > 30) + color_info.color = NMC_TERM_COLOR_MAGENTA; + else if (strength > 5) + color_info.color = NMC_TERM_COLOR_CYAN; + else + color_info.color_fmt = NMC_TERM_FORMAT_DIM; + return color_info; +} + static char * ap_wpa_rsn_flags_to_string (NM80211ApSecurityFlags flags) { @@ -514,6 +686,7 @@ fill_output_access_point (gpointer data, gpointer user_data) GString *security_str; char *ap_name; const char *sig_bars; + ColorInfo color_info; if (info->active_bssid) { const char *current_bssid = nm_access_point_get_bssid (ap); @@ -599,59 +772,18 @@ fill_output_access_point (gpointer data, gpointer user_data) set_val_strc (arr, 15, active ? "*" : " "); set_val_strc (arr, 16, nm_object_get_path (NM_OBJECT (ap))); + /* Set colors */ + color_info = wifi_signal_to_color (strength); + set_val_color_all (arr, color_info.color); + set_val_color_fmt_all (arr, color_info.color_fmt); + if (active) + arr[15].color = NMC_TERM_COLOR_GREEN; + g_ptr_array_add (info->nmc->output_data, arr); g_string_free (security_str, FALSE); } -#if WITH_WIMAX -static void -fill_output_wimax_nsp (NMWimaxNsp *nsp, NmCli *nmc, NMDevice *dev, int idx, guint32 o_flags) -{ - NMDeviceWimax *wimax = NM_DEVICE_WIMAX (dev); - char *nsp_name, *quality_str; - const char *ntype; - gboolean active = FALSE; - NmcOutputField *arr; - - switch (nm_wimax_nsp_get_network_type (nsp)) { - case NM_WIMAX_NSP_NETWORK_TYPE_HOME: - ntype = _("Home"); - break; - case NM_WIMAX_NSP_NETWORK_TYPE_PARTNER: - ntype = _("Partner"); - break; - case NM_WIMAX_NSP_NETWORK_TYPE_ROAMING_PARTNER: - ntype = _("Roaming"); - break; - default: - ntype = _("Unknown"); - break; - } - - if (nm_device_get_state (dev) == NM_DEVICE_STATE_ACTIVATED) { - if (nsp == nm_device_wimax_get_active_nsp (wimax)) - active = TRUE; - } - - quality_str = g_strdup_printf ("%u", nm_wimax_nsp_get_signal_quality (nsp)); - nsp_name = g_strdup_printf ("NSP[%d]", idx); /* NSP */ - - arr = nmc_dup_fields_array (nmc_fields_dev_wimax_list, - sizeof (nmc_fields_dev_wimax_list), - o_flags); - set_val_str (arr, 0, nsp_name); - set_val_strc (arr, 1, nm_wimax_nsp_get_name (nsp)); - set_val_str (arr, 2, quality_str); - set_val_strc (arr, 3, ntype); - set_val_strc (arr, 4, nm_device_get_iface (dev)); - set_val_strc (arr, 5, active ? _("yes") : _("no")); - set_val_strc (arr, 6, nm_object_get_path (NM_OBJECT (nsp))); - - g_ptr_array_add (nmc->output_data, arr); -} -#endif - static char * bluetooth_caps_to_string (NMBluetoothCapabilities caps) { @@ -857,12 +989,12 @@ show_device_info (NMDevice *device, NmCli *nmc) set_val_strc (arr, 16, nm_device_get_managed (device) ? _("yes") : _("no")); set_val_strc (arr, 17, nm_device_get_autoconnect (device) ? _("yes") : _("no")); set_val_strc (arr, 18, nm_device_get_firmware_missing (device) ? _("yes") : _("no")); - set_val_strc (arr, 19, nm_device_get_physical_port_id (device)); - set_val_strc (arr, 20, get_active_connection_id (device)); - set_val_strc (arr, 21, acon ? nm_active_connection_get_uuid (acon) : NULL); - set_val_strc (arr, 22, acon ? nm_object_get_path (NM_OBJECT (acon)) : NULL); - set_val_strc (arr, 23, nmc_device_metered_to_string (nm_device_get_metered (device))); - + set_val_strc (arr, 19, nm_device_get_nm_plugin_missing (device) ? _("yes") : _("no")); + set_val_strc (arr, 20, nm_device_get_physical_port_id (device)); + set_val_strc (arr, 21, get_active_connection_id (device)); + set_val_strc (arr, 22, acon ? nm_active_connection_get_uuid (acon) : NULL); + set_val_strc (arr, 23, acon ? nm_object_get_path (NM_OBJECT (acon)) : NULL); + set_val_strc (arr, 24, nmc_device_metered_to_string (nm_device_get_metered (device))); g_ptr_array_add (nmc->output_data, arr); print_data (nmc); /* Print all data */ @@ -906,7 +1038,7 @@ show_device_info (NMDevice *device, NmCli *nmc) NMDeviceWifiCapabilities wcaps; NMAccessPoint *active_ap = NULL; const char *active_bssid = NULL; - const GPtrArray *aps; + GPtrArray *aps; /* section WIFI-PROPERTIES */ if (!strcasecmp (nmc_fields_dev_show_sections[section_idx].name, nmc_fields_dev_show_sections[2].name)) { @@ -959,8 +1091,9 @@ show_device_info (NMDevice *device, NmCli *nmc) info->output_flags = NMC_OF_FLAG_SECTION_PREFIX; info->active_bssid = active_bssid; info->device = nm_device_get_iface (device); - aps = nm_device_wifi_get_access_points (NM_DEVICE_WIFI (device)); + aps = sort_access_points (nm_device_wifi_get_access_points (NM_DEVICE_WIFI (device))); g_ptr_array_foreach ((GPtrArray *) aps, fill_output_access_point, (gpointer) info); + g_ptr_array_free (aps, FALSE); g_free (info); print_data (nmc); /* Print all data */ was_output = TRUE; @@ -979,84 +1112,13 @@ show_device_info (NMDevice *device, NmCli *nmc) set_val_strc (arr, 0, nmc_fields_dev_show_sections[4].name); /* "WIRED-PROPERTIES" */ set_val_strc (arr, 1, (nm_device_ethernet_get_carrier (NM_DEVICE_ETHERNET (device))) ? _("on") : _("off")); + set_val_arrc (arr, 2, ((const char **) nm_device_ethernet_get_s390_subchannels (NM_DEVICE_ETHERNET (device)))); g_ptr_array_add (nmc->output_data, arr); print_data (nmc); /* Print all data */ was_output = TRUE; } } -#if WITH_WIMAX - else if (NM_IS_DEVICE_WIMAX (device)) { - /* WIMAX-PROPERTIES */ - if (!strcasecmp (nmc_fields_dev_show_sections[section_idx].name, nmc_fields_dev_show_sections[5].name)) { - char *cfreq = NULL, *rssi = NULL, *cinr = NULL, *txpow = NULL; - guint tmp_uint; - gint tmp_int; - - /* Field names */ - tmpl = nmc_fields_dev_show_wimax_prop; - tmpl_len = sizeof (nmc_fields_dev_show_wimax_prop); - nmc->print_fields.indices = parse_output_fields (section_fld ? section_fld : NMC_FIELDS_DEV_SHOW_WIMAX_PROP_ALL, - tmpl, FALSE, NULL, NULL); - arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_FIELD_NAMES); - g_ptr_array_add (nmc->output_data, arr); - - /* Center frequency */ - tmp_uint = nm_device_wimax_get_center_frequency (NM_DEVICE_WIMAX (device)); - if (tmp_uint) - cfreq = g_strdup_printf ("%'.1f MHz", (double) tmp_uint / 1000.0); - - /* RSSI */ - tmp_int = nm_device_wimax_get_rssi (NM_DEVICE_WIMAX (device)); - if (tmp_int) - rssi = g_strdup_printf ("%d dBm", tmp_int); - - /* CINR */ - tmp_int = nm_device_wimax_get_cinr (NM_DEVICE_WIMAX (device)); - if (tmp_int) - cinr = g_strdup_printf ("%d dB", tmp_int); - - /* TX Power */ - tmp_int = nm_device_wimax_get_tx_power (NM_DEVICE_WIMAX (device)); - if (tmp_int) - txpow = g_strdup_printf ("%'.2f dBm", (float) tmp_int / 2.0); - - arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX); - set_val_strc (arr, 0, nmc_fields_dev_show_sections[5].name); /* "WIMAX-PROPERTIES" */ - set_val_str (arr, 1, cfreq); - set_val_str (arr, 2, rssi); - set_val_str (arr, 3, cinr); - set_val_str (arr, 4, txpow); - set_val_strc (arr, 5, nm_device_wimax_get_bsid (NM_DEVICE_WIMAX (device))); - g_ptr_array_add (nmc->output_data, arr); - - print_data (nmc); /* Print all data */ - was_output = TRUE; - } - - /* section NSP */ - if (!strcasecmp (nmc_fields_dev_show_sections[section_idx].name, nmc_fields_dev_show_sections[6].name)) { - const GPtrArray *nsps; - int g, idx = 1; - - tmpl = nmc_fields_dev_wimax_list; - tmpl_len = sizeof (nmc_fields_dev_wimax_list); - nmc->print_fields.indices = parse_output_fields (section_fld ? section_fld : NMC_FIELDS_DEV_WIMAX_LIST_FOR_DEV_LIST, - tmpl, FALSE, NULL, NULL); - arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_FIELD_NAMES); - g_ptr_array_add (nmc->output_data, arr); - - nsps = nm_device_wimax_get_nsps (NM_DEVICE_WIMAX (device)); - for (g = 0; g < nsps->len; g++) { - NMWimaxNsp *nsp = g_ptr_array_index (nsps, g); - - fill_output_wimax_nsp (nsp, nmc, device, idx++, NMC_OF_FLAG_SECTION_PREFIX); - } - print_data (nmc); /* Print all data */ - was_output = TRUE; - } - } -#endif /* IP configuration info */ cfg4 = nm_device_get_ip4_config (device); @@ -1201,19 +1263,43 @@ show_device_info (NMDevice *device, NmCli *nmc) return TRUE; } +static ColorInfo +device_state_to_color (NMDeviceState state) +{ + ColorInfo color_info = { NMC_TERM_COLOR_NORMAL, NMC_TERM_FORMAT_NORMAL }; + + if (state <= NM_DEVICE_STATE_UNAVAILABLE) + color_info.color_fmt= NMC_TERM_FORMAT_DIM; + else if (state == NM_DEVICE_STATE_DISCONNECTED) + color_info.color = NMC_TERM_COLOR_RED; + else if (state >= NM_DEVICE_STATE_PREPARE && state <= NM_DEVICE_STATE_SECONDARIES) + color_info.color = NMC_TERM_COLOR_YELLOW; + else if (state == NM_DEVICE_STATE_ACTIVATED) + color_info.color = NMC_TERM_COLOR_GREEN; + return color_info; +} + static void fill_output_device_status (NMDevice *device, NmCli *nmc) { NMActiveConnection *ac; + NMDeviceState state; + ColorInfo color_info; NmcOutputField *arr = nmc_dup_fields_array (nmc_fields_dev_status, sizeof (nmc_fields_dev_status), 0); + state = nm_device_get_state (device); ac = nm_device_get_active_connection (device); + /* Show devices in color */ + color_info = device_state_to_color (state); + set_val_color_all (arr, color_info.color); + set_val_color_fmt_all (arr, color_info.color_fmt); + set_val_strc (arr, 0, nm_device_get_iface (device)); set_val_strc (arr, 1, nm_device_get_type_description (device)); - set_val_strc (arr, 2, nmc_device_state_to_string (nm_device_get_state (device))); + set_val_strc (arr, 2, nmc_device_state_to_string (state)); set_val_strc (arr, 3, nm_object_get_path (NM_OBJECT (device))); set_val_strc (arr, 4, get_active_connection_id (device)); set_val_strc (arr, 5, ac ? nm_active_connection_get_uuid (ac) : NULL); @@ -1408,6 +1494,7 @@ connected_state_cb (NMDevice *device, NMActiveConnection *active) typedef struct { NmCli *nmc; NMDevice *device; + gboolean hotspot; } AddAndActivateInfo; static void @@ -1425,8 +1512,12 @@ add_and_activate_cb (GObject *client, active = nm_client_add_and_activate_connection_finish (NM_CLIENT (client), result, &error); if (error) { - g_string_printf (nmc->return_text, _("Error: Failed to add/activate new connection: %s"), - error->message); + if (info->hotspot) + g_string_printf (nmc->return_text, _("Error: Failed to setup a Wi-Fi hotspot: %s"), + error->message); + else + g_string_printf (nmc->return_text, _("Error: Failed to add/activate new connection: %s"), + error->message); g_error_free (error); nmc->return_value = NMC_RESULT_ERROR_CON_ACTIVATION; quit (); @@ -1434,7 +1525,10 @@ add_and_activate_cb (GObject *client, state = nm_active_connection_get_state (active); if (state == NM_ACTIVE_CONNECTION_STATE_UNKNOWN) { - g_string_printf (nmc->return_text, _("Error: Failed to add/activate new connection: Unknown error")); + if (info->hotspot) + g_string_printf (nmc->return_text, _("Error: Failed to setup a Wi-Fi hotspot")); + else + g_string_printf (nmc->return_text, _("Error: Failed to add/activate new connection: Unknown error")); nmc->return_value = NMC_RESULT_ERROR_CON_ACTIVATION; g_object_unref (active); quit (); @@ -1445,8 +1539,12 @@ add_and_activate_cb (GObject *client, if (state == NM_ACTIVE_CONNECTION_STATE_ACTIVATED) { if (nmc->print_output == NMC_PRINT_PRETTY) nmc_terminal_erase_line (); - g_print (_("Connection with UUID '%s' created and activated on device '%s'\n"), - nm_active_connection_get_uuid (active), nm_device_get_iface (device)); + if (info->hotspot) + g_print (_("Connection with UUID '%s' created and activated on device '%s'\n"), + nm_active_connection_get_uuid (active), nm_device_get_iface (device)); + else + g_print (_("Hotspot '%s' activated on device '%s'\n"), + nm_active_connection_get_id (active), nm_device_get_iface (device)); } g_object_unref (active); quit (); @@ -1615,7 +1713,7 @@ do_device_connect (NmCli *nmc, int argc, char **argv) * till connect_device_cb() is called, giving NM time to check our permissions. */ nmc->nowait_flag = (nmc->timeout == 0); - nmc->should_wait = TRUE; + nmc->should_wait++; /* Create secret agent */ nmc->secret_agent = nm_secret_agent_simple_new ("nmcli-connect"); @@ -1625,6 +1723,7 @@ do_device_connect (NmCli *nmc, int argc, char **argv) info = g_malloc0 (sizeof (AddAndActivateInfo)); info->nmc = nmc; info->device = device; + info->hotspot = FALSE; nm_client_activate_connection_async (nmc->client, NULL, /* let NM find a connection automatically */ @@ -1727,17 +1826,16 @@ device_cb_info_finish (DeviceCbInfo *info, NMDevice *device) } static void -disconnect_device_cb (GObject *object, GAsyncResult *result, gpointer user_data) +reapply_device_cb (GObject *object, GAsyncResult *result, gpointer user_data) { NMDevice *device = NM_DEVICE (object); DeviceCbInfo *info = (DeviceCbInfo *) user_data; NmCli *nmc = info->nmc; - NMDeviceState state; GError *error = NULL; - if (!nm_device_disconnect_finish (device, result, &error)) { - g_string_printf (nmc->return_text, _("Error: not all devices disconnected.")); - g_printerr (_("Error: Device '%s' (%s) disconnecting failed: %s\n"), + if (!nm_device_reapply_finish (device, result, &error)) { + g_string_printf (nmc->return_text, _("Error: not all connections reapplied.")); + g_printerr (_("Error: Reapplying connection to device '%s' (%s) failed: %s\n"), nm_device_get_iface (device), nm_object_get_path (NM_OBJECT (device)), error->message); @@ -1745,23 +1843,16 @@ disconnect_device_cb (GObject *object, GAsyncResult *result, gpointer user_data) nmc->return_value = NMC_RESULT_ERROR_DEV_DISCONNECT; device_cb_info_finish (info, device); } else { - state = nm_device_get_state (device); - - if (nmc->nowait_flag || state <= NM_DEVICE_STATE_DISCONNECTED) { - /* Don't want to wait or device already disconnected */ - if (state <= NM_DEVICE_STATE_DISCONNECTED) { - if (nmc->print_output == NMC_PRINT_PRETTY) - nmc_terminal_erase_line (); - g_print (_("Device '%s' successfully disconnected.\n"), - nm_device_get_iface (device)); - } - device_cb_info_finish (info, device); - } + if (nmc->print_output == NMC_PRINT_PRETTY) + nmc_terminal_erase_line (); + g_print (_("Connection successfully reapplied to device '%s'.\n"), + nm_device_get_iface (device)); + device_cb_info_finish (info, device); } } static NMCResultCode -do_device_disconnect (NmCli *nmc, int argc, char **argv) +do_device_reapply (NmCli *nmc, int argc, char **argv) { NMDevice **devices; NMDevice *device; @@ -1772,7 +1863,7 @@ do_device_disconnect (NmCli *nmc, int argc, char **argv) int arg_num = argc; int i; - /* Set default timeout for disconnect operation. */ + /* Set default timeout for reapply operation. */ if (nmc->timeout == -1) nmc->timeout = 10; @@ -1823,6 +1914,76 @@ do_device_disconnect (NmCli *nmc, int argc, char **argv) } queue = g_slist_reverse (queue); + info = g_slice_new0 (DeviceCbInfo); + info->nmc = nmc; + + nmc->nowait_flag = (nmc->timeout == 0); + nmc->should_wait = TRUE; + + for (iter = queue; iter; iter = g_slist_next (iter)) { + device = iter->data; + + info->queue = g_slist_prepend (info->queue, g_object_ref (device)); + + /* Now reapply the connection to the device */ + nm_device_reapply_async (device, NULL, 0, NULL, reapply_device_cb, info); + } + +error: + g_strfreev (arg_arr); + g_slist_free (queue); + return nmc->return_value; +} + +static void +disconnect_device_cb (GObject *object, GAsyncResult *result, gpointer user_data) +{ + NMDevice *device = NM_DEVICE (object); + DeviceCbInfo *info = (DeviceCbInfo *) user_data; + NmCli *nmc = info->nmc; + NMDeviceState state; + GError *error = NULL; + + if (!nm_device_disconnect_finish (device, result, &error)) { + g_string_printf (nmc->return_text, _("Error: not all devices disconnected.")); + g_printerr (_("Error: Device '%s' (%s) disconnecting failed: %s\n"), + nm_device_get_iface (device), + nm_object_get_path (NM_OBJECT (device)), + error->message); + g_error_free (error); + nmc->return_value = NMC_RESULT_ERROR_DEV_DISCONNECT; + device_cb_info_finish (info, device); + } else { + state = nm_device_get_state (device); + if (nmc->nowait_flag || state <= NM_DEVICE_STATE_DISCONNECTED) { + /* Don't want to wait or device already disconnected */ + if (state <= NM_DEVICE_STATE_DISCONNECTED) { + if (nmc->print_output == NMC_PRINT_PRETTY) + nmc_terminal_erase_line (); + g_print (_("Device '%s' successfully disconnected.\n"), + nm_device_get_iface (device)); + } + device_cb_info_finish (info, device); + } + } +} + +static NMCResultCode +do_device_disconnect (NmCli *nmc, int argc, char **argv) +{ + NMDevice *device; + DeviceCbInfo *info = NULL; + GSList *queue, *iter; + + /* Set default timeout for disconnect operation. */ + if (nmc->timeout == -1) + nmc->timeout = 10; + + queue = device_list (nmc, argc, argv); + if (!queue) + goto error; + queue = g_slist_reverse (queue); + info = g_slice_new0 (DeviceCbInfo); info->nmc = nmc; info->cmd_disconnect = TRUE; @@ -1833,7 +1994,7 @@ do_device_disconnect (NmCli *nmc, int argc, char **argv) G_CALLBACK (device_removed_cb), info); nmc->nowait_flag = (nmc->timeout == 0); - nmc->should_wait = TRUE; + nmc->should_wait++; for (iter = queue; iter; iter = g_slist_next (iter)) { device = iter->data; @@ -1847,7 +2008,6 @@ do_device_disconnect (NmCli *nmc, int argc, char **argv) } error: - g_strfreev (arg_arr); g_slist_free (queue); return nmc->return_value; } @@ -1878,71 +2038,17 @@ delete_device_cb (GObject *object, GAsyncResult *result, gpointer user_data) static NMCResultCode do_device_delete (NmCli *nmc, int argc, char **argv) { - NMDevice **devices; NMDevice *device; DeviceCbInfo *info = NULL; - GSList *queue = NULL, *iter; - char **arg_arr = NULL; - char **arg_ptr = argv; - int arg_num = argc; - int i; + GSList *queue, *iter; /* Set default timeout for delete operation. */ if (nmc->timeout == -1) nmc->timeout = 10; - if (argc == 0) { - if (nmc->ask) { - char *line = nmc_readline (PROMPT_INTERFACES); - nmc_string_to_arg_array (line, NULL, FALSE, &arg_arr, &arg_num); - g_free (line); - arg_ptr = arg_arr; - } - if (arg_num == 0) { - g_string_printf (nmc->return_text, _("Error: No interface specified.")); - nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; - goto error; - } - } - - devices = get_devices_sorted (nmc->client); - while (arg_num > 0) { - device = NULL; - for (i = 0; devices[i]; i++) { - if (!g_strcmp0 (nm_device_get_iface (devices[i]), *arg_ptr)) { - device = devices[i]; - break; - } - } - - if (device) { - if (!g_slist_find (queue, device)) { - if (nm_device_is_software (device)) - queue = g_slist_prepend (queue, device); - else { - g_printerr (_("Error: Device '%s' is a hardware device. It can't be deleted.\n"), - *arg_ptr); - g_string_printf (nmc->return_text, _("Error: not all devices valid.")); - nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; - } - } else - g_printerr (_("Warning: argument '%s' is duplicated.\n"), *arg_ptr); - } else { - g_printerr (_("Error: Device '%s' not found.\n"), *arg_ptr); - g_string_printf (nmc->return_text, _("Error: not all devices found.")); - nmc->return_value = NMC_RESULT_ERROR_NOT_FOUND; - } - - /* Take next argument */ - next_arg (&arg_num, &arg_ptr); - } - g_free (devices); - - if (!queue) { - g_string_printf (nmc->return_text, _("Error: no valid device provided.")); - nmc->return_value = NMC_RESULT_ERROR_NOT_FOUND; + queue = device_list (nmc, argc, argv); + if (!queue) goto error; - } queue = g_slist_reverse (queue); info = g_slice_new0 (DeviceCbInfo); @@ -1954,7 +2060,7 @@ do_device_delete (NmCli *nmc, int argc, char **argv) G_CALLBACK (device_removed_cb), info); nmc->nowait_flag = (nmc->timeout == 0); - nmc->should_wait = TRUE; + nmc->should_wait++; for (iter = queue; iter; iter = g_slist_next (iter)) { device = iter->data; @@ -1966,17 +2072,225 @@ do_device_delete (NmCli *nmc, int argc, char **argv) } error: - g_strfreev (arg_arr); g_slist_free (queue); return nmc->return_value; } +static NMCResultCode +do_device_set (NmCli *nmc, int argc, char **argv) +{ +#define DEV_SET_AUTOCONNECT 0 +#define DEV_SET_MANAGED 1 + NMDevice **devices; + NMDevice *device = NULL; + const char *ifname = NULL; + int i; + struct { + int idx; + gboolean value; + } values[2] = { + [DEV_SET_AUTOCONNECT] = { -1 }, + [DEV_SET_MANAGED] = { -1 }, + }; + + if (argc >= 1 && g_strcmp0 (*argv, "ifname") == 0) { + argc--; + argv++; + } + + if (argc == 0) { + g_string_printf (nmc->return_text, _("Error: No interface specified.")); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } else + ifname = *argv; + + if (!ifname) { + g_string_printf (nmc->return_text, _("Error: No interface specified.")); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + + devices = get_devices_sorted (nmc->client); + for (i = 0; devices[i]; i++) { + NMDevice *candidate = devices[i]; + const char *dev_iface = nm_device_get_iface (candidate); + + if (!g_strcmp0 (dev_iface, ifname)) + device = candidate; + } + g_free (devices); + + if (!device) { + g_string_printf (nmc->return_text, _("Error: Device '%s' not found."), ifname); + nmc->return_value = NMC_RESULT_ERROR_NOT_FOUND; + goto error; + } + + if (argc == 1) { + g_string_printf (nmc->return_text, _("Error: No property specified.")); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + + i = 0; + while (next_arg (&argc, &argv) == 0) { + gboolean flag; + gs_free_error GError *tmp_err = NULL; + + if (matches (*argv, "managed") == 0) { + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: '%s' argument is missing."), *(argv-1)); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + if (!nmc_string_to_bool (*argv, &flag, &tmp_err)) { + g_string_printf (nmc->return_text, _("Error: 'managed': %s."), + tmp_err->message); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + values[DEV_SET_MANAGED].idx = ++i; + values[DEV_SET_MANAGED].value = flag; + } + else if (matches (*argv, "autoconnect") == 0) { + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: '%s' argument is missing."), *(argv-1)); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + if (!nmc_string_to_bool (*argv, &flag, &tmp_err)) { + g_string_printf (nmc->return_text, _("Error: 'autoconnect': %s."), + tmp_err->message); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + values[DEV_SET_AUTOCONNECT].idx = ++i; + values[DEV_SET_AUTOCONNECT].value = flag; + } + else { + usage_device_set (); + g_string_printf (nmc->return_text, _("Error: property '%s' is not known."), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + } + + /* when multiple properties are specified, set them in the order as they + * are specified on the command line. */ + if ( values[DEV_SET_AUTOCONNECT].idx >= 0 + && values[DEV_SET_MANAGED].idx >= 0 + && values[DEV_SET_MANAGED].idx < values[DEV_SET_AUTOCONNECT].idx) { + nm_device_set_managed (device, values[DEV_SET_MANAGED].value); + values[DEV_SET_MANAGED].idx = -1; + } + if (values[DEV_SET_AUTOCONNECT].idx >= 0) + nm_device_set_autoconnect (device, values[DEV_SET_AUTOCONNECT].value); + if (values[DEV_SET_MANAGED].idx >= 0) + nm_device_set_managed (device, values[DEV_SET_MANAGED].value); + +error: + quit (); + return nmc->return_value; +} + +static void +device_state (NMDevice *device, GParamSpec *pspec, NmCli *nmc) +{ + NMDeviceState state = nm_device_get_state (device); + ColorInfo color = device_state_to_color (state); + char *str = nmc_colorize (nmc, color.color, color.color_fmt, "%s: %s\n", + nm_device_get_iface (device), + nmc_device_state_to_string (state)); + + g_print ("%s", str); + g_free (str); +} + +static void +device_ac (NMDevice *device, GParamSpec *pspec, NmCli *nmc) +{ + NMActiveConnection *ac = nm_device_get_active_connection (device); + const char *id = ac ? nm_active_connection_get_id (ac) : NULL; + + if (!id) + return; + + g_print (_("%s: using connection '%s'\n"), nm_device_get_iface (device), id); +} + +static void +device_watch (NmCli *nmc, NMDevice *device) +{ + nmc->should_wait++; + g_signal_connect (device, "notify::" NM_DEVICE_STATE, G_CALLBACK (device_state), nmc); + g_signal_connect (device, "notify::" NM_DEVICE_ACTIVE_CONNECTION, G_CALLBACK (device_ac), nmc); +} + +static void +device_unwatch (NmCli *nmc, NMDevice *device) +{ + g_signal_handlers_disconnect_by_func (device, device_state, nmc); + if (g_signal_handlers_disconnect_by_func (device, device_ac, nmc)) + nmc->should_wait--; + + /* Terminate if all the watched devices disappeared. */ + if (!nmc->should_wait) + quit (); +} + +static void +device_added (NMClient *client, NMDevice *device, NmCli *nmc) +{ + g_print (_("%s: device created\n"), nm_device_get_iface (device)); + device_watch (nmc, NM_DEVICE (device)); +} + +static void +device_removed (NMClient *client, NMDevice *device, NmCli *nmc) +{ + g_print (_("%s: device removed\n"), nm_device_get_iface (device)); + device_unwatch (nmc, device); +} + +static NMCResultCode +do_device_monitor (NmCli *nmc, int argc, char **argv) +{ + if (argc == 0) { + /* No devices specified. Monitor all. */ + const GPtrArray *devices = nm_client_get_devices (nmc->client); + int i; + + for (i = 0; i < devices->len; i++) + device_watch (nmc, g_ptr_array_index (devices, i)); + + /* We'll watch the device additions too, never exit. */ + nmc->should_wait++; + g_signal_connect (nmc->client, NM_CLIENT_DEVICE_ADDED, G_CALLBACK (device_added), nmc); + } else { + /* Monitor just the specified devices. */ + GSList *queue = device_list (nmc, argc, argv); + GSList *iter; + + if (!queue) + return nmc->return_value; + + for (iter = queue; iter; iter = g_slist_next (iter)) + device_watch (nmc, NM_DEVICE (iter->data)); + g_slist_free (queue); + } + + g_signal_connect (nmc->client, NM_CLIENT_DEVICE_REMOVED, G_CALLBACK (device_removed), nmc); + + return NMC_RESULT_SUCCESS; +} + static void show_access_point_info (NMDevice *device, NmCli *nmc) { NMAccessPoint *active_ap = NULL; const char *active_bssid = NULL; - const GPtrArray *aps; + GPtrArray *aps; APInfo *info; NmcOutputField *arr; @@ -1995,8 +2309,9 @@ show_access_point_info (NMDevice *device, NmCli *nmc) info->output_flags = 0; info->active_bssid = active_bssid; info->device = nm_device_get_iface (device); - aps = nm_device_wifi_get_access_points (NM_DEVICE_WIFI (device)); + aps = sort_access_points (nm_device_wifi_get_access_points (NM_DEVICE_WIFI (device))); g_ptr_array_foreach ((GPtrArray *) aps, fill_output_access_point, (gpointer) info); + g_ptr_array_free (aps, FALSE); print_data (nmc); /* Print all data */ nmc_empty_output_fields (nmc); @@ -2566,7 +2881,7 @@ do_device_wifi_connect_network (NmCli *nmc, int argc, char **argv) if (ap_flags & NM_802_11_AP_FLAGS_PRIVACY) { /* Ask for missing password when one is expected and '--ask' is used */ if (!password && nmc->ask) - password = passwd_ask = nmc_readline (_("Password: ")); + password = passwd_ask = nmc_readline_echo (nmc->show_secrets, _("Password: ")); if (password) { if (!connection) @@ -2600,11 +2915,12 @@ do_device_wifi_connect_network (NmCli *nmc, int argc, char **argv) * the user doesn't want to wait, in order to give NM time to check our * permissions. */ nmc->nowait_flag = (nmc->timeout == 0); - nmc->should_wait = TRUE; + nmc->should_wait++; info = g_malloc0 (sizeof (AddAndActivateInfo)); info->nmc = nmc; info->device = device; + info->hotspot = FALSE; nm_client_add_and_activate_connection_async (nmc->client, connection, @@ -2625,6 +2941,345 @@ error: return nmc->return_value; } +static GBytes * +generate_ssid_for_hotspot (const char *ssid) +{ + GBytes *ssid_bytes; + char *hotspot_ssid = NULL; + + if (!ssid) { + hotspot_ssid = g_strdup_printf ("Hotspot-%s", g_get_host_name ()); + if (strlen (hotspot_ssid) > 32) + hotspot_ssid[32] = '\0'; + ssid = hotspot_ssid; + } + ssid_bytes = g_bytes_new (ssid, strlen (ssid)); + g_free (hotspot_ssid); + return ssid_bytes; +} + +#define WPA_PASSKEY_SIZE 8 +static void +generate_wpa_key (char *key, size_t len) +{ + guint i; + + g_return_if_fail (key); + g_return_if_fail (len > WPA_PASSKEY_SIZE); + + /* generate a 8-chars ASCII WPA key */ + for (i = 0; i < WPA_PASSKEY_SIZE; i++) { + int c; + c = g_random_int_range (33, 126); + /* too many non alphanumeric characters are hard to remember for humans */ + while (!g_ascii_isalnum (c)) + c = g_random_int_range (33, 126); + + key[i] = (gchar) c; + } + key[WPA_PASSKEY_SIZE] = '\0'; +} + +static void +generate_wep_key (char *key, size_t len) +{ + int i; + const char *hexdigits = "0123456789abcdef"; + + g_return_if_fail (key); + g_return_if_fail (len > 10); + + /* generate a 10-digit hex WEP key */ + for (i = 0; i < 10; i++) { + int digit; + digit = g_random_int_range (0, 16); + key[i] = hexdigits[digit]; + } + key[10] = '\0'; +} + +static gboolean +set_wireless_security_for_hotspot (NMSettingWirelessSecurity *s_wsec, + const char *wifi_mode, + NMDeviceWifiCapabilities caps, + const char *password, + gboolean show_password, + GError **error) +{ + char generated_key[11]; + const char *key; + const char *key_mgmt; + + if (g_strcmp0 (wifi_mode, NM_SETTING_WIRELESS_MODE_AP) == 0) { + if (caps & NM_WIFI_DEVICE_CAP_RSN) { + nm_setting_wireless_security_add_proto (s_wsec, "rsn"); + nm_setting_wireless_security_add_pairwise (s_wsec, "ccmp"); + nm_setting_wireless_security_add_group (s_wsec, "ccmp"); + key_mgmt = "wpa-psk"; + } else if (caps & NM_WIFI_DEVICE_CAP_WPA) { + nm_setting_wireless_security_add_proto (s_wsec, "wpa"); + nm_setting_wireless_security_add_pairwise (s_wsec, "tkip"); + nm_setting_wireless_security_add_group (s_wsec, "tkip"); + key_mgmt = "wpa-psk"; + } else + key_mgmt = "none"; + } else + key_mgmt = "none"; + + if (g_strcmp0 (key_mgmt, "wpa-psk") == 0) { + /* use WPA */ + if (password) { + if (!nm_utils_wpa_psk_valid (password)) { + g_set_error (error, NMCLI_ERROR, 0, _("'%s' is not valid WPA PSK"), password); + return FALSE; + } + key = password; + } else { + generate_wpa_key (generated_key, sizeof (generated_key)); + key = generated_key; + } + g_object_set (s_wsec, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, key_mgmt, + NM_SETTING_WIRELESS_SECURITY_PSK, key, + NULL); + } else { + /* use WEP */ + if (password) { + if (!nm_utils_wep_key_valid (password, NM_WEP_KEY_TYPE_KEY)) { + g_set_error (error, NMCLI_ERROR, 0, + _("'%s' is not valid WEP key (it should be 5 or 13 ASCII chars)"), + password); + return FALSE; + } + key = password; + } else { + generate_wep_key (generated_key, sizeof (generated_key)); + key = generated_key; + } + g_object_set (s_wsec, + NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, key_mgmt, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY0, key, + NM_SETTING_WIRELESS_SECURITY_WEP_KEY_TYPE, NM_WEP_KEY_TYPE_KEY, + NULL); + } + if (show_password) + g_print (_("Hotspot password: %s\n"), key); + + return TRUE; +} + +static NMCResultCode +do_device_wifi_hotspot (NmCli *nmc, int argc, char **argv) +{ + AddAndActivateInfo *info; + const char *ifname = NULL; + const char *con_name = NULL; + char *default_name = NULL; + const char *ssid = NULL; + const char *wifi_mode; + const char *band = NULL; + const char *channel = NULL; + unsigned long channel_int; + const char *password = NULL; + gboolean show_password = FALSE; + NMDevice *device = NULL; + int devices_idx; + const GPtrArray *devices; + NMDeviceWifiCapabilities caps; + NMConnection *connection = NULL; + NMSettingConnection *s_con; + NMSettingWireless *s_wifi; + NMSettingWirelessSecurity *s_wsec; + NMSettingIPConfig *s_ip4, *s_ip6; + GBytes *ssid_bytes; + GError *error = NULL; + + /* Set default timeout waiting for operation completion. */ + if (nmc->timeout == -1) + nmc->timeout = 60; + + while (argc > 0) { + if (strcmp (*argv, "ifname") == 0) { + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1)); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + ifname = *argv; + } else if (strcmp (*argv, "con-name") == 0) { + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1)); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + con_name = *argv; + } else if (strcmp (*argv, "ssid") == 0) { + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1)); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + ssid = *argv; + if (strlen (ssid) > 32) { + g_string_printf (nmc->return_text, _("Error: ssid is too long.")); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + } else if (strcmp (*argv, "band") == 0) { + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1)); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + band = *argv; + if (strcmp (band, "a") && strcmp (band, "bg")) { + g_string_printf (nmc->return_text, _("Error: band argument value '%s' is invalid; use 'a' or 'bg'."), + band); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + } else if (strcmp (*argv, "channel") == 0) { + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1)); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + channel = *argv; + } else if (strcmp (*argv, "password") == 0) { + if (next_arg (&argc, &argv) != 0) { + g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1)); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + password = *argv; + /* --show-password is deprecated in favour of global --show-secrets option */ + /* Keep it here for backwards compatibility */ + } else if (nmc_arg_is_option (*argv, "show-password")) { + show_password = TRUE; + } else { + g_string_printf (nmc->return_text, _("Error: Unknown parameter %s."), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + + argc--; + argv++; + } + show_password = nmc->show_secrets || show_password; + + /* Verify band and channel parameters */ + if (!channel) { + if (g_strcmp0 (band, "bg") == 0) + channel = "1"; + if (g_strcmp0 (band, "a") == 0) + channel = "7"; + } + if (channel) { + if (!band) { + g_string_printf (nmc->return_text, _("Error: channel requires band too.")); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + if ( !nmc_string_to_uint (channel, TRUE, 1, 5825, &channel_int) + || !nm_utils_wifi_is_channel_valid (channel_int, band)) { + g_string_printf (nmc->return_text, _("Error: channel '%s' not valid for band '%s'."), + channel, band); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + } + + /* Find Wi-Fi device. When no ifname is provided, the first Wi-Fi is used. */ + devices = nm_client_get_devices (nmc->client); + devices_idx = 0; + device = find_wifi_device_by_iface (devices, ifname, &devices_idx); + + if (!device) { + if (ifname) + g_string_printf (nmc->return_text, _("Error: Device '%s' is not a Wi-Fi device."), ifname); + else + g_string_printf (nmc->return_text, _("Error: No Wi-Fi device found.")); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + + /* Check device supported mode */ + caps = nm_device_wifi_get_capabilities (NM_DEVICE_WIFI (device)); + if (caps & NM_WIFI_DEVICE_CAP_AP) + wifi_mode = NM_SETTING_WIRELESS_MODE_AP; + else if (caps & NM_WIFI_DEVICE_CAP_ADHOC) + wifi_mode = NM_SETTING_WIRELESS_MODE_ADHOC; + else { + g_string_printf (nmc->return_text, _("Error: Device '%s' supports neither AP nor Ad-Hoc mode."), + nm_device_get_iface (device)); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + goto error; + } + + /* Create a connection with appropriate parameters */ + connection = nm_simple_connection_new (); + s_con = (NMSettingConnection *) nm_setting_connection_new (); + nm_connection_add_setting (connection, NM_SETTING (s_con)); + if (!con_name) + con_name = default_name = nmc_unique_connection_name (nm_client_get_connections (nmc->client), "Hotspot"); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, con_name, + NM_SETTING_CONNECTION_AUTOCONNECT, FALSE, + NULL); + g_free (default_name); + + s_wifi = (NMSettingWireless *) nm_setting_wireless_new (); + nm_connection_add_setting (connection, NM_SETTING (s_wifi)); + ssid_bytes = generate_ssid_for_hotspot (ssid); + g_object_set (s_wifi, NM_SETTING_WIRELESS_MODE, wifi_mode, + NM_SETTING_WIRELESS_SSID, ssid_bytes, + NULL); + g_bytes_unref (ssid_bytes); + if (channel) + g_object_set (s_wifi, + NM_SETTING_WIRELESS_CHANNEL, (guint32) channel_int, + NM_SETTING_WIRELESS_BAND, band, + NULL); + + s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new (); + nm_connection_add_setting (connection, NM_SETTING (s_wsec)); + if (!set_wireless_security_for_hotspot (s_wsec, wifi_mode, caps, password, show_password, &error)) { + g_object_unref (connection); + g_string_printf (nmc->return_text, _("Error: Invalid 'password': %s."), error->message); + nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; + g_clear_error (&error); + goto error; + } + + s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new (); + nm_connection_add_setting (connection, NM_SETTING (s_ip4)); + g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_SHARED, NULL); + + s_ip6 = (NMSettingIPConfig *) nm_setting_ip6_config_new (); + nm_connection_add_setting (connection, NM_SETTING (s_ip6)); + g_object_set (s_ip6, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_IGNORE, NULL); + + /* Activate the connection now */ + nmc->nowait_flag = (nmc->timeout == 0); + nmc->should_wait = TRUE; + + info = g_malloc0 (sizeof (AddAndActivateInfo)); + info->nmc = nmc; + info->device = device; + info->hotspot = TRUE; + + nm_client_add_and_activate_connection_async (nmc->client, + connection, + device, + NULL, + NULL, + add_and_activate_cb, + info); + +error: + return nmc->return_value; +} + static void request_rescan_cb (GObject *object, GAsyncResult *result, gpointer user_data) { @@ -2653,8 +3308,6 @@ do_device_wifi_rescan (NmCli *nmc, int argc, char **argv) const char *ssid; int i; - nmc->should_wait = TRUE; - ssids = g_ptr_array_new (); /* Get the parameters */ @@ -2722,7 +3375,7 @@ do_device_wifi_rescan (NmCli *nmc, int argc, char **argv) g_ptr_array_free (ssids, FALSE); return nmc->return_value; error: - nmc->should_wait = FALSE; + nmc->should_wait++; g_ptr_array_free (ssids, FALSE); return nmc->return_value; } @@ -2737,6 +3390,8 @@ do_device_wifi (NmCli *nmc, int argc, char **argv) nmc->return_value = do_device_wifi_list (nmc, argc-1, argv+1); } else if (matches (*argv, "connect") == 0) { nmc->return_value = do_device_wifi_connect_network (nmc, argc-1, argv+1); + } else if (matches (*argv, "hotspot") == 0) { + nmc->return_value = do_device_wifi_hotspot (nmc, argc-1, argv+1); } else if (matches (*argv, "rescan") == 0) { nmc->return_value = do_device_wifi_rescan (nmc, argc-1, argv+1); } else { @@ -2748,46 +3403,98 @@ do_device_wifi (NmCli *nmc, int argc, char **argv) return nmc->return_value; } -#if WITH_WIMAX -static void -show_nsp_info (NMDevice *device, NmCli *nmc) +static int +show_device_lldp_list (NMDevice *device, NmCli *nmc, char *fields_str, int *counter) { - const GPtrArray *nsps; - int i, idx = 1; - NmcOutputField *arr; + NmcOutputField *tmpl, *arr; + GPtrArray *neighbors; + size_t tmpl_len; + const char *str; + int i; - /* Add headers (field names) */ - arr = nmc_dup_fields_array (nmc_fields_dev_wimax_list, sizeof (nmc_fields_dev_wimax_list), - NMC_OF_FLAG_MAIN_HEADER_ADD | NMC_OF_FLAG_FIELD_NAMES); + neighbors = nm_device_get_lldp_neighbors (device); + + if (!neighbors || !neighbors->len) + return 0; + + tmpl = nmc_fields_dev_lldp_list; + tmpl_len = sizeof (nmc_fields_dev_lldp_list); + + /* Main header name */ + nmc->print_fields.header_name = (char *) construct_header_name (_("Device LLDP neighbors"), + nm_device_get_iface (device)); + nmc->print_fields.indices = parse_output_fields (fields_str, nmc_fields_dev_lldp_list, FALSE, NULL, NULL); + arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_MAIN_HEADER_ADD | NMC_OF_FLAG_FIELD_NAMES); g_ptr_array_add (nmc->output_data, arr); - nsps = nm_device_wimax_get_nsps (NM_DEVICE_WIMAX (device)); - for (i = 0; i < nsps->len; i++) { - NMWimaxNsp *nsp = g_ptr_array_index (nsps, i); + for (i = 0; i < neighbors->len; i++) { + NMLldpNeighbor *neighbor = neighbors->pdata[i]; + guint value; + + arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX); + set_val_str (arr, 0, g_strdup_printf ("NEIGHBOR[%d]", (*counter)++)); + + set_val_strc (arr, 1, nm_device_get_iface (device)); + + if (nm_lldp_neighbor_get_attr_string_value (neighbor, NM_LLDP_ATTR_CHASSIS_ID, &str)) + set_val_strc (arr, 2, str); + + if (nm_lldp_neighbor_get_attr_string_value (neighbor, NM_LLDP_ATTR_PORT_ID, &str)) + set_val_strc (arr, 3, str); + + if (nm_lldp_neighbor_get_attr_string_value (neighbor, NM_LLDP_ATTR_PORT_DESCRIPTION, &str)) + set_val_strc (arr, 4, str); + + if (nm_lldp_neighbor_get_attr_string_value (neighbor, NM_LLDP_ATTR_SYSTEM_NAME, &str)) + set_val_strc (arr, 5, str); + + if (nm_lldp_neighbor_get_attr_string_value (neighbor, NM_LLDP_ATTR_SYSTEM_DESCRIPTION, &str)) + set_val_strc (arr, 6, str); + + if (nm_lldp_neighbor_get_attr_uint_value (neighbor, NM_LLDP_ATTR_SYSTEM_CAPABILITIES, &value)) + set_val_str (arr, 7, g_strdup_printf ("%u (%s)", value, nmc_parse_lldp_capabilities (value))); + + if (nm_lldp_neighbor_get_attr_uint_value (neighbor, NM_LLDP_ATTR_IEEE_802_1_PVID, &value)) + set_val_str (arr, 8, g_strdup_printf ("%u", value)); + + if (nm_lldp_neighbor_get_attr_uint_value (neighbor, NM_LLDP_ATTR_IEEE_802_1_PPVID, &value)) + set_val_str (arr, 9, g_strdup_printf ("%u", value)); + + if (nm_lldp_neighbor_get_attr_uint_value (neighbor, NM_LLDP_ATTR_IEEE_802_1_PPVID_FLAGS, &value)) + set_val_str (arr, 10, g_strdup_printf ("%u", value)); + + if (nm_lldp_neighbor_get_attr_uint_value (neighbor, NM_LLDP_ATTR_IEEE_802_1_VID, &value)) + set_val_str (arr, 11, g_strdup_printf ("%u", value)); + + if (nm_lldp_neighbor_get_attr_string_value (neighbor, NM_LLDP_ATTR_IEEE_802_1_VLAN_NAME, &str)) + set_val_strc (arr, 12, str); - fill_output_wimax_nsp (nsp, nmc, device, idx++, 0); + if (nm_lldp_neighbor_get_attr_string_value (neighbor, NM_LLDP_ATTR_DESTINATION, &str)) + set_val_strc (arr, 13, str); + + if (nm_lldp_neighbor_get_attr_uint_value (neighbor, NM_LLDP_ATTR_CHASSIS_ID_TYPE, &value)) + set_val_strc (arr, 14, g_strdup_printf ("%u", value)); + + if (nm_lldp_neighbor_get_attr_uint_value (neighbor, NM_LLDP_ATTR_PORT_ID_TYPE, &value)) + set_val_strc (arr, 15, g_strdup_printf ("%u", value)); + + g_ptr_array_add (nmc->output_data, arr); } - print_data (nmc); /* Print all data */ + + print_data (nmc); nmc_empty_output_fields (nmc); + + return neighbors->len; } -static NMCResultCode -do_device_wimax_list (NmCli *nmc, int argc, char **argv) +static gboolean +do_device_lldp_list (NmCli *nmc, int argc, char **argv) { + NMDevice *device = NULL, **devices = NULL; GError *error = NULL; - NMDevice *device = NULL; - NMWimaxNsp *nsp = NULL; const char *ifname = NULL; - const char *nsp_user = NULL; - const GPtrArray *devices; - const GPtrArray *nsps; - int i, j; char *fields_str; - char *fields_all = NMC_FIELDS_DEV_WIMAX_LIST_ALL; - char *fields_common = NMC_FIELDS_DEV_WIMAX_LIST_COMMON; - NmcOutputField *tmpl, *arr; - size_t tmpl_len; - const char *base_hdr = _("WiMAX NSP list"); + int i, counter = 0; while (argc > 0) { if (strcmp (*argv, "ifname") == 0) { @@ -2797,44 +3504,43 @@ do_device_wimax_list (NmCli *nmc, int argc, char **argv) goto error; } ifname = *argv; - } else if (strcmp (*argv, "nsp") == 0) { - if (next_arg (&argc, &argv) != 0) { - g_string_printf (nmc->return_text, _("Error: %s argument is missing."), *(argv-1)); - nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; - goto error; - } - nsp_user = *argv; } else { - g_printerr (_("Unknown parameter: %s\n"), *argv); + g_string_printf (nmc->return_text, _("Error: unknown parameter: %s"), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; } argc--; argv++; } + if (argc > 0) { + g_string_printf (nmc->return_text, _("Error: invalid extra argument '%s'."), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto error; + } + if (!nmc->required_fields || strcasecmp (nmc->required_fields, "common") == 0) - fields_str = fields_common; + fields_str = NMC_FIELDS_DEV_LLDP_LIST_COMMON; else if (!nmc->required_fields || strcasecmp (nmc->required_fields, "all") == 0) - fields_str = fields_all; + fields_str = NMC_FIELDS_DEV_LLDP_LIST_ALL; else fields_str = nmc->required_fields; - tmpl = nmc_fields_dev_wimax_list; - tmpl_len = sizeof (nmc_fields_dev_wimax_list); - nmc->print_fields.indices = parse_output_fields (fields_str, tmpl, FALSE, NULL, &error); + nmc->print_fields.indices = parse_output_fields (fields_str, nmc_fields_dev_lldp_list, FALSE, NULL, &error); if (error) { - g_string_printf (nmc->return_text, _("Error: 'device wimax': %s"), error->message); + g_string_printf (nmc->return_text, _("Error: 'device lldp list': %s"), error->message); g_error_free (error); nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; - goto error; + return nmc->return_value; } - devices = nm_client_get_devices (nmc->client); + devices = get_devices_sorted (nmc->client); + if (ifname) { - /* Device specified - list only NSPs of this interface */ - for (i = 0; i < devices->len; i++) { - NMDevice *candidate = g_ptr_array_index (devices, i); + for (i = 0; devices[i]; i++) { + NMDevice *candidate = devices[i]; const char *dev_iface = nm_device_get_iface (candidate); if (!g_strcmp0 (dev_iface, ifname)) { @@ -2849,126 +3555,34 @@ do_device_wimax_list (NmCli *nmc, int argc, char **argv) goto error; } - /* Main header name */ - nmc->print_fields.header_name = (char *) construct_header_name (base_hdr, ifname); - - if (NM_IS_DEVICE_WIMAX (device)) { - if (nsp_user) { - /* Specific NSP requested - list only that */ - nsps = nm_device_wimax_get_nsps (NM_DEVICE_WIMAX (device)); - for (j = 0, nsp = NULL; j < nsps->len; j++) { - NMWimaxNsp *candidate_nsp = g_ptr_array_index (nsps, j); - const char *candidate_name = nm_wimax_nsp_get_name (candidate_nsp); - char *nsp_up; - - nsp_up = g_ascii_strup (nsp_user, -1); - if (!strcmp (nsp_up, candidate_name)) - nsp = candidate_nsp; - g_free (nsp_up); - } - if (!nsp) { - g_string_printf (nmc->return_text, _("Error: NSP with name '%s' not found."), nsp_user); - nmc->return_value = NMC_RESULT_ERROR_NOT_FOUND; - goto error; - } - /* Add headers (field names) */ - arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_MAIN_HEADER_ADD | NMC_OF_FLAG_FIELD_NAMES); - g_ptr_array_add (nmc->output_data, arr); - fill_output_wimax_nsp (nsp, nmc, device, 1, 0); - print_data (nmc); /* Print all data */ - } else { - show_nsp_info (device, nmc); - } - } else { - g_string_printf (nmc->return_text, _("Error: Device '%s' is not a WiMAX device."), ifname); - nmc->return_value = NMC_RESULT_ERROR_UNKNOWN; - goto error; - } + nmc_empty_output_fields (nmc); + show_device_lldp_list (device, nmc, fields_str, &counter); } else { - gboolean empty_line = FALSE; - - /* List NSPs for all devices */ - if (nsp_user) { - /* Specific NSP requested - list only that */ - for (i = 0; i < devices->len; i++) { - NMDevice *dev = g_ptr_array_index (devices, i); - int idx = 1; - - if (!NM_IS_DEVICE_WIMAX (dev)) - continue; - - /* Main header name */ - nmc->print_fields.header_name = (char *) construct_header_name (base_hdr, nm_device_get_iface (dev)); - nmc->print_fields.indices = parse_output_fields (fields_str, tmpl, FALSE, NULL, NULL); - - arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_MAIN_HEADER_ADD | NMC_OF_FLAG_FIELD_NAMES); - g_ptr_array_add (nmc->output_data, arr); - - nsps = nm_device_wimax_get_nsps (NM_DEVICE_WIMAX (dev)); - for (j = 0, nsp = NULL; j < nsps->len; j++) { - NMWimaxNsp *candidate_nsp = g_ptr_array_index (nsps, j); - const char *candidate_name = nm_wimax_nsp_get_name (candidate_nsp); - char *nsp_up; - - nsp_up = g_ascii_strup (nsp_user, -1); - if (!strcmp (nsp_up, candidate_name)) { - nsp = candidate_nsp; - fill_output_wimax_nsp (nsp, nmc, dev, idx, 0); - } - g_free (nsp_up); - } - if (empty_line) - g_print ("\n"); /* Empty line between devices' NSPs */ - print_data (nmc); /* Print all data */ - nmc_empty_output_fields (nmc); - empty_line = TRUE; - } - if (!nsp) { - g_string_printf (nmc->return_text, _("Error: Access point with nsp '%s' not found."), nsp_user); - nmc->return_value = NMC_RESULT_ERROR_NOT_FOUND; - goto error; - } - } else { - for (i = 0; i < devices->len; i++) { - NMDevice *dev = g_ptr_array_index (devices, i); - - /* Main header name */ - nmc->print_fields.header_name = (char *) construct_header_name (base_hdr, - nm_device_get_iface (dev)); - nmc->print_fields.indices = parse_output_fields (fields_str, tmpl, FALSE, NULL, NULL); - - if (NM_IS_DEVICE_WIMAX (dev)) { - if (empty_line) - g_print ("\n"); /* Empty line between devices' NSPs */ - show_nsp_info (dev, nmc); - empty_line = TRUE; - } - } + for (i = 0; devices[i]; i++) { + nmc_empty_output_fields (nmc); + show_device_lldp_list (devices[i], nmc, fields_str, &counter); } } error: + g_free (devices); return nmc->return_value; } static NMCResultCode -do_device_wimax (NmCli *nmc, int argc, char **argv) +do_device_lldp (NmCli *nmc, int argc, char **argv) { if (argc == 0) - nmc->return_value = do_device_wimax_list (nmc, argc-1, argv+1); - else if (argc > 0) { - if (matches (*argv, "list") == 0) { - nmc->return_value = do_device_wimax_list (nmc, argc-1, argv+1); - } - else { - g_string_printf (nmc->return_text, _("Error: 'device wimax' command '%s' is not valid."), *argv); - nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; - } + nmc->return_value = do_device_lldp_list (nmc, argc, argv); + else if (matches (*argv, "list") == 0) + nmc->return_value = do_device_lldp_list (nmc, argc-1, argv+1); + else { + g_string_printf (nmc->return_text, _("Error: 'device lldp' command '%s' is not valid."), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; } return nmc->return_value; } -#endif static gboolean is_single_word (const char* line) @@ -3101,6 +3715,13 @@ do_devices (NmCli *nmc, int argc, char **argv) } nmc->return_value = do_device_connect (nmc, argc-1, argv+1); } + else if (matches (*argv, "reapply") == 0) { + if (nmc_arg_is_help (*(argv+1))) { + usage_device_reapply (); + goto usage_exit; + } + nmc->return_value = do_device_reapply (nmc, argc-1, argv+1); + } else if (matches (*argv, "disconnect") == 0) { if (nmc_arg_is_help (*(argv+1))) { usage_device_disconnect (); @@ -3115,6 +3736,20 @@ do_devices (NmCli *nmc, int argc, char **argv) } nmc->return_value = do_device_delete (nmc, argc-1, argv+1); } + else if (matches (*argv, "set") == 0) { + if (nmc_arg_is_help (*(argv+1))) { + usage_device_set (); + goto usage_exit; + } + nmc->return_value = do_device_set (nmc, argc-1, argv+1); + } + else if (matches (*argv, "monitor") == 0) { + if (nmc_arg_is_help (*(argv+1))) { + usage_device_monitor (); + goto usage_exit; + } + nmc->return_value = do_device_monitor (nmc, argc-1, argv+1); + } else if (matches (*argv, "wifi") == 0) { if (nmc_arg_is_help (*(argv+1))) { usage_device_wifi (); @@ -3124,17 +3759,17 @@ do_devices (NmCli *nmc, int argc, char **argv) goto opt_error; nmc->return_value = do_device_wifi (nmc, argc-1, argv+1); } -#if WITH_WIMAX - else if (matches (*argv, "wimax") == 0) { + else if (matches (*argv, "lldp") == 0) { if (nmc_arg_is_help (*(argv+1))) { - usage_device_wimax (); + usage_device_lldp (); goto usage_exit; } if (!nmc_terse_option_check (nmc->print_output, nmc->required_fields, &error)) goto opt_error; - nmc->return_value = do_device_wimax (nmc, argc-1, argv+1); + if (!nmc->mode_specified) + nmc->multiline_output = TRUE; /* multiline mode is default for 'device lldp' */ + nmc->return_value = do_device_lldp (nmc, argc-1, argv+1); } -#endif else { usage (); g_string_printf (nmc->return_text, _("Error: 'dev' command '%s' is not valid."), *argv); @@ -3151,3 +3786,9 @@ opt_error: g_error_free (error); return nmc->return_value; } + +void +monitor_devices (NmCli *nmc) +{ + do_device_monitor (nmc, 0, NULL); +} diff --git a/clients/cli/devices.h b/clients/cli/devices.h index 152dd207..56fc9c2f 100644 --- a/clients/cli/devices.h +++ b/clients/cli/devices.h @@ -24,4 +24,6 @@ NMCResultCode do_devices (NmCli *nmc, int argc, char **argv); +void monitor_devices (NmCli *nmc); + #endif /* NMC_DEVICES_H */ diff --git a/clients/cli/general.c b/clients/cli/general.c index 44c63c35..5ed1f802 100644 --- a/clients/cli/general.c +++ b/clients/cli/general.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. * - * Copyright 2010 - 2014 Red Hat, Inc. + * Copyright 2010 - 2015 Red Hat, Inc. */ #include "config.h" @@ -22,39 +22,33 @@ #include #include -#include -#include - +#include "nm-default.h" #include "polkit-agent.h" #include "utils.h" #include "general.h" +#include "devices.h" +#include "connections.h" /* Available fields for 'general status' */ static NmcOutputField nmc_fields_nm_status[] = { - {"RUNNING", N_("RUNNING"), 15}, /* 0 */ - {"VERSION", N_("VERSION"), 10}, /* 1 */ - {"STATE", N_("STATE"), 15}, /* 2 */ - {"STARTUP", N_("STARTUP"), 10}, /* 3 */ - {"CONNECTIVITY", N_("CONNECTIVITY"), 15}, /* 4 */ - {"NETWORKING", N_("NETWORKING"), 13}, /* 5 */ - {"WIFI-HW", N_("WIFI-HW"), 15}, /* 6 */ - {"WIFI", N_("WIFI"), 10}, /* 7 */ - {"WWAN-HW", N_("WWAN-HW"), 15}, /* 8 */ - {"WWAN", N_("WWAN"), 10}, /* 9 */ - {"WIMAX-HW", N_("WIMAX-HW"), 15}, /* 10 */ - {"WIMAX", N_("WIMAX"), 10}, /* 11 */ - {NULL, NULL, 0} + {"RUNNING", N_("RUNNING")}, /* 0 */ + {"VERSION", N_("VERSION")}, /* 1 */ + {"STATE", N_("STATE")}, /* 2 */ + {"STARTUP", N_("STARTUP")}, /* 3 */ + {"CONNECTIVITY", N_("CONNECTIVITY")}, /* 4 */ + {"NETWORKING", N_("NETWORKING")}, /* 5 */ + {"WIFI-HW", N_("WIFI-HW")}, /* 6 */ + {"WIFI", N_("WIFI")}, /* 7 */ + {"WWAN-HW", N_("WWAN-HW")}, /* 8 */ + {"WWAN", N_("WWAN")}, /* 9 */ + {"WIMAX-HW", N_("WIMAX-HW")}, /* 10 */ + {"WIMAX", N_("WIMAX")}, /* 11 */ + {NULL, NULL} }; -#if WITH_WIMAX -#define NMC_FIELDS_NM_STATUS_ALL "RUNNING,VERSION,STATE,STARTUP,CONNECTIVITY,NETWORKING,WIFI-HW,WIFI,WWAN-HW,WWAN,WIMAX-HW,WIMAX" -#define NMC_FIELDS_NM_STATUS_SWITCH "NETWORKING,WIFI-HW,WIFI,WWAN-HW,WWAN,WIMAX-HW,WIMAX" -#define NMC_FIELDS_NM_STATUS_RADIO "WIFI-HW,WIFI,WWAN-HW,WWAN,WIMAX-HW,WIMAX" -#else #define NMC_FIELDS_NM_STATUS_ALL "RUNNING,VERSION,STATE,STARTUP,CONNECTIVITY,NETWORKING,WIFI-HW,WIFI,WWAN-HW,WWAN" #define NMC_FIELDS_NM_STATUS_SWITCH "NETWORKING,WIFI-HW,WIFI,WWAN-HW,WWAN" #define NMC_FIELDS_NM_STATUS_RADIO "WIFI-HW,WIFI,WWAN-HW,WWAN" -#endif #define NMC_FIELDS_NM_STATUS_COMMON "STATE,CONNECTIVITY,WIFI-HW,WIFI,WWAN-HW,WWAN" #define NMC_FIELDS_NM_NETWORKING "NETWORKING" #define NMC_FIELDS_NM_WIFI "WIFI" @@ -65,18 +59,18 @@ static NmcOutputField nmc_fields_nm_status[] = { /* Available fields for 'general permissions' */ static NmcOutputField nmc_fields_nm_permissions[] = { - {"PERMISSION", N_("PERMISSION"), 57}, /* 0 */ - {"VALUE", N_("VALUE"), 10}, /* 1 */ - {NULL, NULL, 0} + {"PERMISSION", N_("PERMISSION")}, /* 0 */ + {"VALUE", N_("VALUE")}, /* 1 */ + {NULL, NULL} }; #define NMC_FIELDS_NM_PERMISSIONS_ALL "PERMISSION,VALUE" #define NMC_FIELDS_NM_PERMISSIONS_COMMON "PERMISSION,VALUE" /* Available fields for 'general logging' */ static NmcOutputField nmc_fields_nm_logging[] = { - {"LEVEL", N_("LEVEL"), 10}, /* 0 */ - {"DOMAINS", N_("DOMAINS"), 70}, /* 1 */ - {NULL, NULL, 0} + {"LEVEL", N_("LEVEL")}, /* 0 */ + {"DOMAINS", N_("DOMAINS")}, /* 1 */ + {NULL, NULL} }; #define NMC_FIELDS_NM_LOGGING_ALL "LEVEL,DOMAINS" #define NMC_FIELDS_NM_LOGGING_COMMON "LEVEL,DOMAINS" @@ -181,13 +175,8 @@ static void usage_radio (void) { g_printerr (_("Usage: nmcli radio { COMMAND | help }\n\n" -#if WITH_WIMAX - "COMMAND := { all | wifi | wwan | wimax }\n\n" - " all | wifi | wwan | wimax [ on | off ]\n\n" -#else "COMMAND := { all | wifi | wwan }\n\n" " all | wifi | wwan [ on | off ]\n\n" -#endif )); } @@ -221,17 +210,14 @@ usage_radio_wwan (void) "Get status of mobile broadband radio switch, or turn it on/off.\n\n")); } -#if WITH_WIMAX static void -usage_radio_wimax (void) +usage_monitor (void) { - g_printerr (_("Usage: nmcli radio wimax { ARGUMENTS | help }\n" - "\n" - "ARGUMENTS := [on | off]\n" + g_printerr (_("Usage: nmcli monitor\n" "\n" - "Get status of WiMAX radio switch, or turn it on/off.\n\n")); + "Monitor NetworkManager changes.\n" + "Prints a line whenever a change occurs in NetworkManager\n\n")); } -#endif /* quit main loop */ static void @@ -264,6 +250,26 @@ nm_state_to_string (NMState state) } } +static NmcTermColor +state_to_color (NMState state) +{ + switch (state) { + case NM_STATE_CONNECTING: + return NMC_TERM_COLOR_YELLOW; + case NM_STATE_CONNECTED_LOCAL: + case NM_STATE_CONNECTED_SITE: + case NM_STATE_CONNECTED_GLOBAL: + return NMC_TERM_COLOR_GREEN; + case NM_STATE_DISCONNECTING: + return NMC_TERM_COLOR_YELLOW; + case NM_STATE_ASLEEP: + case NM_STATE_DISCONNECTED: + return NMC_TERM_COLOR_RED; + default: + return NMC_TERM_COLOR_NORMAL; + } +} + static const char * nm_connectivity_to_string (NMConnectivityState connectivity) { @@ -282,18 +288,31 @@ nm_connectivity_to_string (NMConnectivityState connectivity) } } +static NmcTermColor +connectivity_to_color (NMConnectivityState connectivity) +{ + switch (connectivity) { + case NM_CONNECTIVITY_NONE: + return NMC_TERM_COLOR_RED; + case NM_CONNECTIVITY_PORTAL: + case NM_CONNECTIVITY_LIMITED: + return NMC_TERM_COLOR_YELLOW; + case NM_CONNECTIVITY_FULL: + return NMC_TERM_COLOR_GREEN; + default: + return NMC_TERM_COLOR_NORMAL; + } +} + static gboolean show_nm_status (NmCli *nmc, const char *pretty_header_name, const char *print_flds) { gboolean startup = FALSE; NMState state = NM_STATE_UNKNOWN; NMConnectivityState connectivity = NM_CONNECTIVITY_UNKNOWN; - const char *net_enabled_str; - const char *wireless_hw_enabled_str, *wireless_enabled_str; - const char *wwan_hw_enabled_str, *wwan_enabled_str; -#if WITH_WIMAX - const char *wimax_hw_enabled_str, *wimax_enabled_str; -#endif + gboolean net_enabled; + gboolean wireless_hw_enabled, wireless_enabled; + gboolean wwan_hw_enabled, wwan_enabled; GError *error = NULL; const char *fields_str; const char *fields_all = print_flds ? print_flds : NMC_FIELDS_NM_STATUS_ALL; @@ -333,15 +352,11 @@ show_nm_status (NmCli *nmc, const char *pretty_header_name, const char *print_fl state = nm_client_get_state (nmc->client); startup = nm_client_get_startup (nmc->client); connectivity = nm_client_get_connectivity (nmc->client); - net_enabled_str = nm_client_networking_get_enabled (nmc->client) ? _("enabled") : _("disabled"); - wireless_hw_enabled_str = nm_client_wireless_hardware_get_enabled (nmc->client) ? _("enabled") : _("disabled"); - wireless_enabled_str = nm_client_wireless_get_enabled (nmc->client) ? _("enabled") : _("disabled"); - wwan_hw_enabled_str = nm_client_wwan_hardware_get_enabled (nmc->client) ? _("enabled") : _("disabled"); - wwan_enabled_str = nm_client_wwan_get_enabled (nmc->client) ? _("enabled") : _("disabled"); -#if WITH_WIMAX - wimax_hw_enabled_str = nm_client_wimax_hardware_get_enabled (nmc->client) ? _("enabled") : _("disabled"); - wimax_enabled_str = nm_client_wimax_get_enabled (nmc->client) ? _("enabled") : _("disabled"); -#endif + net_enabled = nm_client_networking_get_enabled (nmc->client); + wireless_hw_enabled = nm_client_wireless_hardware_get_enabled (nmc->client); + wireless_enabled = nm_client_wireless_get_enabled (nmc->client); + wwan_hw_enabled = nm_client_wwan_hardware_get_enabled (nmc->client); + wwan_enabled = nm_client_wwan_get_enabled (nmc->client); nmc->print_fields.header_name = pretty_header_name ? (char *) pretty_header_name : _("NetworkManager status"); arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_MAIN_HEADER_ADD | NMC_OF_FLAG_FIELD_NAMES); @@ -353,15 +368,22 @@ show_nm_status (NmCli *nmc, const char *pretty_header_name, const char *print_fl set_val_strc (arr, 2, nm_state_to_string (state)); set_val_strc (arr, 3, startup ? _("starting") : _("started")); set_val_strc (arr, 4, nm_connectivity_to_string (connectivity)); - set_val_strc (arr, 5, net_enabled_str); - set_val_strc (arr, 6, wireless_hw_enabled_str); - set_val_strc (arr, 7, wireless_enabled_str); - set_val_strc (arr, 8, wwan_hw_enabled_str); - set_val_strc (arr, 9, wwan_enabled_str); -#if WITH_WIMAX - set_val_strc (arr, 10, wimax_hw_enabled_str); - set_val_strc (arr, 11, wimax_enabled_str); -#endif + set_val_strc (arr, 5, net_enabled ? _("enabled") : _("disabled")); + set_val_strc (arr, 6, wireless_hw_enabled ? _("enabled") : _("disabled")); + set_val_strc (arr, 7, wireless_enabled ? _("enabled") : _("disabled")); + set_val_strc (arr, 8, wwan_hw_enabled ? _("enabled") : _("disabled")); + set_val_strc (arr, 9, wwan_enabled ? _("enabled") : _("disabled")); + + /* Set colors */ + arr[2].color = state_to_color (state); + arr[3].color = startup ? NMC_TERM_COLOR_YELLOW : NMC_TERM_COLOR_GREEN; + arr[4].color = connectivity_to_color (connectivity); + arr[5].color = net_enabled ? NMC_TERM_COLOR_GREEN : NMC_TERM_COLOR_RED; + arr[6].color = wireless_hw_enabled ? NMC_TERM_COLOR_GREEN : NMC_TERM_COLOR_RED; + arr[7].color = wireless_enabled ? NMC_TERM_COLOR_GREEN : NMC_TERM_COLOR_RED; + arr[8].color = wwan_hw_enabled ? NMC_TERM_COLOR_GREEN : NMC_TERM_COLOR_RED; + arr[9].color = wwan_enabled ? NMC_TERM_COLOR_GREEN : NMC_TERM_COLOR_RED; + g_ptr_array_add (nmc->output_data, arr); print_data (nmc); /* Print all data */ @@ -609,7 +631,7 @@ do_general (NmCli *nmc, int argc, char **argv) if (next_arg (&argc, &argv) == 0) g_print ("Warning: ignoring extra garbage after '%s' hostname\n", hostname); - nmc->should_wait = TRUE; + nmc->should_wait++; nmc->get_client (nmc); /* create NMClient */ nm_client_save_hostname_async (nmc->client, hostname, NULL, save_hostname_cb, nmc); } @@ -867,24 +889,6 @@ do_radio (NmCli *nmc, int argc, char **argv) nm_client_wwan_set_enabled (nmc->client, enable_flag); } } -#if WITH_WIMAX - else if (matches (*argv, "wimax") == 0) { - if (nmc_arg_is_help (*(argv+1))) { - usage_radio_wimax (); - goto finish; - } - if (next_arg (&argc, &argv) != 0) { - /* no argument, show current WiMAX state */ - nmc_switch_show (nmc, NMC_FIELDS_NM_WIMAX, _("WiMAX radio switch")); - } else { - if (!nmc_switch_parse_on_off (nmc, *(argv-1), *argv, &enable_flag)) - goto finish; - - nmc->get_client (nmc); /* create NMClient */ - nm_client_wimax_set_enabled (nmc->client, enable_flag); - } - } -#endif else { usage_radio (); g_string_printf (nmc->return_text, _("Error: 'radio' command '%s' is not valid."), *argv); @@ -897,3 +901,121 @@ finish: return nmc->return_value; } +static void +networkmanager_running (NMClient *client, GParamSpec *param, NmCli *nmc) +{ + gboolean running; + NmcTermColor color; + const char *message; + char *str; + + running = nm_client_get_nm_running (client); + if (running) { + color = NMC_TERM_COLOR_GREEN; + message = _("NetworkManager has started"); + } else { + color = NMC_TERM_COLOR_RED; + message = _("NetworkManager has stopped"); + } + + str = nmc_colorize (nmc, color, NMC_TERM_FORMAT_NORMAL, message); + g_print ("%s\n", str); + g_free (str); +} + +static void +client_hostname (NMClient *client, GParamSpec *param, NmCli *nmc) +{ + const char *hostname; + + g_object_get (client, NM_CLIENT_HOSTNAME, &hostname, NULL); + g_print (_("Hostname set to '%s'\n"), hostname); +} + +static void +client_primary_connection (NMClient *client, GParamSpec *param, NmCli *nmc) +{ + NMActiveConnection *primary; + const char *id; + + primary = nm_client_get_primary_connection (client); + if (primary) { + id = nm_active_connection_get_id (primary); + if (!id) + id = nm_active_connection_get_uuid (primary); + + g_print (_("'%s' is now the primary connection\n"), id); + } else { + g_print (_("There's no primary connection\n")); + } +} + +static void +client_connectivity (NMClient *client, GParamSpec *param, NmCli *nmc) +{ + NMConnectivityState connectivity; + char *str; + + g_object_get (client, NM_CLIENT_CONNECTIVITY, &connectivity, NULL); + str = nmc_colorize (nmc, connectivity_to_color (connectivity), NMC_TERM_FORMAT_NORMAL, + _("Connectivity is now '%s'\n"), nm_connectivity_to_string (connectivity)); + g_print ("%s", str); + g_free (str); +} + +static void +client_state (NMClient *client, GParamSpec *param, NmCli *nmc) +{ + NMState state; + char *str; + + g_object_get (client, NM_CLIENT_STATE, &state, NULL); + str = nmc_colorize (nmc, state_to_color (state), NMC_TERM_FORMAT_NORMAL, + _("Networkmanager is now in the '%s' state\n"), + nm_state_to_string (state)); + g_print ("%s", str); + g_free (str); +} + +NMCResultCode +do_monitor (NmCli *nmc, int argc, char **argv) +{ + if (argc > 0) { + if (!nmc_arg_is_help (*argv)) { + g_string_printf (nmc->return_text, _("Error: 'monitor' command '%s' is not valid."), *argv); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + } + + usage_monitor (); + return nmc->return_value; + } + + nmc->get_client (nmc); /* create NMClient */ + + if (!nm_client_get_nm_running (nmc->client)) { + char *str; + + str = nmc_colorize (nmc, NMC_TERM_COLOR_RED, NMC_TERM_FORMAT_NORMAL, + _("Networkmanager is not running (waiting for it)\n")); + g_print ("%s", str); + g_free (str); + } + + g_signal_connect (nmc->client, "notify::" NM_CLIENT_NM_RUNNING, + G_CALLBACK (networkmanager_running), nmc); + g_signal_connect (nmc->client, "notify::" NM_CLIENT_HOSTNAME, + G_CALLBACK (client_hostname), nmc); + g_signal_connect (nmc->client, "notify::" NM_CLIENT_PRIMARY_CONNECTION, + G_CALLBACK (client_primary_connection), nmc); + g_signal_connect (nmc->client, "notify::" NM_CLIENT_CONNECTIVITY, + G_CALLBACK (client_connectivity), nmc); + g_signal_connect (nmc->client, "notify::" NM_CLIENT_STATE, + G_CALLBACK (client_state), nmc); + + nmc->should_wait++; + + monitor_devices (nmc); + monitor_connections (nmc); + + return NMC_RESULT_SUCCESS; +} diff --git a/clients/cli/general.h b/clients/cli/general.h index 7e8c21f9..40dddb20 100644 --- a/clients/cli/general.h +++ b/clients/cli/general.h @@ -25,5 +25,6 @@ NMCResultCode do_general (NmCli *nmc, int argc, char **argv); NMCResultCode do_networking (NmCli *nmc, int argc, char **argv); NMCResultCode do_radio (NmCli *nmc, int argc, char **argv); +NMCResultCode do_monitor (NmCli *nmc, int argc, char **argv); #endif /* NMC_GENERAL_H */ diff --git a/clients/cli/nmcli-completion b/clients/cli/nmcli-completion index 7bdd5255..f8c0298e 100644 --- a/clients/cli/nmcli-completion +++ b/clients/cli/nmcli-completion @@ -187,6 +187,33 @@ _nmcli_compl_OPTIONS() show-secrets) _nmcli_array_delete_at words 0 ;; + order) + if [[ "${#words[@]}" -eq 2 ]]; then + local ord="${words[1]}" + local ord_sta="" + local i + local c=() + + # FIXME: currently the completion considers colon as separator + # for words. Hence the following doesn't work as $ord will + # not contain any colons at this point. + # See https://bugzilla.gnome.org/show_bug.cgi?id=745157 + + if [[ $ord = *":"* ]]; then + ord_sta="${ord%:*}:" + ord="${ord##*:}" + fi + if [[ $ord = [-+]* ]]; then + ord_sta="$ord_sta${ord:0:1}" + fi + for i in active name type path; do + c=("${c[@]}" "$ord_sta$i") + done + _nmcli_list "${c[*]}" + return 0 + fi + _nmcli_array_delete_at words 0 1 + ;; active) _nmcli_array_delete_at words 0 ;; @@ -211,11 +238,18 @@ _nmcli_compl_OPTIONS() fi _nmcli_array_delete_at words 0 1 ;; + colors) + if [[ "${#words[@]}" -eq 2 ]]; then + _nmcli_list "yes no auto" + return 0 + fi + _nmcli_array_delete_at words 0 1 + ;; fields) if [[ "${#words[@]}" -eq 2 ]]; then _nmcli_list "all common NAME UUID TYPE TIMESTAMP TIMESTAMP-REAL AUTOCONNECT READONLY DBUS-PATH ACTIVE DEVICE STATE ACTIVE-PATH - connection 802-3-ethernet 802-1x 802-11-wireless 802-11-wireless-security ipv4 ipv6 serial ppp pppoe gsm cdma bluetooth 802-11-olpc-mesh vpn wimax infiniband bond vlan adsl bridge bridge-port team team-port dcb + connection 802-3-ethernet 802-1x 802-11-wireless 802-11-wireless-security ipv4 ipv6 serial ppp pppoe gsm cdma bluetooth 802-11-olpc-mesh vpn wimax infiniband bond vlan adsl bridge bridge-port team team-port dcb tun ip-tunnel macvlan vxlan GENERAL IP4 DHCP4 IP6 DHCP6 VPN profile active" return 0 @@ -248,6 +282,7 @@ _nmcli_compl_OPTIONS() # expects several options with parameters. This function can parse them and remove them from the words array. _nmcli_compl_ARGS() { + local aliases=${@} local OPTIONS_ALL N_REMOVE_WORDS REMOVE_OPTIONS OPTIONS_HAS_MANDATORY i OPTIONS_ALL=("${OPTIONS[@]}") OPTIONS_UNKNOWN_OPTION= @@ -283,10 +318,20 @@ _nmcli_compl_ARGS() N_REMOVE_WORDS=2 REMOVE_OPTIONS=("${words[0]}") - case "${words[0]}" in + + # change option name to alias + WORD0="${words[0]}" + for alias in "${aliases[@]}" ; do + if [[ "${WORD0}" == ${alias%%:*} ]]; then + WORD0=${alias#*:} + break + fi + done + + case "${WORD0}" in level) if [[ "${#words[@]}" -eq 2 ]]; then - _nmcli_list "ERR WARN INFO DEBUG TRACE" + _nmcli_list "OFF ERR WARN INFO DEBUG TRACE" return 0 fi ;; @@ -367,7 +412,7 @@ _nmcli_compl_ARGS() # user friendly. Only complete them, if the current word already starts with an "8". _nmcli_list "802-3-ethernet 802-11-wireless 802-11-olpc-mesh" else - _nmcli_list "ethernet wifi wimax gsm cdma infiniband bluetooth vpn olpc-mesh vlan bond bond-slave bridge bridge-slave team team-slave pppoe adsl" + _nmcli_list "ethernet wifi wimax gsm cdma infiniband bluetooth vpn olpc-mesh vlan bond bridge team pppoe adsl tun ip-tunnel macvlan vxlan" fi return 0 fi @@ -428,6 +473,15 @@ _nmcli_compl_ARGS() "wifi") _nmcli_list "infrastructure ap adhoc" ;; + "tun") + _nmcli_list "tun tap" + ;; + "ip-tunnel") + _nmcli_list "ipip gre sit isatap vti ip6ip6 ipip6 ip6gre vti6" + ;; + "macvlan") + _nmcli_list "vepa bridge private passthru source" + ;; "bond"| \ *) _nmcli_list "balance-rr active-backup balance-xor broadcast 802.3ad balance-tlb balance-alb" @@ -447,6 +501,12 @@ _nmcli_compl_ARGS() return 0 fi ;; + slave-type) + if [[ "${#words[@]}" -eq 2 ]]; then + _nmcli_list "bond team bridge" + return 0 + fi + ;; lacp-rate) if [[ "${#words[@]}" -eq 2 ]]; then _nmcli_list "slow fast" @@ -465,12 +525,17 @@ _nmcli_compl_ARGS() return 0 fi ;; + managed| \ autoconnect| \ stp| \ hairpin| \ save| \ hidden| \ - private) + private| \ + pi| \ + vnet-hdr| \ + multi-queue|\ + tap) if [[ "${#words[@]}" -eq 2 ]]; then _nmcli_list "yes no" return 0 @@ -518,7 +583,8 @@ _nmcli_compl_ARGS() username| \ service| \ password| \ - passwd-file) + passwd-file| \ + file) if [[ "${#words[@]}" -eq 2 ]]; then return 0 fi @@ -548,6 +614,12 @@ _nmcli_compl_ARGS() return 0 fi ;; + band) + if [[ "${#words[@]}" -eq 2 ]]; then + _nmcli_list "a bg" + return 0 + fi + ;; *) return 1 ;; @@ -581,6 +653,7 @@ _nmcli_compl_ARGS() # some commands expect a connection as parameter. This connection can either be given # as id|uuid|path|apath. Parse that connection parameter. +# Actually, it can also ask for a device name, like `nmcli device set [ifname] ` _nmcli_compl_ARGS_CONNECTION() { if ! _nmcli_array_has_value OPTIONS "${words[0]}"; then @@ -683,6 +756,25 @@ _nmcli_compl_COMMAND_nl() { _nmcli_list_nl "$(printf "%s%s\n%s" "" "$V" "$a")" } +_nmcli_compl_PROPERTIES() +{ + while [[ "${#words[@]}" -gt 0 ]]; do + if [[ ${#words[@]} -le 1 ]]; then + local PREFIX="" + + if [[ "${words[0]:0:1}" == [+-] ]]; then + PREFIX="${words[0]:0:1}" + fi + _nmcli_list_nl "$(echo -e 'print\nquit\nyes' |nmcli c edit "$@" 2>/dev/null |awk -F: '/\..*:/ {print "'$PREFIX'"$1}')" + return 0 + elif [[ ${#words[@]} -le 2 ]]; then + return 0 + fi + _nmcli_array_delete_at words 0 1 + done + _nmcli_list_nl "$(echo -e 'print\nquit\nyes' |nmcli c edit "$@" 2>/dev/null |awk -F: '/\..*:/ {print $1}')" +} + _nmcli() { local cur prev words cword i @@ -707,12 +799,12 @@ _nmcli() cur='' fi - local OPTIONS_UNKNOWN_OPTION OPTIONS_TYPE OPTIONS_TYPED OPTIONS OPTIONS_MANDATORY COMMAND_ARGS_WAIT_OPTIONS OPTIONS_IP OPTIONS_MANDATORY OPTIONS_NEXT_GROUP OPTIONS_REPEATABLE + local OPTIONS_UNKNOWN_OPTION OPTIONS_TYPE OPTIONS_TYPED OPTIONS OPTIONS_MANDATORY COMMAND_ARGS_WAIT_OPTIONS OPTIONS_IP OPTIONS_MANDATORY OPTIONS_NEXT_GROUP OPTIONS_SEP OPTIONS_REPEATABLE local COMMAND_CONNECTION_TYPE COMMAND_CONNECTION_ID OPTIONS_MANDATORY_IFNAME HELP_ONLY_AS_FIRST local COMMAND_CONNECTION_ACTIVE="" HELP_ONLY_AS_FIRST= - local LONG_OPTIONS=(terse pretty mode fields escape nocheck ask wait version help) + local LONG_OPTIONS=(terse pretty mode fields colors escape nocheck ask show-secrets wait version help) _nmcli_compl_OPTIONS i=$? @@ -730,7 +822,7 @@ _nmcli() # (if the current word starts with a dash) or the OBJECT list # otherwise. if [[ "${words[0]:0:1}" != '-' ]]; then - OPTIONS=(help general networking radio connection device agent) + OPTIONS=(help general networking radio connection device agent monitor) elif [[ "${words[0]:1:1}" == '-' || "${words[0]}" == "-" ]]; then OPTIONS=("${LONG_OPTIONS[@]/#/--}") else @@ -791,10 +883,10 @@ _nmcli() ;; r|ra|rad|radi|radio) if [[ ${#words[@]} -eq 2 ]]; then - _nmcli_compl_COMMAND "$command" all wifi wwan wimax + _nmcli_compl_COMMAND "$command" all wifi wwan elif [[ ${#words[@]} -eq 3 ]]; then case "$command" in - a|al|all | w|wi|wif|wifi | ww|wwa|wwan | wim|wima|wimax) + a|al|all | w|wi|wif|wifi | ww|wwa|wwan) _nmcli_compl_COMMAND "${words[2]}" "on off" ;; esac @@ -802,16 +894,16 @@ _nmcli() ;; c|co|con|conn|conne|connec|connect|connecti|connectio|connection) if [[ ${#words[@]} -eq 2 ]]; then - _nmcli_compl_COMMAND "$command" show up down add modify edit delete reload load + _nmcli_compl_COMMAND "$command" show up down add modify clone edit delete monitor reload load import export elif [[ ${#words[@]} -gt 2 ]]; then case "$command" in s|sh|sho|show) if [[ ${#words[@]} -eq 3 ]]; then - _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "id\nuuid\npath\napath\n%s" "$(_nmcli_con_show NAME)")" active show-secrets + _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "id\nuuid\npath\napath\n%s" "$(_nmcli_con_show NAME)")" active order elif [[ ${#words[@]} -gt 3 ]]; then _nmcli_array_delete_at words 0 1 - LONG_OPTIONS=(help active show-secrets) + LONG_OPTIONS=(help active order) HELP_ONLY_AS_FIRST=1 _nmcli_compl_OPTIONS i=$? @@ -910,7 +1002,7 @@ _nmcli() ;; a|ad|add) if [[ ${#words[@]} -eq 3 ]]; then - _nmcli_compl_COMMAND "${words[2]}" type ifname con-name autoconnect + _nmcli_compl_COMMAND "${words[2]}" type ifname con-name autoconnect master slave-type elif [[ ${#words[@]} -gt 3 ]]; then _nmcli_array_delete_at words 0 1 @@ -923,14 +1015,14 @@ _nmcli() ;; 1) if [[ "$HELP_ONLY_AS_FIRST" == 1 ]]; then - _nmcli_compl_COMMAND "${words[2]}" type ifname con-name autoconnect + _nmcli_compl_COMMAND "${words[2]}" type ifname con-name autoconnect master slave-type fi return 0 ;; esac OPTIONS_TYPE= - OPTIONS=(type ifname con-name autoconnect save) + OPTIONS=(type ifname con-name autoconnect save master slave-type) OPTIONS_MANDATORY=(type ifname) COMMAND_ARGS_WAIT_OPTIONS=1 OPTIONS_MANDATORY_IFNAME=1 @@ -951,6 +1043,7 @@ _nmcli() fi OPTIONS_IP=(ip4 ip6 gw4 gw6) + OPTIONS_SEP=(--) OPTIONS_MANDATORY=() case "$OPTIONS_TYPE" in 802-3|802-3-|802-3-e|802-3-et|802-3-eth|802-3-ethe|802-3-ether|802-3-ethern|802-3-etherne|802-3-ethernet| \ @@ -994,32 +1087,14 @@ _nmcli() OPTIONS_TYPE=bond OPTIONS_TYPED=(mode miimon downdelay updelay arp-interval arp-ip-target primary lacp-rate) ;; - bond-|bond-s|bond-sl|bond-sla|bond-slav|bond-slave) - OPTIONS_TYPE=bond-slave - OPTIONS_TYPED=(master) - OPTIONS_MANDATORY=(master) - OPTIONS_IP=() - ;; team) OPTIONS_TYPE=team OPTIONS_TYPED=(config) ;; - team-|team-s|team-sl|team-sla|team-slav|team-slave) - OPTIONS_TYPE=team-slave - OPTIONS_TYPED=(master config) - OPTIONS_MANDATORY=(master) - OPTIONS_IP=() - ;; bridge) OPTIONS_TYPE=bridge OPTIONS_TYPED=(stp priority forward-delay hello-time max-age ageing-time mac) ;; - bridge-|bridge-s|bridge-sl|bridge-sla|bridge-slav|bridge-slave) - OPTIONS_TYPE=bridge-slave - OPTIONS_TYPED=(master priority path-cost hairpin) - OPTIONS_MANDATORY=(master) - OPTIONS_IP=() - ;; vp|vpn) OPTIONS_TYPE=vpn OPTIONS_TYPED=(vpn-type user) @@ -1041,6 +1116,26 @@ _nmcli() OPTIONS_TYPED=(username password protocol encapsulation) OPTIONS_MANDATORY=(username protocol) ;; + tu|tun) + OPTIONS_TYPE=tun + OPTIONS_TYPED=(mode owner group pi vnet-hdr multi-queue) + OPTIONS_MANDATORY=(mode) + ;; + ip|ip-|ip-t|ip-tu|ip-tun|ip-tunn|ip-tunne|ip-tunnel) + OPTIONS_TYPE=ip-tunnel + OPTIONS_TYPED=(mode remote local dev) + OPTIONS_MANDATORY=(mode remote) + ;; + m|ma|mac|macv|macvl|macvla|macvlan) + OPTIONS_TYPE=macvlan + OPTIONS_TYPED=(dev mode tap) + OPTIONS_MANDATORY=(dev mode) + ;; + vx|vxl|vxla|vxlan) + OPTIONS_TYPE=vxlan + OPTIONS_TYPED=(id remote local dev source-port-min source-port-max destination-port) + OPTIONS_MANDATORY=(id remote) + ;; *) # for an unknown connection type, we stop completion here return 0 @@ -1052,7 +1147,7 @@ _nmcli() if [[ "${#OPTIONS_MANDATORY[@]}" -gt 0 ]]; then _nmcli_list "$(echo "${OPTIONS[@]}") $(echo "${OPTIONS_TYPED[@]}")" else - _nmcli_list "$(echo "${OPTIONS[@]}") $(echo "${OPTIONS_TYPED[@]}") $(echo "${OPTIONS_IP[@]}")" + _nmcli_list "$(echo "${OPTIONS[@]}") $(echo "${OPTIONS_TYPED[@]}") $(echo "${OPTIONS_IP[@]}") $(echo "${OPTIONS_SEP[@]}")" fi return 0 fi @@ -1069,7 +1164,7 @@ _nmcli() if [[ "${#OPTIONS_MANDATORY[@]}" -gt 0 ]]; then _nmcli_list "$(echo "${OPTIONS[@]}")" else - _nmcli_list "$(echo "${OPTIONS[@]}") $(echo "${OPTIONS_IP[@]}")" + _nmcli_list "$(echo "${OPTIONS[@]}") $(echo "${OPTIONS_IP[@]}") $(echo "${OPTIONS_SEP[@]}")" fi return 0 fi @@ -1080,11 +1175,12 @@ _nmcli() # we have an unknown option, but still mandatory ones that must be fullfiled first. return 0 fi - if ! _nmcli_array_has_value OPTIONS_IP "${OPTIONS_UNKNOWN_OPTION:1}"; then - # the unknown option is NOT an IP option. + if ! (_nmcli_array_has_value OPTIONS_IP "${OPTIONS_UNKNOWN_OPTION:1}" || + _nmcli_array_has_value OPTIONS_SEP "${OPTIONS_UNKNOWN_OPTION:1}"); then + # the unknown option is neither an IP option nor a separator. return 0 fi - # The unknown option is an IP option, which is fine... continue... + # The unknown option is an IP option or a separator, which is fine... continue... fi fi @@ -1101,8 +1197,9 @@ _nmcli() fi if [[ "$OPTIONS_UNKNOWN_OPTION" != "" ]]; then - if ! _nmcli_array_has_value OPTIONS_IP "${OPTIONS_UNKNOWN_OPTION:1}"; then - # the unknown option is NOT an IP option. + if ! (_nmcli_array_has_value OPTIONS_IP "${OPTIONS_UNKNOWN_OPTION:1}" || + _nmcli_array_has_value OPTIONS_SEP "${OPTIONS_UNKNOWN_OPTION:1}"); then + # the unknown option is neither an IP option nor a separator. return 0 fi fi @@ -1110,8 +1207,8 @@ _nmcli() # no mandatory options... do final completion including IP options - OPTIONS=("${OPTIONS[@]}" "${OPTIONS_IP[@]}") - OPTIONS_NEXT_GROUP=("${OPTIONS_IP[@]}") + OPTIONS=("${OPTIONS[@]}" "${OPTIONS_IP[@]}" "${OPTIONS_SEP[@]}") + OPTIONS_NEXT_GROUP=("${OPTIONS_IP[@]}" "${OPTIONS_SEP[@]}") _nmcli_compl_ARGS && return 0 if [[ "$OPTIONS_UNKNOWN_OPTION" != "" ]]; then @@ -1125,11 +1222,18 @@ _nmcli() return 0 fi + # process the last group of options, as the OPTIONS_TYPED are already handled... - OPTIONS=("${OPTIONS_IP[@]}") - OPTIONS_NEXT_GROUP=() + OPTIONS=("${OPTIONS_IP[@]}" "${OPTIONS_SEP[@]}") + OPTIONS_NEXT_GROUP=("${OPTIONS_SEP[@]}") COMMAND_ARGS_WAIT_OPTIONS=0 _nmcli_compl_ARGS && return 0 + + _nmcli_array_delete_at words 0 + _nmcli_compl_PROPERTIES type "$OPTIONS_TYPE" + + return 0 + fi ;; e|ed|edi|edit) @@ -1186,25 +1290,42 @@ _nmcli() OPTIONS=(id uuid path) _nmcli_compl_ARGS_CONNECTION && return 0 - while [[ "${#words[@]}" -gt 0 ]]; do - if [[ ${#words[@]} -le 1 ]]; then - local PREFIX="" - if [[ "${words[0]:0:1}" == [+-] ]]; then - PREFIX="${words[0]:0:1}" - fi - _nmcli_list_nl "$(nmcli --fields profile connection show ${COMMAND_CONNECTION_TYPE} "$COMMAND_CONNECTION_ID" 2>/dev/null | sed -n 's/^\([^:]\+\):.*/'$PREFIX'\1/p')" + _nmcli_compl_PROPERTIES ${COMMAND_CONNECTION_TYPE} "$COMMAND_CONNECTION_ID" + + return 0 + fi + ;; + c|cl|clo|clon|clone) + if [[ ${#words[@]} -eq 3 ]]; then + _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "id\nuuid\npath\n%s" "$(_nmcli_con_show NAME)")" temporary + elif [[ ${#words[@]} -gt 3 ]]; then + _nmcli_array_delete_at words 0 1 + + LONG_OPTIONS=(help temporary) + HELP_ONLY_AS_FIRST=1 + _nmcli_compl_OPTIONS + case $? in + 0) return 0 - elif [[ ${#words[@]} -le 2 ]]; then + ;; + 1) + if [[ "$HELP_ONLY_AS_FIRST" == 1 ]]; then + _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "id\nuuid\npath\n%s" "$(_nmcli_con_show NAME)")" "${LONG_OPTIONS[@]}" + fi return 0 - fi - _nmcli_array_delete_at words 0 1 - done - _nmcli_list_nl "$(nmcli --fields profile connection show ${COMMAND_CONNECTION_TYPE} "$COMMAND_CONNECTION_ID" 2>/dev/null | sed -n 's/^\([^:]\+\):.*/\1/p')" + ;; + esac + + OPTIONS=(id uuid path) + _nmcli_compl_ARGS_CONNECTION && return 0 + return 0 fi ;; - de|del|dele|delet|delete) + + de|del|dele|delet|delete| \ + m|mo|mon|moni|monit|monito|monitor) if [[ ${#words[@]} -eq 3 ]]; then _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "id\nuuid\npath\n%s" "$(_nmcli_con_show NAME)")" elif [[ ${#words[@]} -gt 3 ]]; then @@ -1238,12 +1359,67 @@ _nmcli() COMPREPLY=() fi ;; + i|im|imp|impo|impor|import) + if [[ ${#words[@]} -eq 3 ]]; then + _nmcli_compl_COMMAND "${words[2]}" type file --temporary + elif [[ ${#words[@]} -gt 3 ]]; then + _nmcli_array_delete_at words 0 1 + + LONG_OPTIONS=(help temporary) + HELP_ONLY_AS_FIRST=1 + _nmcli_compl_OPTIONS + case $? in + 0) + return 0 + ;; + 1) + if [[ "$HELP_ONLY_AS_FIRST" == 1 ]]; then + _nmcli_compl_COMMAND "${words[2]}" type file + fi + return 0 + ;; + esac + + OPTIONS=(type file) + OPTIONS_MANDATORY=(type file) + ALIASES=("type:vpn-type") + _nmcli_compl_ARGS ${ALIASES[@]} + return 0 + fi + ;; + e|ex|exp|expo|expor|export) + if [[ ${#words[@]} -eq 3 ]]; then + _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "id\nuuid\npath\n%s" "$(_nmcli_con_show NAME)")" + elif [[ ${#words[@]} -gt 3 ]]; then + _nmcli_array_delete_at words 0 1 + + LONG_OPTIONS=(help) + HELP_ONLY_AS_FIRST=1 + _nmcli_compl_OPTIONS + case $? in + 0) + return 0 + ;; + 1) + if [[ "$HELP_ONLY_AS_FIRST" == 1 ]]; then + _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "id\nuuid\npath\n%s" "$(_nmcli_con_show NAME)")" "${LONG_OPTIONS[@]}" + fi + return 0 + ;; + esac + + OPTIONS=(id uuid path) + _nmcli_compl_ARGS_CONNECTION && return 0 + return 0 + fi + ;; + esac fi ;; d|de|dev|devi|devic|device) if [[ ${#words[@]} -eq 2 ]]; then - _nmcli_compl_COMMAND "$command" status show connect disconnect delete wifi wimax + _nmcli_compl_COMMAND "$command" status show connect reapply disconnect delete monitor wifi set lldp elif [[ ${#words[@]} -gt 2 ]]; then case "$command" in s|st|sta|stat|statu|status) @@ -1257,15 +1433,28 @@ _nmcli() _nmcli_compl_COMMAND_nl "${words[2]}" "$(_nmcli_dev_status DEVICE)" fi ;; + r|re|rea|reap|reapp|reappl|reapply| \ d|di|dis|disc|disco|discon|disconn|disconne|disconnec|disconnect| \ - de|del|dele|delet|delete) + de|del|dele|delet|delete| \ + m|mo|mon|moni|monit|monito|monitor) if [[ ${#words[@]} -ge 3 ]]; then _nmcli_compl_COMMAND_nl "${words[2]}" "$(_nmcli_dev_status DEVICE)" fi ;; + se|set) + if [[ ${#words[@]} -eq 3 ]]; then + _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "ifname\n%s" "$(_nmcli_dev_status DEVICE)")" + else + _nmcli_array_delete_at words 0 1 + OPTIONS=(ifname) + _nmcli_compl_ARGS_CONNECTION && return 0 + OPTIONS=(autoconnect managed) + _nmcli_compl_ARGS + fi + ;; w|wi|wif|wifi) if [[ ${#words[@]} -eq 3 ]]; then - _nmcli_compl_COMMAND "${words[2]}" list connect rescan + _nmcli_compl_COMMAND "${words[2]}" list connect hotspot rescan else case "${words[2]}" in l|li|lis|list) @@ -1286,6 +1475,11 @@ _nmcli() _nmcli_compl_ARGS fi ;; + h|ho|hot|hots|hotsp|hotspo|hotspot) + _nmcli_array_delete_at words 0 2 + OPTIONS=(ifname con-name ssid band channel password) + _nmcli_compl_ARGS + ;; r|re|res|resc|resca|rescan) _nmcli_array_delete_at words 0 2 OPTIONS_REPEATABLE=(ssid) @@ -1295,20 +1489,19 @@ _nmcli() esac fi ;; - wim|wima|wimax) + l|ll|lld|lldp) if [[ ${#words[@]} -eq 3 ]]; then _nmcli_compl_COMMAND "${words[2]}" list else case "${words[2]}" in l|li|lis|list) _nmcli_array_delete_at words 0 2 - OPTIONS=(ifname nsp) + OPTIONS=(ifname) _nmcli_compl_ARGS ;; esac fi ;; - esac fi ;; @@ -1317,6 +1510,8 @@ _nmcli() _nmcli_compl_COMMAND "$command" secret polkit all fi ;; + m|mo|mon|moni|monit|monito|monitor) + ;; esac return 0 diff --git a/clients/cli/nmcli.c b/clients/cli/nmcli.c index 8d9f7fef..437523da 100644 --- a/clients/cli/nmcli.c +++ b/clients/cli/nmcli.c @@ -16,7 +16,7 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Copyright 2010 - 2014 Red Hat, Inc. + * Copyright 2010 - 2015 Red Hat, Inc. */ /* Generated configuration file */ @@ -33,9 +33,7 @@ #include #include -#include -#include - +#include "nm-default.h" #include "polkit-agent.h" #include "nmcli.h" #include "utils.h" @@ -89,10 +87,12 @@ usage (const char *prog_name) " -t[erse] terse output\n" " -p[retty] pretty output\n" " -m[ode] tabular|multiline output mode\n" + " -c[olors] auto|yes|no whether to use colors in output\n" " -f[ields] |all|common specify fields to output\n" " -e[scape] yes|no escape columns separators in values\n" " -n[ocheck] don't check nmcli and NetworkManager versions\n" " -a[sk] ask for missing parameters\n" + " -s[how-secrets] allow displaying passwords\n" " -w[ait] set timeout waiting for finishing operations\n" " -v[ersion] show program version\n" " -h[elp] print this help\n" @@ -104,6 +104,7 @@ usage (const char *prog_name) " c[onnection] NetworkManager's connections\n" " d[evice] devices managed by NetworkManager\n" " a[gent] NetworkManager secret agent or polkit agent\n" + " m[monitor] monitor NetworkManager changes\n" "\n"), prog_name); } @@ -120,6 +121,7 @@ static const struct cmd { NMCResultCode (*func) (NmCli *nmc, int argc, char **argv); } nmcli_cmds[] = { { "general", do_general }, + { "monitor", do_monitor }, { "networking", do_networking }, { "radio", do_radio }, { "connection", do_connections }, @@ -210,6 +212,24 @@ parse_command_line (NmCli *nmc, int argc, char **argv) nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; return nmc->return_value; } + } else if (matches (opt, "-colors") == 0) { + next_arg (&argc, &argv); + if (argc <= 1) { + g_string_printf (nmc->return_text, _("Error: missing argument for '%s' option."), opt); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + return nmc->return_value; + } + if (matches (argv[1], "auto") == 0) + nmc->use_colors = NMC_USE_COLOR_AUTO; + else if (matches (argv[1], "yes") == 0) + nmc->use_colors = NMC_USE_COLOR_YES; + else if (matches (argv[1], "no") == 0) + nmc->use_colors = NMC_USE_COLOR_NO; + else { + g_string_printf (nmc->return_text, _("Error: '%s' is not valid argument for '%s' option."), argv[1], opt); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + return nmc->return_value; + } } else if (matches (opt, "-escape") == 0) { next_arg (&argc, &argv); if (argc <= 1) { @@ -238,6 +258,8 @@ parse_command_line (NmCli *nmc, int argc, char **argv) nmc->nocheck_ver = TRUE; } else if (matches (opt, "-ask") == 0) { nmc->ask = TRUE; + } else if (matches (opt, "-show-secrets") == 0) { + nmc->show_secrets = TRUE; } else if (matches (opt, "-wait") == 0) { unsigned long timeout; next_arg (&argc, &argv); @@ -515,7 +537,7 @@ nmc_init (NmCli *nmc) nmc->pwds_hash = NULL; nmc->pk_listener = NULL; - nmc->should_wait = FALSE; + nmc->should_wait = 0; nmc->nowait_flag = TRUE; nmc->print_output = NMC_PRINT_NORMAL; nmc->multiline_output = FALSE; @@ -526,6 +548,8 @@ nmc_init (NmCli *nmc) memset (&nmc->print_fields, '\0', sizeof (NmcPrintFields)); nmc->nocheck_ver = FALSE; nmc->ask = FALSE; + nmc->show_secrets = FALSE; + nmc->use_colors = NMC_USE_COLOR_AUTO; nmc->in_editor = FALSE; nmc->editor_status_line = FALSE; nmc->editor_save_confirmation = TRUE; @@ -587,10 +611,8 @@ main (int argc, char *argv[]) textdomain (GETTEXT_PACKAGE); #endif -#if !GLIB_CHECK_VERSION (2, 35, 0) - g_type_init (); -#endif - + nm_g_type_init (); + /* Save terminal settings */ tcgetattr (STDIN_FILENO, &termios_orig); diff --git a/clients/cli/nmcli.h b/clients/cli/nmcli.h index 32e7e5dd..b26f2576 100644 --- a/clients/cli/nmcli.h +++ b/clients/cli/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. * - * Copyright 2010 - 2014 Red Hat, Inc. + * Copyright 2010 - 2015 Red Hat, Inc. */ #ifndef NMC_NMCLI_H @@ -68,6 +68,28 @@ typedef enum { NMC_RESULT_ERROR_NOT_FOUND = 10 } NMCResultCode; +typedef enum { + NMC_TERM_COLOR_NORMAL = 0, + NMC_TERM_COLOR_BLACK = 1, + NMC_TERM_COLOR_RED = 2, + NMC_TERM_COLOR_GREEN = 3, + NMC_TERM_COLOR_YELLOW = 4, + NMC_TERM_COLOR_BLUE = 5, + NMC_TERM_COLOR_MAGENTA = 6, + NMC_TERM_COLOR_CYAN = 7, + NMC_TERM_COLOR_WHITE = 8 +} NmcTermColor; + +typedef enum { + NMC_TERM_FORMAT_NORMAL, + NMC_TERM_FORMAT_BOLD, + NMC_TERM_FORMAT_DIM, + NMC_TERM_FORMAT_UNDERLINE, + NMC_TERM_FORMAT_BLINK, + NMC_TERM_FORMAT_REVERSE, + NMC_TERM_FORMAT_HIDDEN, +} NmcTermFormat; + typedef enum { NMC_PRINT_TERSE = 0, NMC_PRINT_NORMAL = 1, @@ -90,6 +112,8 @@ typedef struct _NmcOutputField { gboolean value_is_array; /* Whether value is char** instead of char* */ gboolean free_value; /* Whether to free the value */ guint32 flags; /* Flags - whether and how to print values/field names/headers */ + NmcTermColor color; /* Use this color to print value */ + NmcTermFormat color_fmt; /* Use this terminal format to print value */ } NmcOutputField; typedef struct { @@ -99,16 +123,10 @@ typedef struct { } NmcPrintFields; typedef enum { - NMC_TERM_COLOR_NORMAL = 0, - NMC_TERM_COLOR_BLACK = 1, - NMC_TERM_COLOR_RED = 2, - NMC_TERM_COLOR_GREEN = 3, - NMC_TERM_COLOR_YELLOW = 4, - NMC_TERM_COLOR_BLUE = 5, - NMC_TERM_COLOR_MAGENTA = 6, - NMC_TERM_COLOR_CYAN = 7, - NMC_TERM_COLOR_WHITE = 8 -} NmcTermColor; + NMC_USE_COLOR_AUTO, + NMC_USE_COLOR_YES, + NMC_USE_COLOR_NO, +} NmcColorOption; /* NmCli - main structure */ typedef struct _NmCli { @@ -126,17 +144,19 @@ typedef struct _NmCli { GHashTable *pwds_hash; /* Hash table with passwords in passwd-file */ NMPolkitListener *pk_listener ; /* polkit agent listener */ - gboolean should_wait; /* Indication that nmcli should not end yet */ + int should_wait; /* Semaphore indicating whether nmcli should not end or not yet */ gboolean nowait_flag; /* '--nowait' option; used for passing to callbacks */ NMCPrintOutput print_output; /* Output mode */ gboolean multiline_output; /* Multiline output instead of default tabular */ gboolean mode_specified; /* Whether tabular/multiline mode was specified via '--mode' option */ + NmcColorOption use_colors; /* Whether to use colors for output: option '--color' */ gboolean escape_values; /* Whether to escape ':' and '\' in terse tabular mode */ char *required_fields; /* Required fields in output: '--fields' option */ GPtrArray *output_data; /* GPtrArray of arrays of NmcOutputField structs - accumulates data for output */ NmcPrintFields print_fields; /* Structure with field indices to print */ gboolean nocheck_ver; /* Don't check nmcli and NM versions: option '--nocheck' */ gboolean ask; /* Ask for missing parameters: option '--ask' */ + gboolean show_secrets; /* Whether to display secrets (both input and output): option '--show-secrets' */ gboolean in_editor; /* Whether running the editor - nmcli con edit' */ gboolean editor_status_line; /* Whether to display status line in connection editor */ gboolean editor_save_confirmation; /* Whether to ask for confirmation on saving connections with 'autoconnect=yes' */ diff --git a/clients/cli/polkit-agent.c b/clients/cli/polkit-agent.c index a163b824..b1fcaad8 100644 --- a/clients/cli/polkit-agent.c +++ b/clients/cli/polkit-agent.c @@ -25,11 +25,8 @@ #include #include #include -#include - -#include -#include +#include "nm-default.h" #include "polkit-agent.h" #include "nm-polkit-listener.h" #include "common.h" @@ -44,18 +41,10 @@ polkit_request (const char *request, gpointer user_data) { char *response, *tmp, *p; - struct termios termios_orig, termios_new; g_print ("%s\n", message); g_print ("(action_id: %s)\n", action_id); - if (!echo_on) { - tcgetattr (STDIN_FILENO, &termios_orig); - termios_new = termios_orig; - termios_new.c_lflag &= ~(ECHO); - tcsetattr (STDIN_FILENO, TCSADRAIN, &termios_new); - } - /* Ask user for polkit authorization password */ if (user) { /* chop of ": " if present */ @@ -63,16 +52,12 @@ polkit_request (const char *request, p = strrchr (tmp, ':'); if (p && !strcmp (p, ": ")) *p = '\0'; - response = nmc_readline ("%s (%s): ", tmp, user); + response = nmc_readline_echo (echo_on, "%s (%s): ", tmp, user); g_free (tmp); } else - response = nmc_readline ("%s", request); + response = nmc_readline_echo (echo_on, "%s", request); g_print ("\n"); - /* Restore original terminal settings */ - if (!echo_on) - tcsetattr (STDIN_FILENO, TCSADRAIN, &termios_orig); - return response; } @@ -142,7 +127,7 @@ nmc_start_polkit_agent_start_try (NmCli *nmc) #else /* polkit agent is not avalable; implement stub functions. */ -#include +#include "nm-default.h" #include "nmcli.h" #include "polkit-agent.h" diff --git a/clients/cli/settings-docs.c b/clients/cli/settings-docs.c index eadc5076..8de1ed21 100644 --- a/clients/cli/settings-docs.c +++ b/clients/cli/settings-docs.c @@ -20,9 +20,11 @@ NmcPropertyDesc setting_802_11_wireless[] = { { "hidden", "If TRUE, indicates this network is a non-broadcasting network that hides its SSID. In this case various workarounds may take place, such as probe-scanning the SSID for more reliable network discovery. However, these workarounds expose inherent insecurities with hidden SSID networks, and thus hidden SSID networks should be used with caution." }, { "mac-address", "If specified, this connection will only apply to the Wi-Fi device whose permanent MAC address matches. This property does not change the MAC address of the device (i.e. MAC spoofing)." }, { "mac-address-blacklist", "A list of permanent MAC addresses of Wi-Fi devices to which this connection should never apply. Each MAC address should be given in the standard hex-digits-and-colons notation (eg \"00:11:22:33:44:55\")." }, + { "mac-address-randomization", "One of NM_SETTING_MAC_RANDOMIZATION_DEFAULT (0) (never randomize unless the user has set a global default to randomize and the supplicant supports randomization), NM_SETTING_MAC_RANDOMIZATION_NEVER (1) (never randomize the MAC address), or NM_SETTING_MAC_RANDOMIZATION_ALWAYS (2) (always randomize the MAC address)." }, { "mode", "Wi-Fi network mode; one of \"infrastructure\", \"adhoc\" or \"ap\". If blank, infrastructure is assumed." }, { "mtu", "If non-zero, only transmit packets of the specified size or smaller, breaking larger packets up into multiple Ethernet frames." }, { "name", "The setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example \"ppp\" or \"wireless\" or \"wired\"." }, + { "powersave", "If set to FALSE, Wi-Fi power saving behavior is disabled. If set to TRUE, Wi-Fi power saving behavior is enabled. All other values are reserved. Note that even though only boolean values are allowed, the property type is an unsigned integer to allow for future expansion." }, { "rate", "If non-zero, directs the device to only use the specified bitrate for communication with the access point. Units are in Kb/s, ie 5500 = 5.5 Mbit/s. This property is highly driver dependent and not all devices support setting a static bitrate." }, { "seen-bssids", "A list of BSSIDs (each BSSID formatted as a MAC address like \"00:11:22:33:44:55\") that have been detected as part of the Wi-Fi network. NetworkManager internally tracks previously seen BSSIDs. The property is only meant for reading and reflects the BSSID list of NetworkManager. The changes you make to this property will not be preserved." }, { "ssid", "SSID of the Wi-Fi network. Must be specified." }, @@ -131,6 +133,7 @@ NmcPropertyDesc setting_bridge[] = { { "hello-time", "The Spanning Tree Protocol (STP) hello time, in seconds." }, { "mac-address", "If specified, the MAC address of bridge. When creating a new bridge, this MAC address will be set. When matching an existing (outside NetworkManager created) bridge, this MAC address must match." }, { "max-age", "The Spanning Tree Protocol (STP) maximum message age, in seconds." }, + { "multicast-snooping", "Controls whether IGMP snooping is enabled for this bridge. Note that if snooping was automatically disabled due to hash collisions, the system may refuse to enable the feature until the collisions are resolved." }, { "name", "The setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example \"ppp\" or \"wireless\" or \"wired\"." }, { "priority", "Sets the Spanning Tree Protocol (STP) priority for this bridge. Lower values are \"better\"; the lowest priority bridge will be elected the root bridge." }, { "stp", "Controls whether Spanning Tree Protocol (STP) is enabled for this bridge." }, @@ -158,8 +161,9 @@ NmcPropertyDesc setting_connection[] = { { "gateway-ping-timeout", "If greater than zero, delay success of IP addressing until either the timeout is reached, or an IP gateway replies to a ping." }, { "id", "A human readable unique identifier for the connection, like \"Work Wi-Fi\" or \"T-Mobile 3G\"." }, { "interface-name", "The name of the network interface this connection is bound to. If not set, then the connection can be attached to any interface of the appropriate type (subject to restrictions imposed by other settings). For software devices this specifies the name of the created device. For connection types where interface names cannot easily be made persistent (e.g. mobile broadband or USB Ethernet), this property should not be used. Setting this property restricts the interfaces a connection can be used with, and if interface names change or are reordered the connection may be applied to the wrong interface." }, + { "lldp", "Whether LLDP is enabled for the connection." }, { "master", "Interface name of the master device or UUID of the master connection." }, - { "metered", "Whether the connection is metered." }, + { "metered", "Whether the connection is metered. When updating this property on a currently activated connection, the change takes effect immediately." }, { "name", "The setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example \"ppp\" or \"wireless\" or \"wired\"." }, { "permissions", "An array of strings defining what access a given user has to this connection. If this is NULL or empty, all users are allowed to access this connection. Otherwise a user is allowed to access this connection if and only if they are in this list. Each entry is of the form \"[type]:[id]:[reserved]\"; for example, \"user:dcbw:blah\". At this time only the \"user\" [type] is allowed. Any other values are ignored and reserved for future use. [id] is the username that this permission refers to, which may not contain the \":\" character. Any [reserved] information present must be ignored and is reserved for future use. All of [type], [id], and [reserved] must be valid UTF-8." }, { "read-only", "FALSE if the connection can be modified using the provided settings service's D-Bus interface with the right privileges, or TRUE if the connection is read-only and cannot be modified." }, @@ -168,7 +172,7 @@ NmcPropertyDesc setting_connection[] = { { "timestamp", "The time, in seconds since the Unix Epoch, that the connection was last _successfully_ fully activated. NetworkManager updates the connection timestamp periodically when the connection is active to ensure that an active connection has the latest timestamp. The property is only meant for reading (changes to this property will not be preserved)." }, { "type", "Base type of the connection. For hardware-dependent connections, should contain the setting name of the hardware-type specific setting (ie, \"802-3-ethernet\" or \"802-11-wireless\" or \"bluetooth\", etc), and for non-hardware dependent connections like VPN or otherwise, should contain the setting name of that setting type (ie, \"vpn\" or \"bridge\", etc)." }, { "uuid", "A universally unique identifier for the connection, for example generated with libuuid. It should be assigned when the connection is created, and never changed as long as the connection still applies to the same network. For example, it should not be changed when the \"id\" property or NMSettingIP4Config changes, but might need to be re-created when the Wi-Fi SSID, mobile broadband network provider, or \"type\" property changes. The UUID must be in the format \"2815492f-7e56-435e-b2e9-246bd7cdc664\" (ie, contains only hexadecimal characters and \"-\")." }, - { "zone", "The trust level of a the connection. Free form case-insensitive string (for example \"Home\", \"Work\", \"Public\"). NULL or unspecified zone means the connection will be placed in the default zone as defined by the firewall." }, + { "zone", "The trust level of a the connection. Free form case-insensitive string (for example \"Home\", \"Work\", \"Public\"). NULL or unspecified zone means the connection will be placed in the default zone as defined by the firewall. When updating this property on a currently activated connection, the change takes effect immediately." }, }; NmcPropertyDesc setting_dcb[] = { @@ -196,6 +200,7 @@ NmcPropertyDesc setting_generic[] = { NmcPropertyDesc setting_gsm[] = { { "apn", "The GPRS Access Point Name specifying the APN used when establishing a data session with the GSM-based network. The APN often determines how the user will be billed for their network usage and whether the user has access to the Internet or just a provider-specific walled-garden, so it is important to use the correct APN for the user's mobile broadband plan. The APN may only be composed of the characters a-z, 0-9, ., and - per GSM 03.60 Section 14.9." }, + { "device-id", "The device unique identifier (as given by the WWAN management service) which this connection applies to. If given, the connection will only apply to the specified device." }, { "home-only", "When TRUE, only connections to the home network will be allowed. Connections to roaming networks will not be made." }, { "name", "The setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example \"ppp\" or \"wireless\" or \"wired\"." }, { "network-id", "The Network ID (GSM LAI format, ie MCC-MNC) to force specific network registration. If the Network ID is specified, NetworkManager will attempt to force the device to register only on the specified network. This can be used to ensure that the device does not roam when direct roaming control of the device is not otherwise possible." }, @@ -204,6 +209,8 @@ NmcPropertyDesc setting_gsm[] = { { "password-flags", "Flags indicating how to handle the \"password\" property." }, { "pin", "If the SIM is locked with a PIN it must be unlocked before any other operations are requested. Specify the PIN here to allow operation of the device." }, { "pin-flags", "Flags indicating how to handle the \"pin\" property." }, + { "sim-id", "The SIM card unique identifier (as given by the WWAN management service) which this connection applies to. If given, the connection will apply to any device also allowed by \"device-id\" which contains a SIM card matching the given identifier." }, + { "sim-operator-id", "A MCC/MNC string like \"310260\" or \"21601\" identifying the specific mobile network operator which this connection applies to. If given, the connection will apply to any device also allowed by \"device-id\" and \"sim-id\" which contains a SIM card provisioined by the given operator." }, { "username", "The username used to authenticate with the network, if required. Many providers do not require a username, or accept any username. But if a username is required, it is specified here." }, }; @@ -216,12 +223,31 @@ NmcPropertyDesc setting_infiniband[] = { { "transport-mode", "The IP-over-InfiniBand transport mode. Either \"datagram\" or \"connected\"." }, }; +NmcPropertyDesc setting_ip_tunnel[] = { + { "encapsulation-limit", "How many additional levels of encapsulation are permitted to be prepended to packets. This property applies only to IPv6 tunnels." }, + { "flow-label", "The flow label to assign to tunnel packets. This property applies only to IPv6 tunnels." }, + { "input-key", "The key used for tunnel input packets; the property is valid only for certain tunnel modes (GRE, IP6GRE). If empty, no key is used." }, + { "local", "The local endpoint of the tunnel; the value can be empty, otherwise it must contain an IPv4 or IPv6 address." }, + { "mode", "The tunneling mode, for example NM_IP_TUNNEL_MODE_IPIP (1) or NM_IP_TUNNEL_MODE_GRE (2)." }, + { "mtu", "None" }, + { "name", "The setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example \"ppp\" or \"wireless\" or \"wired\"." }, + { "output-key", "The key used for tunnel output packets; the property is valid only for certain tunnel modes (GRE, IP6GRE). If empty, no key is used." }, + { "parent", "If given, specifies the parent interface name or parent connection UUID the new device will be bound to so that tunneled packets will only be routed via that interface." }, + { "path-mtu-discovery", "Whether to enable Path MTU Discovery on this tunnel." }, + { "remote", "The remote endpoint of the tunnel; the value must contain an IPv4 or IPv6 address." }, + { "tos", "The type of service (IPv4) or traffic class (IPv6) field to be set on tunneled packets." }, + { "ttl", "The TTL to assign to tunneled packets. 0 is a special value meaning that packets inherit the TTL value." }, +}; + NmcPropertyDesc setting_ipv4[] = { { "addresses", "Array of IP addresses." }, { "dhcp-client-id", "A string sent to the DHCP server to identify the local machine which the DHCP server may use to customize the DHCP lease and options." }, - { "dhcp-hostname", "If the \"dhcp-send-hostname\" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease." }, + { "dhcp-fqdn", "If the \"dhcp-send-hostname\" property is TRUE, then the specified FQDN will be sent to the DHCP server when acquiring a lease. This property and \"dhcp-hostname\" are mutually exclusive and cannot be set at the same time." }, + { "dhcp-hostname", "If the \"dhcp-send-hostname\" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease. This property and \"dhcp-fqdn\" are mutually exclusive and cannot be set at the same time." }, { "dhcp-send-hostname", "If TRUE, a hostname is sent to the DHCP server when acquiring a lease. Some DHCP servers use this hostname to update DNS databases, essentially providing a static hostname for the computer. If the \"dhcp-hostname\" property is NULL and this property is TRUE, the current persistent hostname of the computer is sent." }, + { "dhcp-timeout", "A timeout for a DHCP transaction in seconds." }, { "dns", "Array of IP addresses of DNS servers." }, + { "dns-options", "Array of DNS options. NULL means that the options are unset and left at the default. In this case NetworkManager will use default options. This is distinct from an empty list of properties." }, { "dns-search", "Array of DNS search domains." }, { "gateway", "The gateway associated with this configuration. This is only meaningful if \"addresses\" is also set." }, { "ignore-auto-dns", "When \"method\" is set to \"auto\" and this property to TRUE, automatically configured nameservers and search domains are ignored and only nameservers and search domains specified in the \"dns\" and \"dns-search\" properties, if any, are used." }, @@ -235,15 +261,17 @@ NmcPropertyDesc setting_ipv4[] = { }; NmcPropertyDesc setting_ipv6[] = { + { "addr-gen-mode", "Configure method for creating the address for use with RFC4862 IPv6 Stateless Address Autoconfiguration. The permitted values are: \"eui64\", \"stable-privacy\" or unset. If the property is set to \"eui64\", the addresses will be generated using the interface tokens derived from hardware address. This makes the host part of the address to stay constant, making it possible to track host's presence when it changes networks. The address changes when the interface hardware is replaced. The value of \"stable-privacy\" enables use of cryptographically secure hash of a secret host-specific key along with the connection identification and the network address as specified by RFC7217. This makes it impossible to use the address track host's presence, and makes the address stable when the network interface hardware is replaced. Leaving this unset causes a default that could be subject to change in future versions to be used. Note that this setting is distinct from the Privacy Extensions as configured by \"ip6-privacy\" property and it does not affect the temporary addresses configured with this option." }, { "addresses", "Array of IP addresses." }, - { "dhcp-hostname", "If the \"dhcp-send-hostname\" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease." }, + { "dhcp-hostname", "If the \"dhcp-send-hostname\" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease. This property and \"dhcp-fqdn\" are mutually exclusive and cannot be set at the same time." }, { "dhcp-send-hostname", "If TRUE, a hostname is sent to the DHCP server when acquiring a lease. Some DHCP servers use this hostname to update DNS databases, essentially providing a static hostname for the computer. If the \"dhcp-hostname\" property is NULL and this property is TRUE, the current persistent hostname of the computer is sent." }, { "dns", "Array of IP addresses of DNS servers." }, + { "dns-options", "Array of DNS options. NULL means that the options are unset and left at the default. In this case NetworkManager will use default options. This is distinct from an empty list of properties." }, { "dns-search", "Array of DNS search domains." }, { "gateway", "The gateway associated with this configuration. This is only meaningful if \"addresses\" is also set." }, { "ignore-auto-dns", "When \"method\" is set to \"auto\" and this property to TRUE, automatically configured nameservers and search domains are ignored and only nameservers and search domains specified in the \"dns\" and \"dns-search\" properties, if any, are used." }, { "ignore-auto-routes", "When \"method\" is set to \"auto\" and this property to TRUE, automatically configured routes are ignored and only routes specified in the \"routes\" property, if any, are used." }, - { "ip6-privacy", "Configure IPv6 Privacy Extensions for SLAAC, described in RFC4941. If enabled, it makes the kernel generate a temporary IPv6 address in addition to the public one generated from MAC address via modified EUI-64. This enhances privacy, but could cause problems in some applications, on the other hand. The permitted values are: -1: unknown, 0: disabled, 1: enabled (prefer public address), 2: enabled (prefer temporary addresses). Having a per-connection setting set to \"-1\" (unknown) means fallback to global configuration \"ipv6.ip6-privacy\". If also global configuration is unspecified or set to \"-1\", fallback to read \"/proc/sys/net/ipv6/conf/default/use_tempaddr\"." }, + { "ip6-privacy", "Configure IPv6 Privacy Extensions for SLAAC, described in RFC4941. If enabled, it makes the kernel generate a temporary IPv6 address in addition to the public one generated from MAC address via modified EUI-64. This enhances privacy, but could cause problems in some applications, on the other hand. The permitted values are: -1: unknown, 0: disabled, 1: enabled (prefer public address), 2: enabled (prefer temporary addresses). Having a per-connection setting set to \"-1\" (unknown) means fallback to global configuration \"ipv6.ip6-privacy\". If also global configuration is unspecified or set to \"-1\", fallback to read \"/proc/sys/net/ipv6/conf/default/use_tempaddr\". Note that this setting is distinct from the Stable Privacy addresses that can be enabled with the \"addr-gen-mode\" property's \"stable-privacy\" setting as another way of avoiding host tracking with IPv6 addresses." }, { "may-fail", "If TRUE, allow overall network configuration to proceed even if the configuration specified by this property times out. Note that at least one IP configuration must succeed or overall network configuration will still fail. For example, in IPv6-only networks, setting this property to TRUE on the NMSettingIP4Config allows the overall network configuration to succeed if IPv4 configuration fails but IPv6 configuration completes successfully." }, { "method", "IP configuration method. NMSettingIP4Config and NMSettingIP6Config both support \"auto\", \"manual\", and \"link-local\". See the subclass-specific documentation for other values. In general, for the \"auto\" method, properties such as \"dns\" and \"routes\" specify information that is added on to the information returned from automatic configuration. The \"ignore-auto-routes\" and \"ignore-auto-dns\" properties modify this behavior. For methods that imply no upstream network, such as \"shared\" or \"link-local\", these properties must be empty." }, { "name", "The setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example \"ppp\" or \"wireless\" or \"wired\"." }, @@ -252,6 +280,14 @@ NmcPropertyDesc setting_ipv6[] = { { "routes", "Array of IP routes." }, }; +NmcPropertyDesc setting_macvlan[] = { + { "mode", "The macvlan mode, which specifies the communication mechanism between multiple macvlans on the same lower device." }, + { "name", "The setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example \"ppp\" or \"wireless\" or \"wired\"." }, + { "parent", "If given, specifies the parent interface name or parent connection UUID from which this MAC-VLAN interface should be created. If this property is not specified, the connection must contain an \"802-3-ethernet\" setting with a \"mac-address\" property." }, + { "promiscuous", "Whether the interface should be put in promiscuous mode." }, + { "tap", "Whether the interface should be a MACVTAP." }, +}; + NmcPropertyDesc setting_ppp[] = { { "baud", "If non-zero, instruct pppd to set the serial port to the specified baudrate. This value should normally be left as 0 to automatically choose the speed." }, { "crtscts", "If TRUE, specify that pppd should set the serial port to use hardware flow control with RTS and CTS signals. This value should normally be set to FALSE." }, @@ -301,9 +337,19 @@ NmcPropertyDesc setting_team_port[] = { { "name", "The setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example \"ppp\" or \"wireless\" or \"wired\"." }, }; +NmcPropertyDesc setting_tun[] = { + { "group", "The group ID which will own the device. If set to NULL everyone will be able to use the device." }, + { "mode", "The operating mode of the virtual device. Allowed values are NM_SETTING_TUN_MODE_TUN (1) to create a layer 3 device and NM_SETTING_TUN_MODE_TAP (2) to create an Ethernet-like layer 2 one." }, + { "multi-queue", "If the property is set to TRUE, the interface will support multiple file descriptors (queues) to parallelize packet sending or receiving. Otherwise, the interface will only support a single queue." }, + { "name", "The setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example \"ppp\" or \"wireless\" or \"wired\"." }, + { "owner", "The user ID which will own the device. If set to NULL everyone will be able to use the device." }, + { "pi", "If TRUE the interface will prepend a 4 byte header describing the physical interface to the packets." }, + { "vnet-hdr", "If TRUE the IFF_VNET_HDR the tunnel packets will include a virtio network header." }, +}; + NmcPropertyDesc setting_vlan[] = { { "egress-priority-map", "For outgoing packets, a list of mappings from Linux SKB priorities to 802.1p priorities. The mapping is given in the format \"from:to\" where both \"from\" and \"to\" are unsigned integers, ie \"7:3\"." }, - { "flags", "One or more flags which control the behavior and features of the VLAN interface. Flags include NM_VLAN_FLAG_REORDER_HEADERS (0x1) (reordering of output packet headers), NM_VLAN_FLAG_GVRP (0x2) (use of the GVRP protocol), and NM_VLAN_FLAG_LOOSE_BINDING (0x4) (loose binding of the interface to its master device's operating state)." }, + { "flags", "One or more flags which control the behavior and features of the VLAN interface. Flags include NM_VLAN_FLAG_REORDER_HEADERS (0x1) (reordering of output packet headers), NM_VLAN_FLAG_GVRP (0x2) (use of the GVRP protocol), and NM_VLAN_FLAG_LOOSE_BINDING (0x4) (loose binding of the interface to its master device's operating state). NM_VLAN_FLAG_MVRP (0x8) (use of the MVRP protocol). The default value of this property is NM_VLAN_FLAG_REORDER_HEADERS, but it used to be 0. To preserve backward compatibility, the default-value in the D-Bus API continues to be 0 and a missing property on D-Bus is still considered as 0." }, { "id", "The VLAN identifier that the interface created by this connection should be assigned." }, { "ingress-priority-map", "For incoming packets, a list of mappings from 802.1p priorities to Linux SKB priorities. The mapping is given in the format \"from:to\" where both \"from\" and \"to\" are unsigned integers, ie \"7:3\"." }, { "name", "The setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example \"ppp\" or \"wireless\" or \"wired\"." }, @@ -316,13 +362,34 @@ NmcPropertyDesc setting_vpn[] = { { "persistent", "If the VPN service supports persistence, and this property is TRUE, the VPN will attempt to stay connected across link changes and outages, until explicitly disconnected." }, { "secrets", "Dictionary of key/value pairs of VPN plugin specific secrets like passwords or private keys. Both keys and values must be strings." }, { "service-type", "D-Bus service name of the VPN plugin that this setting uses to connect to its network. i.e. org.freedesktop.NetworkManager.vpnc for the vpnc plugin." }, + { "timeout", "Timeout for the VPN service to establish the connection. Some services may take quite a long time to connect. Value of 0 means a default timeout, which is 60 seconds (unless overriden by vpn.timeout in configuration file). Values greater than zero mean timeout in seconds." }, { "user-name", "If the VPN connection requires a user name for authentication, that name should be provided here. If the connection is available to more than one user, and the VPN requires each user to supply a different name, then leave this property empty. If this property is empty, NetworkManager will automatically supply the username of the user which requested the VPN connection." }, }; +NmcPropertyDesc setting_vxlan[] = { + { "ageing", "Specifies the lifetime in seconds of FDB entries learnt by the kernel." }, + { "destination-port", "Specifies the UDP destination port to communicate to the remote VXLAN tunnel endpoint." }, + { "id", "Specifies the VXLAN Network Identifer (or VXLAN Segment Identifier) to use." }, + { "l2-miss", "Specifies whether netlink LL ADDR miss notifications are generated." }, + { "l3-miss", "Specifies whether netlink IP ADDR miss notifications are generated." }, + { "learning", "Specifies whether unknown source link layer addresses and IP addresses are entered into the VXLAN device forwarding database." }, + { "limit", "Specifies the maximum number of FDB entries. A value of zero means that the kernel will store unlimited entries." }, + { "local", "If given, specifies the source IP address to use in outgoing packets." }, + { "name", "The setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example \"ppp\" or \"wireless\" or \"wired\"." }, + { "parent", "If given, specifies the parent interface name or parent connection UUID." }, + { "proxy", "Specifies whether ARP proxy is turned on." }, + { "remote", "Specifies the unicast destination IP address to use in outgoing packets when the destination link layer address is not known in the VXLAN device forwarding database, or the multicast IP address to join." }, + { "rsc", "Specifies whether route short circuit is turned on." }, + { "source-port-max", "Specifies the maximum UDP source port to communicate to the remote VXLAN tunnel endpoint." }, + { "source-port-min", "Specifies the minimum UDP source port to communicate to the remote VXLAN tunnel endpoint." }, + { "tos", "Specifies the TOS value to use in outgoing packets." }, + { "ttl", "Specifies the time-to-live value to use in outgoing packets." }, +}; + NmcPropertyDesc setting_wimax[] = { - { "mac-address", "If specified, this connection will only apply to the WiMAX device whose MAC address matches. This property does not change the MAC address of the device (known as MAC spoofing)." }, + { "mac-address", "If specified, this connection will only apply to the WiMAX device whose MAC address matches. This property does not change the MAC address of the device (known as MAC spoofing). Deprecated: 1" }, { "name", "The setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example \"ppp\" or \"wireless\" or \"wired\"." }, - { "network-name", "Network Service Provider (NSP) name of the WiMAX network this connection should use." }, + { "network-name", "Network Service Provider (NSP) name of the WiMAX network this connection should use. Deprecated: 1" }, }; @@ -335,30 +402,34 @@ typedef struct { NmcSettingDesc all_settings[] = { { "802-11-olpc-mesh", setting_802_11_olpc_mesh, 4 }, - { "802-11-wireless", setting_802_11_wireless, 14 }, + { "802-11-wireless", setting_802_11_wireless, 16 }, { "802-11-wireless-security", setting_802_11_wireless_security, 18 }, { "802-1x", setting_802_1x, 33 }, { "802-3-ethernet", setting_802_3_ethernet, 14 }, { "adsl", setting_adsl, 8 }, { "bluetooth", setting_bluetooth, 3 }, { "bond", setting_bond, 2 }, - { "bridge", setting_bridge, 8 }, + { "bridge", setting_bridge, 9 }, { "bridge-port", setting_bridge_port, 4 }, { "cdma", setting_cdma, 5 }, - { "connection", setting_connection, 17 }, + { "connection", setting_connection, 18 }, { "dcb", setting_dcb, 16 }, { "generic", setting_generic, 1 }, - { "gsm", setting_gsm, 10 }, + { "gsm", setting_gsm, 13 }, { "infiniband", setting_infiniband, 6 }, - { "ipv4", setting_ipv4, 15 }, - { "ipv6", setting_ipv6, 15 }, + { "ip-tunnel", setting_ip_tunnel, 13 }, + { "ipv4", setting_ipv4, 18 }, + { "ipv6", setting_ipv6, 17 }, + { "macvlan", setting_macvlan, 5 }, { "ppp", setting_ppp, 19 }, { "pppoe", setting_pppoe, 5 }, { "serial", setting_serial, 6 }, { "team", setting_team, 2 }, { "team-port", setting_team_port, 2 }, + { "tun", setting_tun, 7 }, { "vlan", setting_vlan, 6 }, - { "vpn", setting_vpn, 6 }, + { "vpn", setting_vpn, 7 }, + { "vxlan", setting_vxlan, 17 }, { "wimax", setting_wimax, 3 }, }; diff --git a/clients/cli/settings.c b/clients/cli/settings.c index 6a3c90c2..9f95dfe2 100644 --- a/clients/cli/settings.c +++ b/clients/cli/settings.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. * - * Copyright 2010 - 2014 Red Hat, Inc. + * Copyright 2010 - 2015 Red Hat, Inc. */ #include "config.h" @@ -22,13 +22,10 @@ #include #include -#include -#include - +#include "nm-default.h" #include "utils.h" #include "common.h" #include "settings.h" -#include "nm-glib-compat.h" #include "nm-macros-internal.h" #include "gsystem-local-alloc.h" @@ -41,27 +38,28 @@ typedef enum { } NmcPropertyGetType; /* Helper macro to define fields */ -#define SETTING_FIELD(setting, width) { setting, N_(setting), width, NULL, FALSE, FALSE, 0 } +#define SETTING_FIELD(setting) { setting, N_(setting), 0, NULL, FALSE, FALSE, 0 } /* Available fields for NM_SETTING_CONNECTION_SETTING_NAME */ NmcOutputField nmc_fields_setting_connection[] = { - SETTING_FIELD ("name", 15), /* 0 */ - SETTING_FIELD (NM_SETTING_CONNECTION_ID, 25), /* 1 */ - SETTING_FIELD (NM_SETTING_CONNECTION_UUID, 38), /* 2 */ - SETTING_FIELD (NM_SETTING_CONNECTION_INTERFACE_NAME, 20), /* 3 */ - SETTING_FIELD (NM_SETTING_CONNECTION_TYPE, 17), /* 4 */ - SETTING_FIELD (NM_SETTING_CONNECTION_AUTOCONNECT, 13), /* 5 */ - SETTING_FIELD (NM_SETTING_CONNECTION_AUTOCONNECT_PRIORITY, 10), /* 6 */ - SETTING_FIELD (NM_SETTING_CONNECTION_TIMESTAMP, 10), /* 7 */ - SETTING_FIELD (NM_SETTING_CONNECTION_READ_ONLY, 10), /* 8 */ - SETTING_FIELD (NM_SETTING_CONNECTION_PERMISSIONS, 30), /* 9 */ - SETTING_FIELD (NM_SETTING_CONNECTION_ZONE, 10), /* 10 */ - SETTING_FIELD (NM_SETTING_CONNECTION_MASTER, 20), /* 11 */ - SETTING_FIELD (NM_SETTING_CONNECTION_SLAVE_TYPE, 20), /* 12 */ - SETTING_FIELD (NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES, 13), /* 13 */ - SETTING_FIELD (NM_SETTING_CONNECTION_SECONDARIES, 40), /* 14 */ - SETTING_FIELD (NM_SETTING_CONNECTION_GATEWAY_PING_TIMEOUT, 30), /* 15 */ - SETTING_FIELD (NM_SETTING_CONNECTION_METERED, 10), /* 16 */ + SETTING_FIELD ("name"), /* 0 */ + SETTING_FIELD (NM_SETTING_CONNECTION_ID), /* 1 */ + SETTING_FIELD (NM_SETTING_CONNECTION_UUID), /* 2 */ + SETTING_FIELD (NM_SETTING_CONNECTION_INTERFACE_NAME), /* 3 */ + SETTING_FIELD (NM_SETTING_CONNECTION_TYPE), /* 4 */ + SETTING_FIELD (NM_SETTING_CONNECTION_AUTOCONNECT), /* 5 */ + SETTING_FIELD (NM_SETTING_CONNECTION_AUTOCONNECT_PRIORITY), /* 6 */ + SETTING_FIELD (NM_SETTING_CONNECTION_TIMESTAMP), /* 7 */ + SETTING_FIELD (NM_SETTING_CONNECTION_READ_ONLY), /* 8 */ + SETTING_FIELD (NM_SETTING_CONNECTION_PERMISSIONS), /* 9 */ + SETTING_FIELD (NM_SETTING_CONNECTION_ZONE), /* 10 */ + SETTING_FIELD (NM_SETTING_CONNECTION_MASTER), /* 11 */ + SETTING_FIELD (NM_SETTING_CONNECTION_SLAVE_TYPE), /* 12 */ + SETTING_FIELD (NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES), /* 13 */ + SETTING_FIELD (NM_SETTING_CONNECTION_SECONDARIES), /* 14 */ + SETTING_FIELD (NM_SETTING_CONNECTION_GATEWAY_PING_TIMEOUT), /* 15 */ + SETTING_FIELD (NM_SETTING_CONNECTION_METERED), /* 16 */ + SETTING_FIELD (NM_SETTING_CONNECTION_LLDP), /* 17 */ {NULL, NULL, 0, NULL, FALSE, FALSE, 0} }; #define NMC_FIELDS_SETTING_CONNECTION_ALL "name"","\ @@ -80,25 +78,26 @@ NmcOutputField nmc_fields_setting_connection[] = { NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES","\ NM_SETTING_CONNECTION_SECONDARIES","\ NM_SETTING_CONNECTION_GATEWAY_PING_TIMEOUT","\ - NM_SETTING_CONNECTION_METERED + NM_SETTING_CONNECTION_METERED","\ + NM_SETTING_CONNECTION_LLDP #define NMC_FIELDS_SETTING_CONNECTION_COMMON NMC_FIELDS_SETTING_CONNECTION_ALL /* Available fields for NM_SETTING_WIRED_SETTING_NAME */ NmcOutputField nmc_fields_setting_wired[] = { - SETTING_FIELD ("name", 17), /* 0 */ - SETTING_FIELD (NM_SETTING_WIRED_PORT, 8), /* 1 */ - SETTING_FIELD (NM_SETTING_WIRED_SPEED, 10), /* 2 */ - SETTING_FIELD (NM_SETTING_WIRED_DUPLEX, 10), /* 3 */ - SETTING_FIELD (NM_SETTING_WIRED_AUTO_NEGOTIATE, 15), /* 4 */ - SETTING_FIELD (NM_SETTING_WIRED_MAC_ADDRESS, 19), /* 5 */ - SETTING_FIELD (NM_SETTING_WIRED_CLONED_MAC_ADDRESS, 19), /* 6 */ - SETTING_FIELD (NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST, 39), /* 7 */ - SETTING_FIELD (NM_SETTING_WIRED_MTU, 6), /* 8 */ - SETTING_FIELD (NM_SETTING_WIRED_S390_SUBCHANNELS, 20), /* 9 */ - SETTING_FIELD (NM_SETTING_WIRED_S390_NETTYPE, 15), /* 10 */ - SETTING_FIELD (NM_SETTING_WIRED_S390_OPTIONS, 20), /* 11 */ - SETTING_FIELD (NM_SETTING_WIRED_WAKE_ON_LAN, 10), /* 12 */ - SETTING_FIELD (NM_SETTING_WIRED_WAKE_ON_LAN_PASSWORD, 20), /* 13 */ + SETTING_FIELD ("name"), /* 0 */ + SETTING_FIELD (NM_SETTING_WIRED_PORT), /* 1 */ + SETTING_FIELD (NM_SETTING_WIRED_SPEED), /* 2 */ + SETTING_FIELD (NM_SETTING_WIRED_DUPLEX), /* 3 */ + SETTING_FIELD (NM_SETTING_WIRED_AUTO_NEGOTIATE), /* 4 */ + SETTING_FIELD (NM_SETTING_WIRED_MAC_ADDRESS), /* 5 */ + SETTING_FIELD (NM_SETTING_WIRED_CLONED_MAC_ADDRESS), /* 6 */ + SETTING_FIELD (NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST), /* 7 */ + SETTING_FIELD (NM_SETTING_WIRED_MTU), /* 8 */ + SETTING_FIELD (NM_SETTING_WIRED_S390_SUBCHANNELS), /* 9 */ + SETTING_FIELD (NM_SETTING_WIRED_S390_NETTYPE), /* 10 */ + SETTING_FIELD (NM_SETTING_WIRED_S390_OPTIONS), /* 11 */ + SETTING_FIELD (NM_SETTING_WIRED_WAKE_ON_LAN), /* 12 */ + SETTING_FIELD (NM_SETTING_WIRED_WAKE_ON_LAN_PASSWORD), /* 13 */ {NULL, NULL, 0, NULL, FALSE, FALSE, 0} }; #define NMC_FIELDS_SETTING_WIRED_ALL "name"","\ @@ -119,39 +118,39 @@ NmcOutputField nmc_fields_setting_wired[] = { /* Available fields for NM_SETTING_802_1X_SETTING_NAME */ NmcOutputField nmc_fields_setting_8021X[] = { - SETTING_FIELD ("name", 10), /* 0 */ - 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_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_PASSWORD_FLAGS, 20), /* 21 */ - SETTING_FIELD (NM_SETTING_802_1X_PASSWORD_RAW, 20), /* 22 */ - SETTING_FIELD (NM_SETTING_802_1X_PASSWORD_RAW_FLAGS, 20), /* 23 */ - SETTING_FIELD (NM_SETTING_802_1X_PRIVATE_KEY, 15), /* 24 */ - SETTING_FIELD (NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD, 20), /* 25 */ - SETTING_FIELD (NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD_FLAGS, 20), /* 26 */ - SETTING_FIELD (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY, 20), /* 27 */ - SETTING_FIELD (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD, 20), /* 28 */ - SETTING_FIELD (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD_FLAGS, 20), /* 29 */ - SETTING_FIELD (NM_SETTING_802_1X_PIN, 8), /* 30 */ - SETTING_FIELD (NM_SETTING_802_1X_PIN_FLAGS, 20), /* 31 */ - SETTING_FIELD (NM_SETTING_802_1X_SYSTEM_CA_CERTS, 17), /* 32 */ + SETTING_FIELD ("name"), /* 0 */ + SETTING_FIELD (NM_SETTING_802_1X_EAP), /* 1 */ + SETTING_FIELD (NM_SETTING_802_1X_IDENTITY), /* 2 */ + SETTING_FIELD (NM_SETTING_802_1X_ANONYMOUS_IDENTITY), /* 3 */ + SETTING_FIELD (NM_SETTING_802_1X_PAC_FILE), /* 4 */ + SETTING_FIELD (NM_SETTING_802_1X_CA_CERT), /* 5 */ + SETTING_FIELD (NM_SETTING_802_1X_CA_PATH), /* 6 */ + SETTING_FIELD (NM_SETTING_802_1X_SUBJECT_MATCH), /* 7 */ + SETTING_FIELD (NM_SETTING_802_1X_ALTSUBJECT_MATCHES), /* 8 */ + SETTING_FIELD (NM_SETTING_802_1X_CLIENT_CERT), /* 9 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE1_PEAPVER), /* 10 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE1_PEAPLABEL), /* 11 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE1_FAST_PROVISIONING), /* 12 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE2_AUTH), /* 13 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE2_AUTHEAP), /* 14 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE2_CA_CERT), /* 15 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE2_CA_PATH), /* 16 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE2_SUBJECT_MATCH), /* 17 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE2_ALTSUBJECT_MATCHES), /* 18 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE2_CLIENT_CERT), /* 19 */ + SETTING_FIELD (NM_SETTING_802_1X_PASSWORD), /* 20 */ + SETTING_FIELD (NM_SETTING_802_1X_PASSWORD_FLAGS), /* 21 */ + SETTING_FIELD (NM_SETTING_802_1X_PASSWORD_RAW), /* 22 */ + SETTING_FIELD (NM_SETTING_802_1X_PASSWORD_RAW_FLAGS), /* 23 */ + SETTING_FIELD (NM_SETTING_802_1X_PRIVATE_KEY), /* 24 */ + SETTING_FIELD (NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD), /* 25 */ + SETTING_FIELD (NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD_FLAGS), /* 26 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY), /* 27 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD), /* 28 */ + SETTING_FIELD (NM_SETTING_802_1X_PHASE2_PRIVATE_KEY_PASSWORD_FLAGS), /* 29 */ + SETTING_FIELD (NM_SETTING_802_1X_PIN), /* 30 */ + SETTING_FIELD (NM_SETTING_802_1X_PIN_FLAGS), /* 31 */ + SETTING_FIELD (NM_SETTING_802_1X_SYSTEM_CA_CERTS), /* 32 */ {NULL, NULL, 0, NULL, FALSE, FALSE, 0} }; #define NMC_FIELDS_SETTING_802_1X_ALL "name"","\ @@ -191,20 +190,22 @@ NmcOutputField nmc_fields_setting_8021X[] = { /* Available fields for NM_SETTING_WIRELESS_SETTING_NAME */ NmcOutputField nmc_fields_setting_wireless[] = { - SETTING_FIELD ("name", 17), /* 0 */ - SETTING_FIELD (NM_SETTING_WIRELESS_SSID, 34), /* 1 */ - SETTING_FIELD (NM_SETTING_WIRELESS_MODE, 15), /* 2 */ - SETTING_FIELD (NM_SETTING_WIRELESS_BAND, 10), /* 3 */ - SETTING_FIELD (NM_SETTING_WIRELESS_CHANNEL, 10), /* 4 */ - SETTING_FIELD (NM_SETTING_WIRELESS_BSSID, 19), /* 5 */ - SETTING_FIELD (NM_SETTING_WIRELESS_RATE, 10), /* 6 */ - SETTING_FIELD (NM_SETTING_WIRELESS_TX_POWER, 10), /* 7 */ - SETTING_FIELD (NM_SETTING_WIRELESS_MAC_ADDRESS, 19), /* 8 */ - SETTING_FIELD (NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS, 19), /* 9 */ - SETTING_FIELD (NM_SETTING_WIRELESS_MAC_ADDRESS_BLACKLIST, 39), /* 10 */ - SETTING_FIELD (NM_SETTING_WIRELESS_MTU, 6), /* 11 */ - SETTING_FIELD (NM_SETTING_WIRELESS_SEEN_BSSIDS, 35), /* 12 */ - SETTING_FIELD (NM_SETTING_WIRELESS_HIDDEN, 10), /* 13 */ + SETTING_FIELD ("name"), /* 0 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SSID), /* 1 */ + SETTING_FIELD (NM_SETTING_WIRELESS_MODE), /* 2 */ + SETTING_FIELD (NM_SETTING_WIRELESS_BAND), /* 3 */ + SETTING_FIELD (NM_SETTING_WIRELESS_CHANNEL), /* 4 */ + SETTING_FIELD (NM_SETTING_WIRELESS_BSSID), /* 5 */ + SETTING_FIELD (NM_SETTING_WIRELESS_RATE), /* 6 */ + SETTING_FIELD (NM_SETTING_WIRELESS_TX_POWER), /* 7 */ + SETTING_FIELD (NM_SETTING_WIRELESS_MAC_ADDRESS), /* 8 */ + SETTING_FIELD (NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS), /* 9 */ + SETTING_FIELD (NM_SETTING_WIRELESS_MAC_ADDRESS_BLACKLIST), /* 10 */ + SETTING_FIELD (NM_SETTING_WIRELESS_MAC_ADDRESS_RANDOMIZATION), /* 11 */ + SETTING_FIELD (NM_SETTING_WIRELESS_MTU), /* 12 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SEEN_BSSIDS), /* 13 */ + SETTING_FIELD (NM_SETTING_WIRELESS_HIDDEN), /* 14 */ + SETTING_FIELD (NM_SETTING_WIRELESS_POWERSAVE), /* 15 */ {NULL, NULL, 0, NULL, FALSE, FALSE, 0} }; #define NMC_FIELDS_SETTING_WIRELESS_ALL "name"","\ @@ -218,31 +219,33 @@ NmcOutputField nmc_fields_setting_wireless[] = { NM_SETTING_WIRELESS_MAC_ADDRESS","\ NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS","\ NM_SETTING_WIRELESS_MAC_ADDRESS_BLACKLIST","\ + NM_SETTING_WIRELESS_MAC_ADDRESS_RANDOMIZATION","\ NM_SETTING_WIRELESS_MTU","\ NM_SETTING_WIRELESS_SEEN_BSSIDS","\ - NM_SETTING_WIRELESS_HIDDEN + NM_SETTING_WIRELESS_HIDDEN"," \ + NM_SETTING_WIRELESS_POWERSAVE #define NMC_FIELDS_SETTING_WIRELESS_COMMON NMC_FIELDS_SETTING_WIRELESS_ALL /* Available fields for NM_SETTING_WIRELESS_SECURITY_SETTING_NAME */ NmcOutputField nmc_fields_setting_wireless_security[] = { - SETTING_FIELD ("name", 25), /* 0 */ - SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, 10), /* 1 */ - SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX, 15), /* 2 */ - SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, 10), /* 3 */ - SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_PROTO, 10), /* 4 */ - SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_PAIRWISE, 10), /* 5 */ - SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_GROUP, 10), /* 6 */ - SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME, 15), /* 7 */ - SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_WEP_KEY0, 10), /* 8 */ - SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_WEP_KEY1, 10), /* 9 */ - SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_WEP_KEY2, 10), /* 10 */ - SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_WEP_KEY3, 10), /* 11 */ - SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_WEP_KEY_FLAGS, 20), /* 12 */ - SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_WEP_KEY_TYPE, 15), /* 13 */ - SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_PSK, 6), /* 14 */ - SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_PSK_FLAGS, 20), /* 15 */ - SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD, 15), /* 16 */ - SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD_FLAGS, 20), /* 17 */ + SETTING_FIELD ("name"), /* 0 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_KEY_MGMT), /* 1 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX), /* 2 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_AUTH_ALG), /* 3 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_PROTO), /* 4 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_PAIRWISE), /* 5 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_GROUP), /* 6 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_LEAP_USERNAME), /* 7 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_WEP_KEY0), /* 8 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_WEP_KEY1), /* 9 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_WEP_KEY2), /* 10 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_WEP_KEY3), /* 11 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_WEP_KEY_FLAGS), /* 12 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_WEP_KEY_TYPE), /* 13 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_PSK), /* 14 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_PSK_FLAGS), /* 15 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD), /* 16 */ + SETTING_FIELD (NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD_FLAGS), /* 17 */ {NULL, NULL, 0, NULL, FALSE, FALSE, 0} }; #define NMC_FIELDS_SETTING_WIRELESS_SECURITY_ALL "name"","\ @@ -267,27 +270,31 @@ NmcOutputField nmc_fields_setting_wireless_security[] = { /* Available fields for NM_SETTING_IP4_CONFIG_SETTING_NAME */ NmcOutputField nmc_fields_setting_ip4_config[] = { - SETTING_FIELD ("name", 8), /* 0 */ - SETTING_FIELD (NM_SETTING_IP_CONFIG_METHOD, 10), /* 1 */ - SETTING_FIELD (NM_SETTING_IP_CONFIG_DNS, 20), /* 2 */ - SETTING_FIELD (NM_SETTING_IP_CONFIG_DNS_SEARCH, 15), /* 3 */ - SETTING_FIELD (NM_SETTING_IP_CONFIG_ADDRESSES, 20), /* 4 */ - SETTING_FIELD (NM_SETTING_IP_CONFIG_GATEWAY, 20), /* 5 */ - SETTING_FIELD (NM_SETTING_IP_CONFIG_ROUTES, 20), /* 6 */ - SETTING_FIELD (NM_SETTING_IP_CONFIG_ROUTE_METRIC, 15), /* 7 */ - SETTING_FIELD (NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES, 19), /* 8 */ - SETTING_FIELD (NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS, 16), /* 9 */ - SETTING_FIELD (NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID, 15), /* 10 */ - SETTING_FIELD (NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME, 19), /* 11 */ - SETTING_FIELD (NM_SETTING_IP_CONFIG_DHCP_HOSTNAME, 14), /* 12 */ - SETTING_FIELD (NM_SETTING_IP_CONFIG_NEVER_DEFAULT, 15), /* 13 */ - SETTING_FIELD (NM_SETTING_IP_CONFIG_MAY_FAIL, 12), /* 14 */ + SETTING_FIELD ("name"), /* 0 */ + SETTING_FIELD (NM_SETTING_IP_CONFIG_METHOD), /* 1 */ + SETTING_FIELD (NM_SETTING_IP_CONFIG_DNS), /* 2 */ + SETTING_FIELD (NM_SETTING_IP_CONFIG_DNS_SEARCH), /* 3 */ + SETTING_FIELD (NM_SETTING_IP_CONFIG_DNS_OPTIONS), /* 4 */ + SETTING_FIELD (NM_SETTING_IP_CONFIG_ADDRESSES), /* 5 */ + SETTING_FIELD (NM_SETTING_IP_CONFIG_GATEWAY), /* 6 */ + SETTING_FIELD (NM_SETTING_IP_CONFIG_ROUTES), /* 7 */ + SETTING_FIELD (NM_SETTING_IP_CONFIG_ROUTE_METRIC), /* 8 */ + SETTING_FIELD (NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES), /* 9 */ + SETTING_FIELD (NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS), /* 10 */ + SETTING_FIELD (NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID), /* 11 */ + SETTING_FIELD (NM_SETTING_IP4_CONFIG_DHCP_TIMEOUT), /* 12 */ + SETTING_FIELD (NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME), /* 13 */ + SETTING_FIELD (NM_SETTING_IP_CONFIG_DHCP_HOSTNAME), /* 14 */ + SETTING_FIELD (NM_SETTING_IP4_CONFIG_DHCP_FQDN), /* 15 */ + SETTING_FIELD (NM_SETTING_IP_CONFIG_NEVER_DEFAULT), /* 16 */ + SETTING_FIELD (NM_SETTING_IP_CONFIG_MAY_FAIL), /* 17 */ {NULL, NULL, 0, NULL, FALSE, FALSE, 0} }; #define NMC_FIELDS_SETTING_IP4_CONFIG_ALL "name"","\ NM_SETTING_IP_CONFIG_METHOD","\ NM_SETTING_IP_CONFIG_DNS","\ NM_SETTING_IP_CONFIG_DNS_SEARCH","\ + NM_SETTING_IP_CONFIG_DNS_OPTIONS","\ NM_SETTING_IP_CONFIG_ADDRESSES","\ NM_SETTING_IP_CONFIG_GATEWAY","\ NM_SETTING_IP_CONFIG_ROUTES","\ @@ -295,35 +302,40 @@ NmcOutputField nmc_fields_setting_ip4_config[] = { NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES","\ NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS","\ NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID","\ + NM_SETTING_IP4_CONFIG_DHCP_TIMEOUT","\ NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME","\ NM_SETTING_IP_CONFIG_DHCP_HOSTNAME","\ + NM_SETTING_IP4_CONFIG_DHCP_FQDN","\ NM_SETTING_IP_CONFIG_NEVER_DEFAULT","\ NM_SETTING_IP_CONFIG_MAY_FAIL #define NMC_FIELDS_SETTING_IP4_CONFIG_COMMON NMC_FIELDS_SETTING_IP4_CONFIG_ALL /* Available fields for NM_SETTING_IP6_CONFIG_SETTING_NAME */ NmcOutputField nmc_fields_setting_ip6_config[] = { - SETTING_FIELD ("name", 8), /* 0 */ - SETTING_FIELD (NM_SETTING_IP_CONFIG_METHOD, 10), /* 1 */ - SETTING_FIELD (NM_SETTING_IP_CONFIG_DNS, 20), /* 2 */ - SETTING_FIELD (NM_SETTING_IP_CONFIG_DNS_SEARCH, 15), /* 3 */ - SETTING_FIELD (NM_SETTING_IP_CONFIG_ADDRESSES, 20), /* 4 */ - SETTING_FIELD (NM_SETTING_IP_CONFIG_GATEWAY, 20), /* 5 */ - SETTING_FIELD (NM_SETTING_IP_CONFIG_ROUTES, 20), /* 6 */ - SETTING_FIELD (NM_SETTING_IP_CONFIG_ROUTE_METRIC, 15), /* 7 */ - SETTING_FIELD (NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES, 19), /* 8 */ - SETTING_FIELD (NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS, 16), /* 9 */ - SETTING_FIELD (NM_SETTING_IP_CONFIG_NEVER_DEFAULT, 15), /* 10 */ - SETTING_FIELD (NM_SETTING_IP_CONFIG_MAY_FAIL, 12), /* 11 */ - SETTING_FIELD (NM_SETTING_IP6_CONFIG_IP6_PRIVACY, 15), /* 12 */ - SETTING_FIELD (NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME, 19), /* 13 */ - SETTING_FIELD (NM_SETTING_IP_CONFIG_DHCP_HOSTNAME, 14), /* 14 */ + SETTING_FIELD ("name"), /* 0 */ + SETTING_FIELD (NM_SETTING_IP_CONFIG_METHOD), /* 1 */ + SETTING_FIELD (NM_SETTING_IP_CONFIG_DNS), /* 2 */ + SETTING_FIELD (NM_SETTING_IP_CONFIG_DNS_SEARCH), /* 3 */ + SETTING_FIELD (NM_SETTING_IP_CONFIG_DNS_OPTIONS), /* 4 */ + SETTING_FIELD (NM_SETTING_IP_CONFIG_ADDRESSES), /* 5 */ + SETTING_FIELD (NM_SETTING_IP_CONFIG_GATEWAY), /* 6 */ + SETTING_FIELD (NM_SETTING_IP_CONFIG_ROUTES), /* 7 */ + SETTING_FIELD (NM_SETTING_IP_CONFIG_ROUTE_METRIC), /* 8 */ + SETTING_FIELD (NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES), /* 9 */ + SETTING_FIELD (NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS), /* 10 */ + SETTING_FIELD (NM_SETTING_IP_CONFIG_NEVER_DEFAULT), /* 11 */ + SETTING_FIELD (NM_SETTING_IP_CONFIG_MAY_FAIL), /* 12 */ + SETTING_FIELD (NM_SETTING_IP6_CONFIG_IP6_PRIVACY), /* 13 */ + SETTING_FIELD (NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE), /* 14 */ + SETTING_FIELD (NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME), /* 15 */ + SETTING_FIELD (NM_SETTING_IP_CONFIG_DHCP_HOSTNAME), /* 16 */ {NULL, NULL, 0, NULL, FALSE, FALSE, 0} }; #define NMC_FIELDS_SETTING_IP6_CONFIG_ALL "name"","\ NM_SETTING_IP_CONFIG_METHOD","\ NM_SETTING_IP_CONFIG_DNS","\ NM_SETTING_IP_CONFIG_DNS_SEARCH","\ + NM_SETTING_IP_CONFIG_DNS_OPTIONS","\ NM_SETTING_IP_CONFIG_ADDRESSES","\ NM_SETTING_IP_CONFIG_GATEWAY","\ NM_SETTING_IP_CONFIG_ROUTES","\ @@ -333,18 +345,19 @@ NmcOutputField nmc_fields_setting_ip6_config[] = { NM_SETTING_IP_CONFIG_NEVER_DEFAULT","\ NM_SETTING_IP_CONFIG_MAY_FAIL","\ NM_SETTING_IP6_CONFIG_IP6_PRIVACY","\ + NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE","\ NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME","\ NM_SETTING_IP_CONFIG_DHCP_HOSTNAME #define NMC_FIELDS_SETTING_IP6_CONFIG_COMMON NMC_FIELDS_SETTING_IP4_CONFIG_ALL /* Available fields for NM_SETTING_SERIAL_SETTING_NAME */ NmcOutputField nmc_fields_setting_serial[] = { - SETTING_FIELD ("name", 10), /* 0 */ - SETTING_FIELD (NM_SETTING_SERIAL_BAUD, 10), /* 1 */ - SETTING_FIELD (NM_SETTING_SERIAL_BITS, 10), /* 2 */ - SETTING_FIELD (NM_SETTING_SERIAL_PARITY, 10), /* 3 */ - SETTING_FIELD (NM_SETTING_SERIAL_STOPBITS, 10), /* 4 */ - SETTING_FIELD (NM_SETTING_SERIAL_SEND_DELAY, 12), /* 5 */ + SETTING_FIELD ("name"), /* 0 */ + SETTING_FIELD (NM_SETTING_SERIAL_BAUD), /* 1 */ + SETTING_FIELD (NM_SETTING_SERIAL_BITS), /* 2 */ + SETTING_FIELD (NM_SETTING_SERIAL_PARITY), /* 3 */ + SETTING_FIELD (NM_SETTING_SERIAL_STOPBITS), /* 4 */ + SETTING_FIELD (NM_SETTING_SERIAL_SEND_DELAY), /* 5 */ {NULL, NULL, 0, NULL, FALSE, FALSE, 0} }; #define NMC_FIELDS_SETTING_SERIAL_ALL "name"","\ @@ -357,25 +370,25 @@ NmcOutputField nmc_fields_setting_serial[] = { /* Available fields for NM_SETTING_PPP_SETTING_NAME */ NmcOutputField nmc_fields_setting_ppp[] = { - SETTING_FIELD ("name", 10), /* 0 */ - SETTING_FIELD (NM_SETTING_PPP_NOAUTH, 10), /* 1 */ - SETTING_FIELD (NM_SETTING_PPP_REFUSE_EAP, 10), /* 2 */ - SETTING_FIELD (NM_SETTING_PPP_REFUSE_PAP, 10), /* 3 */ - SETTING_FIELD (NM_SETTING_PPP_REFUSE_CHAP, 10), /* 4 */ - SETTING_FIELD (NM_SETTING_PPP_REFUSE_MSCHAP, 10), /* 5 */ - SETTING_FIELD (NM_SETTING_PPP_REFUSE_MSCHAPV2, 10), /* 6 */ - SETTING_FIELD (NM_SETTING_PPP_NOBSDCOMP, 10), /* 7 */ - SETTING_FIELD (NM_SETTING_PPP_NODEFLATE, 10), /* 8 */ - SETTING_FIELD (NM_SETTING_PPP_NO_VJ_COMP, 10), /* 9 */ - SETTING_FIELD (NM_SETTING_PPP_REQUIRE_MPPE, 10), /* 10 */ - SETTING_FIELD (NM_SETTING_PPP_REQUIRE_MPPE_128, 10), /* 11 */ - SETTING_FIELD (NM_SETTING_PPP_MPPE_STATEFUL, 10), /* 12 */ - SETTING_FIELD (NM_SETTING_PPP_CRTSCTS, 10), /* 13 */ - SETTING_FIELD (NM_SETTING_PPP_BAUD, 10), /* 14 */ - SETTING_FIELD (NM_SETTING_PPP_MRU, 10), /* 15 */ - SETTING_FIELD (NM_SETTING_PPP_MTU, 10), /* 16 */ - SETTING_FIELD (NM_SETTING_PPP_LCP_ECHO_FAILURE, 17), /* 17 */ - SETTING_FIELD (NM_SETTING_PPP_LCP_ECHO_INTERVAL, 18), /* 18 */ + SETTING_FIELD ("name"), /* 0 */ + SETTING_FIELD (NM_SETTING_PPP_NOAUTH), /* 1 */ + SETTING_FIELD (NM_SETTING_PPP_REFUSE_EAP), /* 2 */ + SETTING_FIELD (NM_SETTING_PPP_REFUSE_PAP), /* 3 */ + SETTING_FIELD (NM_SETTING_PPP_REFUSE_CHAP), /* 4 */ + SETTING_FIELD (NM_SETTING_PPP_REFUSE_MSCHAP), /* 5 */ + SETTING_FIELD (NM_SETTING_PPP_REFUSE_MSCHAPV2), /* 6 */ + SETTING_FIELD (NM_SETTING_PPP_NOBSDCOMP), /* 7 */ + SETTING_FIELD (NM_SETTING_PPP_NODEFLATE), /* 8 */ + SETTING_FIELD (NM_SETTING_PPP_NO_VJ_COMP), /* 9 */ + SETTING_FIELD (NM_SETTING_PPP_REQUIRE_MPPE), /* 10 */ + SETTING_FIELD (NM_SETTING_PPP_REQUIRE_MPPE_128), /* 11 */ + SETTING_FIELD (NM_SETTING_PPP_MPPE_STATEFUL), /* 12 */ + SETTING_FIELD (NM_SETTING_PPP_CRTSCTS), /* 13 */ + SETTING_FIELD (NM_SETTING_PPP_BAUD), /* 14 */ + SETTING_FIELD (NM_SETTING_PPP_MRU), /* 15 */ + SETTING_FIELD (NM_SETTING_PPP_MTU), /* 16 */ + SETTING_FIELD (NM_SETTING_PPP_LCP_ECHO_FAILURE), /* 17 */ + SETTING_FIELD (NM_SETTING_PPP_LCP_ECHO_INTERVAL), /* 18 */ {NULL, NULL, 0, NULL, FALSE, FALSE, 0} }; #define NMC_FIELDS_SETTING_PPP_ALL "name"","\ @@ -401,11 +414,11 @@ NmcOutputField nmc_fields_setting_ppp[] = { /* Available fields for NM_SETTING_PPPOE_SETTING_NAME */ NmcOutputField nmc_fields_setting_pppoe[] = { - SETTING_FIELD ("name", 10), /* 0 */ - SETTING_FIELD (NM_SETTING_PPPOE_SERVICE, 12), /* 1 */ - SETTING_FIELD (NM_SETTING_PPPOE_USERNAME, 15), /* 2 */ - SETTING_FIELD (NM_SETTING_PPPOE_PASSWORD, 15), /* 3 */ - SETTING_FIELD (NM_SETTING_PPPOE_PASSWORD_FLAGS, 20), /* 4 */ + SETTING_FIELD ("name"), /* 0 */ + SETTING_FIELD (NM_SETTING_PPPOE_SERVICE), /* 1 */ + SETTING_FIELD (NM_SETTING_PPPOE_USERNAME), /* 2 */ + SETTING_FIELD (NM_SETTING_PPPOE_PASSWORD), /* 3 */ + SETTING_FIELD (NM_SETTING_PPPOE_PASSWORD_FLAGS), /* 4 */ {NULL, NULL, 0, NULL, FALSE, FALSE, 0} }; #define NMC_FIELDS_SETTING_PPPOE_ALL "name"","\ @@ -417,14 +430,14 @@ NmcOutputField nmc_fields_setting_pppoe[] = { /* Available fields for NM_SETTING_ADSL_SETTING_NAME */ NmcOutputField nmc_fields_setting_adsl[] = { - SETTING_FIELD ("name", 10), /* 0 */ - SETTING_FIELD (NM_SETTING_ADSL_USERNAME, 15), /* 1 */ - SETTING_FIELD (NM_SETTING_ADSL_PASSWORD, 15), /* 2 */ - SETTING_FIELD (NM_SETTING_ADSL_PASSWORD_FLAGS, 20), /* 3 */ - SETTING_FIELD (NM_SETTING_ADSL_PROTOCOL, 10), /* 4 */ - SETTING_FIELD (NM_SETTING_ADSL_ENCAPSULATION, 10), /* 5 */ - SETTING_FIELD (NM_SETTING_ADSL_VPI, 10), /* 6 */ - SETTING_FIELD (NM_SETTING_ADSL_VCI, 10), /* 7 */ + SETTING_FIELD ("name"), /* 0 */ + SETTING_FIELD (NM_SETTING_ADSL_USERNAME), /* 1 */ + SETTING_FIELD (NM_SETTING_ADSL_PASSWORD), /* 2 */ + SETTING_FIELD (NM_SETTING_ADSL_PASSWORD_FLAGS), /* 3 */ + SETTING_FIELD (NM_SETTING_ADSL_PROTOCOL), /* 4 */ + SETTING_FIELD (NM_SETTING_ADSL_ENCAPSULATION), /* 5 */ + SETTING_FIELD (NM_SETTING_ADSL_VPI), /* 6 */ + SETTING_FIELD (NM_SETTING_ADSL_VCI), /* 7 */ {NULL, NULL, 0, NULL, FALSE, FALSE, 0} }; #define NMC_FIELDS_SETTING_ADSL_ALL "name"","\ @@ -439,16 +452,19 @@ NmcOutputField nmc_fields_setting_adsl[] = { /* Available fields for NM_SETTING_GSM_SETTING_NAME */ NmcOutputField nmc_fields_setting_gsm[] = { - SETTING_FIELD ("name", 10), /* 0 */ - SETTING_FIELD (NM_SETTING_GSM_NUMBER, 10), /* 1 */ - SETTING_FIELD (NM_SETTING_GSM_USERNAME, 15), /* 2 */ - SETTING_FIELD (NM_SETTING_GSM_PASSWORD, 15), /* 3 */ - SETTING_FIELD (NM_SETTING_GSM_PASSWORD_FLAGS, 20), /* 4 */ - SETTING_FIELD (NM_SETTING_GSM_APN, 25), /* 5 */ - SETTING_FIELD (NM_SETTING_GSM_NETWORK_ID, 12), /* 6 */ - SETTING_FIELD (NM_SETTING_GSM_PIN, 10), /* 7 */ - SETTING_FIELD (NM_SETTING_GSM_PIN_FLAGS, 20), /* 8 */ - SETTING_FIELD (NM_SETTING_GSM_HOME_ONLY, 10), /* 9 */ + SETTING_FIELD ("name"), /* 0 */ + SETTING_FIELD (NM_SETTING_GSM_NUMBER), /* 1 */ + SETTING_FIELD (NM_SETTING_GSM_USERNAME), /* 2 */ + SETTING_FIELD (NM_SETTING_GSM_PASSWORD), /* 3 */ + SETTING_FIELD (NM_SETTING_GSM_PASSWORD_FLAGS), /* 4 */ + SETTING_FIELD (NM_SETTING_GSM_APN), /* 5 */ + SETTING_FIELD (NM_SETTING_GSM_NETWORK_ID), /* 6 */ + SETTING_FIELD (NM_SETTING_GSM_PIN), /* 7 */ + SETTING_FIELD (NM_SETTING_GSM_PIN_FLAGS), /* 8 */ + SETTING_FIELD (NM_SETTING_GSM_HOME_ONLY), /* 9 */ + SETTING_FIELD (NM_SETTING_GSM_DEVICE_ID), /* 10 */ + SETTING_FIELD (NM_SETTING_GSM_SIM_ID), /* 11 */ + SETTING_FIELD (NM_SETTING_GSM_SIM_OPERATOR_ID), /* 12 */ {NULL, NULL, 0, NULL, FALSE, FALSE, 0} }; #define NMC_FIELDS_SETTING_GSM_ALL "name"","\ @@ -460,16 +476,19 @@ NmcOutputField nmc_fields_setting_gsm[] = { NM_SETTING_GSM_NETWORK_ID","\ NM_SETTING_GSM_PIN","\ NM_SETTING_GSM_PIN_FLAGS","\ - NM_SETTING_GSM_HOME_ONLY + NM_SETTING_GSM_HOME_ONLY","\ + NM_SETTING_GSM_DEVICE_ID","\ + NM_SETTING_GSM_SIM_ID","\ + NM_SETTING_GSM_SIM_OPERATOR_ID #define NMC_FIELDS_SETTING_GSM_COMMON NMC_FIELDS_SETTING_GSM_ALL /* Available fields for NM_SETTING_CDMA_SETTING_NAME */ NmcOutputField nmc_fields_setting_cdma[] = { - SETTING_FIELD ("name", 10), /* 0 */ - SETTING_FIELD (NM_SETTING_CDMA_NUMBER, 15), /* 1 */ - SETTING_FIELD (NM_SETTING_CDMA_USERNAME, 15), /* 2 */ - SETTING_FIELD (NM_SETTING_CDMA_PASSWORD, 15), /* 3 */ - SETTING_FIELD (NM_SETTING_CDMA_PASSWORD_FLAGS, 20), /* 4 */ + SETTING_FIELD ("name"), /* 0 */ + SETTING_FIELD (NM_SETTING_CDMA_NUMBER), /* 1 */ + SETTING_FIELD (NM_SETTING_CDMA_USERNAME), /* 2 */ + SETTING_FIELD (NM_SETTING_CDMA_PASSWORD), /* 3 */ + SETTING_FIELD (NM_SETTING_CDMA_PASSWORD_FLAGS), /* 4 */ {NULL, NULL, 0, NULL, FALSE, FALSE, 0} }; #define NMC_FIELDS_SETTING_CDMA_ALL "name"","\ @@ -481,9 +500,9 @@ NmcOutputField nmc_fields_setting_cdma[] = { /* Available fields for NM_SETTING_BLUETOOTH_SETTING_NAME */ NmcOutputField nmc_fields_setting_bluetooth[] = { - SETTING_FIELD ("name", 11), /* 0 */ - SETTING_FIELD (NM_SETTING_BLUETOOTH_BDADDR, 19), /* 1 */ - SETTING_FIELD (NM_SETTING_BLUETOOTH_TYPE, 10), /* 2 */ + SETTING_FIELD ("name"), /* 0 */ + SETTING_FIELD (NM_SETTING_BLUETOOTH_BDADDR), /* 1 */ + SETTING_FIELD (NM_SETTING_BLUETOOTH_TYPE), /* 2 */ {NULL, NULL, 0, NULL, FALSE, FALSE, 0} }; #define NMC_FIELDS_SETTING_BLUETOOTH_ALL "name"","\ @@ -493,10 +512,10 @@ NmcOutputField nmc_fields_setting_bluetooth[] = { /* Available fields for NM_SETTING_OLPC_MESH_SETTING_NAME */ NmcOutputField nmc_fields_setting_olpc_mesh[] = { - SETTING_FIELD ("name", 18), /* 0 */ - SETTING_FIELD (NM_SETTING_OLPC_MESH_SSID, 34), /* 1 */ - SETTING_FIELD (NM_SETTING_OLPC_MESH_CHANNEL, 12), /* 2 */ - SETTING_FIELD (NM_SETTING_OLPC_MESH_DHCP_ANYCAST_ADDRESS, 17), /* 3 */ + SETTING_FIELD ("name"), /* 0 */ + SETTING_FIELD (NM_SETTING_OLPC_MESH_SSID), /* 1 */ + SETTING_FIELD (NM_SETTING_OLPC_MESH_CHANNEL), /* 2 */ + SETTING_FIELD (NM_SETTING_OLPC_MESH_DHCP_ANYCAST_ADDRESS), /* 3 */ {NULL, NULL, 0, NULL, FALSE, FALSE, 0} }; #define NMC_FIELDS_SETTING_OLPC_MESH_ALL "name"","\ @@ -507,12 +526,13 @@ NmcOutputField nmc_fields_setting_olpc_mesh[] = { /* Available fields for NM_SETTING_VPN_SETTING_NAME */ NmcOutputField nmc_fields_setting_vpn[] = { - SETTING_FIELD ("name", 6), /* 0 */ - SETTING_FIELD (NM_SETTING_VPN_SERVICE_TYPE, 40), /* 1 */ - SETTING_FIELD (NM_SETTING_VPN_USER_NAME, 12), /* 2 */ - SETTING_FIELD (NM_SETTING_VPN_DATA, 30), /* 3 */ - SETTING_FIELD (NM_SETTING_VPN_SECRETS, 15), /* 4 */ - SETTING_FIELD (NM_SETTING_VPN_PERSISTENT, 15), /* 5 */ + SETTING_FIELD ("name"), /* 0 */ + SETTING_FIELD (NM_SETTING_VPN_SERVICE_TYPE), /* 1 */ + SETTING_FIELD (NM_SETTING_VPN_USER_NAME), /* 2 */ + SETTING_FIELD (NM_SETTING_VPN_DATA), /* 3 */ + SETTING_FIELD (NM_SETTING_VPN_SECRETS), /* 4 */ + SETTING_FIELD (NM_SETTING_VPN_PERSISTENT), /* 5 */ + SETTING_FIELD (NM_SETTING_VPN_TIMEOUT), /* 6 */ {NULL, NULL, 0, NULL, FALSE, FALSE, 0} }; #define NMC_FIELDS_SETTING_VPN_ALL "name"","\ @@ -520,14 +540,15 @@ NmcOutputField nmc_fields_setting_vpn[] = { NM_SETTING_VPN_USER_NAME","\ NM_SETTING_VPN_DATA","\ NM_SETTING_VPN_SECRETS","\ - NM_SETTING_VPN_PERSISTENT + NM_SETTING_VPN_PERSISTENT","\ + NM_SETTING_VPN_TIMEOUT #define NMC_FIELDS_SETTING_VPN_COMMON NMC_FIELDS_SETTING_VPN_ALL /* Available fields for NM_SETTING_WIMAX_SETTING_NAME */ NmcOutputField nmc_fields_setting_wimax[] = { - SETTING_FIELD ("name", 6), /* 0 */ - SETTING_FIELD (NM_SETTING_WIMAX_MAC_ADDRESS, 19), /* 1 */ - SETTING_FIELD (NM_SETTING_WIMAX_NETWORK_NAME, 40), /* 2 */ + SETTING_FIELD ("name"), /* 0 */ + SETTING_FIELD (NM_SETTING_WIMAX_MAC_ADDRESS), /* 1 */ + SETTING_FIELD (NM_SETTING_WIMAX_NETWORK_NAME), /* 2 */ {NULL, NULL, 0, NULL, FALSE, FALSE, 0} }; #define NMC_FIELDS_SETTING_WIMAX_ALL "name"","\ @@ -537,12 +558,12 @@ NmcOutputField nmc_fields_setting_wimax[] = { /* Available fields for NM_SETTING_INFINIBAND_SETTING_NAME */ 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 */ - SETTING_FIELD (NM_SETTING_INFINIBAND_P_KEY, 6), /* 4 */ - SETTING_FIELD (NM_SETTING_INFINIBAND_PARENT, 16), /* 5 */ + SETTING_FIELD ("name"), /* 0 */ + SETTING_FIELD (NM_SETTING_INFINIBAND_MAC_ADDRESS), /* 1 */ + SETTING_FIELD (NM_SETTING_INFINIBAND_MTU), /* 2 */ + SETTING_FIELD (NM_SETTING_INFINIBAND_TRANSPORT_MODE), /* 3 */ + SETTING_FIELD (NM_SETTING_INFINIBAND_P_KEY), /* 4 */ + SETTING_FIELD (NM_SETTING_INFINIBAND_PARENT), /* 5 */ {NULL, NULL, 0, NULL, FALSE, FALSE, 0} }; #define NMC_FIELDS_SETTING_INFINIBAND_ALL "name"","\ @@ -555,8 +576,8 @@ NmcOutputField nmc_fields_setting_infiniband[] = { /* Available fields for NM_SETTING_BOND_SETTING_NAME */ NmcOutputField nmc_fields_setting_bond[] = { - SETTING_FIELD ("name", 8), /* 0 */ - SETTING_FIELD (NM_SETTING_BOND_OPTIONS, 30), /* 1 */ + SETTING_FIELD ("name"), /* 0 */ + SETTING_FIELD (NM_SETTING_BOND_OPTIONS), /* 1 */ {NULL, NULL, 0, NULL, FALSE, FALSE, 0} }; #define NMC_FIELDS_SETTING_BOND_ALL "name"","\ @@ -565,12 +586,12 @@ NmcOutputField nmc_fields_setting_bond[] = { /* Available fields for NM_SETTING_VLAN_SETTING_NAME */ NmcOutputField nmc_fields_setting_vlan[] = { - SETTING_FIELD ("name", 6), /* 0 */ - SETTING_FIELD (NM_SETTING_VLAN_PARENT, 8), /* 1 */ - SETTING_FIELD (NM_SETTING_VLAN_ID, 6), /* 2 */ - SETTING_FIELD (NM_SETTING_VLAN_FLAGS, 45), /* 3 */ - SETTING_FIELD (NM_SETTING_VLAN_INGRESS_PRIORITY_MAP, 22), /* 4 */ - SETTING_FIELD (NM_SETTING_VLAN_EGRESS_PRIORITY_MAP, 22), /* 5 */ + SETTING_FIELD ("name"), /* 0 */ + SETTING_FIELD (NM_SETTING_VLAN_PARENT), /* 1 */ + SETTING_FIELD (NM_SETTING_VLAN_ID), /* 2 */ + SETTING_FIELD (NM_SETTING_VLAN_FLAGS), /* 3 */ + SETTING_FIELD (NM_SETTING_VLAN_INGRESS_PRIORITY_MAP), /* 4 */ + SETTING_FIELD (NM_SETTING_VLAN_EGRESS_PRIORITY_MAP), /* 5 */ {NULL, NULL, 0, NULL, FALSE, FALSE, 0} }; #define NMC_FIELDS_SETTING_VLAN_ALL "name"","\ @@ -583,14 +604,15 @@ NmcOutputField nmc_fields_setting_vlan[] = { /* Available fields for NM_SETTING_BRIDGE_SETTING_NAME */ NmcOutputField nmc_fields_setting_bridge[] = { - SETTING_FIELD ("name", 8), /* 0 */ - SETTING_FIELD (NM_SETTING_BRIDGE_MAC_ADDRESS, 19), /* 1 */ - SETTING_FIELD (NM_SETTING_BRIDGE_STP, 5), /* 2 */ - SETTING_FIELD (NM_SETTING_BRIDGE_PRIORITY, 6), /* 3 */ - SETTING_FIELD (NM_SETTING_BRIDGE_FORWARD_DELAY, 6), /* 4 */ - SETTING_FIELD (NM_SETTING_BRIDGE_HELLO_TIME, 6), /* 5 */ - SETTING_FIELD (NM_SETTING_BRIDGE_MAX_AGE, 6), /* 6 */ - SETTING_FIELD (NM_SETTING_BRIDGE_AGEING_TIME, 6), /* 7 */ + SETTING_FIELD ("name"), /* 0 */ + SETTING_FIELD (NM_SETTING_BRIDGE_MAC_ADDRESS), /* 1 */ + SETTING_FIELD (NM_SETTING_BRIDGE_STP), /* 2 */ + SETTING_FIELD (NM_SETTING_BRIDGE_PRIORITY), /* 3 */ + SETTING_FIELD (NM_SETTING_BRIDGE_FORWARD_DELAY), /* 4 */ + SETTING_FIELD (NM_SETTING_BRIDGE_HELLO_TIME), /* 5 */ + SETTING_FIELD (NM_SETTING_BRIDGE_MAX_AGE), /* 6 */ + SETTING_FIELD (NM_SETTING_BRIDGE_AGEING_TIME), /* 7 */ + SETTING_FIELD (NM_SETTING_BRIDGE_MULTICAST_SNOOPING), /* 8 */ {NULL, NULL, 0, NULL, FALSE, FALSE, 0} }; #define NMC_FIELDS_SETTING_BRIDGE_ALL "name"","\ @@ -600,15 +622,16 @@ NmcOutputField nmc_fields_setting_bridge[] = { NM_SETTING_BRIDGE_FORWARD_DELAY","\ NM_SETTING_BRIDGE_HELLO_TIME","\ NM_SETTING_BRIDGE_MAX_AGE","\ - NM_SETTING_BRIDGE_AGEING_TIME + NM_SETTING_BRIDGE_AGEING_TIME","\ + NM_SETTING_BRIDGE_MULTICAST_SNOOPING #define NMC_FIELDS_SETTING_BRIDGE_COMMON NMC_FIELDS_SETTING_BRIDGE_ALL /* Available fields for NM_SETTING_BRIDGE_PORT_SETTING_NAME */ NmcOutputField nmc_fields_setting_bridge_port[] = { - SETTING_FIELD ("name", 8), /* 0 */ - SETTING_FIELD (NM_SETTING_BRIDGE_PORT_PRIORITY, 10), /* 1 */ - SETTING_FIELD (NM_SETTING_BRIDGE_PORT_PATH_COST, 12), /* 2 */ - SETTING_FIELD (NM_SETTING_BRIDGE_PORT_HAIRPIN_MODE, 15), /* 3 */ + SETTING_FIELD ("name"), /* 0 */ + SETTING_FIELD (NM_SETTING_BRIDGE_PORT_PRIORITY), /* 1 */ + SETTING_FIELD (NM_SETTING_BRIDGE_PORT_PATH_COST), /* 2 */ + SETTING_FIELD (NM_SETTING_BRIDGE_PORT_HAIRPIN_MODE), /* 3 */ {NULL, NULL, 0, NULL, FALSE, FALSE, 0} }; #define NMC_FIELDS_SETTING_BRIDGE_PORT_ALL "name"","\ @@ -619,8 +642,8 @@ NmcOutputField nmc_fields_setting_bridge_port[] = { /* Available fields for NM_SETTING_TEAM_SETTING_NAME */ NmcOutputField nmc_fields_setting_team[] = { - SETTING_FIELD ("name", 8), /* 0 */ - SETTING_FIELD (NM_SETTING_TEAM_CONFIG, 30), /* 1 */ + SETTING_FIELD ("name"), /* 0 */ + SETTING_FIELD (NM_SETTING_TEAM_CONFIG), /* 1 */ {NULL, NULL, 0, NULL, FALSE, FALSE, 0} }; #define NMC_FIELDS_SETTING_TEAM_ALL "name"","\ @@ -629,8 +652,8 @@ NmcOutputField nmc_fields_setting_team[] = { /* Available fields for NM_SETTING_TEAM_PORT_SETTING_NAME */ NmcOutputField nmc_fields_setting_team_port[] = { - SETTING_FIELD ("name", 8), /* 0 */ - SETTING_FIELD (NM_SETTING_TEAM_PORT_CONFIG, 30), /* 1 */ + SETTING_FIELD ("name"), /* 0 */ + SETTING_FIELD (NM_SETTING_TEAM_PORT_CONFIG), /* 1 */ {NULL, NULL, 0, NULL, FALSE, FALSE, 0} }; #define NMC_FIELDS_SETTING_TEAM_PORT_ALL "name"","\ @@ -639,22 +662,22 @@ NmcOutputField nmc_fields_setting_team_port[] = { /* Available fields for NM_SETTING_DCB_SETTING_NAME */ NmcOutputField nmc_fields_setting_dcb[] = { - SETTING_FIELD ("name", 8), /* 0 */ - SETTING_FIELD (NM_SETTING_DCB_APP_FCOE_FLAGS, 5), /* 1 */ - SETTING_FIELD (NM_SETTING_DCB_APP_FCOE_PRIORITY, 5), /* 2 */ - SETTING_FIELD (NM_SETTING_DCB_APP_FCOE_MODE, 8), /* 3 */ - SETTING_FIELD (NM_SETTING_DCB_APP_ISCSI_FLAGS, 5), /* 4 */ - SETTING_FIELD (NM_SETTING_DCB_APP_ISCSI_PRIORITY, 5), /* 5 */ - SETTING_FIELD (NM_SETTING_DCB_APP_FIP_FLAGS, 5), /* 6 */ - SETTING_FIELD (NM_SETTING_DCB_APP_FIP_PRIORITY, 5), /* 7 */ - SETTING_FIELD (NM_SETTING_DCB_PRIORITY_FLOW_CONTROL_FLAGS, 5), /* 8 */ - SETTING_FIELD (NM_SETTING_DCB_PRIORITY_FLOW_CONTROL, 10), /* 9 */ - SETTING_FIELD (NM_SETTING_DCB_PRIORITY_GROUP_FLAGS, 5), /* 10 */ - SETTING_FIELD (NM_SETTING_DCB_PRIORITY_GROUP_ID, 10), /* 11 */ - SETTING_FIELD (NM_SETTING_DCB_PRIORITY_GROUP_BANDWIDTH, 30), /* 12 */ - SETTING_FIELD (NM_SETTING_DCB_PRIORITY_BANDWIDTH, 30), /* 13 */ - SETTING_FIELD (NM_SETTING_DCB_PRIORITY_STRICT_BANDWIDTH, 10), /* 14 */ - SETTING_FIELD (NM_SETTING_DCB_PRIORITY_TRAFFIC_CLASS, 30), /* 15 */ + SETTING_FIELD ("name"), /* 0 */ + SETTING_FIELD (NM_SETTING_DCB_APP_FCOE_FLAGS), /* 1 */ + SETTING_FIELD (NM_SETTING_DCB_APP_FCOE_PRIORITY), /* 2 */ + SETTING_FIELD (NM_SETTING_DCB_APP_FCOE_MODE), /* 3 */ + SETTING_FIELD (NM_SETTING_DCB_APP_ISCSI_FLAGS), /* 4 */ + SETTING_FIELD (NM_SETTING_DCB_APP_ISCSI_PRIORITY), /* 5 */ + SETTING_FIELD (NM_SETTING_DCB_APP_FIP_FLAGS), /* 6 */ + SETTING_FIELD (NM_SETTING_DCB_APP_FIP_PRIORITY), /* 7 */ + SETTING_FIELD (NM_SETTING_DCB_PRIORITY_FLOW_CONTROL_FLAGS), /* 8 */ + SETTING_FIELD (NM_SETTING_DCB_PRIORITY_FLOW_CONTROL), /* 9 */ + SETTING_FIELD (NM_SETTING_DCB_PRIORITY_GROUP_FLAGS), /* 10 */ + SETTING_FIELD (NM_SETTING_DCB_PRIORITY_GROUP_ID), /* 11 */ + SETTING_FIELD (NM_SETTING_DCB_PRIORITY_GROUP_BANDWIDTH), /* 12 */ + SETTING_FIELD (NM_SETTING_DCB_PRIORITY_BANDWIDTH), /* 13 */ + SETTING_FIELD (NM_SETTING_DCB_PRIORITY_STRICT_BANDWIDTH), /* 14 */ + SETTING_FIELD (NM_SETTING_DCB_PRIORITY_TRAFFIC_CLASS), /* 15 */ {NULL, NULL, 0, NULL, FALSE, FALSE, 0} }; #define NMC_FIELDS_SETTING_DCB_ALL "name"","\ @@ -675,8 +698,115 @@ NmcOutputField nmc_fields_setting_dcb[] = { NM_SETTING_DCB_PRIORITY_TRAFFIC_CLASS #define NMC_FIELDS_SETTING_DCB_COMMON NMC_FIELDS_SETTING_DCB_ALL -/*----------------------------------------------------------------------------*/ +/* Available fields for NM_SETTING_TUN_SETTING_NAME */ +NmcOutputField nmc_fields_setting_tun[] = { + SETTING_FIELD ("name"), /* 0 */ + SETTING_FIELD (NM_SETTING_TUN_MODE), /* 1 */ + SETTING_FIELD (NM_SETTING_TUN_OWNER), /* 2 */ + SETTING_FIELD (NM_SETTING_TUN_GROUP), /* 3 */ + SETTING_FIELD (NM_SETTING_TUN_PI), /* 4 */ + SETTING_FIELD (NM_SETTING_TUN_VNET_HDR), /* 5 */ + SETTING_FIELD (NM_SETTING_TUN_MULTI_QUEUE), /* 6 */ + {NULL, NULL, 0, NULL, FALSE, FALSE, 0} +}; +#define NMC_FIELDS_SETTING_TUN_ALL "name"","\ + NM_SETTING_TUN_MODE","\ + NM_SETTING_TUN_OWNER","\ + NM_SETTING_TUN_GROUP","\ + NM_SETTING_TUN_PI","\ + NM_SETTING_TUN_VNET_HDR","\ + NM_SETTING_TUN_MULTI_QUEUE +#define NMC_FIELDS_SETTING_TUN_COMMON NMC_FIELDS_SETTING_TUN_ALL + +/* Available fields for NM_SETTING_IP_TUNNEL_SETTING_NAME */ +NmcOutputField nmc_fields_setting_ip_tunnel[] = { + SETTING_FIELD ("name"), /* 0 */ + SETTING_FIELD (NM_SETTING_IP_TUNNEL_MODE), /* 1 */ + SETTING_FIELD (NM_SETTING_IP_TUNNEL_PARENT), /* 2 */ + SETTING_FIELD (NM_SETTING_IP_TUNNEL_LOCAL), /* 3 */ + SETTING_FIELD (NM_SETTING_IP_TUNNEL_REMOTE), /* 4 */ + SETTING_FIELD (NM_SETTING_IP_TUNNEL_TTL), /* 5 */ + SETTING_FIELD (NM_SETTING_IP_TUNNEL_TOS), /* 6 */ + SETTING_FIELD (NM_SETTING_IP_TUNNEL_PATH_MTU_DISCOVERY), /* 7 */ + SETTING_FIELD (NM_SETTING_IP_TUNNEL_INPUT_KEY), /* 8 */ + SETTING_FIELD (NM_SETTING_IP_TUNNEL_OUTPUT_KEY), /* 9 */ + SETTING_FIELD (NM_SETTING_IP_TUNNEL_ENCAPSULATION_LIMIT), /* 10 */ + SETTING_FIELD (NM_SETTING_IP_TUNNEL_FLOW_LABEL), /* 11 */ + SETTING_FIELD (NM_SETTING_IP_TUNNEL_MTU), /* 12 */ + {NULL, NULL, 0, NULL, FALSE, FALSE, 0} +}; +#define NMC_FIELDS_SETTING_IP_TUNNEL_ALL "name"","\ + NM_SETTING_IP_TUNNEL_MODE","\ + NM_SETTING_IP_TUNNEL_PARENT","\ + NM_SETTING_IP_TUNNEL_LOCAL","\ + NM_SETTING_IP_TUNNEL_REMOTE","\ + NM_SETTING_IP_TUNNEL_TTL","\ + NM_SETTING_IP_TUNNEL_TOS","\ + NM_SETTING_IP_TUNNEL_PATH_MTU_DISCOVERY","\ + NM_SETTING_IP_TUNNEL_INPUT_KEY","\ + NM_SETTING_IP_TUNNEL_OUTPUT_KEY","\ + NM_SETTING_IP_TUNNEL_ENCAPSULATION_LIMIT","\ + NM_SETTING_IP_TUNNEL_FLOW_LABEL","\ + NM_SETTING_IP_TUNNEL_MTU +#define NMC_FIELDS_SETTING_IP_TUNNEL_COMMON NMC_FIELDS_SETTING_IP_TUNNEL_ALL + +/* Available fields for NM_SETTING_MACVLAN_SETTING_NAME */ +NmcOutputField nmc_fields_setting_macvlan[] = { + SETTING_FIELD ("name"), /* 0 */ + SETTING_FIELD (NM_SETTING_MACVLAN_PARENT), /* 1 */ + SETTING_FIELD (NM_SETTING_MACVLAN_MODE), /* 2 */ + SETTING_FIELD (NM_SETTING_MACVLAN_PROMISCUOUS), /* 3 */ + SETTING_FIELD (NM_SETTING_MACVLAN_TAP), /* 4 */ + {NULL, NULL, 0, NULL, FALSE, FALSE, 0} +}; +#define NMC_FIELDS_SETTING_MACVLAN_ALL "name"","\ + NM_SETTING_MACVLAN_PARENT","\ + NM_SETTING_MACVLAN_MODE","\ + NM_SETTING_MACVLAN_PROMISCUOUS","\ + NM_SETTING_MACVLAN_TAP +#define NMC_FIELDS_SETTING_MACVLAN_COMMON NMC_FIELDS_SETTING_MACVLAN_ALL + +/* Available fields for NM_SETTING_VXLAN_SETTING_NAME */ +NmcOutputField nmc_fields_setting_vxlan[] = { + SETTING_FIELD ("name"), /* 0 */ + SETTING_FIELD (NM_SETTING_VXLAN_PARENT), /* 1 */ + SETTING_FIELD (NM_SETTING_VXLAN_ID), /* 2 */ + SETTING_FIELD (NM_SETTING_VXLAN_LOCAL), /* 3 */ + SETTING_FIELD (NM_SETTING_VXLAN_REMOTE), /* 4 */ + SETTING_FIELD (NM_SETTING_VXLAN_SOURCE_PORT_MIN), /* 5 */ + SETTING_FIELD (NM_SETTING_VXLAN_SOURCE_PORT_MAX), /* 6 */ + SETTING_FIELD (NM_SETTING_VXLAN_DESTINATION_PORT), /* 7 */ + SETTING_FIELD (NM_SETTING_VXLAN_TOS), /* 8 */ + SETTING_FIELD (NM_SETTING_VXLAN_TTL), /* 9 */ + SETTING_FIELD (NM_SETTING_VXLAN_AGEING), /* 10 */ + SETTING_FIELD (NM_SETTING_VXLAN_LIMIT), /* 11 */ + SETTING_FIELD (NM_SETTING_VXLAN_LEARNING), /* 12 */ + SETTING_FIELD (NM_SETTING_VXLAN_PROXY), /* 13 */ + SETTING_FIELD (NM_SETTING_VXLAN_RSC), /* 14 */ + SETTING_FIELD (NM_SETTING_VXLAN_L2_MISS), /* 15 */ + SETTING_FIELD (NM_SETTING_VXLAN_L3_MISS), /* 16 */ + {NULL, NULL, 0, NULL, FALSE, FALSE, 0} +}; +#define NMC_FIELDS_SETTING_VXLAN_ALL "name"","\ + NM_SETTING_VXLAN_PARENT","\ + NM_SETTING_VXLAN_ID","\ + NM_SETTING_VXLAN_LOCAL","\ + NM_SETTING_VXLAN_REMOTE","\ + NM_SETTING_VXLAN_SOURCE_PORT_MIN","\ + NM_SETTING_VXLAN_SOURCE_PORT_MAX","\ + NM_SETTING_VXLAN_DESTINATION_PORT","\ + NM_SETTING_VXLAN_TOS","\ + NM_SETTING_VXLAN_TTL","\ + NM_SETTING_VXLAN_AGEING","\ + NM_SETTING_VXLAN_LIMIT","\ + NM_SETTING_VXLAN_LEARNING","\ + NM_SETTING_VXLAN_PROXY","\ + NM_SETTING_VXLAN_RSC","\ + NM_SETTING_VXLAN_L2_MISS","\ + NM_SETTING_VXLAN_L3_MISS +#define NMC_FIELDS_SETTING_VXLAN_COMMON NMC_FIELDS_SETTING_VXLAN_ALL +/*----------------------------------------------------------------------------*/ static char * wep_key_type_to_string (NMWepKeyType type) { @@ -727,6 +857,8 @@ vlan_flags_to_string (guint32 flags) g_string_append (flag_str, _("GVRP, ")); if (flags & NM_VLAN_FLAG_LOOSE_BINDING) g_string_append (flag_str, _("LOOSE_BINDING, ")); + if (flags & NM_VLAN_FLAG_MVRP) + g_string_append (flag_str, _("MVRP, ")); if (flag_str->str[flag_str->len-1] == '(') g_string_append (flag_str, _("unknown")); @@ -776,10 +908,11 @@ ip6_privacy_to_string (NMSettingIP6ConfigPrivacy ip6_privacy, NmcPropertyGetType } static char * -autoconnect_slaves_to_string (NMSettingConnectionAutoconnectSlaves autoconnect_slaves, NmcPropertyGetType get_type) +autoconnect_slaves_to_string (NMSettingConnectionAutoconnectSlaves autoconnect_slaves, + NmcPropertyGetType get_type) { if (get_type == NMC_PROPERTY_GET_PARSABLE) - return g_strdup_printf ("%d", (int) autoconnect_slaves); + return g_strdup_printf ("%d", autoconnect_slaves); switch (autoconnect_slaves) { case NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_NO: @@ -849,6 +982,31 @@ vpn_data_item (const char *key, const char *value, gpointer user_data) return s; \ } +#define DEFINE_GETTER_WITH_DEFAULT(func_name, property_name, check_is_default) \ + static char * \ + func_name (NMSetting *setting, NmcPropertyGetType get_type) \ + { \ + const char *s; \ + char *s_full; \ + GValue val = G_VALUE_INIT; \ + \ + if ((check_is_default)) { \ + if (get_type == NMC_PROPERTY_GET_PARSABLE) \ + return g_strdup (""); \ + return g_strdup (_("(default)")); \ + } \ + \ + g_value_init (&val, G_TYPE_STRING); \ + g_object_get_property (G_OBJECT (setting), property_name, &val); \ + s = g_value_get_string (&val); \ + if (get_type == NMC_PROPERTY_GET_PARSABLE) \ + s_full = g_strdup (s && *s ? s : " "); \ + else \ + s_full = s ? g_strdup_printf ("\"%s\"", s) : g_strdup (""); \ + g_value_unset (&val); \ + return s_full; \ + } + #define DEFINE_SECRET_FLAGS_GETTER(func_name, property_name) \ static char * \ func_name (NMSetting *setting, NmcPropertyGetType get_type) \ @@ -1032,6 +1190,7 @@ DEFINE_GETTER (nmc_property_bridge_get_forward_delay, NM_SETTING_BRIDGE_FORWARD_ DEFINE_GETTER (nmc_property_bridge_get_hello_time, NM_SETTING_BRIDGE_HELLO_TIME) DEFINE_GETTER (nmc_property_bridge_get_max_age, NM_SETTING_BRIDGE_MAX_AGE) DEFINE_GETTER (nmc_property_bridge_get_ageing_time, NM_SETTING_BRIDGE_AGEING_TIME) +DEFINE_GETTER (nmc_property_bridge_get_multicast_snooping, NM_SETTING_BRIDGE_MULTICAST_SNOOPING) /* --- NM_SETTING_BRIDGE_PORT_SETTING_NAME property get functions --- */ DEFINE_GETTER (nmc_property_bridge_port_get_priority, NM_SETTING_BRIDGE_PORT_PRIORITY) @@ -1224,11 +1383,46 @@ DEFINE_GETTER (nmc_property_gsm_get_network_id, NM_SETTING_GSM_NETWORK_ID) DEFINE_GETTER (nmc_property_gsm_get_pin, NM_SETTING_GSM_PIN) DEFINE_SECRET_FLAGS_GETTER (nmc_property_gsm_get_pin_flags, NM_SETTING_GSM_PIN_FLAGS) DEFINE_GETTER (nmc_property_gsm_get_home_only, NM_SETTING_GSM_HOME_ONLY) +DEFINE_GETTER (nmc_property_gsm_get_device_id, NM_SETTING_GSM_DEVICE_ID) +DEFINE_GETTER (nmc_property_gsm_get_sim_id, NM_SETTING_GSM_SIM_ID) +DEFINE_GETTER (nmc_property_gsm_get_sim_operator_id, NM_SETTING_GSM_SIM_OPERATOR_ID) /* --- NM_SETTING_INFINIBAND_SETTING_NAME property get functions --- */ DEFINE_GETTER (nmc_property_ib_get_mac_address, NM_SETTING_INFINIBAND_MAC_ADDRESS) DEFINE_GETTER (nmc_property_ib_get_transport_mode, NM_SETTING_INFINIBAND_TRANSPORT_MODE) +/* --- NM_SETTING_TUN_SETTING_NAME property get functions --- */ +DEFINE_GETTER (nmc_property_tun_get_owner, NM_SETTING_TUN_OWNER); +DEFINE_GETTER (nmc_property_tun_get_group, NM_SETTING_TUN_GROUP); +DEFINE_GETTER (nmc_property_tun_get_pi, NM_SETTING_TUN_PI); +DEFINE_GETTER (nmc_property_tun_get_vnet_hdr, NM_SETTING_TUN_VNET_HDR); +DEFINE_GETTER (nmc_property_tun_get_multi_queue, NM_SETTING_TUN_MULTI_QUEUE); + +/* --- NM_SETTING_IP_TUNNEL_SETTING_NAME property get functions --- */ +DEFINE_GETTER (nmc_property_ip_tunnel_get_parent, NM_SETTING_IP_TUNNEL_PARENT); +DEFINE_GETTER (nmc_property_ip_tunnel_get_local, NM_SETTING_IP_TUNNEL_LOCAL); +DEFINE_GETTER (nmc_property_ip_tunnel_get_remote, NM_SETTING_IP_TUNNEL_REMOTE); +DEFINE_GETTER (nmc_property_ip_tunnel_get_ttl, NM_SETTING_IP_TUNNEL_TTL); +DEFINE_GETTER (nmc_property_ip_tunnel_get_tos, NM_SETTING_IP_TUNNEL_TOS); +DEFINE_GETTER (nmc_property_ip_tunnel_get_path_mtu_discovery, NM_SETTING_IP_TUNNEL_PATH_MTU_DISCOVERY); +DEFINE_GETTER (nmc_property_ip_tunnel_get_input_key, NM_SETTING_IP_TUNNEL_INPUT_KEY); +DEFINE_GETTER (nmc_property_ip_tunnel_get_output_key, NM_SETTING_IP_TUNNEL_OUTPUT_KEY); +DEFINE_GETTER (nmc_property_ip_tunnel_get_encapsulation_limit, NM_SETTING_IP_TUNNEL_ENCAPSULATION_LIMIT); +DEFINE_GETTER (nmc_property_ip_tunnel_get_flow_label, NM_SETTING_IP_TUNNEL_FLOW_LABEL); +DEFINE_GETTER (nmc_property_ip_tunnel_get_mtu, NM_SETTING_IP_TUNNEL_MTU); + +static const char ** +nmc_property_ip_tunnel_allowed_mode (NMSetting *setting, const char *prop) +{ + static const char **words = NULL; + + if (!words) + words = nm_utils_enum_get_values (nm_ip_tunnel_mode_get_type (), + NM_IP_TUNNEL_MODE_UKNOWN + 1, + G_MAXINT); + return words; +} + static char * nmc_property_ib_get_mtu (NMSetting *setting, NmcPropertyGetType get_type) { @@ -1261,6 +1455,7 @@ DEFINE_GETTER (nmc_property_ib_get_parent, NM_SETTING_INFINIBAND_PARENT) DEFINE_GETTER (nmc_property_ipv4_get_method, NM_SETTING_IP_CONFIG_METHOD) DEFINE_GETTER (nmc_property_ipv4_get_dns, NM_SETTING_IP_CONFIG_DNS) DEFINE_GETTER (nmc_property_ipv4_get_dns_search, NM_SETTING_IP_CONFIG_DNS_SEARCH) +DEFINE_GETTER_WITH_DEFAULT (nmc_property_ipv4_get_dns_options, NM_SETTING_IP_CONFIG_DNS_OPTIONS, !nm_setting_ip_config_has_dns_options ((NMSettingIPConfig *) setting)) static char * nmc_property_ip_get_addresses (NMSetting *setting, NmcPropertyGetType get_type) @@ -1349,8 +1544,10 @@ DEFINE_GETTER (nmc_property_ipv4_get_route_metric, NM_SETTING_IP_CONFIG_ROUTE_ME DEFINE_GETTER (nmc_property_ipv4_get_ignore_auto_routes, NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES) DEFINE_GETTER (nmc_property_ipv4_get_ignore_auto_dns, NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS) DEFINE_GETTER (nmc_property_ipv4_get_dhcp_client_id, NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID) +DEFINE_GETTER (nmc_property_ipv4_get_dhcp_timeout, NM_SETTING_IP4_CONFIG_DHCP_TIMEOUT) DEFINE_GETTER (nmc_property_ipv4_get_dhcp_send_hostname, NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME) DEFINE_GETTER (nmc_property_ipv4_get_dhcp_hostname, NM_SETTING_IP_CONFIG_DHCP_HOSTNAME) +DEFINE_GETTER (nmc_property_ipv4_get_dhcp_fqdn, NM_SETTING_IP4_CONFIG_DHCP_FQDN) DEFINE_GETTER (nmc_property_ipv4_get_never_default, NM_SETTING_IP_CONFIG_NEVER_DEFAULT) DEFINE_GETTER (nmc_property_ipv4_get_may_fail, NM_SETTING_IP_CONFIG_MAY_FAIL) @@ -1358,6 +1555,7 @@ DEFINE_GETTER (nmc_property_ipv4_get_may_fail, NM_SETTING_IP_CONFIG_MAY_FAIL) DEFINE_GETTER (nmc_property_ipv6_get_method, NM_SETTING_IP_CONFIG_METHOD) DEFINE_GETTER (nmc_property_ipv6_get_dns, NM_SETTING_IP_CONFIG_DNS) DEFINE_GETTER (nmc_property_ipv6_get_dns_search, NM_SETTING_IP_CONFIG_DNS_SEARCH) +DEFINE_GETTER_WITH_DEFAULT (nmc_property_ipv6_get_dns_options, NM_SETTING_IP_CONFIG_DNS_OPTIONS, !nm_setting_ip_config_has_dns_options ((NMSettingIPConfig *) setting)) static char * nmc_property_ipv6_get_routes (NMSetting *setting, NmcPropertyGetType get_type) @@ -1488,6 +1686,7 @@ nmc_property_vpn_get_secrets (NMSetting *setting, NmcPropertyGetType get_type) } DEFINE_GETTER (nmc_property_vpn_get_persistent, NM_SETTING_VPN_PERSISTENT) +DEFINE_GETTER (nmc_property_vpn_get_timeout, NM_SETTING_VPN_TIMEOUT) /* --- NM_SETTING_WIMAX_SETTING_NAME property get functions --- */ DEFINE_GETTER (nmc_property_wimax_get_network_name, NM_SETTING_WIMAX_NETWORK_NAME) @@ -1579,6 +1778,44 @@ nmc_property_wired_set_wake_on_lan (NMSetting *setting, const char *prop, return TRUE; } +static char * +nmc_property_ip_tunnel_get_mode (NMSetting *setting, NmcPropertyGetType get_type) +{ + NMSettingIPTunnel *s_ip_tunnel = NM_SETTING_IP_TUNNEL (setting); + NMIPTunnelMode mode; + + mode = nm_setting_ip_tunnel_get_mode (s_ip_tunnel); + return nm_utils_enum_to_str (nm_ip_tunnel_mode_get_type (), mode); +} + +static gboolean +nmc_property_ip_tunnel_set_mode (NMSetting *setting, const char *prop, + const char *val, GError **error) +{ + NMIPTunnelMode mode; + gboolean ret; + + ret = nm_utils_enum_from_str (nm_ip_tunnel_mode_get_type(), val, + (int *) &mode, NULL); + + if (!ret) { + gs_free const char **values = NULL; + gs_free char *values_str = NULL; + + values = nm_utils_enum_get_values (nm_ip_tunnel_mode_get_type (), + NM_IP_TUNNEL_MODE_UKNOWN + 1, + G_MAXINT); + values_str = g_strjoinv (",", (char **) values); + g_set_error (error, 1, 0, _("invalid mode '%s', use one of %s"), + val, values_str); + + return FALSE; + } + + g_object_set (setting, prop, mode, NULL); + return TRUE; +} + /* --- NM_SETTING_WIRELESS_SETTING_NAME property get functions --- */ DEFINE_GETTER (nmc_property_wireless_get_mode, NM_SETTING_WIRELESS_MODE) DEFINE_GETTER (nmc_property_wireless_get_band, NM_SETTING_WIRELESS_BAND) @@ -1621,6 +1858,37 @@ nmc_property_wireless_get_mtu (NMSetting *setting, NmcPropertyGetType get_type) return g_strdup_printf ("%d", mtu); } +static char * +nmc_property_wireless_get_powersave (NMSetting *setting, NmcPropertyGetType get_type) +{ + NMSettingWireless *s_wireless = NM_SETTING_WIRELESS (setting); + guint powersave = nm_setting_wireless_get_powersave (s_wireless); + + if (powersave == 0) + return g_strdup (_("no")); + else if (powersave == 1) + return g_strdup (_("yes")); + else + return g_strdup_printf (_("yes (%u)"), powersave); +} + +static char * +nmc_property_wireless_get_mac_address_randomization (NMSetting *setting, NmcPropertyGetType get_type) +{ + NMSettingWireless *s_wifi = NM_SETTING_WIRELESS (setting); + NMSettingMacRandomization randomization = nm_setting_wireless_get_mac_address_randomization (s_wifi); + + if (randomization == NM_SETTING_MAC_RANDOMIZATION_DEFAULT) + return g_strdup (_("default")); + else if (randomization == NM_SETTING_MAC_RANDOMIZATION_NEVER) + return g_strdup (_("never")); + else if (randomization == NM_SETTING_MAC_RANDOMIZATION_ALWAYS) + return g_strdup_printf (_("always")); + else + return g_strdup_printf (_("unknown")); +} + + /* --- NM_SETTING_WIRELESS_SECURITY_SETTING_NAME property get functions --- */ DEFINE_GETTER (nmc_property_wifi_sec_get_key_mgmt, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT) DEFINE_GETTER (nmc_property_wifi_sec_get_wep_tx_keyidx, NM_SETTING_WIRELESS_SECURITY_WEP_TX_KEYIDX) @@ -1670,6 +1938,91 @@ nmc_property_wifi_sec_get_wep_key_type (NMSetting *setting, NmcPropertyGetType g return wep_key_type_to_string (nm_setting_wireless_security_get_wep_key_type (s_wireless_sec)); } +/* --- NM_SETTING_MACVLAN_SETTING_NAME property get functions --- */ +DEFINE_GETTER (nmc_property_macvlan_get_parent, NM_SETTING_MACVLAN_PARENT) +DEFINE_GETTER (nmc_property_macvlan_get_promiscuous, NM_SETTING_MACVLAN_PROMISCUOUS) +DEFINE_GETTER (nmc_property_macvlan_get_tap, NM_SETTING_MACVLAN_TAP) + +static char * +nmc_property_macvlan_get_mode (NMSetting *setting, NmcPropertyGetType get_type) +{ + NMSettingMacvlan *s_macvlan = NM_SETTING_MACVLAN (setting); + NMSettingMacvlanMode mode; + char *tmp, *str; + + mode = nm_setting_macvlan_get_mode (s_macvlan); + tmp = nm_utils_enum_to_str (nm_setting_macvlan_mode_get_type (), mode); + + if (get_type == NMC_PROPERTY_GET_PARSABLE) + str = g_strdup (tmp ? tmp : ""); + else + str = g_strdup_printf ("%d (%s)", mode, tmp ? tmp : ""); + g_free (tmp); + + return str; +} + +static gboolean +nmc_property_macvlan_set_mode (NMSetting *setting, const char *prop, + const char *val, GError **error) +{ + NMSettingMacvlanMode mode; + gs_free const char **options = NULL; + gs_free char *options_str = NULL; + long int t; + gboolean ret; + + if (nmc_string_to_int_base (val, 0, TRUE, 0, _NM_SETTING_MACVLAN_MODE_NUM - 1, &t)) + mode = (NMSettingMacvlanMode) t; + else { + ret = nm_utils_enum_from_str (nm_setting_macvlan_mode_get_type (), val, + (int *) &mode, NULL); + + if (!ret) { + options = nm_utils_enum_get_values (nm_setting_macvlan_mode_get_type(), + NM_SETTING_MACVLAN_MODE_UNKNOWN + 1, + G_MAXINT); + options_str = g_strjoinv (",", (char **) options); + g_set_error (error, 1, 0, _("invalid option '%s', use one of [%s]"), + val, options_str); + return FALSE; + } + } + + g_object_set (setting, prop, (guint) mode, NULL); + return TRUE; +} + +static const char ** +nmc_property_macvlan_allowed_mode (NMSetting *setting, const char *prop) +{ + static const char **words = NULL; + + if (!words) + words = nm_utils_enum_get_values (nm_setting_macvlan_mode_get_type(), + NM_SETTING_MACVLAN_MODE_UNKNOWN + 1, + G_MAXINT); + return words; +} + +/* --- NM_SETTING_VXLAN_SETTING_NAME property get functions --- */ +DEFINE_GETTER (nmc_property_vxlan_get_parent, NM_SETTING_VXLAN_PARENT) +DEFINE_GETTER (nmc_property_vxlan_get_id, NM_SETTING_VXLAN_ID) +DEFINE_GETTER (nmc_property_vxlan_get_local, NM_SETTING_VXLAN_LOCAL) +DEFINE_GETTER (nmc_property_vxlan_get_remote, NM_SETTING_VXLAN_REMOTE) +DEFINE_GETTER (nmc_property_vxlan_get_source_port_min, NM_SETTING_VXLAN_SOURCE_PORT_MIN) +DEFINE_GETTER (nmc_property_vxlan_get_source_port_max, NM_SETTING_VXLAN_SOURCE_PORT_MAX) +DEFINE_GETTER (nmc_property_vxlan_get_destination_port, NM_SETTING_VXLAN_DESTINATION_PORT) +DEFINE_GETTER (nmc_property_vxlan_get_tos, NM_SETTING_VXLAN_TOS) +DEFINE_GETTER (nmc_property_vxlan_get_ttl, NM_SETTING_VXLAN_TTL) +DEFINE_GETTER (nmc_property_vxlan_get_ageing, NM_SETTING_VXLAN_AGEING) +DEFINE_GETTER (nmc_property_vxlan_get_limit, NM_SETTING_VXLAN_LIMIT) +DEFINE_GETTER (nmc_property_vxlan_get_learning, NM_SETTING_VXLAN_LEARNING) +DEFINE_GETTER (nmc_property_vxlan_get_proxy, NM_SETTING_VXLAN_PROXY) +DEFINE_GETTER (nmc_property_vxlan_get_rsc, NM_SETTING_VXLAN_RSC) +DEFINE_GETTER (nmc_property_vxlan_get_l2_miss, NM_SETTING_VXLAN_L2_MISS) +DEFINE_GETTER (nmc_property_vxlan_get_l3_miss, NM_SETTING_VXLAN_L3_MISS) + /*----------------------------------------------------------------------------*/ static void @@ -2878,6 +3231,56 @@ nmc_property_connection_describe_metered (NMSetting *setting, const char *prop) "'unknown' to let NetworkManager choose a value using some heuristics\n"); } +/* 'lldp' */ +static char * +nmc_property_connection_get_lldp (NMSetting *setting, NmcPropertyGetType get_type) +{ + NMSettingConnection *s_conn = NM_SETTING_CONNECTION (setting); + NMSettingConnectionLldp lldp; + char *tmp, *str; + + lldp = nm_setting_connection_get_lldp (s_conn); + tmp = nm_utils_enum_to_str (nm_setting_connection_lldp_get_type (), lldp); + if (get_type == NMC_PROPERTY_GET_PARSABLE) + str = g_strdup_printf ("%s", tmp && *tmp ? tmp : "default"); + else + str = g_strdup_printf ("%d (%s)", lldp, tmp && *tmp ? tmp : "default"); + g_free (tmp); + return str; +} + +static gboolean +nmc_property_connection_set_lldp (NMSetting *setting, const char *prop, + const char *val, GError **error) +{ + NMSettingConnectionLldp lldp; + gboolean ret; + long int t; + + if (nmc_string_to_int_base (val, 0, TRUE, + NM_SETTING_CONNECTION_LLDP_DEFAULT, + NM_SETTING_CONNECTION_LLDP_ENABLE_RX, + &t)) + lldp = t; + else { + ret = nm_utils_enum_from_str (nm_setting_connection_lldp_get_type (), val, + (int *) &lldp, NULL); + + if (!ret) { + if (g_ascii_strcasecmp (val, "enable") == 0) + lldp = NM_SETTING_CONNECTION_LLDP_ENABLE_RX; + else { + g_set_error (error, 1, 0, _("invalid option '%s', use one of [%s]"), + val, "default,disable,enable-rx,enable"); + return FALSE; + } + } + } + + g_object_set (setting, prop, lldp, NULL); + return TRUE; +} + /* --- NM_SETTING_802_1X_SETTING_NAME property setter functions --- */ #define DEFINE_SETTER_STR_LIST(def_func, set_func) \ static gboolean \ @@ -3497,6 +3900,44 @@ DEFINE_REMOVER_INDEX_OR_VALUE (nmc_property_ipv4_remove_dns_search, nm_setting_ip_config_remove_dns_search, _validate_and_remove_ipv4_dns_search) +/* 'dns-options' */ +static gboolean +nmc_property_ipv4_set_dns_options (NMSetting *setting, const char *prop, const char *val, GError **error) +{ + char **strv = NULL; + guint i = 0; + + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + nm_setting_ip_config_clear_dns_options (NM_SETTING_IP_CONFIG (setting), TRUE); + strv = nmc_strsplit_set (val, " \t,", 0); + while (strv && strv[i]) + nm_setting_ip_config_add_dns_option (NM_SETTING_IP_CONFIG (setting), strv[i++]); + g_strfreev (strv); + + return TRUE; +} + +static gboolean +_validate_and_remove_ipv4_dns_option (NMSettingIPConfig *setting, + const char *dns_option, + GError **error) +{ + gboolean ret; + + ret = nm_setting_ip_config_remove_dns_option_by_value (setting, dns_option); + if (!ret) + g_set_error (error, 1, 0, + _("the property doesn't contain DNS option '%s'"), + dns_option); + return ret; +} +DEFINE_REMOVER_INDEX_OR_VALUE (nmc_property_ipv4_remove_dns_option, + NM_SETTING_IP_CONFIG, + nm_setting_ip_config_get_num_dns_options, + nm_setting_ip_config_remove_dns_option, + _validate_and_remove_ipv4_dns_option) + /* 'addresses' */ static NMIPAddress * _parse_ipv4_address (const char *address, GError **error) @@ -3773,6 +4214,44 @@ DEFINE_REMOVER_INDEX_OR_VALUE (nmc_property_ipv6_remove_dns_search, nm_setting_ip_config_remove_dns_search, _validate_and_remove_ipv6_dns_search) +/* 'dns-options' */ +static gboolean +nmc_property_ipv6_set_dns_options (NMSetting *setting, const char *prop, const char *val, GError **error) +{ + char **strv = NULL; + guint i = 0; + + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + nm_setting_ip_config_clear_dns_options (NM_SETTING_IP_CONFIG (setting), TRUE); + strv = nmc_strsplit_set (val, " \t,", 0); + while (strv && strv[i]) + nm_setting_ip_config_add_dns_option (NM_SETTING_IP_CONFIG (setting), strv[i++]); + g_strfreev (strv); + + return TRUE; +} + +static gboolean +_validate_and_remove_ipv6_dns_option (NMSettingIPConfig *setting, + const char *dns_option, + GError **error) +{ + gboolean ret; + + ret = nm_setting_ip_config_remove_dns_option_by_value (setting, dns_option); + if (!ret) + g_set_error (error, 1, 0, + _("the property doesn't contain DNS option '%s'"), + dns_option); + return ret; +} +DEFINE_REMOVER_INDEX_OR_VALUE (nmc_property_ipv6_remove_dns_option, + NM_SETTING_IP_CONFIG, + nm_setting_ip_config_get_num_dns_options, + nm_setting_ip_config_remove_dns_option, + _validate_and_remove_ipv6_dns_option) + /* 'addresses' */ static NMIPAddress * _parse_ipv6_address (const char *address, GError **error) @@ -3945,6 +4424,36 @@ nmc_property_ipv6_set_ip6_privacy (NMSetting *setting, const char *prop, const c return TRUE; } +/* 'addr_gen_mode' */ +static char * +nmc_property_ipv6_get_addr_gen_mode (NMSetting *setting, NmcPropertyGetType get_type) +{ + NMSettingIP6Config *s_ip6 = NM_SETTING_IP6_CONFIG (setting); + NMSettingIP6ConfigAddrGenMode addr_gen_mode; + + addr_gen_mode = nm_setting_ip6_config_get_addr_gen_mode (s_ip6); + return nm_utils_enum_to_str (nm_setting_ip6_config_addr_gen_mode_get_type (), addr_gen_mode); +} + + +static gboolean +nmc_property_ipv6_set_addr_gen_mode (NMSetting *setting, const char *prop, + const char *val, GError **error) +{ + NMSettingIP6ConfigAddrGenMode addr_gen_mode; + + if (!nm_utils_enum_from_str (nm_setting_ip6_config_addr_gen_mode_get_type (), val, + (int *) &addr_gen_mode, NULL)) { + g_set_error (error, 1, 0, _("invalid option '%s', use one of [%s]"), + val, "eui64,stable-privacy"); + return FALSE; + } + + g_object_set (setting, prop, addr_gen_mode, NULL); + return TRUE; +} + + /* --- NM_SETTING_OLPC_MESH_SETTING_NAME property setter functions --- */ static gboolean nmc_property_olpc_set_channel (NMSetting *setting, const char *prop, const char *val, GError **error) @@ -4413,6 +4922,60 @@ DEFINE_REMOVER_INDEX_OR_VALUE (nmc_property_wireless_remove_mac_address_blacklis nm_setting_wireless_remove_mac_blacklist_item, _validate_and_remove_wifi_mac_blacklist_item) +/* 'powersave' */ +static gboolean +nmc_property_wireless_set_powersave (NMSetting *setting, const char *prop, const char *val, GError **error) +{ + unsigned long powersave_int; + gboolean val_bool = FALSE; + + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + + if (!nmc_string_to_uint (val, TRUE, 0, G_MAXUINT32, &powersave_int)) { + if (!nmc_string_to_bool (val, &val_bool, NULL)) { + g_set_error (error, 1, 0, _("'%s' is not a valid powersave value"), val); + return FALSE; + } + powersave_int = val_bool ? 1 : 0; + } + + g_object_set (setting, prop, (guint32) powersave_int, NULL); + return TRUE; +} + +static gboolean +nmc_property_wireless_set_mac_address_randomization (NMSetting *setting, + const char *prop, + const char *val, + GError **error) +{ + NMSettingMacRandomization randomization; + gs_free char *err_token = NULL; + gboolean ret; + long int t; + + if (nmc_string_to_int_base (val, 0, TRUE, + NM_SETTING_MAC_RANDOMIZATION_DEFAULT, + NM_SETTING_MAC_RANDOMIZATION_ALWAYS, + &t)) + randomization = (NMSettingMacRandomization) t; + else { + ret = nm_utils_enum_from_str (nm_setting_mac_randomization_get_type (), + val, + (int *) &randomization, + &err_token); + + if (!ret) { + g_set_error (error, 1, 0, _("invalid option '%s', use 'default', 'never' or 'always'"), + err_token); + return FALSE; + } + } + + g_object_set (setting, prop, (guint) randomization, NULL); + return TRUE; +} + /* --- NM_SETTING_WIRELESS_SECURITY_SETTING_NAME property setter functions --- */ /* 'key-mgmt' */ static const char *wifi_sec_valid_key_mgmts[] = { "none", "ieee8021x", "wpa-none", "wpa-psk", "wpa-eap", NULL }; @@ -4434,14 +4997,15 @@ nmc_property_wifi_sec_set_auth_alg (NMSetting *setting, const char *prop, const return check_and_set_string (setting, prop, val, wifi_sec_valid_auth_algs, error); } -DEFINE_SETTER_STR_LIST_MULTI (check_and_add_wifi_sec_proto, - NM_SETTING_WIRELESS_SECURITY, - nm_setting_wireless_security_add_proto) DEFINE_ALLOWED_VAL_FUNC (nmc_property_wifi_sec_allowed_auth_alg, wifi_sec_valid_auth_algs) /* 'proto' */ static const char *wifi_sec_valid_protos[] = { "wpa", "rsn", NULL }; +DEFINE_SETTER_STR_LIST_MULTI (check_and_add_wifi_sec_proto, + NM_SETTING_WIRELESS_SECURITY, + nm_setting_wireless_security_add_proto) + static gboolean nmc_property_wifi_sec_set_proto (NMSetting *setting, const char *prop, const char *val, GError **error) { @@ -4472,14 +5036,15 @@ DEFINE_REMOVER_INDEX_OR_VALUE (nmc_property_wifi_sec_remove_proto, nm_setting_wireless_security_remove_proto, _validate_and_remove_wifi_sec_proto) -DEFINE_SETTER_STR_LIST_MULTI (check_and_add_wifi_sec_pairwise, - NM_SETTING_WIRELESS_SECURITY, - nm_setting_wireless_security_add_pairwise) DEFINE_ALLOWED_VAL_FUNC (nmc_property_wifi_sec_allowed_proto, wifi_sec_valid_protos) /* 'pairwise' */ static const char *wifi_sec_valid_pairwises[] = { "tkip", "ccmp", NULL }; +DEFINE_SETTER_STR_LIST_MULTI (check_and_add_wifi_sec_pairwise, + NM_SETTING_WIRELESS_SECURITY, + nm_setting_wireless_security_add_pairwise) + static gboolean nmc_property_wifi_sec_set_pairwise (NMSetting *setting, const char *prop, const char *val, GError **error) { @@ -4510,14 +5075,15 @@ DEFINE_REMOVER_INDEX_OR_VALUE (nmc_property_wifi_sec_remove_pairwise, nm_setting_wireless_security_remove_pairwise, _validate_and_remove_wifi_sec_pairwise) -DEFINE_SETTER_STR_LIST_MULTI (check_and_add_wifi_sec_group, - NM_SETTING_WIRELESS_SECURITY, - nm_setting_wireless_security_add_group) DEFINE_ALLOWED_VAL_FUNC (nmc_property_wifi_sec_allowed_pairwise, wifi_sec_valid_pairwises) /* 'group' */ static const char *wifi_sec_valid_groups[] = { "wep40", "wep104", "tkip", "ccmp", NULL }; +DEFINE_SETTER_STR_LIST_MULTI (check_and_add_wifi_sec_group, + NM_SETTING_WIRELESS_SECURITY, + nm_setting_wireless_security_add_group) + static gboolean nmc_property_wifi_sec_set_group (NMSetting *setting, const char *prop, const char *val, GError **error) { @@ -4928,22 +5494,93 @@ nmc_property_dcb_set_app_fcoe_mode (NMSetting *setting, const char *prop, const DEFINE_ALLOWED_VAL_FUNC (nmc_property_dcb_allowed_app_fcoe_modes, _dcb_valid_fcoe_modes) -/*----------------------------------------------------------------------------*/ - -static inline void -_nmc_add_prop_funcs (const char *key, - const NmcPropertyFuncs *item_init) +static gboolean +nmc_property_gsm_set_sim_operator_id (NMSetting *setting, const char *prop, const char *val, GError **error) { - NmcPropertyFuncs *item; + const char *p = val; - item = g_malloc (sizeof (NmcPropertyFuncs)); - *item = *item_init; - g_hash_table_insert (nmc_properties, (gpointer) key, item); -} + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); -#define nmc_add_prop_funcs(key, ...) \ - G_STMT_START { \ - struct { \ + if (strlen (val) != 5 && strlen (val) != 6) { + g_set_error_literal (error, 1, 0, _("SIM operator ID must be a 5 or 6 number MCCMNC code")); + return FALSE; + } + + while (p && *p) { + if (!g_ascii_isdigit (*p++)) { + g_set_error_literal (error, 1, 0, _("SIM operator ID must be a 5 or 6 number MCCMNC code")); + return FALSE; + } + } + g_object_set (G_OBJECT (setting), + NM_SETTING_GSM_SIM_OPERATOR_ID, + val, + NULL); + return TRUE; +} + +static char * +nmc_property_tun_get_mode (NMSetting *setting, NmcPropertyGetType get_type) +{ + NMSettingTun *s_tun = NM_SETTING_TUN (setting); + NMSettingTunMode mode; + char *tmp, *str; + + mode = nm_setting_tun_get_mode (s_tun); + tmp = nm_utils_enum_to_str (nm_setting_tun_mode_get_type (), mode); + if (get_type == NMC_PROPERTY_GET_PARSABLE) + str = g_strdup_printf ("%s", tmp ? tmp : ""); + else + str = g_strdup_printf ("%d (%s)", mode, tmp ? tmp : ""); + g_free (tmp); + return str; +} + +static gboolean +nmc_property_tun_set_mode (NMSetting *setting, const char *prop, + const char *val, GError **error) +{ + NMSettingTunMode mode; + gboolean ret; + long int t; + + if (nmc_string_to_int_base (val, 0, TRUE, 0, NM_SETTING_TUN_MODE_TAP, &t)) + mode = (NMSettingTunMode) t; + else { + ret = nm_utils_enum_from_str (nm_setting_tun_mode_get_type (), val, + (int *) &mode, NULL); + + if (!ret) { + g_set_error (error, 1, 0, _("invalid option '%s', use '%s' or '%s'"), + val, "tun", "tap"); + return FALSE; + } + } + + g_object_set (setting, prop, (guint) mode, NULL); + return TRUE; +} + +static const char *tun_valid_modes[] = { "tun", "tap", "unknown", NULL }; + +DEFINE_ALLOWED_VAL_FUNC (nmc_property_tun_allowed_mode, tun_valid_modes) + +/*----------------------------------------------------------------------------*/ + +static inline void +_nmc_add_prop_funcs (const char *key, + const NmcPropertyFuncs *item_init) +{ + NmcPropertyFuncs *item; + + item = g_malloc (sizeof (NmcPropertyFuncs)); + *item = *item_init; + g_hash_table_insert (nmc_properties, (gpointer) key, item); +} + +#define nmc_add_prop_funcs(key, ...) \ + G_STMT_START { \ + struct { \ NmcPropertyFuncsFields; \ /* The _dummy field is here so that the last argument can be always * NULL. That means every call to nmc_add_prop_funcs() below ends @@ -5323,6 +5960,14 @@ nmc_properties_init (void) NULL, NULL); + nmc_add_prop_funcs (GLUE (BRIDGE, MULTICAST_SNOOPING), + nmc_property_bridge_get_multicast_snooping, + nmc_property_set_bool, + NULL, + NULL, + NULL, + NULL); + /* Add editable properties for NM_SETTING_BRIDGE_PORT_SETTING_NAME */ nmc_add_prop_funcs (GLUE (BRIDGE_PORT, PRIORITY), nmc_property_bridge_port_get_priority, @@ -5489,6 +6134,13 @@ nmc_properties_init (void) nmc_property_connection_describe_metered, NULL, NULL); + nmc_add_prop_funcs (GLUE (CONNECTION, LLDP), + nmc_property_connection_get_lldp, + nmc_property_connection_set_lldp, + NULL, + NULL, + NULL, + NULL); /* Add editable properties for NM_SETTING_DCB_SETTING_NAME */ nmc_add_prop_funcs (GLUE (DCB, APP_FCOE_FLAGS), @@ -5661,6 +6313,27 @@ nmc_properties_init (void) NULL, NULL, NULL); + nmc_add_prop_funcs (GLUE (GSM, DEVICE_ID), + nmc_property_gsm_get_device_id, + nmc_property_set_string, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (GSM, SIM_ID), + nmc_property_gsm_get_sim_id, + nmc_property_set_string, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (GSM, SIM_OPERATOR_ID), + nmc_property_gsm_get_sim_operator_id, + nmc_property_gsm_set_sim_operator_id, + NULL, + NULL, + NULL, + NULL); /* Add editable properties for NM_SETTING_INFINIBAND_SETTING_NAME */ nmc_add_prop_funcs (GLUE (INFINIBAND, MAC_ADDRESS), @@ -5721,6 +6394,13 @@ nmc_properties_init (void) NULL, NULL, NULL); + nmc_add_prop_funcs (GLUE_IP (4, DNS_OPTIONS), + nmc_property_ipv4_get_dns_options, + nmc_property_ipv4_set_dns_options, + nmc_property_ipv4_remove_dns_option, + NULL, + NULL, + NULL); nmc_add_prop_funcs (GLUE_IP (4, ADDRESSES), nmc_property_ip_get_addresses, nmc_property_ipv4_set_addresses, @@ -5770,6 +6450,13 @@ nmc_properties_init (void) NULL, NULL, NULL); + nmc_add_prop_funcs (GLUE (IP4_CONFIG, DHCP_TIMEOUT), + nmc_property_ipv4_get_dhcp_timeout, + nmc_property_set_uint, + NULL, + NULL, + NULL, + NULL); nmc_add_prop_funcs (GLUE_IP (4, DHCP_SEND_HOSTNAME), nmc_property_ipv4_get_dhcp_send_hostname, nmc_property_set_bool, @@ -5784,6 +6471,13 @@ nmc_properties_init (void) NULL, NULL, NULL); + nmc_add_prop_funcs (GLUE (IP4_CONFIG, DHCP_FQDN), + nmc_property_ipv4_get_dhcp_fqdn, + nmc_property_set_string, + NULL, + NULL, + NULL, + NULL); nmc_add_prop_funcs (GLUE_IP (4, NEVER_DEFAULT), nmc_property_ipv4_get_never_default, nmc_property_set_bool, @@ -5821,6 +6515,13 @@ nmc_properties_init (void) NULL, NULL, NULL); + nmc_add_prop_funcs (GLUE_IP (6, DNS_OPTIONS), + nmc_property_ipv6_get_dns_options, + nmc_property_ipv6_set_dns_options, + nmc_property_ipv6_remove_dns_option, + NULL, + NULL, + NULL); nmc_add_prop_funcs (GLUE_IP (6, ADDRESSES), nmc_property_ip_get_addresses, nmc_property_ipv6_set_addresses, @@ -5884,6 +6585,13 @@ nmc_properties_init (void) NULL, NULL, NULL); + nmc_add_prop_funcs (GLUE (IP6_CONFIG, ADDR_GEN_MODE), + nmc_property_ipv6_get_addr_gen_mode, + nmc_property_ipv6_set_addr_gen_mode, + NULL, + NULL, + NULL, + NULL); nmc_add_prop_funcs (GLUE_IP (6, DHCP_SEND_HOSTNAME), nmc_property_ipv6_get_dhcp_send_hostname, nmc_property_set_bool, @@ -6209,6 +6917,14 @@ nmc_properties_init (void) NULL, NULL); + nmc_add_prop_funcs (GLUE (VPN, TIMEOUT), + nmc_property_vpn_get_timeout, + nmc_property_set_uint, + NULL, + NULL, + NULL, + NULL); + /* Add editable properties for NM_SETTING_WIMAX_SETTING_NAME */ nmc_add_prop_funcs (GLUE (WIMAX, NETWORK_NAME), nmc_property_wimax_get_network_name, @@ -6414,6 +7130,20 @@ nmc_properties_init (void) NULL, NULL, NULL); + nmc_add_prop_funcs (GLUE (WIRELESS, POWERSAVE), + nmc_property_wireless_get_powersave, + nmc_property_wireless_set_powersave, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (WIRELESS, MAC_ADDRESS_RANDOMIZATION), + nmc_property_wireless_get_mac_address_randomization, + nmc_property_wireless_set_mac_address_randomization, + NULL, + NULL, + NULL, + NULL); /* Add editable properties for NM_SETTING_WIRELESS_SECURITY_SETTING_NAME */ nmc_add_prop_funcs (GLUE (WIRELESS_SECURITY, KEY_MGMT), @@ -6535,6 +7265,280 @@ nmc_properties_init (void) NULL, NULL, NULL); + + /* Add editable properties for NM_SETTING_TUN_SETTING_NAME */ + nmc_add_prop_funcs (GLUE (TUN, MODE), + nmc_property_tun_get_mode, + nmc_property_tun_set_mode, + NULL, + NULL, + nmc_property_tun_allowed_mode, + NULL); + nmc_add_prop_funcs (GLUE (TUN, OWNER), + nmc_property_tun_get_owner, + nmc_property_set_string, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (TUN, GROUP), + nmc_property_tun_get_group, + nmc_property_set_string, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (TUN, PI), + nmc_property_tun_get_pi, + nmc_property_set_bool, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (TUN, VNET_HDR), + nmc_property_tun_get_vnet_hdr, + nmc_property_set_bool, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (TUN, MULTI_QUEUE), + nmc_property_tun_get_multi_queue, + nmc_property_set_bool, + NULL, + NULL, + NULL, + NULL); + + /* Add editable properties for NM_SETTING_IP_TUNNEL_SETTING_NAME */ + nmc_add_prop_funcs (GLUE (IP_TUNNEL, MODE), + nmc_property_ip_tunnel_get_mode, + nmc_property_ip_tunnel_set_mode, + NULL, + NULL, + nmc_property_ip_tunnel_allowed_mode, + NULL); + nmc_add_prop_funcs (GLUE (IP_TUNNEL, PARENT), + nmc_property_ip_tunnel_get_parent, + nmc_property_set_string, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (IP_TUNNEL, LOCAL), + nmc_property_ip_tunnel_get_local, + nmc_property_set_string, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (IP_TUNNEL, REMOTE), + nmc_property_ip_tunnel_get_remote, + nmc_property_set_string, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (IP_TUNNEL, TTL), + nmc_property_ip_tunnel_get_ttl, + nmc_property_set_uint, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (IP_TUNNEL, TOS), + nmc_property_ip_tunnel_get_tos, + nmc_property_set_uint, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (IP_TUNNEL, PATH_MTU_DISCOVERY), + nmc_property_ip_tunnel_get_path_mtu_discovery, + nmc_property_set_bool, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (IP_TUNNEL, INPUT_KEY), + nmc_property_ip_tunnel_get_input_key, + nmc_property_set_string, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (IP_TUNNEL, OUTPUT_KEY), + nmc_property_ip_tunnel_get_output_key, + nmc_property_set_string, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (IP_TUNNEL, ENCAPSULATION_LIMIT), + nmc_property_ip_tunnel_get_encapsulation_limit, + nmc_property_set_uint, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (IP_TUNNEL, FLOW_LABEL), + nmc_property_ip_tunnel_get_flow_label, + nmc_property_set_uint, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (IP_TUNNEL, MTU), + nmc_property_ip_tunnel_get_mtu, + nmc_property_set_uint, + NULL, + NULL, + NULL, + NULL); + + /* Add editable properties for NM_SETTING_MACVLAN_SETTING_NAME */ + nmc_add_prop_funcs (GLUE (MACVLAN, PARENT), + nmc_property_macvlan_get_parent, + nmc_property_set_string, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (MACVLAN, MODE), + nmc_property_macvlan_get_mode, + nmc_property_macvlan_set_mode, + NULL, + NULL, + nmc_property_macvlan_allowed_mode, + NULL); + nmc_add_prop_funcs (GLUE (MACVLAN, PROMISCUOUS), + nmc_property_macvlan_get_promiscuous, + nmc_property_set_bool, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (MACVLAN, TAP), + nmc_property_macvlan_get_tap, + nmc_property_set_bool, + NULL, + NULL, + NULL, + NULL); + + /* Add editable properties for NM_SETTING_VXLAN_SETTING_NAME */ + nmc_add_prop_funcs (GLUE (VXLAN, PARENT), + nmc_property_vxlan_get_parent, + nmc_property_set_string, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (VXLAN, ID), + nmc_property_vxlan_get_id, + nmc_property_set_uint, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (VXLAN, LOCAL), + nmc_property_vxlan_get_local, + nmc_property_set_string, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (VXLAN, REMOTE), + nmc_property_vxlan_get_remote, + nmc_property_set_string, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (VXLAN, SOURCE_PORT_MIN), + nmc_property_vxlan_get_source_port_min, + nmc_property_set_uint, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (VXLAN, SOURCE_PORT_MAX), + nmc_property_vxlan_get_source_port_max, + nmc_property_set_uint, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (VXLAN, DESTINATION_PORT), + nmc_property_vxlan_get_destination_port, + nmc_property_set_uint, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (VXLAN, TOS), + nmc_property_vxlan_get_tos, + nmc_property_set_uint, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (VXLAN, TTL), + nmc_property_vxlan_get_ttl, + nmc_property_set_uint, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (VXLAN, AGEING), + nmc_property_vxlan_get_ageing, + nmc_property_set_uint, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (VXLAN, LIMIT), + nmc_property_vxlan_get_limit, + nmc_property_set_uint, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (VXLAN, LEARNING), + nmc_property_vxlan_get_learning, + nmc_property_set_bool, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (VXLAN, PROXY), + nmc_property_vxlan_get_proxy, + nmc_property_set_bool, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (VXLAN, RSC), + nmc_property_vxlan_get_rsc, + nmc_property_set_bool, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (VXLAN, L2_MISS), + nmc_property_vxlan_get_l2_miss, + nmc_property_set_bool, + NULL, + NULL, + NULL, + NULL); + nmc_add_prop_funcs (GLUE (VXLAN, L3_MISS), + nmc_property_vxlan_get_l3_miss, + nmc_property_set_bool, + NULL, + NULL, + NULL, + NULL); } void @@ -6864,6 +7868,7 @@ setting_connection_details (NMSetting *setting, NmCli *nmc, const char *one_pro set_val_str (arr, 14, nmc_property_connection_get_secondaries (setting, NMC_PROPERTY_GET_PRETTY)); set_val_str (arr, 15, nmc_property_connection_get_gateway_ping_timeout (setting, NMC_PROPERTY_GET_PRETTY)); set_val_str (arr, 16, nmc_property_connection_get_metered (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 17, nmc_property_connection_get_lldp (setting, NMC_PROPERTY_GET_PRETTY)); g_ptr_array_add (nmc->output_data, arr); print_data (nmc); /* Print all data */ @@ -6994,9 +7999,11 @@ setting_wireless_details (NMSetting *setting, NmCli *nmc, const char *one_prop, set_val_str (arr, 8, nmc_property_wireless_get_mac_address (setting, NMC_PROPERTY_GET_PRETTY)); set_val_str (arr, 9, nmc_property_wireless_get_cloned_mac_address (setting, NMC_PROPERTY_GET_PRETTY)); set_val_str (arr, 10, nmc_property_wireless_get_mac_address_blacklist (setting, NMC_PROPERTY_GET_PRETTY)); - set_val_str (arr, 11, nmc_property_wireless_get_mtu (setting, NMC_PROPERTY_GET_PRETTY)); - set_val_str (arr, 12, nmc_property_wireless_get_seen_bssids (setting, NMC_PROPERTY_GET_PRETTY)); - set_val_str (arr, 13, nmc_property_wireless_get_hidden (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 11, nmc_property_wireless_get_mac_address_randomization (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 12, nmc_property_wireless_get_mtu (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 13, nmc_property_wireless_get_seen_bssids (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 14, nmc_property_wireless_get_hidden (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 15, nmc_property_wireless_get_powersave (setting, NMC_PROPERTY_GET_PRETTY)); g_ptr_array_add (nmc->output_data, arr); print_data (nmc); /* Print all data */ @@ -7067,17 +8074,20 @@ setting_ip4_config_details (NMSetting *setting, NmCli *nmc, const char *one_pro set_val_str (arr, 1, nmc_property_ipv4_get_method (setting, NMC_PROPERTY_GET_PRETTY)); set_val_str (arr, 2, nmc_property_ipv4_get_dns (setting, NMC_PROPERTY_GET_PRETTY)); set_val_str (arr, 3, nmc_property_ipv4_get_dns_search (setting, NMC_PROPERTY_GET_PRETTY)); - set_val_str (arr, 4, nmc_property_ip_get_addresses (setting, NMC_PROPERTY_GET_PRETTY)); - set_val_str (arr, 5, nmc_property_ipv4_get_gateway (setting, NMC_PROPERTY_GET_PRETTY)); - set_val_str (arr, 6, nmc_property_ipv4_get_routes (setting, NMC_PROPERTY_GET_PRETTY)); - set_val_str (arr, 7, nmc_property_ipv4_get_route_metric (setting, NMC_PROPERTY_GET_PRETTY)); - set_val_str (arr, 8, nmc_property_ipv4_get_ignore_auto_routes (setting, NMC_PROPERTY_GET_PRETTY)); - set_val_str (arr, 9, nmc_property_ipv4_get_ignore_auto_dns (setting, NMC_PROPERTY_GET_PRETTY)); - set_val_str (arr, 10, nmc_property_ipv4_get_dhcp_client_id (setting, NMC_PROPERTY_GET_PRETTY)); - set_val_str (arr, 11, nmc_property_ipv4_get_dhcp_send_hostname (setting, NMC_PROPERTY_GET_PRETTY)); - set_val_str (arr, 12, nmc_property_ipv4_get_dhcp_hostname (setting, NMC_PROPERTY_GET_PRETTY)); - set_val_str (arr, 13, nmc_property_ipv4_get_never_default (setting, NMC_PROPERTY_GET_PRETTY)); - set_val_str (arr, 14, nmc_property_ipv4_get_may_fail (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 4, nmc_property_ipv4_get_dns_options (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 5, nmc_property_ip_get_addresses (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 6, nmc_property_ipv4_get_gateway (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 7, nmc_property_ipv4_get_routes (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 8, nmc_property_ipv4_get_route_metric (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 9, nmc_property_ipv4_get_ignore_auto_routes (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 10, nmc_property_ipv4_get_ignore_auto_dns (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 11, nmc_property_ipv4_get_dhcp_client_id (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 12, nmc_property_ipv4_get_dhcp_timeout (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 13, nmc_property_ipv4_get_dhcp_send_hostname (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 14, nmc_property_ipv4_get_dhcp_hostname (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 15, nmc_property_ipv4_get_dhcp_fqdn (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 16, nmc_property_ipv4_get_never_default (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 17, nmc_property_ipv4_get_may_fail (setting, NMC_PROPERTY_GET_PRETTY)); g_ptr_array_add (nmc->output_data, arr); print_data (nmc); /* Print all data */ @@ -7106,17 +8116,19 @@ setting_ip6_config_details (NMSetting *setting, NmCli *nmc, const char *one_pro set_val_str (arr, 1, nmc_property_ipv6_get_method (setting, NMC_PROPERTY_GET_PRETTY)); set_val_str (arr, 2, nmc_property_ipv6_get_dns (setting, NMC_PROPERTY_GET_PRETTY)); set_val_str (arr, 3, nmc_property_ipv6_get_dns_search (setting, NMC_PROPERTY_GET_PRETTY)); - set_val_str (arr, 4, nmc_property_ip_get_addresses (setting, NMC_PROPERTY_GET_PRETTY)); - set_val_str (arr, 5, nmc_property_ipv6_get_gateway (setting, NMC_PROPERTY_GET_PRETTY)); - set_val_str (arr, 6, nmc_property_ipv6_get_routes (setting, NMC_PROPERTY_GET_PRETTY)); - set_val_str (arr, 7, nmc_property_ipv6_get_route_metric (setting, NMC_PROPERTY_GET_PRETTY)); - set_val_str (arr, 8, nmc_property_ipv6_get_ignore_auto_routes (setting, NMC_PROPERTY_GET_PRETTY)); - set_val_str (arr, 9, nmc_property_ipv6_get_ignore_auto_dns (setting, NMC_PROPERTY_GET_PRETTY)); - set_val_str (arr, 10, nmc_property_ipv6_get_never_default (setting, NMC_PROPERTY_GET_PRETTY)); - set_val_str (arr, 11, nmc_property_ipv6_get_may_fail (setting, NMC_PROPERTY_GET_PRETTY)); - set_val_str (arr, 12, nmc_property_ipv6_get_ip6_privacy (setting, NMC_PROPERTY_GET_PRETTY)); - set_val_str (arr, 13, nmc_property_ipv6_get_dhcp_send_hostname (setting, NMC_PROPERTY_GET_PRETTY)); - set_val_str (arr, 14, nmc_property_ipv6_get_dhcp_hostname (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 4, nmc_property_ipv6_get_dns_options (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 5, nmc_property_ip_get_addresses (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 6, nmc_property_ipv6_get_gateway (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 7, nmc_property_ipv6_get_routes (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 8, nmc_property_ipv6_get_route_metric (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 9, nmc_property_ipv6_get_ignore_auto_routes (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 10, nmc_property_ipv6_get_ignore_auto_dns (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 11, nmc_property_ipv6_get_never_default (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 12, nmc_property_ipv6_get_may_fail (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 13, nmc_property_ipv6_get_ip6_privacy (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 14, nmc_property_ipv6_get_addr_gen_mode (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 15, nmc_property_ipv6_get_dhcp_send_hostname (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 16, nmc_property_ipv6_get_dhcp_hostname (setting, NMC_PROPERTY_GET_PRETTY)); g_ptr_array_add (nmc->output_data, arr); print_data (nmc); /* Print all data */ @@ -7253,6 +8265,9 @@ setting_gsm_details (NMSetting *setting, NmCli *nmc, const char *one_prop, gboo set_val_str (arr, 7, GET_SECRET (secrets, setting, nmc_property_gsm_get_pin)); set_val_str (arr, 8, nmc_property_gsm_get_pin_flags (setting, NMC_PROPERTY_GET_PRETTY)); set_val_str (arr, 9, nmc_property_gsm_get_home_only (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 10, nmc_property_gsm_get_device_id (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 11, nmc_property_gsm_get_sim_id (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 12, nmc_property_gsm_get_sim_operator_id (setting, NMC_PROPERTY_GET_PRETTY)); g_ptr_array_add (nmc->output_data, arr); print_data (nmc); /* Print all data */ @@ -7367,6 +8382,7 @@ setting_vpn_details (NMSetting *setting, NmCli *nmc, const char *one_prop, gboo set_val_str (arr, 3, nmc_property_vpn_get_data (setting, NMC_PROPERTY_GET_PRETTY)); set_val_str (arr, 4, GET_SECRET (secrets, setting, nmc_property_vpn_get_secrets)); set_val_str (arr, 5, nmc_property_vpn_get_persistent (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 6, nmc_property_vpn_get_timeout (setting, NMC_PROPERTY_GET_PRETTY)); g_ptr_array_add (nmc->output_data, arr); print_data (nmc); /* Print all data */ @@ -7544,6 +8560,7 @@ setting_bridge_details (NMSetting *setting, NmCli *nmc, const char *one_prop, g set_val_str (arr, 5, nmc_property_bridge_get_hello_time (setting, NMC_PROPERTY_GET_PRETTY)); set_val_str (arr, 6, nmc_property_bridge_get_max_age (setting, NMC_PROPERTY_GET_PRETTY)); set_val_str (arr, 7, nmc_property_bridge_get_ageing_time (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 8, nmc_property_bridge_get_multicast_snooping (setting, NMC_PROPERTY_GET_PRETTY)); g_ptr_array_add (nmc->output_data, arr); print_data (nmc); /* Print all data */ @@ -7671,6 +8688,144 @@ setting_dcb_details (NMSetting *setting, NmCli *nmc, const char *one_prop, gboo return TRUE; } +static gboolean +setting_tun_details (NMSetting *setting, NmCli *nmc, const char *one_prop, gboolean secrets) +{ + NMSettingTun *s_tun = NM_SETTING_TUN (setting); + NmcOutputField *tmpl, *arr; + size_t tmpl_len; + + g_return_val_if_fail (NM_IS_SETTING_TUN (s_tun), FALSE); + + tmpl = nmc_fields_setting_tun; + tmpl_len = sizeof (nmc_fields_setting_tun); + nmc->print_fields.indices = parse_output_fields (one_prop ? one_prop : NMC_FIELDS_SETTING_TUN_ALL, + tmpl, FALSE, NULL, NULL); + arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_FIELD_NAMES); + g_ptr_array_add (nmc->output_data, arr); + + arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX); + set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting))); + set_val_str (arr, 1, nmc_property_tun_get_mode (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 2, nmc_property_tun_get_owner (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 3, nmc_property_tun_get_group (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 4, nmc_property_tun_get_pi (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 5, nmc_property_tun_get_vnet_hdr (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 6, nmc_property_tun_get_multi_queue (setting, NMC_PROPERTY_GET_PRETTY)); + g_ptr_array_add (nmc->output_data, arr); + + print_data (nmc); /* Print all data */ + + return TRUE; +} + +static gboolean +setting_ip_tunnel_details (NMSetting *setting, NmCli *nmc, const char *one_prop, gboolean secrets) +{ + NMSettingIPTunnel *s_ip_tunnel = NM_SETTING_IP_TUNNEL (setting); + NmcOutputField *tmpl, *arr; + size_t tmpl_len; + + g_return_val_if_fail (NM_IS_SETTING_IP_TUNNEL (s_ip_tunnel), FALSE); + + tmpl = nmc_fields_setting_ip_tunnel; + tmpl_len = sizeof (nmc_fields_setting_ip_tunnel); + nmc->print_fields.indices = parse_output_fields (one_prop ? one_prop : NMC_FIELDS_SETTING_IP_TUNNEL_ALL, + tmpl, FALSE, NULL, NULL); + arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_FIELD_NAMES); + g_ptr_array_add (nmc->output_data, arr); + + arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX); + set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting))); + set_val_str (arr, 1, nmc_property_ip_tunnel_get_mode (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 2, nmc_property_ip_tunnel_get_parent (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 3, nmc_property_ip_tunnel_get_local (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 4, nmc_property_ip_tunnel_get_remote (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 5, nmc_property_ip_tunnel_get_ttl (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 6, nmc_property_ip_tunnel_get_tos (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 7, nmc_property_ip_tunnel_get_path_mtu_discovery (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 8, nmc_property_ip_tunnel_get_input_key (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 9, nmc_property_ip_tunnel_get_output_key (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 10, nmc_property_ip_tunnel_get_encapsulation_limit (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 11, nmc_property_ip_tunnel_get_flow_label (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 12, nmc_property_ip_tunnel_get_mtu (setting, NMC_PROPERTY_GET_PRETTY)); + g_ptr_array_add (nmc->output_data, arr); + + print_data (nmc); /* Print all data */ + + return TRUE; +} + +static gboolean +setting_macvlan_details (NMSetting *setting, NmCli *nmc, const char *one_prop, gboolean secrets) +{ + NMSettingMacvlan *s_macvlan = NM_SETTING_MACVLAN (setting); + NmcOutputField *tmpl, *arr; + size_t tmpl_len; + + g_return_val_if_fail (NM_IS_SETTING_MACVLAN (s_macvlan), FALSE); + + tmpl = nmc_fields_setting_macvlan; + tmpl_len = sizeof (nmc_fields_setting_macvlan); + nmc->print_fields.indices = parse_output_fields (one_prop ? one_prop : NMC_FIELDS_SETTING_MACVLAN_ALL, + tmpl, FALSE, NULL, NULL); + arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_FIELD_NAMES); + g_ptr_array_add (nmc->output_data, arr); + + arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX); + set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting))); + set_val_str (arr, 1, nmc_property_macvlan_get_parent (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 2, nmc_property_macvlan_get_mode (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 3, nmc_property_macvlan_get_promiscuous (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 4, nmc_property_macvlan_get_tap (setting, NMC_PROPERTY_GET_PRETTY)); + g_ptr_array_add (nmc->output_data, arr); + + print_data (nmc); /* Print all data */ + + return TRUE; +} + + static gboolean +setting_vxlan_details (NMSetting *setting, NmCli *nmc, const char *one_prop, gboolean secrets) +{ + NMSettingVxlan *s_vxlan = NM_SETTING_VXLAN (setting); + NmcOutputField *tmpl, *arr; + size_t tmpl_len; + + g_return_val_if_fail (NM_IS_SETTING_VXLAN (s_vxlan), FALSE); + + tmpl = nmc_fields_setting_vxlan; + tmpl_len = sizeof (nmc_fields_setting_vxlan); + nmc->print_fields.indices = parse_output_fields (one_prop ? one_prop : NMC_FIELDS_SETTING_VXLAN_ALL, + tmpl, FALSE, NULL, NULL); + arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_FIELD_NAMES); + g_ptr_array_add (nmc->output_data, arr); + + arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_SECTION_PREFIX); + set_val_str (arr, 0, g_strdup (nm_setting_get_name (setting))); + set_val_str (arr, 1, nmc_property_vxlan_get_parent (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 2, nmc_property_vxlan_get_id (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 3, nmc_property_vxlan_get_local (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 4, nmc_property_vxlan_get_remote (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 5, nmc_property_vxlan_get_source_port_min (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 6, nmc_property_vxlan_get_source_port_max (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 7, nmc_property_vxlan_get_destination_port (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 8, nmc_property_vxlan_get_tos (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 9, nmc_property_vxlan_get_ttl (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 10, nmc_property_vxlan_get_ageing (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 11, nmc_property_vxlan_get_limit (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 12, nmc_property_vxlan_get_learning (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 13, nmc_property_vxlan_get_proxy (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 14, nmc_property_vxlan_get_rsc (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 15, nmc_property_vxlan_get_l2_miss (setting, NMC_PROPERTY_GET_PRETTY)); + set_val_str (arr, 16, nmc_property_vxlan_get_l3_miss (setting, NMC_PROPERTY_GET_PRETTY)); + g_ptr_array_add (nmc->output_data, arr); + + print_data (nmc); /* Print all data */ + + return TRUE; +} + typedef struct { const char *sname; gboolean (*func) (NMSetting *setting, NmCli *nmc, const char *one_prop, gboolean secrets); @@ -7702,6 +8857,10 @@ static const SettingDetails detail_printers[] = { { NM_SETTING_TEAM_SETTING_NAME, setting_team_details }, { NM_SETTING_TEAM_PORT_SETTING_NAME, setting_team_port_details }, { NM_SETTING_DCB_SETTING_NAME, setting_dcb_details }, + { NM_SETTING_TUN_SETTING_NAME, setting_tun_details }, + { NM_SETTING_IP_TUNNEL_SETTING_NAME, setting_ip_tunnel_details }, + { NM_SETTING_MACVLAN_SETTING_NAME, setting_macvlan_details }, + { NM_SETTING_VXLAN_SETTING_NAME, setting_vxlan_details }, { NULL }, }; diff --git a/clients/cli/utils.c b/clients/cli/utils.c index 47cd4392..898e7f26 100644 --- a/clients/cli/utils.c +++ b/clients/cli/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 - 2014 Red Hat, Inc. + * Copyright 2010 - 2015 Red Hat, Inc. */ /* Generated configuration file */ @@ -29,9 +29,7 @@ #include #include -#include -#include - +#include "nm-default.h" #include "utils.h" int @@ -307,28 +305,159 @@ nmc_term_color_sequence (NmcTermColor color) } } +/* Parses @str for color as string or number */ +NmcTermColor +nmc_term_color_parse_string (const char *str, GError **error) +{ + unsigned long color_int; + static const char *colors[] = { "normal", "black", "red", "green", "yellow", + "blue", "magenta", "cyan", "white", NULL }; + + if (nmc_string_to_uint (str, TRUE, 0, 8, &color_int)) { + return (NmcTermColor) color_int; + } else { + const char *color, **p; + int i; + + color = nmc_string_is_valid (str, colors, error); + for (p = colors, i = 0; *p != NULL; p++, i++) { + if (*p == color) + return (NmcTermColor) i; + } + return -1; + } +} + +const char * +nmc_term_format_sequence (NmcTermFormat format) +{ + switch (format) { + case NMC_TERM_FORMAT_BOLD: + return "\33[1m"; + break; + case NMC_TERM_FORMAT_DIM: + return "\33[2m"; + break; + case NMC_TERM_FORMAT_UNDERLINE: + return "\33[4m"; + break; + case NMC_TERM_FORMAT_BLINK: + return "\33[5m"; + break; + case NMC_TERM_FORMAT_REVERSE: + return "\33[7m"; + break; + case NMC_TERM_FORMAT_HIDDEN: + return "\33[8m"; + break; + default: + return ""; + break; + } +} + +static gboolean +use_colors (NmCli *nmc) +{ + if (nmc == NULL) + return FALSE; + + if (nmc->use_colors == NMC_USE_COLOR_AUTO) + nmc->use_colors = isatty (fileno (stdout)) ? NMC_USE_COLOR_YES : NMC_USE_COLOR_NO; + + return nmc->use_colors == NMC_USE_COLOR_YES; +} + char * -nmc_colorize (NmcTermColor color, const char *fmt, ...) +nmc_colorize (NmCli *nmc, NmcTermColor color, NmcTermFormat format, const char *fmt, ...) { va_list args; char *str, *colored; - const char *ansi_color, *color_end; + const char *ansi_color, *color_end, *ansi_fmt, *format_end; + static const char *end_seq = "\33[0m"; va_start (args, fmt); str = g_strdup_vprintf (fmt, args); va_end (args); + if (!use_colors (nmc)) + return str; + ansi_color = nmc_term_color_sequence (color); - if (*ansi_color) - color_end = "\33[0m"; - else - color_end = ""; + ansi_fmt = nmc_term_format_sequence (format); + color_end = *ansi_color ? end_seq : ""; + format_end = *ansi_fmt ? end_seq : ""; - colored = g_strdup_printf ("%s%s%s", ansi_color, str, color_end); + colored = g_strdup_printf ("%s%s%s%s%s", ansi_fmt, ansi_color, str, color_end, format_end); g_free (str); return colored; } +/* + * Count characters belonging to terminal color escape sequences. + * @start points to beginning of the string, @end points to the end, + * or NULL if the string is nul-terminated. + */ +static int +nmc_count_color_escape_chars (const char *start, const char *end) +{ + int num = 0; + gboolean inside = FALSE; + + if (end == NULL) + end = start + strlen (start); + + while (start < end) { + if (*start == '\33' && *(start+1) == '[') + inside = TRUE; + if (inside) + num++; + if (*start == 'm') + inside = FALSE; + start++; + } + return num; +} + +/* Filter out possible ANSI color escape sequences */ +/* It directly modifies the passed string @str. */ +void +nmc_filter_out_colors_inplace (char *str) +{ + const char *p1; + char *p2; + gboolean copy_char = TRUE; + + if (!str) + return; + + p1 = p2 = str; + while (*p1) { + if (*p1 == '\33' && *(p1+1) == '[') + copy_char = FALSE; + if (copy_char) + *p2++ = *p1; + if (!copy_char && *p1 == 'm') + copy_char = TRUE; + p1++; + } + *p2 = '\0'; +} + +/* Filter out possible ANSI color escape sequences */ +char * +nmc_filter_out_colors (const char *str) +{ + char *filtered; + + if (!str) + return NULL; + + filtered = g_strdup (str); + nmc_filter_out_colors_inplace (filtered); + return filtered; +} + /* * Convert string to signed integer. * If required, the resulting number is checked to be in the range. @@ -643,21 +772,24 @@ nmc_strsplit_set (const char *str, const char *delimiter, int max_tokens) } /* - * Find out how many columns an UTF-8 string occupies on the screen + * Find out how many columns an UTF-8 string occupies on the screen. */ int nmc_string_screen_width (const char *start, const char *end) { int width = 0; + const char *p = start; if (end == NULL) end = start + strlen (start); - while (start < end) { - width += g_unichar_iswide (g_utf8_get_char (start)) ? 2 : g_unichar_iszerowidth (g_utf8_get_char (start)) ? 0 : 1; - start = g_utf8_next_char (start); + while (p < end) { + width += g_unichar_iswide (g_utf8_get_char (p)) ? 2 : g_unichar_iszerowidth (g_utf8_get_char (p)) ? 0 : 1; + p = g_utf8_next_char (p); } - return width; + + /* Subtract color escape sequences as they don't occupy space. */ + return width - nmc_count_color_escape_chars (start, NULL); } void @@ -692,6 +824,26 @@ set_val_arrc (NmcOutputField fields_array[], guint32 idx, const char **value) fields_array[idx].free_value = FALSE; } +void +set_val_color_all (NmcOutputField fields_array[], NmcTermColor color) +{ + int i; + + for (i = 0; fields_array[i].name; i++) { + fields_array[i].color = color; + } +} + +void +set_val_color_fmt_all (NmcOutputField fields_array[], NmcTermFormat format) +{ + int i; + + for (i = 0; fields_array[i].name; i++) { + fields_array[i].color_fmt = format; + } +} + /* * Free 'value' members in array of NmcOutputField */ @@ -910,23 +1062,55 @@ nmc_empty_output_fields (NmCli *nmc) } static char * -get_value_to_print (NmcOutputField *fields, +colorize_string (NmCli *nmc, + NmcTermColor color, + NmcTermFormat color_fmt, + const char *str, + gboolean *dealloc) +{ + char *out; + + if ( use_colors (nmc) + && (color != NMC_TERM_COLOR_NORMAL || color_fmt != NMC_TERM_FORMAT_NORMAL)) { + out = nmc_colorize (nmc, color, color_fmt, str); + *dealloc = TRUE; + } else { + out = (char *) str; + *dealloc = FALSE; + } + return out; +} + +static char * +get_value_to_print (NmCli *nmc, + NmcOutputField *field, gboolean field_name, const char *not_set_str, gboolean *dealloc) { - gboolean is_array = fields->value_is_array; - char *value; + gboolean is_array = field->value_is_array; + char *value, *out; + gboolean free_value, free_out; if (field_name) - value = _(fields->name_l10n); + value = _(field->name_l10n); else - value = fields->value ? - (is_array ? g_strjoinv (" | ", (char **) fields->value) : - (char *) fields->value) : + value = field->value ? + (is_array ? g_strjoinv (" | ", (char **) field->value) : + (char *) field->value) : (char *) not_set_str; - *dealloc = fields->value && is_array && !field_name; - return value; + free_value = field->value && is_array && !field_name; + + /* colorize the value */ + out = colorize_string (nmc, field->color, field->color_fmt, value, &free_out); + if (free_out) { + if (free_value) + g_free (value); + *dealloc = TRUE; + } else + *dealloc = free_value; + + return out; } /* @@ -985,6 +1169,7 @@ print_required_fields (NmCli *nmc, const NmcOutputField field_values[]) if (!main_header_only && !field_names) { for (i = 0; i < fields.indices->len; i++) { char *tmp; + gboolean free_print_val; int idx = g_array_index (fields.indices, int, i); gboolean is_array = field_values[idx].value_is_array; @@ -996,10 +1181,14 @@ print_required_fields (NmCli *nmc, const NmcOutputField field_values[]) if (is_array) { /* value is a null-terminated string array */ - const char **p; + const char **p, *val; + char *print_val; int j; for (p = (const char **) field_values[idx].value, j = 1; p && *p; p++, j++) { + val = *p ? *p : not_set_str; + print_val = colorize_string (nmc, field_values[idx].color, field_values[idx].color_fmt, + val, &free_print_val); tmp = g_strdup_printf ("%s%s%s[%d]:", section_prefix ? (const char*) field_values[0].value : "", section_prefix ? "." : "", @@ -1007,24 +1196,30 @@ print_required_fields (NmCli *nmc, const NmcOutputField field_values[]) j); width1 = strlen (tmp); width2 = nmc_string_screen_width (tmp, NULL); - g_print ("%-*s%s\n", terse ? 0 : ML_VALUE_INDENT+width1-width2, tmp, - *p ? *p : not_set_str); + g_print ("%-*s%s\n", terse ? 0 : ML_VALUE_INDENT+width1-width2, tmp, print_val); g_free (tmp); + if (free_print_val) + g_free (print_val); } } else { /* value is a string */ const char *hdr_name = (const char*) field_values[0].value; const char *val = (const char*) field_values[idx].value; + char *print_val; + val = val ? val : not_set_str; + print_val = colorize_string (nmc, field_values[idx].color, field_values[idx].color_fmt, + val, &free_print_val); tmp = g_strdup_printf ("%s%s%s:", section_prefix ? hdr_name : "", section_prefix ? "." : "", _(field_values[idx].name_l10n)); width1 = strlen (tmp); width2 = nmc_string_screen_width (tmp, NULL); - g_print ("%-*s%s\n", terse ? 0 : ML_VALUE_INDENT+width1-width2, tmp, - val ? val : not_set_str); + g_print ("%-*s%s\n", terse ? 0 : ML_VALUE_INDENT+width1-width2, tmp, print_val); g_free (tmp); + if (free_print_val) + g_free (print_val); } } if (pretty) { @@ -1042,7 +1237,8 @@ print_required_fields (NmCli *nmc, const NmcOutputField field_values[]) for (i = 0; i < fields.indices->len; i++) { int idx = g_array_index (fields.indices, int, i); gboolean dealloc; - char *value = get_value_to_print ((NmcOutputField *) field_values+idx, field_names, not_set_str, &dealloc); + char *value = get_value_to_print (nmc, (NmcOutputField *) field_values+idx, field_names, + not_set_str, &dealloc); if (terse) { if (escape) { @@ -1140,7 +1336,7 @@ print_data (NmCli *nmc) char *value; row = g_ptr_array_index (nmc->output_data, j); field_names = row[0].flags & NMC_OF_FLAG_FIELD_NAMES; - value = get_value_to_print (row+i, field_names, "--", &dealloc); + value = get_value_to_print (NULL, row+i, field_names, "--", &dealloc); len = nmc_string_screen_width (value, NULL); max_width = len > max_width ? len : max_width; if (dealloc) diff --git a/clients/cli/utils.h b/clients/cli/utils.h index ba649f8f..8047fe7f 100644 --- a/clients/cli/utils.h +++ b/clients/cli/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. * - * Copyright 2010 - 2014 Red Hat, Inc. + * Copyright 2010 - 2015 Red Hat, Inc. */ #ifndef NMC_UTILS_H @@ -74,7 +74,11 @@ char *nmc_ip6_address_as_string (const struct in6_addr *ip, GError **error); void nmc_terminal_erase_line (void); void nmc_terminal_show_progress (const char *str); const char *nmc_term_color_sequence (NmcTermColor color); -char *nmc_colorize (NmcTermColor color, const char * fmt, ...); +const char *nmc_term_format_sequence (NmcTermFormat format); +NmcTermColor nmc_term_color_parse_string (const char *str, GError **error); +char *nmc_colorize (NmCli *nmc, NmcTermColor color, NmcTermFormat format, const char * fmt, ...); +void nmc_filter_out_colors_inplace (char *str); +char *nmc_filter_out_colors (const char *str); char *nmc_get_user_input (const char *ask_str); int nmc_string_to_arg_array (const char *line, const char *delim, gboolean unquote, char ***argv, int *argc); @@ -87,6 +91,8 @@ void set_val_str (NmcOutputField fields_array[], guint32 index, char *value); void set_val_strc (NmcOutputField fields_array[], guint32 index, const char *value); void set_val_arr (NmcOutputField fields_array[], guint32 index, char **value); void set_val_arrc (NmcOutputField fields_array[], guint32 index, const char **value); +void set_val_color_all (NmcOutputField fields_array[], NmcTermColor color); +void set_val_color_fmt_all (NmcOutputField fields_array[], NmcTermFormat format); void nmc_free_output_field_values (NmcOutputField fields_array[]); GArray *parse_output_fields (const char *fields_str, const NmcOutputField fields_array[], diff --git a/clients/common/nm-polkit-listener.c b/clients/common/nm-polkit-listener.c index c1c7c908..9646374e 100644 --- a/clients/common/nm-polkit-listener.c +++ b/clients/common/nm-polkit-listener.c @@ -36,10 +36,8 @@ #include #include #include -#include -#include -#include "nm-glib-compat.h" +#include "nm-default.h" #include "nm-polkit-listener.h" G_DEFINE_TYPE (NMPolkitListener, nm_polkit_listener, POLKIT_AGENT_TYPE_LISTENER) diff --git a/clients/common/nm-polkit-listener.h b/clients/common/nm-polkit-listener.h index 3cd75019..22c436c1 100644 --- a/clients/common/nm-polkit-listener.h +++ b/clients/common/nm-polkit-listener.h @@ -19,11 +19,11 @@ #ifndef __NM_POLKIT_LISTENER_H__ #define __NM_POLKIT_LISTENER_H__ -#include - #define POLKIT_AGENT_I_KNOW_API_IS_SUBJECT_TO_CHANGE #include +#include "nm-default.h" + G_BEGIN_DECLS #define NM_TYPE_POLKIT_LISTENER (nm_polkit_listener_get_type ()) diff --git a/clients/common/nm-secret-agent-simple.c b/clients/common/nm-secret-agent-simple.c index 6cb6c58d..233e1409 100644 --- a/clients/common/nm-secret-agent-simple.c +++ b/clients/common/nm-secret-agent-simple.c @@ -32,13 +32,11 @@ #include "config.h" #include -#include -#include -#include #include -#include +#include +#include "nm-default.h" #include "nm-vpn-helpers.h" #include "nm-secret-agent-simple.h" @@ -357,23 +355,9 @@ get_vpn_secret_flags (NMSettingVpn *s_vpn, const char *secret_name) { NMSettingSecretFlags flags = NM_SETTING_SECRET_FLAG_NONE; GHashTable *vpn_data; - char *flag_name; - const char *val; - unsigned long tmp; g_object_get (s_vpn, NM_SETTING_VPN_DATA, &vpn_data, NULL); - - flag_name = g_strdup_printf ("%s-flags", secret_name); - - /* Try new flags value first */ - val = g_hash_table_lookup (vpn_data, flag_name); - if (val) { - errno = 0; - tmp = strtoul (val, NULL, 10); - if (errno == 0 && tmp <= NM_SETTING_SECRET_FLAGS_ALL) - flags = (NMSettingSecretFlags) tmp; - } - g_free (flag_name); + nm_vpn_service_plugin_get_secret_flags (vpn_data, secret_name, &flags); g_hash_table_unref (vpn_data); return flags; diff --git a/clients/common/nm-vpn-helpers.c b/clients/common/nm-vpn-helpers.c index 370e128c..36e8e6b2 100644 --- a/clients/common/nm-vpn-helpers.c +++ b/clients/common/nm-vpn-helpers.c @@ -26,184 +26,53 @@ #include "config.h" #include -#include #include -#include - -#include +#include "nm-default.h" #include "nm-utils.h" #include "nm-vpn-helpers.h" -#include "nm-glib-compat.h" - -#define VPN_NAME_FILES_DIR NMCONFDIR "/VPN" -#define DEFAULT_DIR_LIB NMLIBDIR"/VPN" - -static gboolean plugins_loaded = FALSE; -static GHashTable *plugins_hash = NULL; -static GSList *plugins_list = NULL; +#include "nm-macros-internal.h" -GQuark nm_vpn_error_quark (void); -G_DEFINE_QUARK (NM_VPN_ERROR, nm_vpn_error) -#define NM_VPN_ERROR nm_vpn_error_quark () -#define NM_VPN_ERROR_GENERIC 0 +static gboolean plugins_loaded; +static GSList *plugins = NULL; NMVpnEditorPlugin * -nm_vpn_get_plugin_by_service (const char *service) +nm_vpn_get_plugin_by_service (const char *service, GError **error) { - NMVpnEditorPlugin *plugin; - const char *str; - char *tmp = NULL; + NMVpnEditorPlugin *plugin = NULL; + NMVpnPluginInfo *plugin_info; + char *type = NULL; g_return_val_if_fail (service != NULL, NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); if (G_UNLIKELY (!plugins_loaded)) - nm_vpn_get_plugins (NULL); - - if (!plugins_hash) - return NULL; - - if (g_str_has_prefix (service, NM_DBUS_SERVICE)) - str = service; - else - str = tmp = g_strdup_printf ("%s.%s", NM_DBUS_SERVICE, service); - - plugin = g_hash_table_lookup (plugins_hash, str); - g_free (tmp); - + nm_vpn_get_plugins (); + + if (!g_str_has_prefix (service, NM_DBUS_INTERFACE)) + service = type = g_strdup_printf ("%s.%s", NM_DBUS_INTERFACE, service); + + plugin_info = nm_vpn_plugin_info_list_find_by_service (plugins, service); + if (plugin_info) { + plugin = nm_vpn_plugin_info_get_editor_plugin (plugin_info); + if (!plugin) + plugin = nm_vpn_plugin_info_load_editor_plugin (plugin_info, error); + } else + g_set_error_literal (error, NM_VPN_PLUGIN_ERROR, NM_VPN_PLUGIN_ERROR_FAILED, + _("could not get VPN plugin info")); + g_free (type); return plugin; } GSList * -nm_vpn_get_plugins (GError **error) +nm_vpn_get_plugins (void) { - GDir *dir; - const char *f; - GHashTableIter iter; - NMVpnEditorPlugin *plugin; - - if (error) - g_return_val_if_fail (*error == NULL, NULL); - if (G_LIKELY (plugins_loaded)) - return plugins_list; - + return plugins; plugins_loaded = TRUE; - - dir = g_dir_open (VPN_NAME_FILES_DIR, 0, NULL); - if (!dir) { - g_set_error (error, NM_VPN_ERROR, NM_VPN_ERROR_GENERIC, "Couldn't read VPN .name files directory " VPN_NAME_FILES_DIR "."); - return NULL; - } - - plugins_hash = g_hash_table_new_full (g_str_hash, g_str_equal, - (GDestroyNotify) g_free, (GDestroyNotify) g_object_unref); - - while ((f = g_dir_read_name (dir))) { - char *path = NULL, *service = NULL; - char *so_path = NULL, *so_name = NULL; - GKeyFile *keyfile = NULL; - GModule *module = NULL; - NMVpnEditorPluginFactory factory = NULL; - - if (!g_str_has_suffix (f, ".name")) - continue; - - path = g_strdup_printf ("%s/%s", VPN_NAME_FILES_DIR, f); - - keyfile = g_key_file_new (); - if (!g_key_file_load_from_file (keyfile, path, 0, NULL)) - goto next; - - service = g_key_file_get_string (keyfile, "VPN Connection", "service", NULL); - if (!service) - goto next; - - so_path = g_key_file_get_string (keyfile, "libnm", "plugin", NULL); - if (!so_path) - goto next; - - if (g_path_is_absolute (so_path)) - module = g_module_open (so_path, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL); - - if (!module) { - /* Remove any path and extension components, then reconstruct path - * to the SO in LIBDIR - */ - so_name = g_path_get_basename (so_path); - g_free (so_path); - so_path = g_strdup_printf ("%s/NetworkManager/%s", NMLIBDIR, so_name); - g_free (so_name); - - module = g_module_open (so_path, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL); - if (!module) { - g_clear_error (error); - g_set_error (error, NM_VPN_ERROR, NM_VPN_ERROR_GENERIC, "Cannot load the VPN plugin which provides the " - "service '%s'.", service); - goto next; - } - } - - if (g_module_symbol (module, "nm_vpn_editor_plugin_factory", (gpointer) &factory)) { - GError *factory_error = NULL; - gboolean success = FALSE; - - plugin = factory (&factory_error); - if (plugin) { - char *plug_name = NULL, *plug_service = NULL; - - /* Validate plugin properties */ - g_object_get (G_OBJECT (plugin), - NM_VPN_EDITOR_PLUGIN_NAME, &plug_name, - NM_VPN_EDITOR_PLUGIN_SERVICE, &plug_service, - NULL); - if (!plug_name || !strlen (plug_name)) { - g_clear_error (error); - g_set_error (error, NM_VPN_ERROR, NM_VPN_ERROR_GENERIC, "cannot load VPN plugin in '%s': missing plugin name", - g_module_name (module)); - } else if (!plug_service || strcmp (plug_service, service)) { - g_clear_error (error); - g_set_error (error, NM_VPN_ERROR, NM_VPN_ERROR_GENERIC, "cannot load VPN plugin in '%s': invalid service name", - g_module_name (module)); - } else { - /* Success! */ - g_object_set_data_full (G_OBJECT (plugin), "gmodule", module, - (GDestroyNotify) g_module_close); - g_hash_table_insert (plugins_hash, g_strdup (service), plugin); - success = TRUE; - } - g_free (plug_name); - g_free (plug_service); - } else { - g_clear_error (error); - g_set_error (error, NM_VPN_ERROR, NM_VPN_ERROR_GENERIC, "cannot load VPN plugin in '%s': %s", - g_module_name (module), g_module_error ()); - } - - if (!success) - g_module_close (module); - } else { - g_clear_error (error); - g_set_error (error, NM_VPN_ERROR, NM_VPN_ERROR_GENERIC, "cannot locate nm_vpn_editor_plugin_factory() in '%s': %s", - g_module_name (module), g_module_error ()); - g_module_close (module); - } - - next: - g_free (so_path); - g_free (service); - g_key_file_free (keyfile); - g_free (path); - } - g_dir_close (dir); - - /* Copy hash to list */ - g_hash_table_iter_init (&iter, plugins_hash); - while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &plugin)) - plugins_list = g_slist_prepend (plugins_list, plugin); - - return plugins_list; + plugins = nm_vpn_plugin_info_list_load (); + return plugins; } gboolean @@ -220,11 +89,11 @@ nm_vpn_supports_ipv6 (NMConnection *connection) service_type = nm_setting_vpn_get_service_type (s_vpn); g_return_val_if_fail (service_type != NULL, FALSE); - plugin = nm_vpn_get_plugin_by_service (service_type); + plugin = nm_vpn_get_plugin_by_service (service_type, NULL); g_return_val_if_fail (plugin != NULL, FALSE); capabilities = nm_vpn_editor_plugin_get_capabilities (plugin); - return (capabilities & NM_VPN_EDITOR_PLUGIN_CAPABILITY_IPV6) != 0; + return NM_FLAGS_HAS (capabilities, NM_VPN_EDITOR_PLUGIN_CAPABILITY_IPV6); } const VpnPasswordName * diff --git a/clients/common/nm-vpn-helpers.h b/clients/common/nm-vpn-helpers.h index 6b3396ef..4f8d2194 100644 --- a/clients/common/nm-vpn-helpers.h +++ b/clients/common/nm-vpn-helpers.h @@ -19,19 +19,18 @@ #ifndef __NM_VPN_HELPERS_H__ #define __NM_VPN_HELPERS_H__ -#include #include -#include +#include "nm-default.h" struct { const char *name; const char *ui_name; } typedef VpnPasswordName; -GSList *nm_vpn_get_plugins (GError **error); +GSList *nm_vpn_get_plugins (void); -NMVpnEditorPlugin *nm_vpn_get_plugin_by_service (const char *service); +NMVpnEditorPlugin *nm_vpn_get_plugin_by_service (const char *service, GError **error); gboolean nm_vpn_supports_ipv6 (NMConnection *connection); diff --git a/clients/nm-online.c b/clients/nm-online.c index 5a818bae..c02f9cc9 100644 --- a/clients/nm-online.c +++ b/clients/nm-online.c @@ -38,10 +38,10 @@ #include #include -#include - #include +#include "nm-default.h" + #define PROGRESS_STEPS 15 #define WAIT_STARTUP_TAG "wait-startup" @@ -188,9 +188,7 @@ main (int argc, char *argv[]) } remaining_ms = t_secs * 1000; -#if !GLIB_CHECK_VERSION (2, 35, 0) - g_type_init (); -#endif + nm_g_type_init (); client = nm_client_new (NULL, &error); if (!client) { diff --git a/clients/tui/Makefile.am b/clients/tui/Makefile.am index a84fcdff..caf792ee 100644 --- a/clients/tui/Makefile.am +++ b/clients/tui/Makefile.am @@ -4,8 +4,8 @@ SUBDIRS = newt . AM_CPPFLAGS= \ -I$(top_srcdir) \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ + -I$(top_srcdir)/shared \ + -I$(top_builddir)/shared \ -I$(top_srcdir)/libnm-core \ -I$(top_builddir)/libnm-core \ -I$(top_srcdir)/libnm \ @@ -18,8 +18,6 @@ AM_CPPFLAGS= \ -DG_LOG_DOMAIN=\""nmtui"\" \ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ -DLOCALEDIR=\""$(localedir)"\" \ - -DNMCONFDIR=\"$(nmconfdir)\" \ - -DNMLIBDIR=\"$(libdir)\" \ $(NULL) bin_PROGRAMS = nmtui @@ -27,12 +25,12 @@ links = nmtui-edit nmtui-connect nmtui-hostname install-exec-hook: for link in $(links); do \ - ln -f $(DESTDIR)$(bindir)/nmtui $(DESTDIR)$(bindir)/$$link; \ + $(LN_S) -f nmtui "$(DESTDIR)$(bindir)/$$link"; \ done uninstall-hook: for link in $(links); do \ - rm -f $(DESTDIR)$(bindir)/$$link; \ + rm -f "$(DESTDIR)$(bindir)/$$link"; \ done nmtui_SOURCES = \ diff --git a/clients/tui/Makefile.in b/clients/tui/Makefile.in index 866ae462..f489995d 100644 --- a/clients/tui/Makefile.in +++ b/clients/tui/Makefile.in @@ -311,7 +311,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -323,8 +322,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -334,6 +331,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -388,16 +386,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -434,6 +429,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -462,7 +459,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -477,6 +473,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -537,6 +535,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -544,6 +543,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -562,8 +562,8 @@ with_valgrind = @with_valgrind@ @BUILD_NMTUI_TRUE@SUBDIRS = newt . @BUILD_NMTUI_TRUE@AM_CPPFLAGS = \ @BUILD_NMTUI_TRUE@ -I$(top_srcdir) \ -@BUILD_NMTUI_TRUE@ -I$(top_srcdir)/include \ -@BUILD_NMTUI_TRUE@ -I$(top_builddir)/include \ +@BUILD_NMTUI_TRUE@ -I$(top_srcdir)/shared \ +@BUILD_NMTUI_TRUE@ -I$(top_builddir)/shared \ @BUILD_NMTUI_TRUE@ -I$(top_srcdir)/libnm-core \ @BUILD_NMTUI_TRUE@ -I$(top_builddir)/libnm-core \ @BUILD_NMTUI_TRUE@ -I$(top_srcdir)/libnm \ @@ -576,8 +576,6 @@ with_valgrind = @with_valgrind@ @BUILD_NMTUI_TRUE@ -DG_LOG_DOMAIN=\""nmtui"\" \ @BUILD_NMTUI_TRUE@ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ @BUILD_NMTUI_TRUE@ -DLOCALEDIR=\""$(localedir)"\" \ -@BUILD_NMTUI_TRUE@ -DNMCONFDIR=\"$(nmconfdir)\" \ -@BUILD_NMTUI_TRUE@ -DNMLIBDIR=\"$(libdir)\" \ @BUILD_NMTUI_TRUE@ $(NULL) @BUILD_NMTUI_TRUE@links = nmtui-edit nmtui-connect nmtui-hostname @@ -1156,12 +1154,12 @@ uninstall-am: uninstall-binPROGRAMS @BUILD_NMTUI_TRUE@install-exec-hook: @BUILD_NMTUI_TRUE@ for link in $(links); do \ -@BUILD_NMTUI_TRUE@ ln -f $(DESTDIR)$(bindir)/nmtui $(DESTDIR)$(bindir)/$$link; \ +@BUILD_NMTUI_TRUE@ $(LN_S) -f nmtui "$(DESTDIR)$(bindir)/$$link"; \ @BUILD_NMTUI_TRUE@ done @BUILD_NMTUI_TRUE@uninstall-hook: @BUILD_NMTUI_TRUE@ for link in $(links); do \ -@BUILD_NMTUI_TRUE@ rm -f $(DESTDIR)$(bindir)/$$link; \ +@BUILD_NMTUI_TRUE@ rm -f "$(DESTDIR)$(bindir)/$$link"; \ @BUILD_NMTUI_TRUE@ done # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/clients/tui/newt/Makefile.am b/clients/tui/newt/Makefile.am index e572238b..e07f9bef 100644 --- a/clients/tui/newt/Makefile.am +++ b/clients/tui/newt/Makefile.am @@ -1,5 +1,8 @@ AM_CPPFLAGS= \ - -I$(top_srcdir)/include \ + -I$(top_srcdir)/shared \ + -I$(top_builddir)/shared \ + -I$(top_srcdir)/libnm-core \ + -I$(top_builddir)/libnm-core \ -DG_LOG_DOMAIN=\""nmtui"\" \ $(GLIB_CFLAGS) \ $(NEWT_CFLAGS) \ diff --git a/clients/tui/newt/Makefile.in b/clients/tui/newt/Makefile.in index ab647863..f1c579cb 100644 --- a/clients/tui/newt/Makefile.in +++ b/clients/tui/newt/Makefile.in @@ -212,7 +212,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -224,8 +223,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -235,6 +232,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -289,16 +287,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -335,6 +330,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -363,7 +360,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -378,6 +374,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -438,6 +436,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -445,6 +444,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -461,7 +461,10 @@ with_netconfig = @with_netconfig@ with_resolvconf = @with_resolvconf@ with_valgrind = @with_valgrind@ AM_CPPFLAGS = \ - -I$(top_srcdir)/include \ + -I$(top_srcdir)/shared \ + -I$(top_builddir)/shared \ + -I$(top_srcdir)/libnm-core \ + -I$(top_builddir)/libnm-core \ -DG_LOG_DOMAIN=\""nmtui"\" \ $(GLIB_CFLAGS) \ $(NEWT_CFLAGS) \ diff --git a/clients/tui/newt/nmt-newt-form.c b/clients/tui/newt/nmt-newt-form.c index 19bd3998..ce401e25 100644 --- a/clients/tui/newt/nmt-newt-form.c +++ b/clients/tui/newt/nmt-newt-form.c @@ -30,8 +30,6 @@ #include #include -#include - #include "nmt-newt-form.h" #include "nmt-newt-button.h" #include "nmt-newt-grid.h" diff --git a/clients/tui/newt/nmt-newt-popup.c b/clients/tui/newt/nmt-newt-popup.c index b604eaaa..f7813063 100644 --- a/clients/tui/newt/nmt-newt-popup.c +++ b/clients/tui/newt/nmt-newt-popup.c @@ -28,8 +28,6 @@ #include "config.h" -#include - #include "nmt-newt-popup.h" #include "nmt-newt-form.h" #include "nmt-newt-hacks.h" diff --git a/clients/tui/newt/nmt-newt-types.h b/clients/tui/newt/nmt-newt-types.h index 608f7ff6..4ea0a7b8 100644 --- a/clients/tui/newt/nmt-newt-types.h +++ b/clients/tui/newt/nmt-newt-types.h @@ -19,9 +19,9 @@ #ifndef NMT_NEWT_TYPES_H #define NMT_NEWT_TYPES_H -#include #include -#include "nm-glib-compat.h" + +#include "nm-default.h" G_BEGIN_DECLS diff --git a/clients/tui/newt/nmt-newt-utils.c b/clients/tui/newt/nmt-newt-utils.c index 70a65a84..841144d8 100644 --- a/clients/tui/newt/nmt-newt-utils.c +++ b/clients/tui/newt/nmt-newt-utils.c @@ -28,9 +28,7 @@ #include #include -#include - -#include "nm-glib-compat.h" +#include "nm-default.h" #include "nmt-newt-utils.h" static void diff --git a/clients/tui/newt/nmt-newt-utils.h b/clients/tui/newt/nmt-newt-utils.h index 3b37868a..706f10d3 100644 --- a/clients/tui/newt/nmt-newt-utils.h +++ b/clients/tui/newt/nmt-newt-utils.h @@ -20,7 +20,8 @@ #define NMT_NEWT_UTILS_H #include -#include + +#include "nm-default.h" G_BEGIN_DECLS diff --git a/clients/tui/nm-editor-bindings.c b/clients/tui/nm-editor-bindings.c index 9218c31f..a21ed666 100644 --- a/clients/tui/nm-editor-bindings.c +++ b/clients/tui/nm-editor-bindings.c @@ -33,7 +33,6 @@ #include #include "nm-editor-bindings.h" -#include "nm-gvaluearray-compat.h" static void value_transform_string_int (const GValue *src_value, diff --git a/clients/tui/nm-editor-utils.c b/clients/tui/nm-editor-utils.c index fa2a2752..026ef231 100644 --- a/clients/tui/nm-editor-utils.c +++ b/clients/tui/nm-editor-utils.c @@ -27,9 +27,9 @@ #include "config.h" -#include #include +#include "nm-default.h" #include "nm-editor-utils.h" #if 0 #include "nm-vpn-helpers.h" @@ -224,7 +224,7 @@ nm_editor_utils_get_connection_type_list (void) #if 0 /* Add "VPN" only if there are plugins */ - vpn_plugins_hash = nm_vpn_get_plugins (NULL); + vpn_plugins_hash = nm_vpn_get_plugins (); have_vpn_plugins = vpn_plugins_hash && g_hash_table_size (vpn_plugins_hash); if (have_vpn_plugins) { GHashTableIter iter; diff --git a/clients/tui/nmt-address-list.c b/clients/tui/nmt-address-list.c index 42873c52..3faf3442 100644 --- a/clients/tui/nmt-address-list.c +++ b/clients/tui/nmt-address-list.c @@ -35,8 +35,6 @@ #include #include -#include - #include "nmt-address-list.h" #include "nmt-ip-entry.h" diff --git a/clients/tui/nmt-connect-connection-list.c b/clients/tui/nmt-connect-connection-list.c index 88502ba7..c21cc5be 100644 --- a/clients/tui/nmt-connect-connection-list.c +++ b/clients/tui/nmt-connect-connection-list.c @@ -27,7 +27,6 @@ #include "config.h" #include -#include #include diff --git a/clients/tui/nmt-device-entry.c b/clients/tui/nmt-device-entry.c index 2af5e584..2760b149 100644 --- a/clients/tui/nmt-device-entry.c +++ b/clients/tui/nmt-device-entry.c @@ -40,7 +40,6 @@ #include #include -#include #include #include "nmtui.h" diff --git a/clients/tui/nmt-edit-connection-list.c b/clients/tui/nmt-edit-connection-list.c index e1b982dd..72e8c706 100644 --- a/clients/tui/nmt-edit-connection-list.c +++ b/clients/tui/nmt-edit-connection-list.c @@ -26,8 +26,6 @@ #include "config.h" -#include - #include "nmtui.h" #include "nmtui-edit.h" #include "nmt-edit-connection-list.h" diff --git a/clients/tui/nmt-editor-page.c b/clients/tui/nmt-editor-page.c index a46d0ed4..f2afc8c7 100644 --- a/clients/tui/nmt-editor-page.c +++ b/clients/tui/nmt-editor-page.c @@ -26,8 +26,6 @@ #include "config.h" -#include - #include "nmt-editor-page.h" G_DEFINE_ABSTRACT_TYPE (NmtEditorPage, nmt_editor_page, G_TYPE_OBJECT) diff --git a/clients/tui/nmt-editor-section.c b/clients/tui/nmt-editor-section.c index ff463f7f..b9a3ae83 100644 --- a/clients/tui/nmt-editor-section.c +++ b/clients/tui/nmt-editor-section.c @@ -25,8 +25,6 @@ #include "config.h" -#include - #include "nmt-editor-section.h" #include "nmt-newt-toggle-button.h" diff --git a/clients/tui/nmt-editor.c b/clients/tui/nmt-editor.c index abc92866..aaa73cbe 100644 --- a/clients/tui/nmt-editor.c +++ b/clients/tui/nmt-editor.c @@ -27,10 +27,9 @@ #include "nmt-editor.h" -#include -#include #include +#include "nm-default.h" #include "nmtui.h" #include "nm-editor-utils.h" diff --git a/clients/tui/nmt-ip-entry.c b/clients/tui/nmt-ip-entry.c index 30c7e2e4..d31a1f46 100644 --- a/clients/tui/nmt-ip-entry.c +++ b/clients/tui/nmt-ip-entry.c @@ -33,8 +33,6 @@ #include #include -#include - #include "nmt-ip-entry.h" G_DEFINE_TYPE (NmtIPEntry, nmt_ip_entry, NMT_TYPE_NEWT_ENTRY) diff --git a/clients/tui/nmt-mac-entry.h b/clients/tui/nmt-mac-entry.h index 2e3e6cd1..099bacb7 100644 --- a/clients/tui/nmt-mac-entry.h +++ b/clients/tui/nmt-mac-entry.h @@ -19,6 +19,7 @@ #ifndef NMT_MAC_ENTRY_H #define NMT_MAC_ENTRY_H +#include "nm-default.h" #include "nm-utils.h" #include "nmt-newt.h" diff --git a/clients/tui/nmt-mtu-entry.c b/clients/tui/nmt-mtu-entry.c index f599557a..9f11af0a 100644 --- a/clients/tui/nmt-mtu-entry.c +++ b/clients/tui/nmt-mtu-entry.c @@ -34,8 +34,6 @@ #include -#include - #include "nmt-mtu-entry.h" G_DEFINE_TYPE (NmtMtuEntry, nmt_mtu_entry, NMT_TYPE_NEWT_GRID) diff --git a/clients/tui/nmt-page-bond.c b/clients/tui/nmt-page-bond.c index b043b513..ecc9aefc 100644 --- a/clients/tui/nmt-page-bond.c +++ b/clients/tui/nmt-page-bond.c @@ -27,9 +27,7 @@ #include "config.h" -#include -#include - +#include "nm-default.h" #include "nmt-page-bond.h" #include "nmt-address-list.h" diff --git a/clients/tui/nmt-page-bridge-port.c b/clients/tui/nmt-page-bridge-port.c index c9ef14ed..fdf44039 100644 --- a/clients/tui/nmt-page-bridge-port.c +++ b/clients/tui/nmt-page-bridge-port.c @@ -23,9 +23,7 @@ #include "config.h" -#include -#include - +#include "nm-default.h" #include "nmt-page-bridge-port.h" G_DEFINE_TYPE (NmtPageBridgePort, nmt_page_bridge_port, NMT_TYPE_EDITOR_PAGE) diff --git a/clients/tui/nmt-page-bridge.c b/clients/tui/nmt-page-bridge.c index 460be60b..e9b0e66d 100644 --- a/clients/tui/nmt-page-bridge.c +++ b/clients/tui/nmt-page-bridge.c @@ -23,9 +23,7 @@ #include "config.h" -#include -#include - +#include "nm-default.h" #include "nmt-page-bridge.h" #include "nmt-address-list.h" @@ -91,6 +89,12 @@ nmt_page_bridge_constructed (GObject *object) label = nmt_newt_label_new (_("seconds")); nmt_editor_grid_append (grid, _("Aging time"), widget, label); + widget = nmt_newt_checkbox_new (_("Enable IGMP snooping")); + g_object_bind_property (s_bridge, NM_SETTING_BRIDGE_MULTICAST_SNOOPING, + widget, "active", + G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); + nmt_editor_grid_append (grid, NULL, widget, NULL); + widget = stp = nmt_newt_checkbox_new (_("Enable STP (Spanning Tree Protocol)")); g_object_bind_property (s_bridge, NM_SETTING_BRIDGE_STP, widget, "active", diff --git a/clients/tui/nmt-page-dsl.c b/clients/tui/nmt-page-dsl.c index 1d476aa0..2346b496 100644 --- a/clients/tui/nmt-page-dsl.c +++ b/clients/tui/nmt-page-dsl.c @@ -23,9 +23,7 @@ #include "config.h" -#include -#include - +#include "nm-default.h" #include "nmt-page-dsl.h" #include "nmt-page-ethernet.h" #include "nmt-page-ppp.h" diff --git a/clients/tui/nmt-page-dsl.h b/clients/tui/nmt-page-dsl.h index b938ead2..dc84ca07 100644 --- a/clients/tui/nmt-page-dsl.h +++ b/clients/tui/nmt-page-dsl.h @@ -19,6 +19,7 @@ #ifndef NMT_PAGE_DSL_H #define NMT_PAGE_DSL_H +#include "nm-default.h" #include "nmt-editor-page-device.h" G_BEGIN_DECLS diff --git a/clients/tui/nmt-page-ethernet.c b/clients/tui/nmt-page-ethernet.c index cf4ef2c4..fed81f1c 100644 --- a/clients/tui/nmt-page-ethernet.c +++ b/clients/tui/nmt-page-ethernet.c @@ -23,9 +23,7 @@ #include "config.h" -#include -#include - +#include "nm-default.h" #include "nmt-page-ethernet.h" #include "nmt-mac-entry.h" #include "nmt-mtu-entry.h" diff --git a/clients/tui/nmt-page-infiniband.c b/clients/tui/nmt-page-infiniband.c index f39b0b84..e10c5a7a 100644 --- a/clients/tui/nmt-page-infiniband.c +++ b/clients/tui/nmt-page-infiniband.c @@ -23,9 +23,7 @@ #include "config.h" -#include -#include - +#include "nm-default.h" #include "nmt-page-infiniband.h" #include "nmt-mtu-entry.h" diff --git a/clients/tui/nmt-page-ip4.c b/clients/tui/nmt-page-ip4.c index c7009e2f..2cc4f6af 100644 --- a/clients/tui/nmt-page-ip4.c +++ b/clients/tui/nmt-page-ip4.c @@ -25,9 +25,7 @@ #include -#include -#include - +#include "nm-default.h" #include "nmt-page-ip4.h" #include "nmt-ip-entry.h" #include "nmt-address-list.h" diff --git a/clients/tui/nmt-page-ip6.c b/clients/tui/nmt-page-ip6.c index 122c37f6..e547122b 100644 --- a/clients/tui/nmt-page-ip6.c +++ b/clients/tui/nmt-page-ip6.c @@ -25,9 +25,7 @@ #include -#include -#include - +#include "nm-default.h" #include "nmt-page-ip6.h" #include "nmt-ip-entry.h" #include "nmt-address-list.h" diff --git a/clients/tui/nmt-page-ppp.c b/clients/tui/nmt-page-ppp.c index cec36549..662ebd9c 100644 --- a/clients/tui/nmt-page-ppp.c +++ b/clients/tui/nmt-page-ppp.c @@ -25,9 +25,7 @@ #include -#include -#include - +#include "nm-default.h" #include "nmt-page-ppp.h" #include "nmt-newt-section.h" #include "nmt-newt-separator.h" diff --git a/clients/tui/nmt-page-team-port.c b/clients/tui/nmt-page-team-port.c index 645dc9d3..797c1cf1 100644 --- a/clients/tui/nmt-page-team-port.c +++ b/clients/tui/nmt-page-team-port.c @@ -23,9 +23,7 @@ #include "config.h" -#include -#include - +#include "nm-default.h" #include "nmt-page-team-port.h" G_DEFINE_TYPE (NmtPageTeamPort, nmt_page_team_port, NMT_TYPE_EDITOR_PAGE) diff --git a/clients/tui/nmt-page-team.c b/clients/tui/nmt-page-team.c index e520b02a..572941b6 100644 --- a/clients/tui/nmt-page-team.c +++ b/clients/tui/nmt-page-team.c @@ -23,9 +23,7 @@ #include "config.h" -#include -#include - +#include "nm-default.h" #include "nmt-page-team.h" #include "nmt-slave-list.h" diff --git a/clients/tui/nmt-page-team.h b/clients/tui/nmt-page-team.h index 2d8bf07a..994b63d3 100644 --- a/clients/tui/nmt-page-team.h +++ b/clients/tui/nmt-page-team.h @@ -19,6 +19,7 @@ #ifndef NMT_PAGE_TEAM_H #define NMT_PAGE_TEAM_H +#include "nm-default.h" #include "nmt-editor-page-device.h" G_BEGIN_DECLS diff --git a/clients/tui/nmt-page-vlan.c b/clients/tui/nmt-page-vlan.c index 9b9c8f52..d392c552 100644 --- a/clients/tui/nmt-page-vlan.c +++ b/clients/tui/nmt-page-vlan.c @@ -23,9 +23,7 @@ #include "config.h" -#include -#include - +#include "nm-default.h" #include "nm-editor-bindings.h" #include "nmt-page-vlan.h" diff --git a/clients/tui/nmt-page-wifi.c b/clients/tui/nmt-page-wifi.c index 9cd20abf..c4b085ea 100644 --- a/clients/tui/nmt-page-wifi.c +++ b/clients/tui/nmt-page-wifi.c @@ -29,9 +29,7 @@ #include -#include -#include - +#include "nm-default.h" #include "nmt-page-wifi.h" #include "nmt-mac-entry.h" #include "nmt-mtu-entry.h" diff --git a/clients/tui/nmt-password-dialog.c b/clients/tui/nmt-password-dialog.c index bf29dcf5..8eca7dc0 100644 --- a/clients/tui/nmt-password-dialog.c +++ b/clients/tui/nmt-password-dialog.c @@ -26,8 +26,6 @@ #include "config.h" -#include - #include "nmt-password-dialog.h" #include "nm-secret-agent-simple.h" #include "nmtui.h" diff --git a/clients/tui/nmt-password-fields.c b/clients/tui/nmt-password-fields.c index 7ef037b9..cba64935 100644 --- a/clients/tui/nmt-password-fields.c +++ b/clients/tui/nmt-password-fields.c @@ -27,8 +27,6 @@ #include "config.h" -#include - #include "nmt-password-fields.h" G_DEFINE_TYPE (NmtPasswordFields, nmt_password_fields, NMT_TYPE_NEWT_GRID) diff --git a/clients/tui/nmt-route-editor.c b/clients/tui/nmt-route-editor.c index 77bbec76..dc4d118b 100644 --- a/clients/tui/nmt-route-editor.c +++ b/clients/tui/nmt-route-editor.c @@ -27,9 +27,7 @@ #include "config.h" -#include -#include - +#include "nm-default.h" #include "nmt-route-editor.h" #include "nmt-route-table.h" diff --git a/clients/tui/nmt-route-entry.c b/clients/tui/nmt-route-entry.c index 3a875520..1cc99940 100644 --- a/clients/tui/nmt-route-entry.c +++ b/clients/tui/nmt-route-entry.c @@ -32,7 +32,6 @@ #include #include -#include #include #include "nmt-route-entry.h" diff --git a/clients/tui/nmt-route-table.c b/clients/tui/nmt-route-table.c index 523d8ee3..0731acb6 100644 --- a/clients/tui/nmt-route-table.c +++ b/clients/tui/nmt-route-table.c @@ -30,7 +30,6 @@ #include #include -#include #include #include "nmt-route-table.h" diff --git a/clients/tui/nmt-slave-list.c b/clients/tui/nmt-slave-list.c index 9c8596f7..5a9b7482 100644 --- a/clients/tui/nmt-slave-list.c +++ b/clients/tui/nmt-slave-list.c @@ -26,7 +26,6 @@ #include "config.h" -#include #include #include "nmt-slave-list.h" diff --git a/clients/tui/nmt-utils.h b/clients/tui/nmt-utils.h index 7e24fcab..5531dbeb 100644 --- a/clients/tui/nmt-utils.h +++ b/clients/tui/nmt-utils.h @@ -19,7 +19,7 @@ #ifndef NMT_UTILS_H #define NMT_UTILS_H -#include +#include "nm-default.h" G_BEGIN_DECLS diff --git a/clients/tui/nmt-widget-list.c b/clients/tui/nmt-widget-list.c index 9159ed98..b314e146 100644 --- a/clients/tui/nmt-widget-list.c +++ b/clients/tui/nmt-widget-list.c @@ -37,8 +37,6 @@ #include #include -#include - #include "nmt-widget-list.h" #include "nmt-newt.h" diff --git a/clients/tui/nmtui-connect.c b/clients/tui/nmtui-connect.c index 9838b6fd..9d705bf1 100644 --- a/clients/tui/nmtui-connect.c +++ b/clients/tui/nmtui-connect.c @@ -28,10 +28,6 @@ #include -#include - -#include "gsystem-local-alloc.h" - #include "nmt-newt.h" #include "nmtui.h" diff --git a/clients/tui/nmtui-edit.c b/clients/tui/nmtui-edit.c index 0c3206da..258b798a 100644 --- a/clients/tui/nmtui-edit.c +++ b/clients/tui/nmtui-edit.c @@ -27,7 +27,6 @@ #include -#include #include #include "nmtui.h" diff --git a/clients/tui/nmtui-hostname.c b/clients/tui/nmtui-hostname.c index 23de95b8..f77a918b 100644 --- a/clients/tui/nmtui-hostname.c +++ b/clients/tui/nmtui-hostname.c @@ -25,8 +25,6 @@ #include "config.h" -#include - #include "nmt-newt.h" #include "nmtui.h" diff --git a/clients/tui/nmtui.c b/clients/tui/nmtui.c index 0fac98eb..20e7d02b 100644 --- a/clients/tui/nmtui.c +++ b/clients/tui/nmtui.c @@ -30,11 +30,9 @@ #include #include -#include -#include - #include +#include "nm-default.h" #include "nmt-newt.h" #include "nm-editor-bindings.h" diff --git a/config.h.in b/config.h.in index a6b807fe..0b7e8d68 100644 --- a/config.h.in +++ b/config.h.in @@ -7,6 +7,9 @@ nm-ifcfg-rh-docs.xml */ #undef BUILD_SETTING_DOCS +/* Path to ConsoleKit database */ +#undef CKDB_PATH + /* Default configuration option for main.plugins setting */ #undef CONFIG_PLUGINS_DEFAULT @@ -16,6 +19,9 @@ /* Define to path of dnsmasq binary */ #undef DNSMASQ_PATH +/* Define to path of unbound dnssec-trigger-script */ +#undef DNSSEC_TRIGGER_SCRIPT + /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS @@ -31,13 +37,6 @@ the CoreFoundation framework. */ #undef HAVE_CFPREFERENCESCOPYAPPVALUE -/* Define if you have dbus-glib >= 0.100 */ -#undef HAVE_DBUS_GLIB_100 - -/* Define if you have a dbus-glib with - dbus_g_method_invocation_get_g_connection() */ -#undef HAVE_DBUS_GLIB_GMI_GET_CONNECTION - /* Define if the GNU dcgettext() function is already present or preinstalled. */ #undef HAVE_DCGETTEXT @@ -60,14 +59,8 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H -/* Define if the kernel has IN6_ADDR_GEN_MODE_* */ -#undef HAVE_KERNEL_INET6_ADDR_GEN_MODE - -/* Define if libnl has rtnl_link_inet6_get_addr_gen_mode() */ -#undef HAVE_LIBNL_INET6_ADDR_GEN_MODE - -/* Define if libnl has rtnl_link_inet6_get_token() */ -#undef HAVE_LIBNL_INET6_TOKEN +/* Define if you have libaudit support */ +#undef HAVE_LIBAUDIT /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H @@ -126,6 +119,12 @@ /* Define if you have Linux Wireless Extensions support */ #undef HAVE_WEXT +/* Enable Gentoo hostname persist method */ +#undef HOSTNAME_PERSIST_GENTOO + +/* Enable SuSE hostname persist method */ +#undef HOSTNAME_PERSIST_SUSE + /* Define to path of iptables binary */ #undef IPTABLES_PATH @@ -135,12 +134,18 @@ /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR -/* Path to netconfig (if enabled) */ +/* Path to netconfig */ #undef NETCONFIG_PATH /* The default value of the auth-polkit configuration option */ #undef NM_CONFIG_DEFAULT_AUTH_POLKIT +/* The default value of the logging.audit configuration option */ +#undef NM_CONFIG_DEFAULT_LOGGING_AUDIT + +/* Default configuration option for logging.backend */ +#undef NM_CONFIG_LOGGING_BACKEND_DEFAULT + /* Define the distribution version string */ #undef NM_DIST_VERSION @@ -177,15 +182,30 @@ /* Define to path of pppd binary */ #undef PPPD_PATH -/* Define to path of pppoe binary */ -#undef PPPOE_PATH - -/* Path to resolvconf (if enabled) */ +/* Path to resolvconf */ #undef RESOLVCONF_PATH +/* Define to 1 if ConsoleKit is available */ +#undef SESSION_TRACKING_CONSOLEKIT + +/* Define to 1 if libsystemd-login is available */ +#undef SESSION_TRACKING_SYSTEMD + +/* The size of `dev_t', as computed by sizeof. */ +#undef SIZEOF_DEV_T + /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS +/* Define to 1 to use ConsoleKit2 suspend api */ +#undef SUSPEND_RESUME_CONSOLEKIT + +/* Define to 1 to use systemd suspend api */ +#undef SUSPEND_RESUME_SYSTEMD + +/* Define to 1 if libsystemd-journald is available */ +#undef SYSTEMD_JOURNAL + /* Define to path to system CA certificates */ #undef SYSTEM_CA_PATH @@ -241,15 +261,15 @@ /* Define if you have PPP support */ #undef WITH_PPP +/* Whether compilation of ibft setting plugin is enabled */ +#undef WITH_SETTINGS_PLUGIN_IBFT + /* Define if you have Teamd control support */ #undef WITH_TEAMDCTL /* Define if you have Wi-Fi support */ #undef WITH_WIFI -/* Define if you have WiMAX support */ -#undef WITH_WIMAX - /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD diff --git a/configure b/configure index 775544bb..acb348d7 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.69 for NetworkManager 1.0.10. +# Generated by GNU Autoconf 2.69 for NetworkManager 1.1.90. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='NetworkManager' PACKAGE_TARNAME='NetworkManager' -PACKAGE_VERSION='1.0.10' -PACKAGE_STRING='NetworkManager 1.0.10' +PACKAGE_VERSION='1.1.90' +PACKAGE_STRING='NetworkManager 1.1.90' PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager' PACKAGE_URL='' @@ -682,6 +682,9 @@ BUILD_NMTUI_FALSE BUILD_NMTUI_TRUE NEWT_LIBS NEWT_CFLAGS +BUILD_NMCLI_FALSE +BUILD_NMCLI_TRUE +READLINE_LIBS LIBNDP_LIBS LIBNDP_CFLAGS WITH_CONCHECK_FALSE @@ -692,6 +695,7 @@ LIBSOUP_LIBS LIBSOUP_CFLAGS KERNEL_FIRMWARE_DIR SYSTEM_CA_PATH +DNSSEC_TRIGGER_SCRIPT DNSMASQ_PATH IPTABLES_PATH with_netconfig @@ -708,7 +712,6 @@ WITH_MODEM_MANAGER_1_FALSE WITH_MODEM_MANAGER_1_TRUE MM_GLIB_LIBS MM_GLIB_CFLAGS -PPPOE_PATH PPPD_PATH PPPD_PLUGIN_DIR WITH_PPP_FALSE @@ -721,9 +724,6 @@ WITH_GNUTLS_FALSE WITH_GNUTLS_TRUE WITH_NSS_FALSE WITH_NSS_TRUE -LIBGCRYPT_LIBS -LIBGCRYPT_CFLAGS -LIBGCRYPT_CONFIG GNUTLS_LIBS GNUTLS_CFLAGS NSS_LIBS @@ -738,32 +738,28 @@ WITH_TEAMDCTL_FALSE WITH_TEAMDCTL_TRUE LIBTEAMDCTL_LIBS LIBTEAMDCTL_CFLAGS -WITH_WIMAX_FALSE -WITH_WIMAX_TRUE -IWMX_SDK_LIBS -IWMX_SDK_CFLAGS -READLINE_LIBS UUID_LIBS UUID_CFLAGS LIBNL_LIBS LIBNL_CFLAGS -HAVE_SELINUX_FALSE -HAVE_SELINUX_TRUE +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT +LIBAUDIT_LIBS +LIBAUDIT_CFLAGS SELINUX_LIBS SELINUX_CFLAGS +SUSPEND_RESUME_CONSOLEKIT_FALSE +SUSPEND_RESUME_CONSOLEKIT_TRUE SUSPEND_RESUME_SYSTEMD_FALSE SUSPEND_RESUME_SYSTEMD_TRUE SUSPEND_RESUME_UPOWER_FALSE SUSPEND_RESUME_UPOWER_TRUE SYSTEMD_INHIBIT_LIBS SYSTEMD_INHIBIT_CFLAGS -CKDB_PATH SYSTEMD_LOGIN_LIBS SYSTEMD_LOGIN_CFLAGS -SESSION_TRACKING_SYSTEMD_FALSE -SESSION_TRACKING_SYSTEMD_TRUE -SESSION_TRACKING_CK_FALSE -SESSION_TRACKING_CK_TRUE +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT +SYSTEMD_JOURNAL_LIBS +SYSTEMD_JOURNAL_CFLAGS HAVE_SYSTEMD_200_FALSE HAVE_SYSTEMD_200_TRUE SYSTEMD_200_LIBS @@ -791,16 +787,14 @@ INTROSPECTION_COMPILER INTROSPECTION_SCANNER GUDEV_LIBS GUDEV_CFLAGS +WITH_LEGACY_LIBRARIES_FALSE +WITH_LEGACY_LIBRARIES_TRUE +DBUS_LIBS +DBUS_CFLAGS AM_TESTS_FD_REDIRECT LOG_DRIVER GLIB_LIBS GLIB_CFLAGS -HAVE_DBUS_GLIB_100_FALSE -HAVE_DBUS_GLIB_100_TRUE -DBUS_GLIB_100_LIBS -DBUS_GLIB_100_CFLAGS -DBUS_LIBS -DBUS_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG @@ -823,8 +817,6 @@ CONFIG_PLUGIN_IFNET_FALSE CONFIG_PLUGIN_IFNET_TRUE CONFIG_PLUGIN_IFUPDOWN_FALSE CONFIG_PLUGIN_IFUPDOWN_TRUE -CONFIG_PLUGIN_IFCFG_SUSE_FALSE -CONFIG_PLUGIN_IFCFG_SUSE_TRUE CONFIG_PLUGIN_IFCFG_RH_FALSE CONFIG_PLUGIN_IFCFG_RH_TRUE CONFIG_PLUGIN_IBFT_FALSE @@ -832,8 +824,10 @@ CONFIG_PLUGIN_IBFT_TRUE nmrundir nmstatedir nmdatadir +nmlibdir nmconfdir nmbinary +runstatedir GETTEXT_PACKAGE POSUB LTLIBINTL @@ -899,7 +893,6 @@ ac_ct_AR AR DLLTOOL OBJDUMP -LN_S NM ac_ct_DUMPBIN DUMPBIN @@ -915,6 +908,7 @@ build_vendor build_cpu build LIBTOOL +LN_S am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE @@ -1037,14 +1031,20 @@ enable_code_coverage with_dist_version enable_wifi with_wext +with_libnm_glib enable_introspection enable_qt with_udev_dir with_systemdsystemunitdir +with_hostname_persist +with_systemd_journal +with_config_logging_backend_default +with_systemd_logind +with_consolekit with_session_tracking with_suspend_resume with_selinux -enable_wimax +with_libaudit enable_teamdctl enable_polkit enable_polkit_agent @@ -1054,7 +1054,6 @@ with_dbus_sys_dir enable_ppp with_pppd_plugin_dir with_pppd -with_pppoe with_modem_manager_1 enable_bluez5_dun with_dhclient @@ -1063,13 +1062,16 @@ with_resolvconf with_netconfig with_iptables with_dnsmasq +with_dnssec_trigger with_system_ca_path with_kernel_firmware_dir with_libsoup enable_concheck +with_nmcli with_nmtui enable_more_warnings enable_more_asserts +with_more_asserts enable_more_logging enable_lto enable_vala @@ -1099,30 +1101,30 @@ CXXCPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR -DBUS_CFLAGS -DBUS_LIBS -DBUS_GLIB_100_CFLAGS -DBUS_GLIB_100_LIBS GLIB_CFLAGS GLIB_LIBS +DBUS_CFLAGS +DBUS_LIBS GUDEV_CFLAGS GUDEV_LIBS QT_CFLAGS QT_LIBS SYSTEMD_200_CFLAGS SYSTEMD_200_LIBS +SYSTEMD_JOURNAL_CFLAGS +SYSTEMD_JOURNAL_LIBS SYSTEMD_LOGIN_CFLAGS SYSTEMD_LOGIN_LIBS SYSTEMD_INHIBIT_CFLAGS SYSTEMD_INHIBIT_LIBS SELINUX_CFLAGS SELINUX_LIBS +LIBAUDIT_CFLAGS +LIBAUDIT_LIBS LIBNL_CFLAGS LIBNL_LIBS UUID_CFLAGS UUID_LIBS -IWMX_SDK_CFLAGS -IWMX_SDK_LIBS LIBTEAMDCTL_CFLAGS LIBTEAMDCTL_LIBS POLKIT_CFLAGS @@ -1683,7 +1685,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 1.0.10 to adapt to many kinds of systems. +\`configure' configures NetworkManager 1.1.90 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1753,7 +1755,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of NetworkManager 1.0.10:";; + short | recursive ) echo "Configuration of NetworkManager 1.1.90:";; esac cat <<\_ACEOF @@ -1781,6 +1783,7 @@ Optional Features: enable ibft configuration plugin --enable-ifcfg-rh enable ifcfg-rh configuration plugin (Fedora/RHEL) --enable-ifcfg-suse enable ifcfg-suse configuration plugin (SUSE) + (deprecated) --enable-ifupdown enable ifupdown configuration plugin (Debian/Ubuntu) --enable-ifnet enable ifnet configuration plugin (Gentoo) --enable-code-coverage Whether to enable code coverage support @@ -1788,7 +1791,6 @@ Optional Features: --enable-introspection=[no/auto/yes] Enable introspection for this build --enable-qt enable Qt examples - --enable-wimax enable WiMAX support --enable-teamdctl enable Teamd control support --enable-polkit=yes|no|disabled set default value for auth-polkit configuration @@ -1801,7 +1803,8 @@ Optional Features: --enable-bluez5-dun enable Bluez5 DUN support --enable-concheck enable connectivity checking support --enable-more-warnings Possible values: no/yes/error - --enable-more-asserts Enable more assertions for debugging (default: no) + --enable-more-asserts Enable more assertions for debugging (default: no). + Deprecated option. Use --with-more-asserts=level --enable-more-logging Enable more debug logging (default: no) --enable-lto Enable Link Time Optimization for smaller size (default: no) @@ -1836,18 +1839,34 @@ Optional Packages: --with-dist-version= Define the NM''s distribution version string --with-wext=yes Enable or disable Linux Wireless Extensions + --without-libnm-glib don't build legacy libraries --with-udev-dir=DIR Absolute path of the udev base directory. Set to 'no' not to install the udev rules --with-systemdsystemunitdir=DIR Directory for systemd service files + --with-hostname-persist=default|suse|gentoo + Hostname persist method + --with-systemd-journal=yes|no + Use systemd journal for logging + --with-logging-backend-default=backend + Default value for logging.backend + --with-systemd-logind=yes|no + Support systemd session tracking + --with-consolekit=yes|no + Support consolekit session tracking --with-session-tracking=systemd|consolekit|no - Select session tracking support (default: - consolekit) - --with-suspend-resume=upower|systemd + Compatibility option to choose one session tracking + module + --with-suspend-resume=upower|systemd|consolekit Build NetworkManager with specific suspend/resume support --with-selinux=yes|no|auto Build with SELinux (default: auto) + --with-libaudit=yes|yes-disabled-by-default|no|auto + Build with audit daemon support (default: auto). + yes-disabled-by-default enables support, but + disables it unless explicitly configured via + NetworkManager.conf --with-crypto=nss|gnutls Cryptography library to use for certificate and key operations @@ -1856,8 +1875,6 @@ Optional Packages: path to the pppd plugins directory --with-pppd=/path/to/pppd path to pppd binary - --with-pppoe=/path/to/pppoe - path to pppoe binary --with-modem-manager-1 Enable new ModemManager1 interface support --with-dhclient=yes|no|path Enable dhclient 4.x support @@ -1870,13 +1887,18 @@ Optional Packages: path to iptables --with-dnsmasq=/path/to/dnsmasq path to dnsmasq + --with-dnssec-trigger=/path/to/dnssec-trigger-script + path to unbound dnssec-trigger-script --with-system-ca-path=/path/to/ssl/certs path to system CA certificates --with-kernel-firmware-dir=DIR where kernel firmware directory is (default is /lib/firmware) --with-libsoup=yes|no Link against libsoup + --with-nmcli=yes|no Build nmcli --with-nmtui=yes|no Build nmtui + --with-more-asserts=level + Enable more assertions for debugging (default: 0) --with-valgrind=yes|no|path Use valgrind to memory-check the tests (default: no) --with-tests Build NetworkManager tests (deprecated) @@ -1903,14 +1925,10 @@ Some influential environment variables: directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path - DBUS_CFLAGS C compiler flags for DBUS, overriding pkg-config - DBUS_LIBS linker flags for DBUS, overriding pkg-config - DBUS_GLIB_100_CFLAGS - C compiler flags for DBUS_GLIB_100, overriding pkg-config - DBUS_GLIB_100_LIBS - linker flags for DBUS_GLIB_100, overriding pkg-config GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config GLIB_LIBS linker flags for GLIB, overriding pkg-config + DBUS_CFLAGS C compiler flags for DBUS, overriding pkg-config + DBUS_LIBS linker flags for DBUS, overriding pkg-config GUDEV_CFLAGS C compiler flags for GUDEV, overriding pkg-config GUDEV_LIBS linker flags for GUDEV, overriding pkg-config @@ -1920,6 +1938,10 @@ Some influential environment variables: C compiler flags for SYSTEMD_200, overriding pkg-config SYSTEMD_200_LIBS linker flags for SYSTEMD_200, overriding pkg-config + SYSTEMD_JOURNAL_CFLAGS + C compiler flags for SYSTEMD_JOURNAL, overriding pkg-config + SYSTEMD_JOURNAL_LIBS + linker flags for SYSTEMD_JOURNAL, overriding pkg-config SYSTEMD_LOGIN_CFLAGS C compiler flags for SYSTEMD_LOGIN, overriding pkg-config SYSTEMD_LOGIN_LIBS @@ -1932,15 +1954,15 @@ Some influential environment variables: C compiler flags for SELINUX, overriding pkg-config SELINUX_LIBS linker flags for SELINUX, overriding pkg-config + LIBAUDIT_CFLAGS + C compiler flags for LIBAUDIT, overriding pkg-config + LIBAUDIT_LIBS + linker flags for LIBAUDIT, overriding pkg-config LIBNL_CFLAGS C compiler flags for LIBNL, overriding pkg-config LIBNL_LIBS linker flags for LIBNL, overriding pkg-config UUID_CFLAGS C compiler flags for UUID, overriding pkg-config UUID_LIBS linker flags for UUID, overriding pkg-config - IWMX_SDK_CFLAGS - C compiler flags for IWMX_SDK, overriding pkg-config - IWMX_SDK_LIBS - linker flags for IWMX_SDK, overriding pkg-config LIBTEAMDCTL_CFLAGS C compiler flags for LIBTEAMDCTL, overriding pkg-config LIBTEAMDCTL_LIBS @@ -2040,7 +2062,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -NetworkManager configure 1.0.10 +NetworkManager configure 1.1.90 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2580,11 +2602,194 @@ $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type + +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid; break +else + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=$ac_mid; break +else + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid +else + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + echo >>conftest.val; read $3 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 1.0.10, which was +It was created by NetworkManager $as_me 1.1.90, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3454,7 +3659,7 @@ fi # Define the identity of the package. PACKAGE='NetworkManager' - VERSION='1.0.10' + VERSION='1.1.90' cat >>confdefs.h <<_ACEOF @@ -6339,6 +6544,18 @@ fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + + case `pwd` in *\ * | *\ *) @@ -6992,17 +7209,6 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } -fi - # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } @@ -17333,10 +17539,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu NM_MAJOR_VERSION=1 -NM_MINOR_VERSION=0 -NM_MICRO_VERSION=10 -NM_VERSION=1.0.10 -NM_GIT_SHA=c163759fe463d1f4e1f4f8599c7ff3e4b537fe0d +NM_MINOR_VERSION=1 +NM_MICRO_VERSION=90 +NM_VERSION=1.1.90 +NM_GIT_SHA=83d043b1126ad8037260308302f55261ca33b40b @@ -17359,6 +17565,39 @@ _ACEOF fi +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of dev_t" >&5 +$as_echo_n "checking size of dev_t... " >&6; } +if ${ac_cv_sizeof_dev_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (dev_t))" "ac_cv_sizeof_dev_t" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_dev_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (dev_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_dev_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_dev_t" >&5 +$as_echo "$ac_cv_sizeof_dev_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_DEV_T $ac_cv_sizeof_dev_t +_ACEOF + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 @@ -20033,16 +20272,24 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h esac +# Add runstatedir if not specified manually in autoconf < 2.70 +if test -z "$runstatedir"; then : + runstatedir="$localstatedir/run" +fi + + # NetworkManager paths -nmbinary="$sbindir/$PACKAGE" +nmbinary='${sbindir}'/$PACKAGE + +nmconfdir='${sysconfdir}'/$PACKAGE -nmconfdir="$sysconfdir/$PACKAGE" +nmlibdir='${prefix}'/lib/$PACKAGE -nmdatadir="$datadir/$PACKAGE" +nmdatadir='${datadir}'/$PACKAGE -nmstatedir="$localstatedir/lib/$PACKAGE" +nmstatedir='${localstatedir}'/lib/$PACKAGE -nmrundir="$localstatedir/run/$PACKAGE" +nmrundir='${runstatedir}'/$PACKAGE # Alternative configuration plugins @@ -20232,14 +20479,6 @@ else CONFIG_PLUGIN_IFCFG_RH_FALSE= fi - if test "$enable_ifcfg_suse" = "yes"; then - CONFIG_PLUGIN_IFCFG_SUSE_TRUE= - CONFIG_PLUGIN_IFCFG_SUSE_FALSE='#' -else - CONFIG_PLUGIN_IFCFG_SUSE_TRUE='#' - CONFIG_PLUGIN_IFCFG_SUSE_FALSE= -fi - if test "$enable_ifupdown" = "yes"; then CONFIG_PLUGIN_IFUPDOWN_TRUE= CONFIG_PLUGIN_IFUPDOWN_FALSE='#' @@ -20268,17 +20507,32 @@ fi if test -z "$config_plugins_default" -o "$config_plugins_default" = no; then config_plugins_default='' test "$enable_ifcfg_rh" = "yes" && config_plugins_default="$config_plugins_default,ifcfg-rh" - test "$enable_ifcfg_suse" = "yes" && config_plugins_default="$config_plugins_default,ifcfg-suse" test "$enable_ifupdown" = "yes" && config_plugins_default="$config_plugins_default,ifupdown" test "$enable_ifnet" = "yes" && config_plugins_default="$config_plugins_default,ifnet" test "$enable_config_plugin_ibft" = "yes" && config_plugins_default="$config_plugins_default,ibft" config_plugins_default="${config_plugins_default#,}" fi +test "$enable_ifcfg_rh" = "yes" && distro_plugins="$distro_plugins,ifcfg-rh" +test "$enable_ifcfg_suse" = "yes" && distro_plugins="$distro_plugins,ifcfg-suse" +test "$enable_ifupdown" = "yes" && distro_plugins="$distro_plugins,ifupdown" +test "$enable_ifnet" = "yes" && distro_plugins="$distro_plugins,ifnet" +distro_plugins="${distro_plugins#,}" + + cat >>confdefs.h <<_ACEOF #define CONFIG_PLUGINS_DEFAULT "$config_plugins_default" _ACEOF +if test "${enable_config_plugin_ibft}" = yes; then + +$as_echo "#define WITH_SETTINGS_PLUGIN_IBFT 1" >>confdefs.h + +else + +$as_echo "#define WITH_SETTINGS_PLUGIN_IBFT 0" >>confdefs.h + +fi if test "$enable_ifcfg_rh" = "yes"; then DISTRO_NETWORK_SERVICE=network.service @@ -21034,19 +21288,19 @@ $as_echo "no" >&6; } fi pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS" >&5 -$as_echo_n "checking for DBUS... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5 +$as_echo_n "checking for GLIB... " >&6; } -if test -n "$DBUS_CFLAGS"; then - pkg_cv_DBUS_CFLAGS="$DBUS_CFLAGS" +if test -n "$GLIB_CFLAGS"; then + pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 >= 1.1 dbus-glib-1 >= 0.94\""; } >&5 - ($PKG_CONFIG --exists --print-errors "dbus-1 >= 1.1 dbus-glib-1 >= 0.94") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-unix-2.0 >= 2.37.6 gmodule-2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gio-unix-2.0 >= 2.37.6 gmodule-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_DBUS_CFLAGS=`$PKG_CONFIG --cflags "dbus-1 >= 1.1 dbus-glib-1 >= 0.94" 2>/dev/null` + pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "gio-unix-2.0 >= 2.37.6 gmodule-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -21054,16 +21308,16 @@ fi else pkg_failed=untried fi -if test -n "$DBUS_LIBS"; then - pkg_cv_DBUS_LIBS="$DBUS_LIBS" +if test -n "$GLIB_LIBS"; then + pkg_cv_GLIB_LIBS="$GLIB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 >= 1.1 dbus-glib-1 >= 0.94\""; } >&5 - ($PKG_CONFIG --exists --print-errors "dbus-1 >= 1.1 dbus-glib-1 >= 0.94") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-unix-2.0 >= 2.37.6 gmodule-2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gio-unix-2.0 >= 2.37.6 gmodule-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_DBUS_LIBS=`$PKG_CONFIG --libs "dbus-1 >= 1.1 dbus-glib-1 >= 0.94" 2>/dev/null` + pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "gio-unix-2.0 >= 2.37.6 gmodule-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -21084,128 +21338,45 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - DBUS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "dbus-1 >= 1.1 dbus-glib-1 >= 0.94" 2>&1` + GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gio-unix-2.0 >= 2.37.6 gmodule-2.0" 2>&1` else - DBUS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "dbus-1 >= 1.1 dbus-glib-1 >= 0.94" 2>&1` + GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gio-unix-2.0 >= 2.37.6 gmodule-2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs - echo "$DBUS_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (dbus-1 >= 1.1 dbus-glib-1 >= 0.94) were not met: - -$DBUS_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. + echo "$GLIB_PKG_ERRORS" >&5 -Alternatively, you may set the environment variables DBUS_CFLAGS -and DBUS_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 DBUS_CFLAGS -and DBUS_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5 +$as_echo_n "checking for GLIB... " >&6; } -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } +if test -n "$GLIB_CFLAGS"; then + pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-unix-2.0 >= 2.32 gmodule-2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gio-unix-2.0 >= 2.32 gmodule-2.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "gio-unix-2.0 >= 2.32 gmodule-2.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes else - DBUS_CFLAGS=$pkg_cv_DBUS_CFLAGS - DBUS_LIBS=$pkg_cv_DBUS_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -fi - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbus_g_method_invocation_get_g_connection in -ldbus-glib-1" >&5 -$as_echo_n "checking for dbus_g_method_invocation_get_g_connection in -ldbus-glib-1... " >&6; } -if ${ac_cv_lib_dbus_glib_1_dbus_g_method_invocation_get_g_connection+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldbus-glib-1 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dbus_g_method_invocation_get_g_connection (); -int -main () -{ -return dbus_g_method_invocation_get_g_connection (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dbus_glib_1_dbus_g_method_invocation_get_g_connection=yes -else - ac_cv_lib_dbus_glib_1_dbus_g_method_invocation_get_g_connection=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dbus_glib_1_dbus_g_method_invocation_get_g_connection" >&5 -$as_echo "$ac_cv_lib_dbus_glib_1_dbus_g_method_invocation_get_g_connection" >&6; } -if test "x$ac_cv_lib_dbus_glib_1_dbus_g_method_invocation_get_g_connection" = xyes; then : - ac_have_gmi_get_con="1" -else - ac_have_gmi_get_con="0" -fi - - -cat >>confdefs.h <<_ACEOF -#define HAVE_DBUS_GLIB_GMI_GET_CONNECTION $ac_have_gmi_get_con -_ACEOF - - - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS_GLIB_100" >&5 -$as_echo_n "checking for DBUS_GLIB_100... " >&6; } - -if test -n "$DBUS_GLIB_100_CFLAGS"; then - pkg_cv_DBUS_GLIB_100_CFLAGS="$DBUS_GLIB_100_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-glib-1 >= 0.100\""; } >&5 - ($PKG_CONFIG --exists --print-errors "dbus-glib-1 >= 0.100") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_DBUS_GLIB_100_CFLAGS=`$PKG_CONFIG --cflags "dbus-glib-1 >= 0.100" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes + pkg_failed=yes fi else pkg_failed=untried fi -if test -n "$DBUS_GLIB_100_LIBS"; then - pkg_cv_DBUS_GLIB_100_LIBS="$DBUS_GLIB_100_LIBS" +if test -n "$GLIB_LIBS"; then + pkg_cv_GLIB_LIBS="$GLIB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-glib-1 >= 0.100\""; } >&5 - ($PKG_CONFIG --exists --print-errors "dbus-glib-1 >= 0.100") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-unix-2.0 >= 2.32 gmodule-2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gio-unix-2.0 >= 2.32 gmodule-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_DBUS_GLIB_100_LIBS=`$PKG_CONFIG --libs "dbus-glib-1 >= 0.100" 2>/dev/null` + pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "gio-unix-2.0 >= 2.32 gmodule-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -21226,103 +21397,51 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - DBUS_GLIB_100_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "dbus-glib-1 >= 0.100" 2>&1` + GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gio-unix-2.0 >= 2.32 gmodule-2.0" 2>&1` else - DBUS_GLIB_100_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "dbus-glib-1 >= 0.100" 2>&1` + GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gio-unix-2.0 >= 2.32 gmodule-2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs - echo "$DBUS_GLIB_100_PKG_ERRORS" >&5 + echo "$GLIB_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (gio-unix-2.0 >= 2.32 gmodule-2.0) were not met: + +$GLIB_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. - have_dbus_glib_100=no +Alternatively, you may set the environment variables GLIB_CFLAGS +and GLIB_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; } - have_dbus_glib_100=no -else - DBUS_GLIB_100_CFLAGS=$pkg_cv_DBUS_GLIB_100_CFLAGS - DBUS_GLIB_100_LIBS=$pkg_cv_DBUS_GLIB_100_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - have_dbus_glib_100=yes -fi -if (test "${have_dbus_glib_100}" = "yes"); then - -$as_echo "#define HAVE_DBUS_GLIB_100 1" >>confdefs.h - -else + { { $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. -$as_echo "#define HAVE_DBUS_GLIB_100 0" >>confdefs.h +Alternatively, you may set the environment variables GLIB_CFLAGS +and GLIB_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. -fi - if test "${have_dbus_glib_100}" = "yes"; then - HAVE_DBUS_GLIB_100_TRUE= - HAVE_DBUS_GLIB_100_FALSE='#' +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } else - HAVE_DBUS_GLIB_100_TRUE='#' - HAVE_DBUS_GLIB_100_FALSE= -fi - - - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5 -$as_echo_n "checking for GLIB... " >&6; } + GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS + GLIB_LIBS=$pkg_cv_GLIB_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } -if test -n "$GLIB_CFLAGS"; then - pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-unix-2.0 >= 2.37.6 gmodule-2.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gio-unix-2.0 >= 2.37.6 gmodule-2.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "gio-unix-2.0 >= 2.37.6 gmodule-2.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$GLIB_LIBS"; then - pkg_cv_GLIB_LIBS="$GLIB_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-unix-2.0 >= 2.37.6 gmodule-2.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gio-unix-2.0 >= 2.37.6 gmodule-2.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "gio-unix-2.0 >= 2.37.6 gmodule-2.0" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried fi + LOG_DRIVER='$(top_srcdir)/build-aux/test-driver' - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +elif test $pkg_failed = untried; 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 - GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gio-unix-2.0 >= 2.37.6 gmodule-2.0" 2>&1` - else - GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gio-unix-2.0 >= 2.37.6 gmodule-2.0" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$GLIB_PKG_ERRORS" >&5 - - pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5 $as_echo_n "checking for GLIB... " >&6; } @@ -21415,24 +21534,44 @@ $as_echo "yes" >&6; } fi LOG_DRIVER='$(top_srcdir)/build-aux/test-driver' -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else + GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS + GLIB_LIBS=$pkg_cv_GLIB_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + LOG_DRIVER='$(top_srcdir)/build-aux/tap-driver.sh' +, + AM_TESTS_FD_REDIRECT='--tap' + +fi + +GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32" + + + + + +# Check whether --with-libnm-glib was given. +if test "${with_libnm_glib+set}" = set; then : + withval=$with_libnm_glib; +fi + +if test "$with_libnm_glib" != "no"; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5 -$as_echo_n "checking for GLIB... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DBUS" >&5 +$as_echo_n "checking for DBUS... " >&6; } -if test -n "$GLIB_CFLAGS"; then - pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS" +if test -n "$DBUS_CFLAGS"; then + pkg_cv_DBUS_CFLAGS="$DBUS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-unix-2.0 >= 2.32 gmodule-2.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gio-unix-2.0 >= 2.32 gmodule-2.0") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 >= 1.1 dbus-glib-1 >= 0.94\""; } >&5 + ($PKG_CONFIG --exists --print-errors "dbus-1 >= 1.1 dbus-glib-1 >= 0.94") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "gio-unix-2.0 >= 2.32 gmodule-2.0" 2>/dev/null` + pkg_cv_DBUS_CFLAGS=`$PKG_CONFIG --cflags "dbus-1 >= 1.1 dbus-glib-1 >= 0.94" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -21440,16 +21579,16 @@ fi else pkg_failed=untried fi -if test -n "$GLIB_LIBS"; then - pkg_cv_GLIB_LIBS="$GLIB_LIBS" +if test -n "$DBUS_LIBS"; then + pkg_cv_DBUS_LIBS="$DBUS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-unix-2.0 >= 2.32 gmodule-2.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gio-unix-2.0 >= 2.32 gmodule-2.0") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 >= 1.1 dbus-glib-1 >= 0.94\""; } >&5 + ($PKG_CONFIG --exists --print-errors "dbus-1 >= 1.1 dbus-glib-1 >= 0.94") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "gio-unix-2.0 >= 2.32 gmodule-2.0" 2>/dev/null` + pkg_cv_DBUS_LIBS=`$PKG_CONFIG --libs "dbus-1 >= 1.1 dbus-glib-1 >= 0.94" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -21470,62 +21609,45 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gio-unix-2.0 >= 2.32 gmodule-2.0" 2>&1` + DBUS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "dbus-1 >= 1.1 dbus-glib-1 >= 0.94" 2>&1` else - GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gio-unix-2.0 >= 2.32 gmodule-2.0" 2>&1` + DBUS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "dbus-1 >= 1.1 dbus-glib-1 >= 0.94" 2>&1` fi # Put the nasty error message in config.log where it belongs - echo "$GLIB_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (gio-unix-2.0 >= 2.32 gmodule-2.0) were not met: - -$GLIB_PKG_ERRORS + echo "$DBUS_PKG_ERRORS" >&5 -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "$DBUS_PKG_ERRORS -Alternatively, you may set the environment variables GLIB_CFLAGS -and GLIB_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 +Configure with --without-libnm-glib if you do not need the legacy libraries +See \`config.log' 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 GLIB_CFLAGS -and GLIB_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. +as_fn_error $? "$DBUS_PKG_ERRORS -To get pkg-config, see . +Configure with --without-libnm-glib if you do not need the legacy libraries See \`config.log' for more details" "$LINENO" 5; } else - GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS - GLIB_LIBS=$pkg_cv_GLIB_LIBS + DBUS_CFLAGS=$pkg_cv_DBUS_CFLAGS + DBUS_LIBS=$pkg_cv_DBUS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - + : fi - LOG_DRIVER='$(top_srcdir)/build-aux/test-driver' - + with_libnm_glib=yes +fi + if test "$with_libnm_glib" != "no"; then + WITH_LEGACY_LIBRARIES_TRUE= + WITH_LEGACY_LIBRARIES_FALSE='#' else - GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS - GLIB_LIBS=$pkg_cv_GLIB_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - LOG_DRIVER='$(top_srcdir)/build-aux/tap-driver.sh' -, - AM_TESTS_FD_REDIRECT='--tap' - + WITH_LEGACY_LIBRARIES_TRUE='#' + WITH_LEGACY_LIBRARIES_FALSE= fi -GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32" - - - pkg_failed=no @@ -21622,8 +21744,6 @@ fi - - # Check whether --enable-introspection was given. if test "${enable_introspection+set}" = set; then : enableval=$enable_introspection; @@ -21799,8 +21919,6 @@ if (test "${enable_qt}" = "yes"); then if test x"$have_qt" = x"no"; then as_fn_error $? "Qt development headers are required" "$LINENO" 5 fi - - # Check for moc-qt4 and if not found then moc QT4_BINDIR=`$PKG_CONFIG QtCore --variable moc_location` for ac_prog in moc-qt4 moc @@ -21998,64 +22116,67 @@ else fi -# session tracking support -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Session tracking support" >&5 -$as_echo_n "checking Session tracking support... " >&6; } +# Hostname persist mode -# Check whether --with-session-tracking was given. -if test "${with_session_tracking+set}" = set; then : - withval=$with_session_tracking; +# Check whether --with-hostname-persist was given. +if test "${with_hostname_persist+set}" = set; then : + withval=$with_hostname_persist; fi -# default to consolekit -if test -z "$with_session_tracking"; then : - with_session_tracking=consolekit + +if test "$with_hostname_persist" = "suse"; then : + hostname_persist=suse fi -if test "$with_session_tracking" = "ck"; then : - with_session_tracking=consolekit +if test "$with_hostname_persist" = "gentoo"; then : + hostname_persist=gentoo fi -if test "$with_session_tracking" = "none"; then : - with_session_tracking=no +if test "$with_hostname_persist" = "default"; then : + hostname_persist=default fi -# check value -if ! (echo "$with_session_tracking" | grep -q -E "^(systemd|consolekit|no)$"); then : - as_fn_error $? "--with-session-tracking must be systemd/consolekit/no -else - not $with_session_tracking" "$LINENO" 5 +# if the method was not explicitly set, try to guess it from the enabled plugins +if test -z "$hostname_persist" -a "$distro_plugins" = "ifcfg-suse"; then : + hostname_persist=suse fi -# add conditionals and subtitutions - if test "$with_session_tracking" = "consolekit"; then - SESSION_TRACKING_CK_TRUE= - SESSION_TRACKING_CK_FALSE='#' -else - SESSION_TRACKING_CK_TRUE='#' - SESSION_TRACKING_CK_FALSE= +if test -z "$hostname_persist" -a "$distro_plugins" = "ifnet"; then : + hostname_persist=gentoo fi - - if test "$with_session_tracking" = "systemd"; then - SESSION_TRACKING_SYSTEMD_TRUE= - SESSION_TRACKING_SYSTEMD_FALSE='#' -else - SESSION_TRACKING_SYSTEMD_TRUE='#' - SESSION_TRACKING_SYSTEMD_FALSE= +if test -z "$hostname_persist"; then : + hostname_persist=default fi -if test "$with_session_tracking" = "systemd"; then +if test "$hostname_persist" = suse; then -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD_LOGIN" >&5 -$as_echo_n "checking for SYSTEMD_LOGIN... " >&6; } +$as_echo "#define HOSTNAME_PERSIST_SUSE 1" >>confdefs.h -if test -n "$SYSTEMD_LOGIN_CFLAGS"; then - pkg_cv_SYSTEMD_LOGIN_CFLAGS="$SYSTEMD_LOGIN_CFLAGS" +elif test "$hostname_persist" = gentoo; then + +$as_echo "#define HOSTNAME_PERSIST_GENTOO 1" >>confdefs.h + +fi + + +# Check whether --with-systemd-journal was given. +if test "${with_systemd_journal+set}" = set; then : + withval=$with_systemd_journal; +fi + +have_systemd_journal=no +if test "$with_systemd_journal" != "no"; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD_JOURNAL" >&5 +$as_echo_n "checking for SYSTEMD_JOURNAL... " >&6; } + +if test -n "$SYSTEMD_JOURNAL_CFLAGS"; then + pkg_cv_SYSTEMD_JOURNAL_CFLAGS="$SYSTEMD_JOURNAL_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\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libsystemd") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd >= 209\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libsystemd >= 209") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_SYSTEMD_LOGIN_CFLAGS=`$PKG_CONFIG --cflags "libsystemd" 2>/dev/null` + pkg_cv_SYSTEMD_JOURNAL_CFLAGS=`$PKG_CONFIG --cflags "libsystemd >= 209" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -22063,16 +22184,16 @@ fi else pkg_failed=untried fi -if test -n "$SYSTEMD_LOGIN_LIBS"; then - pkg_cv_SYSTEMD_LOGIN_LIBS="$SYSTEMD_LOGIN_LIBS" +if test -n "$SYSTEMD_JOURNAL_LIBS"; then + pkg_cv_SYSTEMD_JOURNAL_LIBS="$SYSTEMD_JOURNAL_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\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libsystemd") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd >= 209\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libsystemd >= 209") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_SYSTEMD_LOGIN_LIBS=`$PKG_CONFIG --libs "libsystemd" 2>/dev/null` + pkg_cv_SYSTEMD_JOURNAL_LIBS=`$PKG_CONFIG --libs "libsystemd >= 209" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -22093,28 +22214,28 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - SYSTEMD_LOGIN_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd" 2>&1` + SYSTEMD_JOURNAL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd >= 209" 2>&1` else - SYSTEMD_LOGIN_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd" 2>&1` + SYSTEMD_JOURNAL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd >= 209" 2>&1` fi # Put the nasty error message in config.log where it belongs - echo "$SYSTEMD_LOGIN_PKG_ERRORS" >&5 + echo "$SYSTEMD_JOURNAL_PKG_ERRORS" >&5 pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD_LOGIN" >&5 -$as_echo_n "checking for SYSTEMD_LOGIN... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD_JOURNAL" >&5 +$as_echo_n "checking for SYSTEMD_JOURNAL... " >&6; } -if test -n "$SYSTEMD_LOGIN_CFLAGS"; then - pkg_cv_SYSTEMD_LOGIN_CFLAGS="$SYSTEMD_LOGIN_CFLAGS" +if test -n "$SYSTEMD_JOURNAL_CFLAGS"; then + pkg_cv_SYSTEMD_JOURNAL_CFLAGS="$SYSTEMD_JOURNAL_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 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-journal\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libsystemd-journal") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_SYSTEMD_LOGIN_CFLAGS=`$PKG_CONFIG --cflags "libsystemd-login" 2>/dev/null` + pkg_cv_SYSTEMD_JOURNAL_CFLAGS=`$PKG_CONFIG --cflags "libsystemd-journal" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -22122,16 +22243,16 @@ fi else pkg_failed=untried fi -if test -n "$SYSTEMD_LOGIN_LIBS"; then - pkg_cv_SYSTEMD_LOGIN_LIBS="$SYSTEMD_LOGIN_LIBS" +if test -n "$SYSTEMD_JOURNAL_LIBS"; then + pkg_cv_SYSTEMD_JOURNAL_LIBS="$SYSTEMD_JOURNAL_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 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-journal\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libsystemd-journal") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_SYSTEMD_LOGIN_LIBS=`$PKG_CONFIG --libs "libsystemd-login" 2>/dev/null` + pkg_cv_SYSTEMD_JOURNAL_LIBS=`$PKG_CONFIG --libs "libsystemd-journal" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -22152,63 +22273,43 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - SYSTEMD_LOGIN_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd-login" 2>&1` + SYSTEMD_JOURNAL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd-journal" 2>&1` else - SYSTEMD_LOGIN_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd-login" 2>&1` + SYSTEMD_JOURNAL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd-journal" 2>&1` fi # Put the nasty error message in config.log where it belongs - echo "$SYSTEMD_LOGIN_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (libsystemd-login) were not met: - -$SYSTEMD_LOGIN_PKG_ERRORS + echo "$SYSTEMD_JOURNAL_PKG_ERRORS" >&5 -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_LOGIN_CFLAGS -and SYSTEMD_LOGIN_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 + have_systemd_journal=no 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_LOGIN_CFLAGS -and SYSTEMD_LOGIN_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; } + have_systemd_journal=no else - SYSTEMD_LOGIN_CFLAGS=$pkg_cv_SYSTEMD_LOGIN_CFLAGS - SYSTEMD_LOGIN_LIBS=$pkg_cv_SYSTEMD_LOGIN_LIBS + SYSTEMD_JOURNAL_CFLAGS=$pkg_cv_SYSTEMD_JOURNAL_CFLAGS + SYSTEMD_JOURNAL_LIBS=$pkg_cv_SYSTEMD_JOURNAL_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - + have_systemd_journal=yes fi elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD_LOGIN" >&5 -$as_echo_n "checking for SYSTEMD_LOGIN... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD_JOURNAL" >&5 +$as_echo_n "checking for SYSTEMD_JOURNAL... " >&6; } -if test -n "$SYSTEMD_LOGIN_CFLAGS"; then - pkg_cv_SYSTEMD_LOGIN_CFLAGS="$SYSTEMD_LOGIN_CFLAGS" +if test -n "$SYSTEMD_JOURNAL_CFLAGS"; then + pkg_cv_SYSTEMD_JOURNAL_CFLAGS="$SYSTEMD_JOURNAL_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 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-journal\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libsystemd-journal") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_SYSTEMD_LOGIN_CFLAGS=`$PKG_CONFIG --cflags "libsystemd-login" 2>/dev/null` + pkg_cv_SYSTEMD_JOURNAL_CFLAGS=`$PKG_CONFIG --cflags "libsystemd-journal" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -22216,16 +22317,16 @@ fi else pkg_failed=untried fi -if test -n "$SYSTEMD_LOGIN_LIBS"; then - pkg_cv_SYSTEMD_LOGIN_LIBS="$SYSTEMD_LOGIN_LIBS" +if test -n "$SYSTEMD_JOURNAL_LIBS"; then + pkg_cv_SYSTEMD_JOURNAL_LIBS="$SYSTEMD_JOURNAL_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 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-journal\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libsystemd-journal") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_SYSTEMD_LOGIN_LIBS=`$PKG_CONFIG --libs "libsystemd-login" 2>/dev/null` + pkg_cv_SYSTEMD_JOURNAL_LIBS=`$PKG_CONFIG --libs "libsystemd-journal" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -22246,115 +22347,146 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - SYSTEMD_LOGIN_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd-login" 2>&1` + SYSTEMD_JOURNAL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd-journal" 2>&1` else - SYSTEMD_LOGIN_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd-login" 2>&1` + SYSTEMD_JOURNAL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd-journal" 2>&1` fi # Put the nasty error message in config.log where it belongs - echo "$SYSTEMD_LOGIN_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (libsystemd-login) were not met: - -$SYSTEMD_LOGIN_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. + echo "$SYSTEMD_JOURNAL_PKG_ERRORS" >&5 -Alternatively, you may set the environment variables SYSTEMD_LOGIN_CFLAGS -and SYSTEMD_LOGIN_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 + have_systemd_journal=no 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_LOGIN_CFLAGS -and SYSTEMD_LOGIN_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; } + have_systemd_journal=no else - SYSTEMD_LOGIN_CFLAGS=$pkg_cv_SYSTEMD_LOGIN_CFLAGS - SYSTEMD_LOGIN_LIBS=$pkg_cv_SYSTEMD_LOGIN_LIBS + SYSTEMD_JOURNAL_CFLAGS=$pkg_cv_SYSTEMD_JOURNAL_CFLAGS + SYSTEMD_JOURNAL_LIBS=$pkg_cv_SYSTEMD_JOURNAL_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - + have_systemd_journal=yes fi else - SYSTEMD_LOGIN_CFLAGS=$pkg_cv_SYSTEMD_LOGIN_CFLAGS - SYSTEMD_LOGIN_LIBS=$pkg_cv_SYSTEMD_LOGIN_LIBS + SYSTEMD_JOURNAL_CFLAGS=$pkg_cv_SYSTEMD_JOURNAL_CFLAGS + SYSTEMD_JOURNAL_LIBS=$pkg_cv_SYSTEMD_JOURNAL_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } + have_systemd_journal=yes +fi + if test "$have_systemd_journal" != "yes"; then + if test "$with_systemd_journal" = "yes"; then + as_fn_error $? "Missing systemd-journald support" "$LINENO" 5 + fi + fi +fi +if test "$have_systemd_journal" = "yes"; then + +$as_echo "#define SYSTEMD_JOURNAL 1" >>confdefs.h + +else + +$as_echo "#define SYSTEMD_JOURNAL 0" >>confdefs.h fi +# Check whether --with-config-logging-backend-default was given. +if test "${with_config_logging_backend_default+set}" = set; then : + withval=$with_config_logging_backend_default; nm_config_logging_backend_default="$withval" +else + nm_config_logging_backend_default="" fi -if test "$with_session_tracking" = "consolekit"; then - CKDB_PATH=/var/run/ConsoleKit/database +if test "$nm_config_logging_backend_default" != 'debug' \ + -a "$nm_config_logging_backend_default" != 'syslog' \ + -a "$nm_config_logging_backend_default" != 'journal' \ + -a "$nm_config_logging_backend_default" != 'journal-syslog-style'; then + # unknown backend. Reset to default. Silently accept the invalid value to + # be future proof. + nm_config_logging_backend_default='' +fi +if test "$nm_config_logging_backend_default" = ""; then + if test "$have_systemd_journal" = "yes"; then + nm_config_logging_backend_default='journal-syslog-style' + else + nm_config_logging_backend_default='syslog' + fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_session_tracking" >&5 -$as_echo "$with_session_tracking" >&6; } +cat >>confdefs.h <<_ACEOF +#define NM_CONFIG_LOGGING_BACKEND_DEFAULT "$nm_config_logging_backend_default" +_ACEOF -# Check whether --with-suspend-resume was given. -if test "${with_suspend_resume+set}" = set; then : - withval=$with_suspend_resume; -fi +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT="$nm_config_logging_backend_default" -if test "z$with_suspend_resume" = "z"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd >= 209\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libsystemd >= 209") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - have_systemd_inhibit=yes -else - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login >= 183\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libsystemd-login >= 183") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - have_systemd_inhibit=yes -else - have_systemd_inhibit=no + +# Session tracking support + +# Check whether --with-systemd-logind was given. +if test "${with_systemd_logind+set}" = set; then : + withval=$with_systemd_logind; fi + + +# Check whether --with-consolekit was given. +if test "${with_consolekit+set}" = set; then : + withval=$with_consolekit; fi - if test "z${have_systemd_inhibit}" = "zyes"; then - # Use systemd if it's new enough - with_suspend_resume="systemd" - else - # Fall back to upower - with_suspend_resume="upower" - fi + + +# Check whether --with-session-tracking was given. +if test "${with_session_tracking+set}" = set; then : + withval=$with_session_tracking; fi -case $with_suspend_resume in - upower) ;; - systemd) +# backwards compatibility +if test "$with_session_tracking" = "ck"; then : + use_consolekit="yes" use_systemd_logind="no" +fi +if test "$with_session_tracking" = "consolekit"; then : + use_consolekit="yes" use_systemd_logind="no" +fi +if test "$with_session_tracking" = "systemd"; then : + use_consolekit="no" use_systemd_logind="yes" +fi +if test "$with_session_tracking" = "no"; then : + use_consolekit="no" use_systemd_logind="no" +fi +if test "$with_session_tracking" = "none"; then : + use_consolekit="no" use_systemd_logind="no" +fi +# current options +if test -n "$with_systemd_logind" ; then : + use_systemd_logind="$with_systemd_logind" +fi +if test -n "$with_consolekit" ; then : + use_consolekit="$with_consolekit" +fi +# defaults +if test -z "$use_systemd_logind"; then : + use_systemd_logind="auto" +fi +if test -z "$use_consolekit"; then : + use_consolekit="yes" +fi +# output +session_tracking= +if test "$use_systemd_logind" = "yes" -o "$use_systemd_logind" = "auto"; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD_INHIBIT" >&5 -$as_echo_n "checking for SYSTEMD_INHIBIT... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD_LOGIN" >&5 +$as_echo_n "checking for SYSTEMD_LOGIN... " >&6; } -if test -n "$SYSTEMD_INHIBIT_CFLAGS"; then - pkg_cv_SYSTEMD_INHIBIT_CFLAGS="$SYSTEMD_INHIBIT_CFLAGS" +if test -n "$SYSTEMD_LOGIN_CFLAGS"; then + pkg_cv_SYSTEMD_LOGIN_CFLAGS="$SYSTEMD_LOGIN_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 >= 209\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libsystemd >= 209") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libsystemd") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_SYSTEMD_INHIBIT_CFLAGS=`$PKG_CONFIG --cflags "libsystemd >= 209" 2>/dev/null` + pkg_cv_SYSTEMD_LOGIN_CFLAGS=`$PKG_CONFIG --cflags "libsystemd" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -22362,16 +22494,16 @@ fi else pkg_failed=untried fi -if test -n "$SYSTEMD_INHIBIT_LIBS"; then - pkg_cv_SYSTEMD_INHIBIT_LIBS="$SYSTEMD_INHIBIT_LIBS" +if test -n "$SYSTEMD_LOGIN_LIBS"; then + pkg_cv_SYSTEMD_LOGIN_LIBS="$SYSTEMD_LOGIN_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 >= 209\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libsystemd >= 209") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libsystemd") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_SYSTEMD_INHIBIT_LIBS=`$PKG_CONFIG --libs "libsystemd >= 209" 2>/dev/null` + pkg_cv_SYSTEMD_LOGIN_LIBS=`$PKG_CONFIG --libs "libsystemd" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -22392,28 +22524,28 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - SYSTEMD_INHIBIT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd >= 209" 2>&1` + SYSTEMD_LOGIN_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd" 2>&1` else - SYSTEMD_INHIBIT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd >= 209" 2>&1` + SYSTEMD_LOGIN_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd" 2>&1` fi # Put the nasty error message in config.log where it belongs - echo "$SYSTEMD_INHIBIT_PKG_ERRORS" >&5 + echo "$SYSTEMD_LOGIN_PKG_ERRORS" >&5 pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD_INHIBIT" >&5 -$as_echo_n "checking for SYSTEMD_INHIBIT... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD_LOGIN" >&5 +$as_echo_n "checking for SYSTEMD_LOGIN... " >&6; } -if test -n "$SYSTEMD_INHIBIT_CFLAGS"; then - pkg_cv_SYSTEMD_INHIBIT_CFLAGS="$SYSTEMD_INHIBIT_CFLAGS" +if test -n "$SYSTEMD_LOGIN_CFLAGS"; then + pkg_cv_SYSTEMD_LOGIN_CFLAGS="$SYSTEMD_LOGIN_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 >= 183\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libsystemd-login >= 183") 2>&5 + { { $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_INHIBIT_CFLAGS=`$PKG_CONFIG --cflags "libsystemd-login >= 183" 2>/dev/null` + pkg_cv_SYSTEMD_LOGIN_CFLAGS=`$PKG_CONFIG --cflags "libsystemd-login" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -22421,16 +22553,16 @@ fi else pkg_failed=untried fi -if test -n "$SYSTEMD_INHIBIT_LIBS"; then - pkg_cv_SYSTEMD_INHIBIT_LIBS="$SYSTEMD_INHIBIT_LIBS" +if test -n "$SYSTEMD_LOGIN_LIBS"; then + pkg_cv_SYSTEMD_LOGIN_LIBS="$SYSTEMD_LOGIN_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 >= 183\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libsystemd-login >= 183") 2>&5 + { { $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_INHIBIT_LIBS=`$PKG_CONFIG --libs "libsystemd-login >= 183" 2>/dev/null` + pkg_cv_SYSTEMD_LOGIN_LIBS=`$PKG_CONFIG --libs "libsystemd-login" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -22451,63 +22583,43 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - SYSTEMD_INHIBIT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd-login >= 183" 2>&1` + SYSTEMD_LOGIN_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd-login" 2>&1` else - SYSTEMD_INHIBIT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd-login >= 183" 2>&1` + SYSTEMD_LOGIN_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd-login" 2>&1` fi # Put the nasty error message in config.log where it belongs - echo "$SYSTEMD_INHIBIT_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (libsystemd-login >= 183) were not met: - -$SYSTEMD_INHIBIT_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. + echo "$SYSTEMD_LOGIN_PKG_ERRORS" >&5 -Alternatively, you may set the environment variables SYSTEMD_INHIBIT_CFLAGS -and SYSTEMD_INHIBIT_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 + have_systemd_logind=no 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_INHIBIT_CFLAGS -and SYSTEMD_INHIBIT_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; } + have_systemd_logind=no else - SYSTEMD_INHIBIT_CFLAGS=$pkg_cv_SYSTEMD_INHIBIT_CFLAGS - SYSTEMD_INHIBIT_LIBS=$pkg_cv_SYSTEMD_INHIBIT_LIBS + SYSTEMD_LOGIN_CFLAGS=$pkg_cv_SYSTEMD_LOGIN_CFLAGS + SYSTEMD_LOGIN_LIBS=$pkg_cv_SYSTEMD_LOGIN_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - + have_systemd_logind=yes fi elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD_INHIBIT" >&5 -$as_echo_n "checking for SYSTEMD_INHIBIT... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD_LOGIN" >&5 +$as_echo_n "checking for SYSTEMD_LOGIN... " >&6; } -if test -n "$SYSTEMD_INHIBIT_CFLAGS"; then - pkg_cv_SYSTEMD_INHIBIT_CFLAGS="$SYSTEMD_INHIBIT_CFLAGS" +if test -n "$SYSTEMD_LOGIN_CFLAGS"; then + pkg_cv_SYSTEMD_LOGIN_CFLAGS="$SYSTEMD_LOGIN_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 >= 183\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libsystemd-login >= 183") 2>&5 + { { $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_INHIBIT_CFLAGS=`$PKG_CONFIG --cflags "libsystemd-login >= 183" 2>/dev/null` + pkg_cv_SYSTEMD_LOGIN_CFLAGS=`$PKG_CONFIG --cflags "libsystemd-login" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -22515,16 +22627,16 @@ fi else pkg_failed=untried fi -if test -n "$SYSTEMD_INHIBIT_LIBS"; then - pkg_cv_SYSTEMD_INHIBIT_LIBS="$SYSTEMD_INHIBIT_LIBS" +if test -n "$SYSTEMD_LOGIN_LIBS"; then + pkg_cv_SYSTEMD_LOGIN_LIBS="$SYSTEMD_LOGIN_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 >= 183\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libsystemd-login >= 183") 2>&5 + { { $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_INHIBIT_LIBS=`$PKG_CONFIG --libs "libsystemd-login >= 183" 2>/dev/null` + pkg_cv_SYSTEMD_LOGIN_LIBS=`$PKG_CONFIG --libs "libsystemd-login" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -22545,99 +22657,113 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - SYSTEMD_INHIBIT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd-login >= 183" 2>&1` + SYSTEMD_LOGIN_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd-login" 2>&1` else - SYSTEMD_INHIBIT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd-login >= 183" 2>&1` + SYSTEMD_LOGIN_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd-login" 2>&1` fi # Put the nasty error message in config.log where it belongs - echo "$SYSTEMD_INHIBIT_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (libsystemd-login >= 183) were not met: - -$SYSTEMD_INHIBIT_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. + echo "$SYSTEMD_LOGIN_PKG_ERRORS" >&5 -Alternatively, you may set the environment variables SYSTEMD_INHIBIT_CFLAGS -and SYSTEMD_INHIBIT_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 + have_systemd_logind=no 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_INHIBIT_CFLAGS -and SYSTEMD_INHIBIT_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; } + have_systemd_logind=no else - SYSTEMD_INHIBIT_CFLAGS=$pkg_cv_SYSTEMD_INHIBIT_CFLAGS - SYSTEMD_INHIBIT_LIBS=$pkg_cv_SYSTEMD_INHIBIT_LIBS + SYSTEMD_LOGIN_CFLAGS=$pkg_cv_SYSTEMD_LOGIN_CFLAGS + SYSTEMD_LOGIN_LIBS=$pkg_cv_SYSTEMD_LOGIN_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - + have_systemd_logind=yes fi else - SYSTEMD_INHIBIT_CFLAGS=$pkg_cv_SYSTEMD_INHIBIT_CFLAGS - SYSTEMD_INHIBIT_LIBS=$pkg_cv_SYSTEMD_INHIBIT_LIBS + SYSTEMD_LOGIN_CFLAGS=$pkg_cv_SYSTEMD_LOGIN_CFLAGS + SYSTEMD_LOGIN_LIBS=$pkg_cv_SYSTEMD_LOGIN_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - + have_systemd_logind=yes fi - ;; - *) - as_fn_error $? "--with-suspend-resume must be one of upower, systemd" "$LINENO" 5 - ;; -esac - if test "x$with_suspend_resume" = "xupower"; then - SUSPEND_RESUME_UPOWER_TRUE= - SUSPEND_RESUME_UPOWER_FALSE='#' else - SUSPEND_RESUME_UPOWER_TRUE='#' - SUSPEND_RESUME_UPOWER_FALSE= + have_systemd_logind=no +fi +if test "$use_systemd_logind" = "yes" -a "$have_systemd_logind" = "no"; then + as_fn_error $? "You must have libsystemd installed to build with systemd-logind support." "$LINENO" 5 fi +if test "$have_systemd_logind" = "yes"; then - if test "x$with_suspend_resume" = "xsystemd"; then - SUSPEND_RESUME_SYSTEMD_TRUE= - SUSPEND_RESUME_SYSTEMD_FALSE='#' -else - SUSPEND_RESUME_SYSTEMD_TRUE='#' - SUSPEND_RESUME_SYSTEMD_FALSE= +$as_echo "#define SESSION_TRACKING_SYSTEMD 1" >>confdefs.h + + session_tracking="$session_tracking, systemd-logind" fi +if test "$use_consolekit" = "yes"; then +$as_echo "#define SESSION_TRACKING_CONSOLEKIT 1" >>confdefs.h -# SELinux support -# Check whether --with-selinux was given. -if test "${with_selinux+set}" = set; then : - withval=$with_selinux; +$as_echo "#define CKDB_PATH \"/var/run/ConsoleKit/database\"" >>confdefs.h + + session_tracking="$session_tracking, consolekit" +fi +session_tracking="$(printf '%s' "${session_tracking}" | sed 's/^, //')" + + +# Check whether --with-suspend-resume was given. +if test "${with_suspend_resume+set}" = set; then : + withval=$with_suspend_resume; +fi + +if test "z$with_suspend_resume" = "z"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd >= 209\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libsystemd >= 209") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + have_systemd_inhibit=yes else - with_selinux=auto + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login >= 183\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libsystemd-login >= 183") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + have_systemd_inhibit=yes +else + have_systemd_inhibit=no +fi +fi + if test "z${have_systemd_inhibit}" = "zyes"; then + # Use systemd if it's new enough + with_suspend_resume="systemd" + else + if test "$use_consolekit" = "yes"; then + # Use consolekit suspend if session tracking is consolekit + with_suspend_resume="consolekit" + else + # Fall back to upower + with_suspend_resume="upower" + fi + fi fi -if test "$with_selinux" = "yes" -o "$with_selinux" = "auto"; then +case $with_suspend_resume in + upower) ;; + systemd) pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SELINUX" >&5 -$as_echo_n "checking for SELINUX... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD_INHIBIT" >&5 +$as_echo_n "checking for SYSTEMD_INHIBIT... " >&6; } -if test -n "$SELINUX_CFLAGS"; then - pkg_cv_SELINUX_CFLAGS="$SELINUX_CFLAGS" +if test -n "$SYSTEMD_INHIBIT_CFLAGS"; then + pkg_cv_SYSTEMD_INHIBIT_CFLAGS="$SYSTEMD_INHIBIT_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libselinux\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libselinux") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd >= 209\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libsystemd >= 209") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_SELINUX_CFLAGS=`$PKG_CONFIG --cflags "libselinux" 2>/dev/null` + pkg_cv_SYSTEMD_INHIBIT_CFLAGS=`$PKG_CONFIG --cflags "libsystemd >= 209" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -22645,16 +22771,16 @@ fi else pkg_failed=untried fi -if test -n "$SELINUX_LIBS"; then - pkg_cv_SELINUX_LIBS="$SELINUX_LIBS" +if test -n "$SYSTEMD_INHIBIT_LIBS"; then + pkg_cv_SYSTEMD_INHIBIT_LIBS="$SYSTEMD_INHIBIT_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libselinux\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libselinux") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd >= 209\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libsystemd >= 209") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_SELINUX_LIBS=`$PKG_CONFIG --libs "libselinux" 2>/dev/null` + pkg_cv_SYSTEMD_INHIBIT_LIBS=`$PKG_CONFIG --libs "libsystemd >= 209" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -22675,65 +22801,28 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - SELINUX_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libselinux" 2>&1` + SYSTEMD_INHIBIT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd >= 209" 2>&1` else - SELINUX_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libselinux" 2>&1` + SYSTEMD_INHIBIT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd >= 209" 2>&1` fi # Put the nasty error message in config.log where it belongs - echo "$SELINUX_PKG_ERRORS" >&5 - - have_selinux=no -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - have_selinux=no -else - SELINUX_CFLAGS=$pkg_cv_SELINUX_CFLAGS - SELINUX_LIBS=$pkg_cv_SELINUX_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - have_selinux=yes -fi -else - have_selinux=no -fi -if test "$with_selinux" = "yes" -a "$have_selinux" = "no"; then - as_fn_error $? "You must have libselinux installed to build --with-selinux=yes." "$LINENO" 5 -fi -if test "$have_selinux" = "yes"; then - -$as_echo "#define HAVE_SELINUX 1" >>confdefs.h - -else - -$as_echo "#define HAVE_SELINUX 0" >>confdefs.h - -fi - if test "${have_selinux}" = "yes"; then - HAVE_SELINUX_TRUE= - HAVE_SELINUX_FALSE='#' -else - HAVE_SELINUX_TRUE='#' - HAVE_SELINUX_FALSE= -fi - + echo "$SYSTEMD_INHIBIT_PKG_ERRORS" >&5 -# libnl support for the linux platform pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBNL" >&5 -$as_echo_n "checking for LIBNL... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD_INHIBIT" >&5 +$as_echo_n "checking for SYSTEMD_INHIBIT... " >&6; } -if test -n "$LIBNL_CFLAGS"; then - pkg_cv_LIBNL_CFLAGS="$LIBNL_CFLAGS" +if test -n "$SYSTEMD_INHIBIT_CFLAGS"; then + pkg_cv_SYSTEMD_INHIBIT_CFLAGS="$SYSTEMD_INHIBIT_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-3.0 >= 3.2.8 libnl-route-3.0 libnl-genl-3.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libnl-3.0 >= 3.2.8 libnl-route-3.0 libnl-genl-3.0") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login >= 183\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libsystemd-login >= 183") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_LIBNL_CFLAGS=`$PKG_CONFIG --cflags "libnl-3.0 >= 3.2.8 libnl-route-3.0 libnl-genl-3.0" 2>/dev/null` + pkg_cv_SYSTEMD_INHIBIT_CFLAGS=`$PKG_CONFIG --cflags "libsystemd-login >= 183" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -22741,16 +22830,16 @@ fi else pkg_failed=untried fi -if test -n "$LIBNL_LIBS"; then - pkg_cv_LIBNL_LIBS="$LIBNL_LIBS" +if test -n "$SYSTEMD_INHIBIT_LIBS"; then + pkg_cv_SYSTEMD_INHIBIT_LIBS="$SYSTEMD_INHIBIT_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-3.0 >= 3.2.8 libnl-route-3.0 libnl-genl-3.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libnl-3.0 >= 3.2.8 libnl-route-3.0 libnl-genl-3.0") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-login >= 183\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libsystemd-login >= 183") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_LIBNL_LIBS=`$PKG_CONFIG --libs "libnl-3.0 >= 3.2.8 libnl-route-3.0 libnl-genl-3.0" 2>/dev/null` + pkg_cv_SYSTEMD_INHIBIT_LIBS=`$PKG_CONFIG --libs "libsystemd-login >= 183" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -22771,22 +22860,22 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - LIBNL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libnl-3.0 >= 3.2.8 libnl-route-3.0 libnl-genl-3.0" 2>&1` + SYSTEMD_INHIBIT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd-login >= 183" 2>&1` else - LIBNL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libnl-3.0 >= 3.2.8 libnl-route-3.0 libnl-genl-3.0" 2>&1` + SYSTEMD_INHIBIT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd-login >= 183" 2>&1` fi # Put the nasty error message in config.log where it belongs - echo "$LIBNL_PKG_ERRORS" >&5 + echo "$SYSTEMD_INHIBIT_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (libnl-3.0 >= 3.2.8 libnl-route-3.0 libnl-genl-3.0) were not met: + as_fn_error $? "Package requirements (libsystemd-login >= 183) were not met: -$LIBNL_PKG_ERRORS +$SYSTEMD_INHIBIT_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 LIBNL_CFLAGS -and LIBNL_LIBS to avoid the need to call pkg-config. +Alternatively, you may set the environment variables SYSTEMD_INHIBIT_CFLAGS +and SYSTEMD_INHIBIT_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 @@ -22797,169 +22886,183 @@ as_fn_error $? "The pkg-config script could not be found or is too old. Make su 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 LIBNL_CFLAGS -and LIBNL_LIBS to avoid the need to call pkg-config. +Alternatively, you may set the environment variables SYSTEMD_INHIBIT_CFLAGS +and SYSTEMD_INHIBIT_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 - LIBNL_CFLAGS=$pkg_cv_LIBNL_CFLAGS - LIBNL_LIBS=$pkg_cv_LIBNL_LIBS + SYSTEMD_INHIBIT_CFLAGS=$pkg_cv_SYSTEMD_INHIBIT_CFLAGS + SYSTEMD_INHIBIT_LIBS=$pkg_cv_SYSTEMD_INHIBIT_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD_INHIBIT" >&5 +$as_echo_n "checking for SYSTEMD_INHIBIT... " >&6; } - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rtnl_link_inet6_get_addr_gen_mode in -lnl-route-3" >&5 -$as_echo_n "checking for rtnl_link_inet6_get_addr_gen_mode in -lnl-route-3... " >&6; } -if ${ac_cv_lib_nl_route_3_rtnl_link_inet6_get_addr_gen_mode+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnl-route-3 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char rtnl_link_inet6_get_addr_gen_mode (); -int -main () -{ -return rtnl_link_inet6_get_addr_gen_mode (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_nl_route_3_rtnl_link_inet6_get_addr_gen_mode=yes +if test -n "$SYSTEMD_INHIBIT_CFLAGS"; then + pkg_cv_SYSTEMD_INHIBIT_CFLAGS="$SYSTEMD_INHIBIT_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 >= 183\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libsystemd-login >= 183") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SYSTEMD_INHIBIT_CFLAGS=`$PKG_CONFIG --cflags "libsystemd-login >= 183" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes else - ac_cv_lib_nl_route_3_rtnl_link_inet6_get_addr_gen_mode=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + pkg_failed=yes fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nl_route_3_rtnl_link_inet6_get_addr_gen_mode" >&5 -$as_echo "$ac_cv_lib_nl_route_3_rtnl_link_inet6_get_addr_gen_mode" >&6; } -if test "x$ac_cv_lib_nl_route_3_rtnl_link_inet6_get_addr_gen_mode" = xyes; then : - ac_have_addr_gen_mode="1" -else - ac_have_addr_gen_mode="0" + else + pkg_failed=untried +fi +if test -n "$SYSTEMD_INHIBIT_LIBS"; then + pkg_cv_SYSTEMD_INHIBIT_LIBS="$SYSTEMD_INHIBIT_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 >= 183\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libsystemd-login >= 183") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_SYSTEMD_INHIBIT_LIBS=`$PKG_CONFIG --libs "libsystemd-login >= 183" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried fi -cat >>confdefs.h <<_ACEOF -#define HAVE_LIBNL_INET6_ADDR_GEN_MODE $ac_have_addr_gen_mode -_ACEOF +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Linux kernel IN6_ADDR_GEN_MODE enum" >&5 -$as_echo_n "checking Linux kernel IN6_ADDR_GEN_MODE enum... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __user - #define __user - #endif - #include -int -main () -{ -int a = IN6_ADDR_GEN_MODE_EUI64; a++; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_have_kernel_gen_mode=yes +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes else - ac_have_kernel_gen_mode=no + _pkg_short_errors_supported=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_have_kernel_gen_mode" >&5 -$as_echo "$ac_have_kernel_gen_mode" >&6; } -if test "$ac_have_kernel_gen_mode" = yes; then + if test $_pkg_short_errors_supported = yes; then + SYSTEMD_INHIBIT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd-login >= 183" 2>&1` + else + SYSTEMD_INHIBIT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd-login >= 183" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$SYSTEMD_INHIBIT_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (libsystemd-login >= 183) were not met: + +$SYSTEMD_INHIBIT_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_INHIBIT_CFLAGS +and SYSTEMD_INHIBIT_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. -$as_echo "#define HAVE_KERNEL_INET6_ADDR_GEN_MODE 1" >>confdefs.h +Alternatively, you may set the environment variables SYSTEMD_INHIBIT_CFLAGS +and SYSTEMD_INHIBIT_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_INHIBIT_CFLAGS=$pkg_cv_SYSTEMD_INHIBIT_CFLAGS + SYSTEMD_INHIBIT_LIBS=$pkg_cv_SYSTEMD_INHIBIT_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } -$as_echo "#define HAVE_KERNEL_INET6_ADDR_GEN_MODE 0" >>confdefs.h +fi +else + SYSTEMD_INHIBIT_CFLAGS=$pkg_cv_SYSTEMD_INHIBIT_CFLAGS + SYSTEMD_INHIBIT_LIBS=$pkg_cv_SYSTEMD_INHIBIT_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } fi -# IPv6 tokenized identifiers support in libnl -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rtnl_link_inet6_get_token in -lnl-route-3" >&5 -$as_echo_n "checking for rtnl_link_inet6_get_token in -lnl-route-3... " >&6; } -if ${ac_cv_lib_nl_route_3_rtnl_link_inet6_get_token+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnl-route-3 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +$as_echo "#define SUSPEND_RESUME_SYSTEMD 1" >>confdefs.h -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char rtnl_link_inet6_get_token (); -int -main () -{ -return rtnl_link_inet6_get_token (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_nl_route_3_rtnl_link_inet6_get_token=yes + ;; + consolekit) + +$as_echo "#define SUSPEND_RESUME_CONSOLEKIT 1" >>confdefs.h + + ;; + *) + as_fn_error $? "--with-suspend-resume must be one of upower, systemd, consolekit" "$LINENO" 5 + ;; +esac + if test "x$with_suspend_resume" = "xupower"; then + SUSPEND_RESUME_UPOWER_TRUE= + SUSPEND_RESUME_UPOWER_FALSE='#' else - ac_cv_lib_nl_route_3_rtnl_link_inet6_get_token=no + SUSPEND_RESUME_UPOWER_TRUE='#' + SUSPEND_RESUME_UPOWER_FALSE= fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + + if test "x$with_suspend_resume" = "xsystemd"; then + SUSPEND_RESUME_SYSTEMD_TRUE= + SUSPEND_RESUME_SYSTEMD_FALSE='#' +else + SUSPEND_RESUME_SYSTEMD_TRUE='#' + SUSPEND_RESUME_SYSTEMD_FALSE= fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nl_route_3_rtnl_link_inet6_get_token" >&5 -$as_echo "$ac_cv_lib_nl_route_3_rtnl_link_inet6_get_token" >&6; } -if test "x$ac_cv_lib_nl_route_3_rtnl_link_inet6_get_token" = xyes; then : - ac_have_ipv6_token="1" + + if test "x$with_suspend_resume" = "xconsolekit"; then + SUSPEND_RESUME_CONSOLEKIT_TRUE= + SUSPEND_RESUME_CONSOLEKIT_FALSE='#' else - ac_have_ipv6_token="0" + SUSPEND_RESUME_CONSOLEKIT_TRUE='#' + SUSPEND_RESUME_CONSOLEKIT_FALSE= fi -cat >>confdefs.h <<_ACEOF -#define HAVE_LIBNL_INET6_TOKEN $ac_have_ipv6_token -_ACEOF +# SELinux support +# Check whether --with-selinux was given. +if test "${with_selinux+set}" = set; then : + withval=$with_selinux; +else + with_selinux=auto +fi -# uuid library +if test "$with_selinux" = "yes" -o "$with_selinux" = "auto"; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for UUID" >&5 -$as_echo_n "checking for UUID... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SELINUX" >&5 +$as_echo_n "checking for SELINUX... " >&6; } -if test -n "$UUID_CFLAGS"; then - pkg_cv_UUID_CFLAGS="$UUID_CFLAGS" +if test -n "$SELINUX_CFLAGS"; then + pkg_cv_SELINUX_CFLAGS="$SELINUX_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"uuid\""; } >&5 - ($PKG_CONFIG --exists --print-errors "uuid") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libselinux\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libselinux") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_UUID_CFLAGS=`$PKG_CONFIG --cflags "uuid" 2>/dev/null` + pkg_cv_SELINUX_CFLAGS=`$PKG_CONFIG --cflags "libselinux" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -22967,16 +23070,16 @@ fi else pkg_failed=untried fi -if test -n "$UUID_LIBS"; then - pkg_cv_UUID_LIBS="$UUID_LIBS" +if test -n "$SELINUX_LIBS"; then + pkg_cv_SELINUX_LIBS="$SELINUX_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"uuid\""; } >&5 - ($PKG_CONFIG --exists --print-errors "uuid") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libselinux\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libselinux") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_UUID_LIBS=`$PKG_CONFIG --libs "uuid" 2>/dev/null` + pkg_cv_SELINUX_LIBS=`$PKG_CONFIG --libs "libselinux" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -22997,234 +23100,170 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - UUID_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "uuid" 2>&1` + SELINUX_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libselinux" 2>&1` else - UUID_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "uuid" 2>&1` + SELINUX_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libselinux" 2>&1` fi # Put the nasty error message in config.log where it belongs - echo "$UUID_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements (uuid) were not met: - -$UUID_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. + echo "$SELINUX_PKG_ERRORS" >&5 -Alternatively, you may set the environment variables UUID_CFLAGS -and UUID_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details." "$LINENO" 5 + have_selinux=no 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 UUID_CFLAGS -and UUID_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; } + have_selinux=no else - UUID_CFLAGS=$pkg_cv_UUID_CFLAGS - UUID_LIBS=$pkg_cv_UUID_LIBS + SELINUX_CFLAGS=$pkg_cv_SELINUX_CFLAGS + SELINUX_LIBS=$pkg_cv_SELINUX_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - + have_selinux=yes fi +else + have_selinux=no +fi +if test "$with_selinux" = "yes" -a "$have_selinux" = "no"; then + as_fn_error $? "You must have libselinux installed to build --with-selinux=yes." "$LINENO" 5 +fi +if test "$have_selinux" = "yes"; then +$as_echo "#define HAVE_SELINUX 1" >>confdefs.h - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a readline compatible library" >&5 -$as_echo_n "checking for a readline compatible library... " >&6; } -if ${ax_cv_lib_readline+:} false; then : - $as_echo_n "(cached) " >&6 else - ORIG_LIBS="$LIBS" - for readline_lib in readline edit editline; do - # prefer ncurses since we use it for nmtui too - for termcap_lib in "" ncurses termcap curses; do - if test -z "$termcap_lib"; then - TRY_LIB="-l$readline_lib" - else - TRY_LIB="-l$readline_lib -l$termcap_lib" - fi - LIBS="$ORIG_LIBS $TRY_LIB" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +$as_echo "#define HAVE_SELINUX 0" >>confdefs.h -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char readline (); -int -main () -{ -return readline (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ax_cv_lib_readline="$TRY_LIB" fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -n "$ax_cv_lib_readline"; then - break - fi - done - if test -n "$ax_cv_lib_readline"; then - break - fi - done - LIBS="$ORIG_LIBS" +# libaudit support + +# Check whether --with-libaudit was given. +if test "${with_libaudit+set}" = set; then : + withval=$with_libaudit; +else + with_libaudit=auto fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_lib_readline" >&5 -$as_echo "$ax_cv_lib_readline" >&6; } - if test -z "$ax_cv_lib_readline"; then - as_fn_error $? "readline library with terminfo support is required (one of readline, edit, or editline, AND one of ncurses, curses, or termcap)" "$LINENO" 5 - fi +if test "$with_libaudit" = "yes" -o "$with_libaudit" = "yes-disabled-by-default" -o "$with_libaudit" = "auto"; then - ORIG_LIBS="$LIBS" - LIBS="$LIBS $ax_cv_lib_readline" - for ac_header in readline.h readline/readline.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBAUDIT" >&5 +$as_echo_n "checking for LIBAUDIT... " >&6; } +if test -n "$LIBAUDIT_CFLAGS"; then + pkg_cv_LIBAUDIT_CFLAGS="$LIBAUDIT_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"audit\""; } >&5 + ($PKG_CONFIG --exists --print-errors "audit") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBAUDIT_CFLAGS=`$PKG_CONFIG --cflags "audit" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$LIBAUDIT_LIBS"; then + pkg_cv_LIBAUDIT_LIBS="$LIBAUDIT_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"audit\""; } >&5 + ($PKG_CONFIG --exists --print-errors "audit") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBAUDIT_LIBS=`$PKG_CONFIG --libs "audit" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried fi - -done - # Check history - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readline supports history" >&5 -$as_echo_n "checking whether readline supports history... " >&6; } -if ${ax_cv_lib_readline_history+:} false; then : - $as_echo_n "(cached) " >&6 -else - ax_cv_lib_readline_history="no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char add_history (); -int -main () -{ -return add_history (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ax_cv_lib_readline_history="yes" +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + if test $_pkg_short_errors_supported = yes; then + LIBAUDIT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "audit" 2>&1` + else + LIBAUDIT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "audit" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$LIBAUDIT_PKG_ERRORS" >&5 + have_libaudit=no +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + have_libaudit=no +else + LIBAUDIT_CFLAGS=$pkg_cv_LIBAUDIT_CFLAGS + LIBAUDIT_LIBS=$pkg_cv_LIBAUDIT_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + have_libaudit=yes fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_lib_readline_history" >&5 -$as_echo "$ax_cv_lib_readline_history" >&6; } - if test "$ax_cv_lib_readline_history" != "yes"; then - as_fn_error $? "readline history support is required" "$LINENO" 5 - fi - for ac_header in history.h readline/history.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - + if test "$with_libaudit" != "auto" -a "$have_libaudit" = "no"; then + as_fn_error $? "You must have libaudit installed to build --with-libaudit=$with_libaudit." "$LINENO" 5 + fi +else + have_libaudit=no fi +if test "$have_libaudit" = "yes"; then -done +$as_echo "#define HAVE_LIBAUDIT 1" >>confdefs.h + + if test "$with_libaudit" = "yes-disabled-by-default"; then + +$as_echo "#define NM_CONFIG_DEFAULT_LOGGING_AUDIT FALSE" >>confdefs.h + + NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT='false' + else +$as_echo "#define NM_CONFIG_DEFAULT_LOGGING_AUDIT TRUE" >>confdefs.h - # check rl_echo_signal_char() - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readline supports rl_echo_signal_char()" >&5 -$as_echo_n "checking whether readline supports rl_echo_signal_char()... " >&6; } -if ${ax_cv_lib_readline_echo_signal_char+:} false; then : - $as_echo_n "(cached) " >&6 + NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT='true' + fi else - ax_cv_lib_readline_echo_signal_char="no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char rl_echo_signal_char (); -int -main () -{ -return rl_echo_signal_char (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ax_cv_lib_readline_echo_signal_char="yes" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +$as_echo "#define HAVE_LIBAUDIT 0" >>confdefs.h -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_lib_readline_echo_signal_char" >&5 -$as_echo "$ax_cv_lib_readline_echo_signal_char" >&6; } - if test "$ax_cv_lib_readline_echo_signal_char" != "yes"; then - as_fn_error $? "rl_echo_signal_char() is required (install readline6?)" "$LINENO" 5 - fi - LIBS="$ORIG_LIBS" - READLINE_LIBS="$ax_cv_lib_readline" +$as_echo "#define NM_CONFIG_DEFAULT_LOGGING_AUDIT FALSE" >>confdefs.h + NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT='false' +fi -# Intel WiMAX SDK checks +# libnl support for the linux platform pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for IWMX_SDK" >&5 -$as_echo_n "checking for IWMX_SDK... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBNL" >&5 +$as_echo_n "checking for LIBNL... " >&6; } -if test -n "$IWMX_SDK_CFLAGS"; then - pkg_cv_IWMX_SDK_CFLAGS="$IWMX_SDK_CFLAGS" +if test -n "$LIBNL_CFLAGS"; then + pkg_cv_LIBNL_CFLAGS="$LIBNL_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libiWmxSdk-0 >= 1.5.1\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libiWmxSdk-0 >= 1.5.1") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnl-3.0 >= 3.2.8\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libnl-3.0 >= 3.2.8") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_IWMX_SDK_CFLAGS=`$PKG_CONFIG --cflags "libiWmxSdk-0 >= 1.5.1" 2>/dev/null` + pkg_cv_LIBNL_CFLAGS=`$PKG_CONFIG --cflags "libnl-3.0 >= 3.2.8" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -23232,16 +23271,16 @@ fi else pkg_failed=untried fi -if test -n "$IWMX_SDK_LIBS"; then - pkg_cv_IWMX_SDK_LIBS="$IWMX_SDK_LIBS" +if test -n "$LIBNL_LIBS"; then + pkg_cv_LIBNL_LIBS="$LIBNL_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libiWmxSdk-0 >= 1.5.1\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libiWmxSdk-0 >= 1.5.1") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnl-3.0 >= 3.2.8\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libnl-3.0 >= 3.2.8") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_IWMX_SDK_LIBS=`$PKG_CONFIG --libs "libiWmxSdk-0 >= 1.5.1" 2>/dev/null` + pkg_cv_LIBNL_LIBS=`$PKG_CONFIG --libs "libnl-3.0 >= 3.2.8" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -23262,63 +23301,138 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - IWMX_SDK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libiWmxSdk-0 >= 1.5.1" 2>&1` + LIBNL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libnl-3.0 >= 3.2.8" 2>&1` else - IWMX_SDK_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libiWmxSdk-0 >= 1.5.1" 2>&1` + LIBNL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libnl-3.0 >= 3.2.8" 2>&1` fi # Put the nasty error message in config.log where it belongs - echo "$IWMX_SDK_PKG_ERRORS" >&5 + echo "$LIBNL_PKG_ERRORS" >&5 - have_wimax=no + as_fn_error $? "Package requirements (libnl-3.0 >= 3.2.8) were not met: + +$LIBNL_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 LIBNL_CFLAGS +and LIBNL_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; } - have_wimax=no + { { $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 LIBNL_CFLAGS +and LIBNL_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 - IWMX_SDK_CFLAGS=$pkg_cv_IWMX_SDK_CFLAGS - IWMX_SDK_LIBS=$pkg_cv_IWMX_SDK_LIBS + LIBNL_CFLAGS=$pkg_cv_LIBNL_CFLAGS + LIBNL_LIBS=$pkg_cv_LIBNL_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - have_wimax=yes + +fi + +# uuid library + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for UUID" >&5 +$as_echo_n "checking for UUID... " >&6; } + +if test -n "$UUID_CFLAGS"; then + pkg_cv_UUID_CFLAGS="$UUID_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"uuid\""; } >&5 + ($PKG_CONFIG --exists --print-errors "uuid") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_UUID_CFLAGS=`$PKG_CONFIG --cflags "uuid" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried fi -# Check whether --enable-wimax was given. -if test "${enable_wimax+set}" = set; then : - enableval=$enable_wimax; enable_wimax=${enableval} +if test -n "$UUID_LIBS"; then + pkg_cv_UUID_LIBS="$UUID_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"uuid\""; } >&5 + ($PKG_CONFIG --exists --print-errors "uuid") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_UUID_LIBS=`$PKG_CONFIG --libs "uuid" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes else - enable_wimax=${have_wimax} + pkg_failed=yes +fi + else + pkg_failed=untried fi -if (test "${enable_wimax}" = "yes"); then - if test x"$have_wimax" = x"no"; then - as_fn_error $? "Intel WiMAX SDK is required" "$LINENO" 5 - fi - # Ensure the WiMAX stack is built with libnl3; otherwise crashes happen - # due to symbol conflicts - WMX_LIB_PATH=`$PKG_CONFIG --variable=libdir libiWmxSdk-0` - FOO=`ldd $WMX_LIB_PATH/libiWmxSdk.so.0.0.0 | grep libnl-3 2>&1` - if test "$?" != "0"; then - as_fn_error $? "Intel WiMAX stack built with incompatible libnl version!" "$LINENO" 5 - 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 + UUID_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "uuid" 2>&1` + else + UUID_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "uuid" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$UUID_PKG_ERRORS" >&5 + as_fn_error $? "Package requirements (uuid) were not met: +$UUID_PKG_ERRORS -$as_echo "#define WITH_WIMAX 1" >>confdefs.h +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. -else +Alternatively, you may set the environment variables UUID_CFLAGS +and UUID_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. -$as_echo "#define WITH_WIMAX 0" >>confdefs.h +Alternatively, you may set the environment variables UUID_CFLAGS +and UUID_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. -fi - if test "${enable_wimax}" = "yes"; then - WITH_WIMAX_TRUE= - WITH_WIMAX_FALSE='#' +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } else - WITH_WIMAX_TRUE='#' - WITH_WIMAX_FALSE= -fi + UUID_CFLAGS=$pkg_cv_UUID_CFLAGS + UUID_LIBS=$pkg_cv_UUID_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi # Teamd control checks @@ -23403,9 +23517,6 @@ if (test "${enable_teamdctl}" = "yes"); then if test x"$have_teamdctl" = x"no"; then as_fn_error $? "Teamd control is required" "$LINENO" 5 fi - - - # temporary bug workaround LIBTEAMDCTL_CFLAGS=`echo $LIBTEAMDCTL_CFLAGS | sed -e 's:/teamdctl.h::'` @@ -23543,9 +23654,6 @@ if (test "${enable_polkit_agent}" = "yes"); then as_fn_error $? "Polkit agent is required" "$LINENO" 5 fi - - - $as_echo "#define WITH_POLKIT_AGENT 1" >>confdefs.h else @@ -23685,8 +23793,6 @@ fi fi - - $as_echo "#define HAVE_NSS 1" >>confdefs.h with_nss=yes @@ -23700,12 +23806,12 @@ if test -n "$GNUTLS_CFLAGS"; then pkg_cv_GNUTLS_CFLAGS="$GNUTLS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls >= 1.2\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gnutls >= 1.2") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls >= 2.12\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gnutls >= 2.12") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_GNUTLS_CFLAGS=`$PKG_CONFIG --cflags "gnutls >= 1.2" 2>/dev/null` + pkg_cv_GNUTLS_CFLAGS=`$PKG_CONFIG --cflags "gnutls >= 2.12" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -23717,12 +23823,12 @@ if test -n "$GNUTLS_LIBS"; then pkg_cv_GNUTLS_LIBS="$GNUTLS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls >= 1.2\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gnutls >= 1.2") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls >= 2.12\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gnutls >= 2.12") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_GNUTLS_LIBS=`$PKG_CONFIG --libs "gnutls >= 1.2" 2>/dev/null` + pkg_cv_GNUTLS_LIBS=`$PKG_CONFIG --libs "gnutls >= 2.12" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -23743,14 +23849,14 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - GNUTLS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gnutls >= 1.2" 2>&1` + GNUTLS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gnutls >= 2.12" 2>&1` else - GNUTLS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gnutls >= 1.2" 2>&1` + GNUTLS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gnutls >= 2.12" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GNUTLS_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (gnutls >= 1.2) were not met: + as_fn_error $? "Package requirements (gnutls >= 2.12) were not met: $GNUTLS_PKG_ERRORS @@ -23782,59 +23888,10 @@ else $as_echo "yes" >&6; } fi - # Extract the first word of "libgcrypt-config", so it can be a program name with args. -set dummy libgcrypt-config; 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_path_LIBGCRYPT_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $LIBGCRYPT_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_LIBGCRYPT_CONFIG="$LIBGCRYPT_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_LIBGCRYPT_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $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 - - test -z "$ac_cv_path_LIBGCRYPT_CONFIG" && ac_cv_path_LIBGCRYPT_CONFIG="no" - ;; -esac -fi -LIBGCRYPT_CONFIG=$ac_cv_path_LIBGCRYPT_CONFIG -if test -n "$LIBGCRYPT_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBGCRYPT_CONFIG" >&5 -$as_echo "$LIBGCRYPT_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test x"$LIBGCRYPT_CONFIG" = xno; then - as_fn_error $? "gnutls explicitly requested but gcrypt not found on system" "$LINENO" 5 - else $as_echo "#define HAVE_GNUTLS 1" >>confdefs.h - LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags` - LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs` - - - with_gnutls=yes - fi + with_gnutls=yes else as_fn_error $? "Please choose either 'nss' or 'gnutls' for certificate and crypto operations" "$LINENO" 5 fi @@ -23938,79 +23995,21 @@ fi # Check whether --with-pppd was given. -if test "${with_pppd+set}" = set; then : - withval=$with_pppd; -fi - -if test "x${with_pppd}" = x; then - # Extract the first word of "pppd", so it can be a program name with args. -set dummy pppd; 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_path_PPPD_PATH+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PPPD_PATH in - [\\/]* | ?:[\\/]*) - ac_cv_path_PPPD_PATH="$PPPD_PATH" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="$PATH:/sbin:/usr/sbin" -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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PPPD_PATH="$as_dir/$ac_word$ac_exec_ext" - $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 - - ;; -esac -fi -PPPD_PATH=$ac_cv_path_PPPD_PATH -if test -n "$PPPD_PATH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PPPD_PATH" >&5 -$as_echo "$PPPD_PATH" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -else - PPPD_PATH="$with_pppd" -fi - -cat >>confdefs.h <<_ACEOF -#define PPPD_PATH "$PPPD_PATH" -_ACEOF - - - - -# Check whether --with-pppoe was given. -if test "${with_pppoe+set}" = set; then : - withval=$with_pppoe; +if test "${with_pppd+set}" = set; then : + withval=$with_pppd; fi -if test "x${with_pppoe}" = x; then - # Extract the first word of "pppoe", so it can be a program name with args. -set dummy pppoe; ac_word=$2 +if test "x${with_pppd}" = x; then + # Extract the first word of "pppd", so it can be a program name with args. +set dummy pppd; 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_path_PPPOE_PATH+:} false; then : +if ${ac_cv_path_PPPD_PATH+:} false; then : $as_echo_n "(cached) " >&6 else - case $PPPOE_PATH in + case $PPPD_PATH in [\\/]* | ?:[\\/]*) - ac_cv_path_PPPOE_PATH="$PPPOE_PATH" # Let the user override the test with a path. + ac_cv_path_PPPD_PATH="$PPPD_PATH" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -24021,7 +24020,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PPPOE_PATH="$as_dir/$ac_word$ac_exec_ext" + ac_cv_path_PPPD_PATH="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -24032,10 +24031,10 @@ IFS=$as_save_IFS ;; esac fi -PPPOE_PATH=$ac_cv_path_PPPOE_PATH -if test -n "$PPPOE_PATH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PPPOE_PATH" >&5 -$as_echo "$PPPOE_PATH" >&6; } +PPPD_PATH=$ac_cv_path_PPPD_PATH +if test -n "$PPPD_PATH"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PPPD_PATH" >&5 +$as_echo "$PPPD_PATH" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -24043,11 +24042,11 @@ fi else - PPPOE_PATH="$with_pppoe" + PPPD_PATH="$with_pppd" fi cat >>confdefs.h <<_ACEOF -#define PPPOE_PATH "$PPPOE_PATH" +#define PPPD_PATH "$PPPD_PATH" _ACEOF @@ -24134,8 +24133,6 @@ $as_echo "yes" >&6; } have_libmm_glib=yes fi - - if (test "${have_libmm_glib}" = "no"); then if (test "${with_modem_manager_1}" = "yes"); then as_fn_error $? "Couldn't find libmm-glib" "$LINENO" 5 @@ -24710,6 +24707,66 @@ _ACEOF +# dnssec-trigger-script path + +# Check whether --with-dnssec_trigger was given. +if test "${with_dnssec_trigger+set}" = set; then : + withval=$with_dnssec_trigger; +fi + +if test "x${with_dnssec_trigger}" = x; then + # Extract the first word of "dnssec-trigger-script", so it can be a program name with args. +set dummy dnssec-trigger-script; 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_path_DNSSEC_TRIGGER_SCRIPT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $DNSSEC_TRIGGER_SCRIPT in + [\\/]* | ?:[\\/]*) + ac_cv_path_DNSSEC_TRIGGER_SCRIPT="$DNSSEC_TRIGGER_SCRIPT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="/usr/local/libexec:/usr/local/lib:/usr/local/lib/dnssec-trigger:/usr/libexec:/usr/lib:/usr/lib/dnssec-trigger" +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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_DNSSEC_TRIGGER_SCRIPT="$as_dir/$ac_word$ac_exec_ext" + $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 + + test -z "$ac_cv_path_DNSSEC_TRIGGER_SCRIPT" && ac_cv_path_DNSSEC_TRIGGER_SCRIPT="/usr/libexec/dnssec-trigger-script" + ;; +esac +fi +DNSSEC_TRIGGER_SCRIPT=$ac_cv_path_DNSSEC_TRIGGER_SCRIPT +if test -n "$DNSSEC_TRIGGER_SCRIPT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DNSSEC_TRIGGER_SCRIPT" >&5 +$as_echo "$DNSSEC_TRIGGER_SCRIPT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +else + DNSSEC_TRIGGER_SCRIPT="$with_dnssec_trigger" +fi + +cat >>confdefs.h <<_ACEOF +#define DNSSEC_TRIGGER_SCRIPT "$DNSSEC_TRIGGER_SCRIPT" +_ACEOF + + + # system CA certificates path # Check whether --with-system-ca-path was given. @@ -24862,8 +24919,6 @@ if (test "${enable_concheck}" = "yes"); then as_fn_error $? "Connectivity checking requires libsoup" "$LINENO" 5 fi - - $as_echo "#define WITH_CONCHECK 1" >>confdefs.h else @@ -24973,6 +25028,195 @@ $as_echo "yes" >&6; } fi +# Check whether --with-nmcli was given. +if test "${with_nmcli+set}" = set; then : + withval=$with_nmcli; +fi + +if test "$with_nmcli" != no; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a readline compatible library" >&5 +$as_echo_n "checking for a readline compatible library... " >&6; } +if ${ax_cv_lib_readline+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ORIG_LIBS="$LIBS" + for readline_lib in readline edit editline; do + # prefer ncurses since we use it for nmtui too + for termcap_lib in "" ncurses termcap curses; do + if test -z "$termcap_lib"; then + TRY_LIB="-l$readline_lib" + else + TRY_LIB="-l$readline_lib -l$termcap_lib" + fi + LIBS="$ORIG_LIBS $TRY_LIB" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char readline (); +int +main () +{ +return readline (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_cv_lib_readline="$TRY_LIB" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -n "$ax_cv_lib_readline"; then + break + fi + done + if test -n "$ax_cv_lib_readline"; then + break + fi + done + LIBS="$ORIG_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_lib_readline" >&5 +$as_echo "$ax_cv_lib_readline" >&6; } + + if test -z "$ax_cv_lib_readline"; then + as_fn_error $? "readline library with terminfo support is required (one of readline, edit, or editline, AND one of ncurses, curses, or termcap)" "$LINENO" 5 + fi + + ORIG_LIBS="$LIBS" + LIBS="$LIBS $ax_cv_lib_readline" + for ac_header in readline.h readline/readline.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + # Check history + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readline supports history" >&5 +$as_echo_n "checking whether readline supports history... " >&6; } +if ${ax_cv_lib_readline_history+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_cv_lib_readline_history="no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char add_history (); +int +main () +{ +return add_history (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_cv_lib_readline_history="yes" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_lib_readline_history" >&5 +$as_echo "$ax_cv_lib_readline_history" >&6; } + if test "$ax_cv_lib_readline_history" != "yes"; then + as_fn_error $? "readline history support is required" "$LINENO" 5 + fi + for ac_header in history.h readline/history.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + # check rl_echo_signal_char() + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readline supports rl_echo_signal_char()" >&5 +$as_echo_n "checking whether readline supports rl_echo_signal_char()... " >&6; } +if ${ax_cv_lib_readline_echo_signal_char+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_cv_lib_readline_echo_signal_char="no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char rl_echo_signal_char (); +int +main () +{ +return rl_echo_signal_char (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_cv_lib_readline_echo_signal_char="yes" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_lib_readline_echo_signal_char" >&5 +$as_echo "$ax_cv_lib_readline_echo_signal_char" >&6; } + if test "$ax_cv_lib_readline_echo_signal_char" != "yes"; then + as_fn_error $? "rl_echo_signal_char() is required (install readline6?)" "$LINENO" 5 + fi + + LIBS="$ORIG_LIBS" + READLINE_LIBS="$ax_cv_lib_readline" + + + build_nmcli=yes +else + build_nmcli=no +fi + if test "$build_nmcli" = yes; then + BUILD_NMCLI_TRUE= + BUILD_NMCLI_FALSE='#' +else + BUILD_NMCLI_TRUE='#' + BUILD_NMCLI_FALSE= +fi + + + # Check whether --with-nmtui was given. if test "${with_nmtui+set}" = set; then : withval=$with_nmtui; @@ -25405,12 +25649,29 @@ if test "${enable_more_asserts+set}" = set; then : enableval=$enable_more_asserts; fi +more_asserts=0 if test "${enable_more_asserts}" = "yes"; then + more_asserts=100 +fi -$as_echo "#define NM_MORE_ASSERTS 1" >>confdefs.h +# Check whether --with-more-asserts was given. +if test "${with_more_asserts+set}" = set; then : + withval=$with_more_asserts; more_asserts=${with_more_asserts} +fi +if test "${more_asserts}" = "no"; then + more_asserts=0 +else + if test "${more_asserts}" = "yes"; then + more_asserts=100 + fi fi +cat >>confdefs.h <<_ACEOF +#define NM_MORE_ASSERTS $more_asserts +_ACEOF + + # Check whether --enable-more-logging was given. if test "${enable_more_logging+set}" = set; then : enableval=$enable_more_logging; @@ -26295,7 +26556,7 @@ fi -ac_config_files="$ac_config_files Makefile include/Makefile include/nm-version-macros.h src/Makefile src/tests/Makefile src/tests/config/Makefile src/dhcp-manager/Makefile src/dhcp-manager/tests/Makefile src/dnsmasq-manager/tests/Makefile src/supplicant-manager/tests/Makefile src/supplicant-manager/tests/certs/Makefile src/ppp-manager/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/ibft/Makefile src/settings/plugins/ibft/tests/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/plugins/example/Makefile src/platform/Makefile src/platform/tests/Makefile src/rdisc/Makefile src/rdisc/tests/Makefile src/devices/adsl/Makefile src/devices/wimax/Makefile src/devices/bluetooth/Makefile src/devices/team/Makefile src/devices/wifi/Makefile src/devices/wifi/tests/Makefile src/devices/wwan/Makefile libnm-core/Makefile libnm-core/tests/Makefile libnm/libnm.pc libnm/Makefile libnm/tests/Makefile libnm-util/libnm-util.pc libnm-util/Makefile libnm-util/tests/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 clients/Makefile clients/cli/Makefile clients/tui/Makefile clients/tui/newt/Makefile initscript/RedHat/NetworkManager initscript/Debian/NetworkManager initscript/Slackware/rc.networkmanager initscript/SUSE/networkmanager initscript/Arch/networkmanager initscript/Mandriva/networkmanager initscript/linexa/networkmanager introspection/Makefile introspection/all.xml man/Makefile man/NetworkManager.conf.xml man/nm-system-settings.conf.5 man/nm-online.1 man/nmcli.1 man/nmtui.1 po/Makefile.in policy/Makefile policy/org.freedesktop.NetworkManager.policy.in data/Makefile docs/Makefile docs/api/Makefile docs/api/version.xml docs/libnm-glib/Makefile docs/libnm-glib/version.xml docs/libnm-util/Makefile docs/libnm-util/version.xml docs/libnm/Makefile docs/libnm/version.xml NetworkManager.pc examples/Makefile examples/shell/Makefile examples/python/Makefile examples/python/dbus/Makefile examples/python/gi/Makefile examples/ruby/Makefile examples/C/Makefile examples/C/glib/Makefile examples/C/qt/Makefile examples/dispatcher/Makefile vapi/Makefile" +ac_config_files="$ac_config_files Makefile shared/Makefile shared/nm-version-macros.h src/Makefile src/tests/Makefile src/tests/config/Makefile src/dhcp-manager/Makefile src/dhcp-manager/tests/Makefile src/dnsmasq-manager/tests/Makefile src/supplicant-manager/tests/Makefile src/supplicant-manager/tests/certs/Makefile src/ppp-manager/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/ibft/Makefile src/settings/plugins/ibft/tests/Makefile src/settings/plugins/keyfile/Makefile src/settings/plugins/keyfile/tests/Makefile src/settings/plugins/keyfile/tests/keyfiles/Makefile src/platform/Makefile src/platform/tests/Makefile src/rdisc/Makefile src/rdisc/tests/Makefile src/devices/Makefile src/devices/tests/Makefile src/devices/adsl/Makefile src/devices/bluetooth/Makefile src/devices/team/Makefile src/devices/wifi/Makefile src/devices/wifi/tests/Makefile src/devices/wwan/Makefile libnm-core/Makefile libnm-core/tests/Makefile libnm/libnm.pc libnm/Makefile libnm/tests/Makefile libnm-util/libnm-util.pc libnm-util/Makefile libnm-util/tests/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 clients/Makefile clients/cli/Makefile clients/tui/Makefile clients/tui/newt/Makefile introspection/Makefile introspection/all.xml man/Makefile man/nm-system-settings.conf.5 man/nm-online.1 man/nmcli.1 man/nmtui.1 po/Makefile.in policy/Makefile policy/org.freedesktop.NetworkManager.policy.in data/Makefile docs/Makefile docs/api/Makefile docs/api/version.xml docs/libnm-glib/Makefile docs/libnm-glib/version.xml docs/libnm-util/Makefile docs/libnm-util/version.xml docs/libnm/Makefile docs/libnm/version.xml NetworkManager.pc examples/Makefile examples/shell/Makefile examples/python/Makefile examples/python/dbus/Makefile examples/python/gi/Makefile examples/python/python-networkmanager/Makefile examples/ruby/Makefile examples/lua/Makefile examples/lua/lgi/Makefile examples/C/Makefile examples/C/glib/Makefile examples/C/qt/Makefile examples/dispatcher/Makefile vapi/Makefile" @@ -26459,10 +26720,6 @@ if test -z "${CONFIG_PLUGIN_IFCFG_RH_TRUE}" && test -z "${CONFIG_PLUGIN_IFCFG_RH as_fn_error $? "conditional \"CONFIG_PLUGIN_IFCFG_RH\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${CONFIG_PLUGIN_IFCFG_SUSE_TRUE}" && test -z "${CONFIG_PLUGIN_IFCFG_SUSE_FALSE}"; then - as_fn_error $? "conditional \"CONFIG_PLUGIN_IFCFG_SUSE\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${CONFIG_PLUGIN_IFUPDOWN_TRUE}" && test -z "${CONFIG_PLUGIN_IFUPDOWN_FALSE}"; then as_fn_error $? "conditional \"CONFIG_PLUGIN_IFUPDOWN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -26483,8 +26740,8 @@ 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_DBUS_GLIB_100_TRUE}" && test -z "${HAVE_DBUS_GLIB_100_FALSE}"; then - as_fn_error $? "conditional \"HAVE_DBUS_GLIB_100\" was never defined. +if test -z "${WITH_LEGACY_LIBRARIES_TRUE}" && test -z "${WITH_LEGACY_LIBRARIES_FALSE}"; then + as_fn_error $? "conditional \"WITH_LEGACY_LIBRARIES\" 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 @@ -26507,14 +26764,6 @@ if test -z "${HAVE_SYSTEMD_200_TRUE}" && test -z "${HAVE_SYSTEMD_200_FALSE}"; th as_fn_error $? "conditional \"HAVE_SYSTEMD_200\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -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 "${SUSPEND_RESUME_UPOWER_TRUE}" && test -z "${SUSPEND_RESUME_UPOWER_FALSE}"; then as_fn_error $? "conditional \"SUSPEND_RESUME_UPOWER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -26523,12 +26772,8 @@ if test -z "${SUSPEND_RESUME_SYSTEMD_TRUE}" && test -z "${SUSPEND_RESUME_SYSTEMD as_fn_error $? "conditional \"SUSPEND_RESUME_SYSTEMD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${HAVE_SELINUX_TRUE}" && test -z "${HAVE_SELINUX_FALSE}"; then - as_fn_error $? "conditional \"HAVE_SELINUX\" 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 - as_fn_error $? "conditional \"WITH_WIMAX\" was never defined. +if test -z "${SUSPEND_RESUME_CONSOLEKIT_TRUE}" && test -z "${SUSPEND_RESUME_CONSOLEKIT_FALSE}"; then + as_fn_error $? "conditional \"SUSPEND_RESUME_CONSOLEKIT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_TEAMDCTL_TRUE}" && test -z "${WITH_TEAMDCTL_FALSE}"; then @@ -26567,6 +26812,10 @@ 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 "${BUILD_NMCLI_TRUE}" && test -z "${BUILD_NMCLI_FALSE}"; then + as_fn_error $? "conditional \"BUILD_NMCLI\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${BUILD_NMTUI_TRUE}" && test -z "${BUILD_NMTUI_FALSE}"; then as_fn_error $? "conditional \"BUILD_NMTUI\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -27020,7 +27269,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 1.0.10, which was +This file was extended by NetworkManager $as_me 1.1.90, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -27086,7 +27335,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 1.0.10 +NetworkManager config.status 1.1.90 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -27608,8 +27857,8 @@ do "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; - "include/nm-version-macros.h") CONFIG_FILES="$CONFIG_FILES include/nm-version-macros.h" ;; + "shared/Makefile") CONFIG_FILES="$CONFIG_FILES shared/Makefile" ;; + "shared/nm-version-macros.h") CONFIG_FILES="$CONFIG_FILES shared/nm-version-macros.h" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/tests/Makefile") CONFIG_FILES="$CONFIG_FILES src/tests/Makefile" ;; "src/tests/config/Makefile") CONFIG_FILES="$CONFIG_FILES src/tests/config/Makefile" ;; @@ -27629,17 +27878,16 @@ do "src/settings/plugins/ifcfg-rh/tests/network-scripts/Makefile") CONFIG_FILES="$CONFIG_FILES src/settings/plugins/ifcfg-rh/tests/network-scripts/Makefile" ;; "src/settings/plugins/ibft/Makefile") CONFIG_FILES="$CONFIG_FILES src/settings/plugins/ibft/Makefile" ;; "src/settings/plugins/ibft/tests/Makefile") CONFIG_FILES="$CONFIG_FILES src/settings/plugins/ibft/tests/Makefile" ;; - "src/settings/plugins/ifcfg-suse/Makefile") CONFIG_FILES="$CONFIG_FILES src/settings/plugins/ifcfg-suse/Makefile" ;; "src/settings/plugins/keyfile/Makefile") CONFIG_FILES="$CONFIG_FILES src/settings/plugins/keyfile/Makefile" ;; "src/settings/plugins/keyfile/tests/Makefile") CONFIG_FILES="$CONFIG_FILES src/settings/plugins/keyfile/tests/Makefile" ;; "src/settings/plugins/keyfile/tests/keyfiles/Makefile") CONFIG_FILES="$CONFIG_FILES src/settings/plugins/keyfile/tests/keyfiles/Makefile" ;; - "src/settings/plugins/example/Makefile") CONFIG_FILES="$CONFIG_FILES src/settings/plugins/example/Makefile" ;; "src/platform/Makefile") CONFIG_FILES="$CONFIG_FILES src/platform/Makefile" ;; "src/platform/tests/Makefile") CONFIG_FILES="$CONFIG_FILES src/platform/tests/Makefile" ;; "src/rdisc/Makefile") CONFIG_FILES="$CONFIG_FILES src/rdisc/Makefile" ;; "src/rdisc/tests/Makefile") CONFIG_FILES="$CONFIG_FILES src/rdisc/tests/Makefile" ;; + "src/devices/Makefile") CONFIG_FILES="$CONFIG_FILES src/devices/Makefile" ;; + "src/devices/tests/Makefile") CONFIG_FILES="$CONFIG_FILES src/devices/tests/Makefile" ;; "src/devices/adsl/Makefile") CONFIG_FILES="$CONFIG_FILES src/devices/adsl/Makefile" ;; - "src/devices/wimax/Makefile") CONFIG_FILES="$CONFIG_FILES src/devices/wimax/Makefile" ;; "src/devices/bluetooth/Makefile") CONFIG_FILES="$CONFIG_FILES src/devices/bluetooth/Makefile" ;; "src/devices/team/Makefile") CONFIG_FILES="$CONFIG_FILES src/devices/team/Makefile" ;; "src/devices/wifi/Makefile") CONFIG_FILES="$CONFIG_FILES src/devices/wifi/Makefile" ;; @@ -27664,17 +27912,9 @@ do "clients/cli/Makefile") CONFIG_FILES="$CONFIG_FILES clients/cli/Makefile" ;; "clients/tui/Makefile") CONFIG_FILES="$CONFIG_FILES clients/tui/Makefile" ;; "clients/tui/newt/Makefile") CONFIG_FILES="$CONFIG_FILES clients/tui/newt/Makefile" ;; - "initscript/RedHat/NetworkManager") CONFIG_FILES="$CONFIG_FILES initscript/RedHat/NetworkManager" ;; - "initscript/Debian/NetworkManager") CONFIG_FILES="$CONFIG_FILES initscript/Debian/NetworkManager" ;; - "initscript/Slackware/rc.networkmanager") CONFIG_FILES="$CONFIG_FILES initscript/Slackware/rc.networkmanager" ;; - "initscript/SUSE/networkmanager") CONFIG_FILES="$CONFIG_FILES initscript/SUSE/networkmanager" ;; - "initscript/Arch/networkmanager") CONFIG_FILES="$CONFIG_FILES initscript/Arch/networkmanager" ;; - "initscript/Mandriva/networkmanager") CONFIG_FILES="$CONFIG_FILES initscript/Mandriva/networkmanager" ;; - "initscript/linexa/networkmanager") CONFIG_FILES="$CONFIG_FILES initscript/linexa/networkmanager" ;; "introspection/Makefile") CONFIG_FILES="$CONFIG_FILES introspection/Makefile" ;; "introspection/all.xml") CONFIG_FILES="$CONFIG_FILES introspection/all.xml" ;; "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; - "man/NetworkManager.conf.xml") CONFIG_FILES="$CONFIG_FILES man/NetworkManager.conf.xml" ;; "man/nm-system-settings.conf.5") CONFIG_FILES="$CONFIG_FILES man/nm-system-settings.conf.5" ;; "man/nm-online.1") CONFIG_FILES="$CONFIG_FILES man/nm-online.1" ;; "man/nmcli.1") CONFIG_FILES="$CONFIG_FILES man/nmcli.1" ;; @@ -27698,7 +27938,10 @@ do "examples/python/Makefile") CONFIG_FILES="$CONFIG_FILES examples/python/Makefile" ;; "examples/python/dbus/Makefile") CONFIG_FILES="$CONFIG_FILES examples/python/dbus/Makefile" ;; "examples/python/gi/Makefile") CONFIG_FILES="$CONFIG_FILES examples/python/gi/Makefile" ;; + "examples/python/python-networkmanager/Makefile") CONFIG_FILES="$CONFIG_FILES examples/python/python-networkmanager/Makefile" ;; "examples/ruby/Makefile") CONFIG_FILES="$CONFIG_FILES examples/ruby/Makefile" ;; + "examples/lua/Makefile") CONFIG_FILES="$CONFIG_FILES examples/lua/Makefile" ;; + "examples/lua/lgi/Makefile") CONFIG_FILES="$CONFIG_FILES examples/lua/lgi/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" ;; @@ -29428,42 +29671,46 @@ echo " exec_prefix: $exec_prefix" echo " systemdunitdir: $with_systemdsystemunitdir" echo " nmbinary: $nmbinary" echo " nmconfdir: $nmconfdir" +echo " nmlibdir: $nmlibdir" echo " nmdatadir: $nmdatadir" echo " nmstatedir: $nmstatedir" echo " nmrundir: $nmrundir" echo echo "Platform:" -echo " session tracking: $with_session_tracking" +echo " session tracking: $session_tracking" echo " suspend/resume: $with_suspend_resume" if test "${enable_polkit}" = "yes"; then if test "${enable_modify_system}" = "yes"; then - echo " policykit: yes (permissive modify.system) (default=${enable_polkit})" + echo " policykit: yes (permissive modify.system) (default: main.auth-polkit=${enable_polkit})" else - echo " policykit: yes (restrictive modify.system) (default=${enable_polkit})" + echo " policykit: yes (restrictive modify.system) (default: main.auth-polkit=${enable_polkit})" fi else echo " policykit: no" fi echo " polkit agent: ${enable_polkit_agent}" echo " selinux: $have_selinux" +echo " systemd-journald: $have_systemd_journal (default: logging.backend=${nm_config_logging_backend_default})" +echo " hostname persist: ${hostname_persist}" +echo " libaudit: $have_libaudit (default: logging.audit=${NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT})" echo echo "Features:" echo " wext: $ac_with_wext" echo " wifi: $enable_wifi" -echo " wimax: $enable_wimax" echo " ppp: $enable_ppp" echo " modemmanager-1: $with_modem_manager_1" echo " concheck: $enable_concheck" echo " libteamdctl: $enable_teamdctl" +echo " libnm-glib: $with_libnm_glib" +echo " nmcli: $build_nmcli" echo " nmtui: $build_nmtui" echo echo "Configuration plugins (main.plugins=${config_plugins_default})" echo " ibft: ${enable_config_plugin_ibft}" echo " ifcfg-rh: ${enable_ifcfg_rh}" -echo " ifcfg-suse: ${enable_ifcfg_suse}" echo " ifupdown: ${enable_ifupdown}" echo " ifnet: ${enable_ifnet}" echo @@ -29481,6 +29728,7 @@ echo echo "Miscellaneous:" echo " documentation: $enable_gtk_doc" echo " tests: $enable_tests" +echo " more-asserts: $more_asserts" echo " valgrind: $with_valgrind $with_valgrind_suppressions" echo " code coverage: $enable_code_coverage" echo " LTO: $enable_lto" diff --git a/configure.ac b/configure.ac index 1ed69354..6da64157 100644 --- a/configure.ac +++ b/configure.ac @@ -2,8 +2,8 @@ AC_PREREQ([2.63]) dnl The NM version number m4_define([nm_major_version], [1]) -m4_define([nm_minor_version], [0]) -m4_define([nm_micro_version], [10]) +m4_define([nm_minor_version], [1]) +m4_define([nm_micro_version], [90]) m4_define([nm_version], [nm_major_version.nm_minor_version.nm_micro_version]) m4_define([nm_git_sha], [m4_esyscmd([ ( [ -d ./.git/ ] && [ "$(readlink -f ./.git/)" = "$(readlink -f "$(git rev-parse --git-dir 2>/dev/null)" 2>/dev/null)" ] && git rev-parse --verify -q HEAD 2>/dev/null ) || true ])]) @@ -17,7 +17,7 @@ AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR([build-aux]) AC_REQUIRE_AUX_FILE([tap-driver.sh]) -AM_INIT_AUTOMAKE(1.12 tar-ustar no-dist-gzip dist-bzip2 -Wno-portability) dnl NB: Do not [quote] this parameter. +AM_INIT_AUTOMAKE(1.12 tar-ustar no-dist-gzip dist-xz -Wno-portability) dnl NB: Do not [quote] this parameter. AM_MAINTAINER_MODE([enable]) AM_SILENT_RULES([yes]) @@ -33,6 +33,8 @@ AM_PROG_CC_C_O # C++ only required if --enable-qt=yes AC_PROG_CXX +AC_PROG_LN_S + dnl Initialize libtool LT_PREREQ([2.2]) LT_INIT([disable-static]) @@ -53,6 +55,7 @@ dnl dnl Checks for typedefs, structures, and compiler characteristics. dnl AC_TYPE_PID_T +AC_CHECK_SIZEOF(dev_t) dnl dnl translation support @@ -71,17 +74,22 @@ dnl Make sha1.c happy on big endian systems dnl AC_C_BIGENDIAN +# Add runstatedir if not specified manually in autoconf < 2.70 +AS_IF([test -z "$runstatedir"], runstatedir="$localstatedir/run") +AC_SUBST(runstatedir) + # NetworkManager paths -AC_SUBST(nmbinary, "$sbindir/$PACKAGE", [NetworkManager binary executable]) -AC_SUBST(nmconfdir, "$sysconfdir/$PACKAGE", [NetworkManager configuration directory]) -AC_SUBST(nmdatadir, "$datadir/$PACKAGE", [NetworkManager shared data directory]) -AC_SUBST(nmstatedir, "$localstatedir/lib/$PACKAGE", [NetworkManager persistent state directory]) -AC_SUBST(nmrundir, "$localstatedir/run/$PACKAGE", [NetworkManager runtime state directory]) +AC_SUBST(nmbinary, '${sbindir}'/$PACKAGE, [NetworkManager binary executable]) +AC_SUBST(nmconfdir, '${sysconfdir}'/$PACKAGE, [NetworkManager configuration directory]) +AC_SUBST(nmlibdir, '${prefix}'/lib/$PACKAGE, [NetworkManager library directory]) +AC_SUBST(nmdatadir, '${datadir}'/$PACKAGE, [NetworkManager shared data directory]) +AC_SUBST(nmstatedir, '${localstatedir}'/lib/$PACKAGE, [NetworkManager persistent state directory]) +AC_SUBST(nmrundir, '${runstatedir}'/$PACKAGE, [NetworkManager runtime state directory]) # Alternative configuration plugins AC_ARG_ENABLE(config-plugin-ibft, AS_HELP_STRING([--enable-config-plugin-ibft], [enable ibft configuration plugin])) AC_ARG_ENABLE(ifcfg-rh, AS_HELP_STRING([--enable-ifcfg-rh], [enable ifcfg-rh configuration plugin (Fedora/RHEL)])) -AC_ARG_ENABLE(ifcfg-suse, AS_HELP_STRING([--enable-ifcfg-suse], [enable ifcfg-suse configuration plugin (SUSE)])) +AC_ARG_ENABLE(ifcfg-suse, AS_HELP_STRING([--enable-ifcfg-suse], [enable ifcfg-suse configuration plugin (SUSE) (deprecated)])) AC_ARG_ENABLE(ifupdown, AS_HELP_STRING([--enable-ifupdown], [enable ifupdown configuration plugin (Debian/Ubuntu)])) AC_ARG_ENABLE(ifnet, AS_HELP_STRING([--enable-ifnet], [enable ifnet configuration plugin (Gentoo)])) # Default alternative plugins by distribution @@ -101,7 +109,6 @@ AS_IF([test -z "$enable_config_plugin_ibft"], enable_config_plugin_ibft="yes") # Create automake conditionals AM_CONDITIONAL(CONFIG_PLUGIN_IBFT, test "$enable_config_plugin_ibft" = "yes") AM_CONDITIONAL(CONFIG_PLUGIN_IFCFG_RH, test "$enable_ifcfg_rh" = "yes") -AM_CONDITIONAL(CONFIG_PLUGIN_IFCFG_SUSE, test "$enable_ifcfg_suse" = "yes") AM_CONDITIONAL(CONFIG_PLUGIN_IFUPDOWN, test "$enable_ifupdown" = "yes") AM_CONDITIONAL(CONFIG_PLUGIN_IFNET, test "$enable_ifnet" = "yes") @@ -109,13 +116,24 @@ AC_ARG_WITH(config-plugins-default, AS_HELP_STRING([--with-config-plugins-defaul if test -z "$config_plugins_default" -o "$config_plugins_default" = no; then config_plugins_default='' test "$enable_ifcfg_rh" = "yes" && config_plugins_default="$config_plugins_default,ifcfg-rh" - test "$enable_ifcfg_suse" = "yes" && config_plugins_default="$config_plugins_default,ifcfg-suse" test "$enable_ifupdown" = "yes" && config_plugins_default="$config_plugins_default,ifupdown" test "$enable_ifnet" = "yes" && config_plugins_default="$config_plugins_default,ifnet" test "$enable_config_plugin_ibft" = "yes" && config_plugins_default="$config_plugins_default,ibft" config_plugins_default="${config_plugins_default#,}" fi + +test "$enable_ifcfg_rh" = "yes" && distro_plugins="$distro_plugins,ifcfg-rh" +test "$enable_ifcfg_suse" = "yes" && distro_plugins="$distro_plugins,ifcfg-suse" +test "$enable_ifupdown" = "yes" && distro_plugins="$distro_plugins,ifupdown" +test "$enable_ifnet" = "yes" && distro_plugins="$distro_plugins,ifnet" +distro_plugins="${distro_plugins#,}" + AC_DEFINE_UNQUOTED(CONFIG_PLUGINS_DEFAULT, "$config_plugins_default", [Default configuration option for main.plugins setting]) +if test "${enable_config_plugin_ibft}" = yes; then + AC_DEFINE(WITH_SETTINGS_PLUGIN_IBFT, 1, [Whether compilation of ibft setting plugin is enabled]) +else + AC_DEFINE(WITH_SETTINGS_PLUGIN_IBFT, 0, [Whether compilation of ibft setting plugin is enabled]) +fi if test "$enable_ifcfg_rh" = "yes"; then DISTRO_NETWORK_SERVICE=network.service @@ -253,27 +271,6 @@ dnl AC_CHECK_LIB([dl], [dladdr], LIBDL="-ldl", LIBDL="") AC_SUBST(LIBDL) -dnl -dnl Checks for dbus-glib -dnl -PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.1 dbus-glib-1 >= 0.94) -AC_SUBST(DBUS_CFLAGS) -AC_SUBST(DBUS_LIBS) - -AC_CHECK_LIB([dbus-glib-1], [dbus_g_method_invocation_get_g_connection], ac_have_gmi_get_con="1", ac_have_gmi_get_con="0") -AC_DEFINE_UNQUOTED(HAVE_DBUS_GLIB_GMI_GET_CONNECTION, $ac_have_gmi_get_con, [Define if you have a dbus-glib with dbus_g_method_invocation_get_g_connection()]) - -dnl -dnl Only dbus-glib >= 0.100 can use private dbus connections -dnl -PKG_CHECK_MODULES(DBUS_GLIB_100, [dbus-glib-1 >= 0.100], [have_dbus_glib_100=yes],[have_dbus_glib_100=no]) -if (test "${have_dbus_glib_100}" = "yes"); then - AC_DEFINE(HAVE_DBUS_GLIB_100, 1, [Define if you have dbus-glib >= 0.100]) -else - AC_DEFINE(HAVE_DBUS_GLIB_100, 0, [Define if you have dbus-glib >= 0.100]) -fi -AM_CONDITIONAL(HAVE_DBUS_GLIB_100, test "${have_dbus_glib_100}" = "yes") - PKG_CHECK_MODULES(GLIB, [gio-unix-2.0 >= 2.37.6 gmodule-2.0], [AC_SUBST(LOG_DRIVER, '$(top_srcdir)/build-aux/tap-driver.sh'), AC_SUBST(AM_TESTS_FD_REDIRECT, '--tap')], @@ -282,16 +279,24 @@ PKG_CHECK_MODULES(GLIB, [gio-unix-2.0 >= 2.37.6 gmodule-2.0], dnl GLIB_VERSION_MIN_REQUIRED should match the version above. dnl GLIB_VERSION_MAX_ALLOWED should be set to the same version; -dnl nm-glib-compat.h will cause it to be overridden for the functions +dnl nm-glib.h will cause it to be overridden for the functions dnl we have compat versions of. GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32" AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) +AC_ARG_WITH(libnm-glib, AS_HELP_STRING([--without-libnm-glib], [don't build legacy libraries])) +if test "$with_libnm_glib" != "no"; then + PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.1 dbus-glib-1 >= 0.94, :, + [AC_MSG_FAILURE([$DBUS_PKG_ERRORS + +Configure with --without-libnm-glib if you do not need the legacy libraries])]) + with_libnm_glib=yes +fi +AM_CONDITIONAL(WITH_LEGACY_LIBRARIES, test "$with_libnm_glib" != "no") + PKG_CHECK_MODULES(GUDEV, gudev-1.0 >= 165) -AC_SUBST(GUDEV_CFLAGS) -AC_SUBST(GUDEV_LIBS) GOBJECT_INTROSPECTION_CHECK([0.9.6]) @@ -303,8 +308,6 @@ if (test "${enable_qt}" = "yes"); then if test x"$have_qt" = x"no"; then AC_MSG_ERROR(Qt development headers are required) fi - AC_SUBST(QT_CFLAGS) - AC_SUBST(QT_LIBS) # Check for moc-qt4 and if not found then moc QT4_BINDIR=`$PKG_CONFIG QtCore --variable moc_location` AC_CHECK_PROGS(MOC, [moc-qt4 moc],, [$QT4_BINDIR:$PATH]) @@ -343,56 +346,141 @@ fi PKG_CHECK_MODULES(SYSTEMD_200, [systemd >= 200], [have_systemd_200=yes],[have_systemd_200=no]) AM_CONDITIONAL(HAVE_SYSTEMD_200, test "${have_systemd_200}" = "yes") -# session tracking support -AC_MSG_CHECKING([Session tracking support]) +# Hostname persist mode +AC_ARG_WITH(hostname-persist, AS_HELP_STRING([--with-hostname-persist=default|suse|gentoo], + [Hostname persist method])) + +AS_IF([test "$with_hostname_persist" = "suse"], hostname_persist=suse) +AS_IF([test "$with_hostname_persist" = "gentoo"], hostname_persist=gentoo) +AS_IF([test "$with_hostname_persist" = "default"], hostname_persist=default) +# if the method was not explicitly set, try to guess it from the enabled plugins +AS_IF([test -z "$hostname_persist" -a "$distro_plugins" = "ifcfg-suse"], hostname_persist=suse) +AS_IF([test -z "$hostname_persist" -a "$distro_plugins" = "ifnet"], hostname_persist=gentoo) +AS_IF([test -z "$hostname_persist"], hostname_persist=default) + +if test "$hostname_persist" = suse; then + AC_DEFINE(HOSTNAME_PERSIST_SUSE, 1, [Enable SuSE hostname persist method]) +elif test "$hostname_persist" = gentoo; then + AC_DEFINE(HOSTNAME_PERSIST_GENTOO, 1, [Enable Gentoo hostname persist method]) +fi + +AC_ARG_WITH(systemd-journal, AS_HELP_STRING([--with-systemd-journal=yes|no], [Use systemd journal for logging])) +have_systemd_journal=no +if test "$with_systemd_journal" != "no"; then + PKG_CHECK_MODULES(SYSTEMD_JOURNAL, + [libsystemd >= 209], + [have_systemd_journal=yes], + [PKG_CHECK_MODULES(SYSTEMD_JOURNAL, + [libsystemd-journal], + [have_systemd_journal=yes], + [have_systemd_journal=no])]) + if test "$have_systemd_journal" != "yes"; then + if test "$with_systemd_journal" = "yes"; then + AC_MSG_ERROR([Missing systemd-journald support]) + fi + fi +fi +if test "$have_systemd_journal" = "yes"; then + AC_DEFINE([SYSTEMD_JOURNAL], 1, [Define to 1 if libsystemd-journald is available]) +else + AC_DEFINE([SYSTEMD_JOURNAL], 0, [Define to 1 if libsystemd-journald is available]) +fi + +AC_ARG_WITH(config-logging-backend-default, AS_HELP_STRING([--with-logging-backend-default=backend], [Default value for logging.backend]), nm_config_logging_backend_default="$withval", nm_config_logging_backend_default="") +if test "$nm_config_logging_backend_default" != 'debug' \ + -a "$nm_config_logging_backend_default" != 'syslog' \ + -a "$nm_config_logging_backend_default" != 'journal' \ + -a "$nm_config_logging_backend_default" != 'journal-syslog-style'; then + # unknown backend. Reset to default. Silently accept the invalid value to + # be future proof. + nm_config_logging_backend_default='' +fi +if test "$nm_config_logging_backend_default" = ""; then + if test "$have_systemd_journal" = "yes"; then + nm_config_logging_backend_default='journal-syslog-style' + else + nm_config_logging_backend_default='syslog' + fi +fi +AC_DEFINE_UNQUOTED(NM_CONFIG_LOGGING_BACKEND_DEFAULT, "$nm_config_logging_backend_default", [Default configuration option for logging.backend]) +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT="$nm_config_logging_backend_default" +AC_SUBST(NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT) + +# Session tracking support +AC_ARG_WITH(systemd-logind, AS_HELP_STRING([--with-systemd-logind=yes|no], + [Support systemd session tracking])) +AC_ARG_WITH(consolekit, AS_HELP_STRING([--with-consolekit=yes|no], + [Support consolekit session tracking])) AC_ARG_WITH(session-tracking, AS_HELP_STRING([--with-session-tracking=systemd|consolekit|no], - [Select session tracking support (default: consolekit)])) -# default to consolekit -AS_IF([test -z "$with_session_tracking"], with_session_tracking=consolekit) -AS_IF([test "$with_session_tracking" = "ck"], with_session_tracking=consolekit) -AS_IF([test "$with_session_tracking" = "none"], with_session_tracking=no) -# check value -AS_IF([! (echo "$with_session_tracking" | grep -q -E "^(systemd|consolekit|no)$")], - AC_MSG_ERROR([--with-session-tracking must be systemd/consolekit/no, not $with_session_tracking])) -# add conditionals and subtitutions -AM_CONDITIONAL(SESSION_TRACKING_CK, test "$with_session_tracking" = "consolekit") -AM_CONDITIONAL(SESSION_TRACKING_SYSTEMD, test "$with_session_tracking" = "systemd") -if test "$with_session_tracking" = "systemd"; then - PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd],, - [PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd-login])]) - AC_SUBST(SYSTEMD_LOGIN_CFLAGS) - AC_SUBST(SYSTEMD_LOGIN_LIBS) -fi -if test "$with_session_tracking" = "consolekit"; then - AC_SUBST(CKDB_PATH, /var/run/ConsoleKit/database) -fi -AC_MSG_RESULT($with_session_tracking) - -AC_ARG_WITH(suspend-resume, AS_HELP_STRING([--with-suspend-resume=upower|systemd], [Build NetworkManager with specific suspend/resume support])) + [Compatibility option to choose one session tracking module])) +# backwards compatibility +AS_IF([test "$with_session_tracking" = "ck"], [use_consolekit="yes" use_systemd_logind="no"]) +AS_IF([test "$with_session_tracking" = "consolekit"], [use_consolekit="yes" use_systemd_logind="no"]) +AS_IF([test "$with_session_tracking" = "systemd"], [use_consolekit="no" use_systemd_logind="yes"]) +AS_IF([test "$with_session_tracking" = "no"], [use_consolekit="no" use_systemd_logind="no"]) +AS_IF([test "$with_session_tracking" = "none"], [use_consolekit="no" use_systemd_logind="no"]) +# current options +AS_IF([test -n "$with_systemd_logind" ], [use_systemd_logind="$with_systemd_logind"]) +AS_IF([test -n "$with_consolekit" ], [use_consolekit="$with_consolekit"]) +# defaults +AS_IF([test -z "$use_systemd_logind"], [use_systemd_logind="auto"]) +AS_IF([test -z "$use_consolekit"], [use_consolekit="yes"]) +# output +session_tracking= +if test "$use_systemd_logind" = "yes" -o "$use_systemd_logind" = "auto"; then + PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd], [have_systemd_logind=yes], [PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd-login], [have_systemd_logind=yes], [have_systemd_logind=no])]) +else + have_systemd_logind=no +fi +if test "$use_systemd_logind" = "yes" -a "$have_systemd_logind" = "no"; then + AC_MSG_ERROR([You must have libsystemd installed to build with systemd-logind support.]) +fi +if test "$have_systemd_logind" = "yes"; then + AC_DEFINE([SESSION_TRACKING_SYSTEMD], 1, [Define to 1 if libsystemd-login is available]) + session_tracking="$session_tracking, systemd-logind" +fi +if test "$use_consolekit" = "yes"; then + AC_DEFINE([SESSION_TRACKING_CONSOLEKIT], 1, [Define to 1 if ConsoleKit is available]) + AC_DEFINE([CKDB_PATH], "/var/run/ConsoleKit/database", [Path to ConsoleKit database]) + session_tracking="$session_tracking, consolekit" +fi +session_tracking="$(printf '%s' "${session_tracking}" | sed 's/^, //')" + +AC_ARG_WITH(suspend-resume, AS_HELP_STRING([--with-suspend-resume=upower|systemd|consolekit], [Build NetworkManager with specific suspend/resume support])) if test "z$with_suspend_resume" = "z"; then PKG_CHECK_EXISTS([libsystemd >= 209], [have_systemd_inhibit=yes], [PKG_CHECK_EXISTS([libsystemd-login >= 183], [have_systemd_inhibit=yes], [have_systemd_inhibit=no])]) if test "z${have_systemd_inhibit}" = "zyes"; then - # Use systemd if it's new enough - with_suspend_resume="systemd" + # Use systemd if it's new enough + with_suspend_resume="systemd" else - # Fall back to upower - with_suspend_resume="upower" + if test "$use_consolekit" = "yes"; then + # Use consolekit suspend if session tracking is consolekit + with_suspend_resume="consolekit" + else + # Fall back to upower + with_suspend_resume="upower" + fi fi fi case $with_suspend_resume in upower) ;; systemd) - PKG_CHECK_MODULES(SYSTEMD_INHIBIT, [libsystemd >= 209],, - [PKG_CHECK_MODULES(SYSTEMD_INHIBIT, [libsystemd-login >= 183])]) + PKG_CHECK_MODULES(SYSTEMD_INHIBIT, [libsystemd >= 209],, + [PKG_CHECK_MODULES(SYSTEMD_INHIBIT, [libsystemd-login >= 183])]) + AC_DEFINE([SUSPEND_RESUME_SYSTEMD], 1, [Define to 1 to use systemd suspend api]) + ;; + consolekit) + AC_DEFINE([SUSPEND_RESUME_CONSOLEKIT], 1, [Define to 1 to use ConsoleKit2 suspend api]) ;; *) - AC_MSG_ERROR(--with-suspend-resume must be one of [upower, systemd]) + AC_MSG_ERROR(--with-suspend-resume must be one of [upower, systemd, consolekit]) ;; esac AM_CONDITIONAL(SUSPEND_RESUME_UPOWER, test "x$with_suspend_resume" = "xupower") AM_CONDITIONAL(SUSPEND_RESUME_SYSTEMD, test "x$with_suspend_resume" = "xsystemd") +AM_CONDITIONAL(SUSPEND_RESUME_CONSOLEKIT, test "x$with_suspend_resume" = "xconsolekit") # SELinux support AC_ARG_WITH(selinux, AS_HELP_STRING([--with-selinux=yes|no|auto], [Build with SELinux (default: auto)]),,[with_selinux=auto]) @@ -409,75 +497,38 @@ if test "$have_selinux" = "yes"; then else AC_DEFINE(HAVE_SELINUX, 0, [Define if you have SELinux support]) fi -AM_CONDITIONAL(HAVE_SELINUX, test "${have_selinux}" = "yes") - -# libnl support for the linux platform -PKG_CHECK_MODULES(LIBNL, libnl-3.0 >= 3.2.8 libnl-route-3.0 libnl-genl-3.0) -AC_SUBST(LIBNL_CFLAGS) -AC_SUBST(LIBNL_LIBS) - -AC_CHECK_LIB([nl-route-3], [rtnl_link_inet6_get_addr_gen_mode], - ac_have_addr_gen_mode="1", - ac_have_addr_gen_mode="0") -AC_DEFINE_UNQUOTED(HAVE_LIBNL_INET6_ADDR_GEN_MODE, - $ac_have_addr_gen_mode, [Define if libnl has rtnl_link_inet6_get_addr_gen_mode()]) -AC_MSG_CHECKING([Linux kernel IN6_ADDR_GEN_MODE enum]) -AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[#ifndef __user - #define __user - #endif - #include ]], - [[int a = IN6_ADDR_GEN_MODE_EUI64; a++;]])], - [ac_have_kernel_gen_mode=yes], - [ac_have_kernel_gen_mode=no]) -AC_MSG_RESULT($ac_have_kernel_gen_mode) -if test "$ac_have_kernel_gen_mode" = yes; then - AC_DEFINE(HAVE_KERNEL_INET6_ADDR_GEN_MODE, 1, [Define if the kernel has IN6_ADDR_GEN_MODE_*]) +# libaudit support +AC_ARG_WITH(libaudit, AS_HELP_STRING([--with-libaudit=yes|yes-disabled-by-default|no|auto], [Build with audit daemon support (default: auto). yes-disabled-by-default enables support, but disables it unless explicitly configured via NetworkManager.conf]),,[with_libaudit=auto]) +if test "$with_libaudit" = "yes" -o "$with_libaudit" = "yes-disabled-by-default" -o "$with_libaudit" = "auto"; then + PKG_CHECK_MODULES(LIBAUDIT, audit, [have_libaudit=yes], [have_libaudit=no]) + if test "$with_libaudit" != "auto" -a "$have_libaudit" = "no"; then + AC_MSG_ERROR([You must have libaudit installed to build --with-libaudit=$with_libaudit.]) + fi +else + have_libaudit=no +fi +if test "$have_libaudit" = "yes"; then + AC_DEFINE(HAVE_LIBAUDIT, 1, [Define if you have libaudit support]) + if test "$with_libaudit" = "yes-disabled-by-default"; then + AC_DEFINE(NM_CONFIG_DEFAULT_LOGGING_AUDIT, FALSE, [The default value of the logging.audit configuration option]) + NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT='false' + else + AC_DEFINE(NM_CONFIG_DEFAULT_LOGGING_AUDIT, TRUE, [The default value of the logging.audit configuration option]) + NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT='true' + fi else - AC_DEFINE(HAVE_KERNEL_INET6_ADDR_GEN_MODE, 0, [Define if the kernel has IN6_ADDR_GEN_MODE_*]) + AC_DEFINE(HAVE_LIBAUDIT, 0, [Define if you have libaudit support]) + AC_DEFINE(NM_CONFIG_DEFAULT_LOGGING_AUDIT, FALSE, [The default value of the logging.audit configuration option]) + NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT='false' fi +AC_SUBST(NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT) -# IPv6 tokenized identifiers support in libnl -AC_CHECK_LIB([nl-route-3], [rtnl_link_inet6_get_token], - ac_have_ipv6_token="1", - ac_have_ipv6_token="0") -AC_DEFINE_UNQUOTED(HAVE_LIBNL_INET6_TOKEN, - $ac_have_ipv6_token, [Define if libnl has rtnl_link_inet6_get_token()]) +# libnl support for the linux platform +PKG_CHECK_MODULES(LIBNL, libnl-3.0 >= 3.2.8) # uuid library PKG_CHECK_MODULES(UUID, uuid) -AC_SUBST(UUID_CFLAGS) -AC_SUBST(UUID_LIBS) - -dnl Checks for readline library - used by nmcli -AX_LIB_READLINE - -# Intel WiMAX SDK checks -PKG_CHECK_MODULES(IWMX_SDK, [libiWmxSdk-0 >= 1.5.1], [have_wimax=yes],[have_wimax=no]) -AC_ARG_ENABLE(wimax, AS_HELP_STRING([--enable-wimax], [enable WiMAX support]), - [enable_wimax=${enableval}], [enable_wimax=${have_wimax}]) -if (test "${enable_wimax}" = "yes"); then - if test x"$have_wimax" = x"no"; then - AC_MSG_ERROR(Intel WiMAX SDK is required) - fi - - # Ensure the WiMAX stack is built with libnl3; otherwise crashes happen - # due to symbol conflicts - WMX_LIB_PATH=`$PKG_CONFIG --variable=libdir libiWmxSdk-0` - FOO=`ldd $WMX_LIB_PATH/libiWmxSdk.so.0.0.0 | grep libnl-3 2>&1` - if test "$?" != "0"; then - AC_MSG_ERROR([Intel WiMAX stack built with incompatible libnl version!]) - fi - - AC_SUBST(IWMX_SDK_CFLAGS) - AC_SUBST(IWMX_SDK_LIBS) - AC_DEFINE(WITH_WIMAX, 1, [Define if you have WiMAX support]) -else - AC_DEFINE(WITH_WIMAX, 0, [Define if you have WiMAX support]) -fi -AM_CONDITIONAL(WITH_WIMAX, test "${enable_wimax}" = "yes") # Teamd control checks PKG_CHECK_MODULES(LIBTEAMDCTL, [libteamdctl >= 1.9], [have_teamdctl=yes],[have_teamdctl=no]) @@ -487,9 +538,6 @@ if (test "${enable_teamdctl}" = "yes"); then if test x"$have_teamdctl" = x"no"; then AC_MSG_ERROR(Teamd control is required) fi - - AC_SUBST(LIBTEAMDCTL_CFLAGS) - AC_SUBST(LIBTEAMDCTL_LIBS) # temporary bug workaround LIBTEAMDCTL_CFLAGS=`echo $LIBTEAMDCTL_CFLAGS | sed -e 's:/teamdctl.h::'` AC_DEFINE(WITH_TEAMDCTL, 1, [Define if you have Teamd control support]) @@ -527,9 +575,6 @@ if (test "${enable_polkit_agent}" = "yes"); then if test x"$have_pk_agent" = x"no"; then AC_MSG_ERROR(Polkit agent is required) fi - - AC_SUBST(POLKIT_CFLAGS) - AC_SUBST(POLKIT_LIBS) AC_DEFINE(WITH_POLKIT_AGENT, 1, [Define if you have polkit agent]) else AC_DEFINE(WITH_POLKIT_AGENT, 0, [Define if you have polkit agent]) @@ -558,23 +603,12 @@ if test x"$ac_crypto" = xnss; then AC_MSG_ERROR([No usable NSS found]) fi - AC_SUBST(NSS_CFLAGS) - AC_SUBST(NSS_LIBS) AC_DEFINE(HAVE_NSS, 1, [Define if you have NSS]) with_nss=yes elif test x"$ac_crypto" = xgnutls; then - PKG_CHECK_MODULES(GNUTLS, [gnutls >= 1.2]) - AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no) - if test x"$LIBGCRYPT_CONFIG" = xno; then - AC_MSG_ERROR([gnutls explicitly requested but gcrypt not found on system]) - else - AC_DEFINE(HAVE_GNUTLS, 1, [Define if you have libgnutls]) - LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags` - LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs` - AC_SUBST(LIBGCRYPT_CFLAGS) - AC_SUBST(LIBGCRYPT_LIBS) - with_gnutls=yes - fi + PKG_CHECK_MODULES(GNUTLS, [gnutls >= 2.12]) + AC_DEFINE(HAVE_GNUTLS, 1, [Define if you have libgnutls]) + with_gnutls=yes else AC_MSG_ERROR([Please choose either 'nss' or 'gnutls' for certificate and crypto operations]) fi @@ -633,15 +667,6 @@ fi AC_DEFINE_UNQUOTED(PPPD_PATH, "$PPPD_PATH", [Define to path of pppd binary]) AC_SUBST(PPPD_PATH) -AC_ARG_WITH(pppoe, AS_HELP_STRING([--with-pppoe=/path/to/pppoe], [path to pppoe binary])) -if test "x${with_pppoe}" = x; then - AC_PATH_PROG(PPPOE_PATH, pppoe, [], $PATH:/sbin:/usr/sbin) -else - PPPOE_PATH="$with_pppoe" -fi -AC_DEFINE_UNQUOTED(PPPOE_PATH, "$PPPOE_PATH", [Define to path of pppoe binary]) -AC_SUBST(PPPOE_PATH) - # ModemManager1 with libmm-glib AC_ARG_WITH(modem-manager-1, AS_HELP_STRING([--with-modem-manager-1], [Enable new ModemManager1 interface support]),,[with_modem_manager_1=auto]) if (test "${with_modem_manager_1}" != "no"); then @@ -649,8 +674,6 @@ if (test "${with_modem_manager_1}" != "no"); then [mm-glib >= 0.7.991], [have_libmm_glib=yes], [have_libmm_glib=no]) - AC_SUBST(MM_GLIB_CFLAGS) - AC_SUBST(MM_GLIB_LIBS) if (test "${have_libmm_glib}" = "no"); then if (test "${with_modem_manager_1}" = "yes"); then @@ -747,10 +770,10 @@ if test "$with_netconfig" = "yes"; then fi # Define resolvconf and netconfig paths if test "$with_resolvconf" != "no"; then - AC_DEFINE_UNQUOTED(RESOLVCONF_PATH, "$with_resolvconf", [Path to resolvconf (if enabled)]) + AC_DEFINE_UNQUOTED(RESOLVCONF_PATH, "$with_resolvconf", [Path to resolvconf]) fi if test "$with_netconfig" != "no"; then - AC_DEFINE_UNQUOTED(NETCONFIG_PATH, "$with_netconfig", [Path to netconfig (if enabled)]) + AC_DEFINE_UNQUOTED(NETCONFIG_PATH, "$with_netconfig", [Path to netconfig]) fi # iptables path @@ -776,6 +799,16 @@ fi AC_DEFINE_UNQUOTED(DNSMASQ_PATH, "$DNSMASQ_PATH", [Define to path of dnsmasq binary]) AC_SUBST(DNSMASQ_PATH) +# dnssec-trigger-script path +AC_ARG_WITH(dnssec_trigger, AS_HELP_STRING([--with-dnssec-trigger=/path/to/dnssec-trigger-script], [path to unbound dnssec-trigger-script])) +if test "x${with_dnssec_trigger}" = x; then + AC_PATH_PROG(DNSSEC_TRIGGER_SCRIPT, dnssec-trigger-script, /usr/libexec/dnssec-trigger-script, /usr/local/libexec:/usr/local/lib:/usr/local/lib/dnssec-trigger:/usr/libexec:/usr/lib:/usr/lib/dnssec-trigger) +else + DNSSEC_TRIGGER_SCRIPT="$with_dnssec_trigger" +fi +AC_DEFINE_UNQUOTED(DNSSEC_TRIGGER_SCRIPT, "$DNSSEC_TRIGGER_SCRIPT", [Define to path of unbound dnssec-trigger-script]) +AC_SUBST(DNSSEC_TRIGGER_SCRIPT) + # system CA certificates path AC_ARG_WITH(system-ca-path, AS_HELP_STRING([--with-system-ca-path=/path/to/ssl/certs], [path to system CA certificates])) if test "x${with_system_ca_path}" = x; then @@ -816,8 +849,6 @@ if (test "${enable_concheck}" = "yes"); then if test x"$with_libsoup" = x"no"; then AC_MSG_ERROR(Connectivity checking requires libsoup) 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]) @@ -826,6 +857,15 @@ AM_CONDITIONAL(WITH_CONCHECK, test "${enable_concheck}" = "yes") PKG_CHECK_MODULES(LIBNDP, [libndp]) +AC_ARG_WITH(nmcli, AS_HELP_STRING([--with-nmcli=yes|no], [Build nmcli])) +if test "$with_nmcli" != no; then + AX_LIB_READLINE + build_nmcli=yes +else + build_nmcli=no +fi +AM_CONDITIONAL(BUILD_NMCLI, test "$build_nmcli" = yes) + AC_ARG_WITH(nmtui, AS_HELP_STRING([--with-nmtui=yes|no], [Build nmtui])) if test "$with_nmtui" != no; then PKG_CHECK_MODULES(NEWT, [libnewt >= 0.52.15], [build_nmtui=yes], [build_nmtui=no]) @@ -841,10 +881,23 @@ AM_CONDITIONAL(BUILD_NMTUI, test "$build_nmtui" = yes) NM_COMPILER_WARNINGS AC_ARG_ENABLE(more-asserts, - AS_HELP_STRING([--enable-more-asserts], [Enable more assertions for debugging (default: no)])) + AS_HELP_STRING([--enable-more-asserts], [Enable more assertions for debugging (default: no). Deprecated option. Use --with-more-asserts=level])) +more_asserts=0 if test "${enable_more_asserts}" = "yes"; then - AC_DEFINE(NM_MORE_ASSERTS, [1], [Define if more asserts are enabled]) + more_asserts=100 +fi +AC_ARG_WITH(more-asserts, + AS_HELP_STRING([--with-more-asserts=level], [Enable more assertions for debugging (default: 0)]), + [more_asserts=${with_more_asserts}], + []) +if test "${more_asserts}" = "no"; then + more_asserts=0 +else + if test "${more_asserts}" = "yes"; then + more_asserts=100 + fi fi +AC_DEFINE_UNQUOTED(NM_MORE_ASSERTS, $more_asserts, [Define if more asserts are enabled]) AC_ARG_ENABLE(more-logging, AS_HELP_STRING([--enable-more-logging], [Enable more debug logging (default: no)])) @@ -956,8 +1009,8 @@ AM_CONDITIONAL(SETTING_DOCS_AVAILABLE, test "$build_setting_docs" = "yes" -o "$h AC_CONFIG_FILES([ Makefile -include/Makefile -include/nm-version-macros.h +shared/Makefile +shared/nm-version-macros.h src/Makefile src/tests/Makefile src/tests/config/Makefile @@ -977,17 +1030,16 @@ src/settings/plugins/ifcfg-rh/tests/Makefile src/settings/plugins/ifcfg-rh/tests/network-scripts/Makefile src/settings/plugins/ibft/Makefile src/settings/plugins/ibft/tests/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/plugins/example/Makefile src/platform/Makefile src/platform/tests/Makefile src/rdisc/Makefile src/rdisc/tests/Makefile +src/devices/Makefile +src/devices/tests/Makefile src/devices/adsl/Makefile -src/devices/wimax/Makefile src/devices/bluetooth/Makefile src/devices/team/Makefile src/devices/wifi/Makefile @@ -1012,17 +1064,9 @@ clients/Makefile clients/cli/Makefile clients/tui/Makefile clients/tui/newt/Makefile -initscript/RedHat/NetworkManager -initscript/Debian/NetworkManager -initscript/Slackware/rc.networkmanager -initscript/SUSE/networkmanager -initscript/Arch/networkmanager -initscript/Mandriva/networkmanager -initscript/linexa/networkmanager introspection/Makefile introspection/all.xml man/Makefile -man/NetworkManager.conf.xml man/nm-system-settings.conf.5 man/nm-online.1 man/nmcli.1 @@ -1046,7 +1090,10 @@ examples/shell/Makefile examples/python/Makefile examples/python/dbus/Makefile examples/python/gi/Makefile +examples/python/python-networkmanager/Makefile examples/ruby/Makefile +examples/lua/Makefile +examples/lua/lgi/Makefile examples/C/Makefile examples/C/glib/Makefile examples/C/qt/Makefile @@ -1064,42 +1111,46 @@ echo " exec_prefix: $exec_prefix" echo " systemdunitdir: $with_systemdsystemunitdir" echo " nmbinary: $nmbinary" echo " nmconfdir: $nmconfdir" +echo " nmlibdir: $nmlibdir" echo " nmdatadir: $nmdatadir" echo " nmstatedir: $nmstatedir" echo " nmrundir: $nmrundir" echo echo "Platform:" -echo " session tracking: $with_session_tracking" +echo " session tracking: $session_tracking" echo " suspend/resume: $with_suspend_resume" if test "${enable_polkit}" = "yes"; then if test "${enable_modify_system}" = "yes"; then - echo " policykit: yes (permissive modify.system) (default=${enable_polkit})" + echo " policykit: yes (permissive modify.system) (default: main.auth-polkit=${enable_polkit})" else - echo " policykit: yes (restrictive modify.system) (default=${enable_polkit})" + echo " policykit: yes (restrictive modify.system) (default: main.auth-polkit=${enable_polkit})" fi else echo " policykit: no" fi echo " polkit agent: ${enable_polkit_agent}" echo " selinux: $have_selinux" +echo " systemd-journald: $have_systemd_journal (default: logging.backend=${nm_config_logging_backend_default})" +echo " hostname persist: ${hostname_persist}" +echo " libaudit: $have_libaudit (default: logging.audit=${NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT})" echo echo "Features:" echo " wext: $ac_with_wext" echo " wifi: $enable_wifi" -echo " wimax: $enable_wimax" echo " ppp: $enable_ppp" echo " modemmanager-1: $with_modem_manager_1" echo " concheck: $enable_concheck" echo " libteamdctl: $enable_teamdctl" +echo " libnm-glib: $with_libnm_glib" +echo " nmcli: $build_nmcli" echo " nmtui: $build_nmtui" echo echo "Configuration plugins (main.plugins=${config_plugins_default})" echo " ibft: ${enable_config_plugin_ibft}" echo " ifcfg-rh: ${enable_ifcfg_rh}" -echo " ifcfg-suse: ${enable_ifcfg_suse}" echo " ifupdown: ${enable_ifupdown}" echo " ifnet: ${enable_ifnet}" echo @@ -1117,6 +1168,7 @@ echo echo "Miscellaneous:" echo " documentation: $enable_gtk_doc" echo " tests: $enable_tests" +echo " more-asserts: $more_asserts" echo " valgrind: $with_valgrind $with_valgrind_suppressions" echo " code coverage: $enable_code_coverage" echo " LTO: $enable_lto" diff --git a/data/Makefile.in b/data/Makefile.in index db9db2f9..c50d11f5 100644 --- a/data/Makefile.in +++ b/data/Makefile.in @@ -179,7 +179,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -191,8 +190,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -202,6 +199,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -256,16 +254,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -302,6 +297,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -330,7 +327,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -345,6 +341,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -405,6 +403,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -412,6 +411,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ diff --git a/data/NetworkManager-wait-online.service.in b/data/NetworkManager-wait-online.service.in index 6ad6942c..8c4fa678 100644 --- a/data/NetworkManager-wait-online.service.in +++ b/data/NetworkManager-wait-online.service.in @@ -2,12 +2,11 @@ Description=Network Manager Wait Online Requisite=NetworkManager.service After=NetworkManager.service -Wants=network.target -Before=network.target network-online.target +Before=network-online.target [Service] Type=oneshot ExecStart=@bindir@/nm-online -s -q --timeout=30 [Install] -WantedBy=multi-user.target +WantedBy=network-online.target diff --git a/data/NetworkManager.service.in b/data/NetworkManager.service.in index 980573d3..6690f5a5 100644 --- a/data/NetworkManager.service.in +++ b/data/NetworkManager.service.in @@ -11,6 +11,9 @@ ExecStart=@sbindir@/NetworkManager --no-daemon Restart=on-failure # NM doesn't want systemd to kill its children for it KillMode=process +CapabilityBoundingSet=CAP_NET_ADMIN CAP_DAC_OVERRIDE CAP_NET_RAW CAP_NET_BIND_SERVICE CAP_SETGID CAP_SETUID CAP_SYS_MODULE CAP_AUDIT_WRITE CAP_KILL +ProtectSystem=true +ProtectHome=read-only [Install] WantedBy=multi-user.target diff --git a/docs/Makefile.am b/docs/Makefile.am index 5fdeff62..52cbe528 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -1,2 +1,7 @@ -SUBDIRS = libnm-glib libnm-util libnm api +SUBDIRS = libnm api +if WITH_LEGACY_LIBRARIES +SUBDIRS += \ + libnm-util \ + libnm-glib +endif diff --git a/docs/Makefile.in b/docs/Makefile.in index b66cb0b4..46116645 100644 --- a/docs/Makefile.in +++ b/docs/Makefile.in @@ -87,6 +87,10 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +@WITH_LEGACY_LIBRARIES_TRUE@am__append_1 = \ +@WITH_LEGACY_LIBRARIES_TRUE@ libnm-util \ +@WITH_LEGACY_LIBRARIES_TRUE@ libnm-glib + subdir = docs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_readline.m4 \ @@ -163,7 +167,7 @@ am__define_uniq_tagged_files = \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) +DIST_SUBDIRS = libnm api libnm-util libnm-glib am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ @@ -206,7 +210,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -218,8 +221,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -229,6 +230,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -283,16 +285,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -329,6 +328,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -357,7 +358,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -372,6 +372,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -432,6 +434,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -439,6 +442,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -454,7 +458,7 @@ with_dhcpcd = @with_dhcpcd@ with_netconfig = @with_netconfig@ with_resolvconf = @with_resolvconf@ with_valgrind = @with_valgrind@ -SUBDIRS = libnm-glib libnm-util libnm api +SUBDIRS = libnm api $(am__append_1) all: all-recursive .SUFFIXES: diff --git a/docs/api/Makefile.in b/docs/api/Makefile.in index ef861209..d08d2f88 100644 --- a/docs/api/Makefile.in +++ b/docs/api/Makefile.in @@ -156,7 +156,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -168,8 +167,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -179,6 +176,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -233,16 +231,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -279,6 +274,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -307,7 +304,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -322,6 +318,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -382,6 +380,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -389,6 +388,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ diff --git a/docs/api/html/index.html b/docs/api/html/index.html index d4495dc0..aff2b5b7 100644 --- a/docs/api/html/index.html +++ b/docs/api/html/index.html @@ -14,7 +14,7 @@
-

Version 1.0.10 +

Version 1.1.90

diff --git a/docs/api/html/ref-migrating.html b/docs/api/html/ref-migrating.html index 34f90ebb..6527f738 100644 --- a/docs/api/html/ref-migrating.html +++ b/docs/api/html/ref-migrating.html @@ -256,7 +256,7 @@ are now string-based permissions. The mapping is as follows:

-

Table 27. 

+

Table 31. 

@@ -424,7 +424,7 @@ following values:

-

Table 28. 

+

Table 32. 

@@ -496,7 +496,7 @@ their replacements:

-

Table 29. 

+

Table 33. 

diff --git a/docs/api/html/ref-settings.html b/docs/api/html/ref-settings.html index 24add750..e3b8a8de 100644 --- a/docs/api/html/ref-settings.html +++ b/docs/api/html/ref-settings.html @@ -30,7 +30,7 @@ This part documents the properties and value types of each "Setting" object that composes the basic unit of NetworkManager configuration, the "Connection". Each Connection object is simply a dictionary mapping - setting names (like "wimax" or "bluetooth") to a dictionary of + setting names (like "802-3-ethernet" or "bluetooth") to a dictionary of key/value pairs that represents each itself.

@@ -451,6 +451,12 @@
+ + + + + + @@ -619,6 +625,12 @@ + + + + + + @@ -628,7 +640,7 @@ - + @@ -682,7 +694,7 @@ - +
The Spanning Tree Protocol (STP) maximum message age, in seconds.
multicast-snooping
boolean
TRUE
Controls whether IGMP snooping is enabled for this bridge. Note that if snooping was automatically disabled due to hash collisions, the system may refuse to enable the feature until the collisions are resolved.
name
string
bridge
The name of the network interface this connection is bound to. If not set, then the connection can be attached to any interface of the appropriate type (subject to restrictions imposed by other settings). For software devices this specifies the name of the created device. For connection types where interface names cannot easily be made persistent (e.g. mobile broadband or USB Ethernet), this property should not be used. Setting this property restricts the interfaces a connection can be used with, and if interface names change or are reordered the connection may be applied to the wrong interface.
lldp
int32
-1
Whether LLDP is enabled for the connection.
master
string
metered
NMMetered (int32)
Whether the connection is metered.Whether the connection is metered. When updating this property on a currently activated connection, the change takes effect immediately.
name
zone
string
The trust level of a the connection. Free form case-insensitive string (for example "Home", "Work", "Public"). NULL or unspecified zone means the connection will be placed in the default zone as defined by the firewall.The trust level of a the connection. Free form case-insensitive string (for example "Home", "Work", "Public"). NULL or unspecified zone means the connection will be placed in the default zone as defined by the firewall. When updating this property on a currently activated connection, the change takes effect immediately.
@@ -851,6 +863,12 @@ The GPRS Access Point Name specifying the APN used when establishing a data session with the GSM-based network. The APN often determines how the user will be billed for their network usage and whether the user has access to the Internet or just a provider-specific walled-garden, so it is important to use the correct APN for the user's mobile broadband plan. The APN may only be composed of the characters a-z, 0-9, ., and - per GSM 03.60 Section 14.9. +
device-id
+
string
+

+The device unique identifier (as given by the WWAN management service) which this connection applies to.  If given, the connection will only apply to the specified device.
+
+
 
home-only
boolean
FALSE
@@ -899,6 +917,18 @@ Flags indicating how to handle the "pin" property. +
sim-id
+
string
+

+The SIM card unique identifier (as given by the WWAN management service) which this connection applies to.  If given, the connection will apply to any device also allowed by "device-id" which contains a SIM card matching the given identifier.
+
+
+
sim-operator-id
+
string
+

+A MCC/MNC string like "310260" or "21601" identifying the specific mobile network operator which this connection applies to.  If given, the connection will apply to any device also allowed by "device-id" and "sim-id" which contains a SIM card provisioined by the given operator.
+
+
 
username
string

@@ -999,10 +1029,16 @@
 A string sent to the DHCP server to identify the local machine which the DHCP server may use to customize the DHCP lease and options.
 
 
+
dhcp-fqdn
+
string
+

+If the "dhcp-send-hostname" property is TRUE, then the specified FQDN will be sent to the DHCP server when acquiring a lease. This property and "dhcp-hostname" are mutually exclusive and cannot be set at the same time.
+
+
 
dhcp-hostname
string

-If the "dhcp-send-hostname" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease.
+If the "dhcp-send-hostname" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease. This property and "dhcp-fqdn" are mutually exclusive and cannot be set at the same time.
 
 
 
dhcp-send-hostname
@@ -1011,12 +1047,24 @@ If TRUE, a hostname is sent to the DHCP server when acquiring a lease. Some DHCP servers use this hostname to update DNS databases, essentially providing a static hostname for the computer. If the "dhcp-hostname" property is NULL and this property is TRUE, the current persistent hostname of the computer is sent. +
dhcp-timeout
+
uint32
+
0
+A timeout for a DHCP transaction in seconds. + +
dns
array of uint32
[]
Array of IP addresses of DNS servers (as network-byte-order integers) +
dns-options
+
array of string
+
[]
+Array of DNS options. NULL means that the options are unset and left at the default. In this case NetworkManager will use default options. This is distinct from an empty list of properties. + +
dns-search
array of string
[]
@@ -1103,6 +1151,12 @@ +
addr-gen-mode
+
int32
+
1
+Configure method for creating the address for use with RFC4862 IPv6 Stateless Address Autoconfiguration. The permitted values are: "eui64", "stable-privacy" or unset. If the property is set to "eui64", the addresses will be generated using the interface tokens derived from hardware address. This makes the host part of the address to stay constant, making it possible to track host's presence when it changes networks. The address changes when the interface hardware is replaced. The value of "stable-privacy" enables use of cryptographically secure hash of a secret host-specific key along with the connection identification and the network address as specified by RFC7217. This makes it impossible to use the address track host's presence, and makes the address stable when the network interface hardware is replaced. Leaving this unset causes a default that could be subject to change in future versions to be used. Note that this setting is distinct from the Privacy Extensions as configured by "ip6-privacy" property and it does not affect the temporary addresses configured with this option. + +
address-data
array of vardict

@@ -1118,7 +1172,7 @@
 
dhcp-hostname
string

-If the "dhcp-send-hostname" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease.
+If the "dhcp-send-hostname" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease. This property and "dhcp-fqdn" are mutually exclusive and cannot be set at the same time.
 
 
 
dhcp-send-hostname
@@ -1133,6 +1187,12 @@ Array of IP addresses of DNS servers (in network byte order) +
dns-options
+
array of string
+
[]
+Array of DNS options. NULL means that the options are unset and left at the default. In this case NetworkManager will use default options. This is distinct from an empty list of properties. + +
dns-search
array of string
[]
@@ -1160,7 +1220,7 @@
ip6-privacy
NMSettingIP6ConfigPrivacy (int32)

-Configure IPv6 Privacy Extensions for SLAAC, described in RFC4941.  If enabled, it makes the kernel generate a temporary IPv6 address in addition to the public one generated from MAC address via modified EUI-64.  This enhances privacy, but could cause problems in some applications, on the other hand.  The permitted values are: -1: unknown, 0: disabled, 1: enabled (prefer public address), 2: enabled (prefer temporary addresses). Having a per-connection setting set to "-1" (unknown) means fallback to global configuration "ipv6.ip6-privacy". If also global configuration is unspecified or set to "-1", fallback to read "/proc/sys/net/ipv6/conf/default/use_tempaddr".
+Configure IPv6 Privacy Extensions for SLAAC, described in RFC4941.  If enabled, it makes the kernel generate a temporary IPv6 address in addition to the public one generated from MAC address via modified EUI-64.  This enhances privacy, but could cause problems in some applications, on the other hand.  The permitted values are: -1: unknown, 0: disabled, 1: enabled (prefer public address), 2: enabled (prefer temporary addresses). Having a per-connection setting set to "-1" (unknown) means fallback to global configuration "ipv6.ip6-privacy". If also global configuration is unspecified or set to "-1", fallback to read "/proc/sys/net/ipv6/conf/default/use_tempaddr". Note that this setting is distinct from the Stable Privacy addresses that can be enabled with the "addr-gen-mode" property's "stable-privacy" setting as another way of avoiding host tracking with IPv6 addresses.
 
 
 
may-fail
@@ -1209,7 +1269,155 @@


-

Table 15. 802-11-olpc-mesh setting

+

Table 15. ip-tunnel setting

+
++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Key NameValue TypeDefault ValueValue Description
encapsulation-limit
uint32
0
How many additional levels of encapsulation are permitted to be prepended to packets. This property applies only to IPv6 tunnels.
flow-label
uint32
0
The flow label to assign to tunnel packets. This property applies only to IPv6 tunnels.
input-key
string
The key used for tunnel input packets; the property is valid only for certain tunnel modes (GRE, IP6GRE). If empty, no key is used.
local
string
The local endpoint of the tunnel; the value can be empty, otherwise it must contain an IPv4 or IPv6 address.
mode
uint32
0
The tunneling mode, for example NM_IP_TUNNEL_MODE_IPIP (1) or NM_IP_TUNNEL_MODE_GRE (2).
mtu
uint32
0
None
name
string
ip-tunnel
The setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired".
output-key
string
The key used for tunnel output packets; the property is valid only for certain tunnel modes (GRE, IP6GRE). If empty, no key is used.
parent
string
If given, specifies the parent interface name or parent connection UUID the new device will be bound to so that tunneled packets will only be routed via that interface.
path-mtu-discovery
boolean
TRUE
Whether to enable Path MTU Discovery on this tunnel.
remote
string
The remote endpoint of the tunnel; the value must contain an IPv4 or IPv6 address.
tos
uint32
0
The type of service (IPv4) or traffic class (IPv6) field to be set on tunneled packets.
ttl
uint32
0
The TTL to assign to tunneled packets. 0 is a special value meaning that packets inherit the TTL value.
+
+


+
+

Table 16. macvlan setting

+
++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Key NameValue TypeDefault ValueValue Description
mode
uint32
0
The macvlan mode, which specifies the communication mechanism between multiple macvlans on the same lower device.
name
string
macvlan
The setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired".
parent
string
If given, specifies the parent interface name or parent connection UUID from which this MAC-VLAN interface should be created. If this property is not specified, the connection must contain an "802-3-ethernet" setting with a "mac-address" property.
promiscuous
boolean
TRUE
Whether the interface should be put in promiscuous mode.
tap
boolean
FALSE
Whether the interface should be a MACVTAP.
+
+


+
+

Table 17. 802-11-olpc-mesh setting

@@ -1253,7 +1461,7 @@


-

Table 16. ppp setting

+

Table 18. ppp setting

@@ -1387,7 +1595,7 @@


-

Table 17. pppoe setting

+

Table 19. pppoe setting

@@ -1437,7 +1645,7 @@


-

Table 18. serial setting

+

Table 20. serial setting

@@ -1493,7 +1701,7 @@


-

Table 19. team setting

+

Table 21. team setting

@@ -1531,7 +1739,7 @@


-

Table 20. team-port setting

+

Table 22. team-port setting

@@ -1563,7 +1771,69 @@


-

Table 21. vlan setting

+

Table 23. tun setting

+
++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Key NameValue TypeDefault ValueValue Description
group
string
The group ID which will own the device. If set to NULL everyone will be able to use the device.
mode
uint32
1
The operating mode of the virtual device. Allowed values are NM_SETTING_TUN_MODE_TUN (1) to create a layer 3 device and NM_SETTING_TUN_MODE_TAP (2) to create an Ethernet-like layer 2 one.
multi-queue
boolean
FALSE
If the property is set to TRUE, the interface will support multiple file descriptors (queues) to parallelize packet sending or receiving. Otherwise, the interface will only support a single queue.
name
string
tun
The setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired".
owner
string
The user ID which will own the device. If set to NULL everyone will be able to use the device.
pi
boolean
FALSE
If TRUE the interface will prepend a 4 byte header describing the physical interface to the packets.
vnet-hdr
boolean
FALSE
If TRUE the IFF_VNET_HDR the tunnel packets will include a virtio network header.
+
+


+
+

Table 24. vlan setting

@@ -1588,7 +1858,7 @@ - + @@ -1625,7 +1895,7 @@


-

Table 22. vpn setting

+

Table 25. vpn setting

flags
NMVlanFlags (uint32)
One or more flags which control the behavior and features of the VLAN interface. Flags include NM_VLAN_FLAG_REORDER_HEADERS (0x1) (reordering of output packet headers), NM_VLAN_FLAG_GVRP (0x2) (use of the GVRP protocol), and NM_VLAN_FLAG_LOOSE_BINDING (0x4) (loose binding of the interface to its master device's operating state).One or more flags which control the behavior and features of the VLAN interface. Flags include NM_VLAN_FLAG_REORDER_HEADERS (0x1) (reordering of output packet headers), NM_VLAN_FLAG_GVRP (0x2) (use of the GVRP protocol), and NM_VLAN_FLAG_LOOSE_BINDING (0x4) (loose binding of the interface to its master device's operating state). NM_VLAN_FLAG_MVRP (0x8) (use of the MVRP protocol). The default value of this property is NM_VLAN_FLAG_REORDER_HEADERS, but it used to be 0. To preserve backward compatibility, the default-value in the D-Bus API continues to be 0 and a missing property on D-Bus is still considered as 0.
id
@@ -1671,6 +1941,12 @@ + + + + + + @@ -1681,7 +1957,129 @@


-

Table 23. wimax setting

+

Table 26. vxlan setting

+
D-Bus service name of the VPN plugin that this setting uses to connect to its network. i.e. org.freedesktop.NetworkManager.vpnc for the vpnc plugin.
timeout
uint32
0
Timeout for the VPN service to establish the connection. Some services may take quite a long time to connect. Value of 0 means a default timeout, which is 60 seconds (unless overriden by vpn.timeout in configuration file). Values greater than zero mean timeout in seconds.
user-name
string
++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Key NameValue TypeDefault ValueValue Description
ageing
uint32
0
Specifies the lifetime in seconds of FDB entries learnt by the kernel.
destination-port
uint32
8472
Specifies the UDP destination port to communicate to the remote VXLAN tunnel endpoint.
id
uint32
0
Specifies the VXLAN Network Identifer (or VXLAN Segment Identifier) to use.
l2-miss
boolean
FALSE
Specifies whether netlink LL ADDR miss notifications are generated.
l3-miss
boolean
FALSE
Specifies whether netlink IP ADDR miss notifications are generated.
learning
boolean
TRUE
Specifies whether unknown source link layer addresses and IP addresses are entered into the VXLAN device forwarding database.
limit
uint32
0
Specifies the maximum number of FDB entries. A value of zero means that the kernel will store unlimited entries.
local
string
If given, specifies the source IP address to use in outgoing packets.
name
string
vxlan
The setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired".
parent
string
If given, specifies the parent interface name or parent connection UUID.
proxy
boolean
FALSE
Specifies whether ARP proxy is turned on.
remote
string
Specifies the unicast destination IP address to use in outgoing packets when the destination link layer address is not known in the VXLAN device forwarding database, or the multicast IP address to join.
rsc
boolean
FALSE
Specifies whether route short circuit is turned on.
source-port-max
uint32
0
Specifies the maximum UDP source port to communicate to the remote VXLAN tunnel endpoint.
source-port-min
uint32
0
Specifies the minimum UDP source port to communicate to the remote VXLAN tunnel endpoint.
tos
uint32
0
Specifies the TOS value to use in outgoing packets.
ttl
uint32
0
Specifies the time-to-live value to use in outgoing packets.
+
+


+
+

Table 27. wimax setting

@@ -1700,7 +2098,7 @@ - + @@ -1712,14 +2110,14 @@ - +
mac-address
byte array
If specified, this connection will only apply to the WiMAX device whose MAC address matches. This property does not change the MAC address of the device (known as MAC spoofing).If specified, this connection will only apply to the WiMAX device whose MAC address matches. This property does not change the MAC address of the device (known as MAC spoofing). Deprecated: 1
name
network-name
string
Network Service Provider (NSP) name of the WiMAX network this connection should use.Network Service Provider (NSP) name of the WiMAX network this connection should use. Deprecated: 1


-

Table 24. 802-3-ethernet setting

+

Table 28. 802-3-ethernet setting

@@ -1823,7 +2221,7 @@


-

Table 25. 802-11-wireless setting

+

Table 29. 802-11-wireless setting

@@ -1881,6 +2279,12 @@ + + + + + + @@ -1899,6 +2303,12 @@ + + + + + + @@ -1933,7 +2343,7 @@


-

Table 26. 802-11-wireless-security setting

+

Table 30. 802-11-wireless-security setting

A list of permanent MAC addresses of Wi-Fi devices to which this connection should never apply. Each MAC address should be given in the standard hex-digits-and-colons notation (eg "00:11:22:33:44:55").
mac-address-randomization
uint32
0
One of NM_SETTING_MAC_RANDOMIZATION_DEFAULT (0) (never randomize unless the user has set a global default to randomize and the supplicant supports randomization), NM_SETTING_MAC_RANDOMIZATION_NEVER (1) (never randomize the MAC address), or NM_SETTING_MAC_RANDOMIZATION_ALWAYS (2) (always randomize the MAC address).
mode
string
The setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired".
powersave
uint32
0
If set to FALSE, Wi-Fi power saving behavior is disabled. If set to TRUE, Wi-Fi power saving behavior is enabled. All other values are reserved. Note that even though only boolean values are allowed, the property type is an unsigned integer to allow for future expansion.
rate
uint32
0
diff --git a/docs/api/html/spec.html b/docs/api/html/spec.html index 870e837f..dd4be9bf 100644 --- a/docs/api/html/spec.html +++ b/docs/api/html/spec.html @@ -1,4 +1,4 @@ -NetworkManager D-Bus Interface Specification version 1.0.10

NetworkManager D-Bus Interface Specification

Version 1.0.10

Copyright (C) 2008 - 2011 Red Hat, Inc.
Copyright (C) 2008 - 2009 Novell, Inc.
+

NetworkManager D-Bus Interface Specification

Version 1.1.90

Copyright (C) 2008 - 2011 Red Hat, Inc.
Copyright (C) 2008 - 2009 Novell, Inc.

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 @@ -116,10 +116,22 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

- Get the list of network devices. + Get the list of realized network devices.

Returns

devices - ao
- List of object paths of network devices known to the system. + List of object paths of network devices known to the system. This + list does not include device placeholders (see GetAllDevices()). +

GetAllDevices ( + + ) → + ao

+ Get the list of all network devices. +

Returns

devices - + ao
+ List of object paths of network devices and device placeholders + (eg, devices that do not yet exist but which can be automatically + created by NetworkManager if one of their AvailableConnections + was activated).

GetDeviceByIpIface ( s: iface ) → @@ -246,7 +258,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Parameters

level - s
- One of [ERR, WARN, INFO, DEBUG, TRACE]. + One of [ERR, WARN, INFO, DEBUG, TRACE, OFF, KEEP]. + This level is applied to the domains as specified in the domains + argument. Except for the special level "KEEP", all unmentioned + domains are disabled entirely. "KEEP" is special and allows + not to change the current setting except for the specified + domains. E.g. level=KEEP and domains=PLATFORM:DEBUG will only + touch the platform domain.
domains - s
A combination of logging domains separated by commas (','), or "NONE" @@ -332,7 +350,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Properties:

Devices - ao - (read)
- The list of network devices/interfaces NetworkManager knows about. + The list of realized network devices. Realized devices are those which + have backing resources (eg from the kernel or a management daemon like + ModemManager, teamd, etc). +
AllDevices - + ao - + (read)
+ The list of both realized and un-realized network devices. Un-realized + devices are software devices which do not yet have backing resources, + but for which backing resources can be created if the device is + activated.
NetworkingEnabled - b - (read)
@@ -386,8 +413,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.(read) (NM_METERED)
- Wheter the connectivity is metered. This is equivalent to the - metered property of the device associated with the primary + Indicates whether the connectivity is metered. This is equivalent + to the metered property of the device associated with the primary connection.
ActivatingConnection - o - @@ -417,6 +444,18 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.NM_CONNECTIVITY)
The network connectivity state. +
GlobalDnsConfiguration - + a{sv} - + (readwrite)
+ Dictionary of global DNS settings where the key is one of + "searches", "options" and "domains". The values for the + "searches" and "options" keys are string arrays describing the + list of search domains and resolver options, respectively. + The value of the "domains" key is a second-level dictionary, + where each key is a domain name, and each key's value is a + third-level dictionary with the keys "servers" and + "options". "servers" is a string array of DNS servers, + "options" is a string array of domain-specific options.

Enumerated types:

NM_STATE

Describes the overall state of the daemon.
NM_STATE_UNKNOWN = 0
@@ -498,7 +537,23 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
NM_802_11_AP_SEC_NONE = 0x0
Null flag.
NM_802_11_AP_SEC_PAIR_WEP40 = 0x1
Access point supports pairwise 40-bit WEP encryption.
NM_802_11_AP_SEC_PAIR_WEP104 = 0x2
Access point supports pairwise 104-bit WEP encryption.
NM_802_11_AP_SEC_PAIR_TKIP = 0x4
Access point supports pairwise TKIP encryption.
NM_802_11_AP_SEC_PAIR_CCMP = 0x8
Access point supports pairwise CCMP encryption.
NM_802_11_AP_SEC_GROUP_WEP40 = 0x10
Access point supports a group 40-bit WEP cipher.
NM_802_11_AP_SEC_GROUP_WEP104 = 0x20
Access point supports a group 104-bit WEP cipher.
NM_802_11_AP_SEC_GROUP_TKIP = 0x40
Access point supports a group TKIP cipher.
NM_802_11_AP_SEC_GROUP_CCMP = 0x80
Access point supports a group CCMP cipher.
NM_802_11_AP_SEC_KEY_MGMT_PSK = 0x100
Access point supports PSK key management.
NM_802_11_AP_SEC_KEY_MGMT_802_1X = 0x200
Access point supports 802.1x key management.
-

org.freedesktop.NetworkManager.Device

Methods:

Disconnect ( +

org.freedesktop.NetworkManager.Device

Methods:

Reapply ( + a{sa{sv}}: connection, u: flags + ) → + nothing

+ Attempts to update the configuration of a device without deactivating it. + You can either modify the configuration by passing the desired setup via "connection" + argument or just omit the argument to bring it in sync with the connection that + has been activated but could have been modified since. +

Parameters

connection - + a{sa{sv}}
+ The effective connection settings and properties to use. If empty, the connection + settings from the connection that is active on the device will be used. +
flags - + u
+ Flags which would modify the behavior of the Reapply call. + There are no flags defined currently and the users should use the value of 0. +

Disconnect ( ) → nothing

@@ -613,8 +668,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Managed - b - - (read)
- Whether or not this device is managed by NetworkManager. + (readwrite)
+ Whether or not this device is managed by NetworkManager. Setting this + property has a similar effect to configuring the device as unmanaged + via the keyfile.unmanaged-devices setting in NetworkManager.conf. + Changes to this value are not persistent and lost after NetworkManager + restart.
Autoconnect - b - (readwrite)
@@ -628,6 +687,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.(read)
If TRUE, indicates the device is likely missing firmware necessary for its operation. +
NmPluginMissing - + b - + (read)
+ If TRUE, indicates the NetworkManager plugin for the device is likely + missing or misconfigured.
DeviceType - u - (read) @@ -656,6 +720,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Whether the amount of traffic flowing through the device is subject to limitations, for example set by service providers. +
LldpNeighbors - + aa{sv} - + (read)
+ Array of LLDP neighbors; each element is a dictionary mapping + LLDP TLV names to variant boxed values. +
Real - + b - + (read)
+ True if the device exists, or False for placeholder devices that + do not yet exist but could be automatically created by NetworkManager + if one of their AvailableConnections was activated.

Enumerated types:

NM_DEVICE_STATE

NM_DEVICE_STATE_UNKNOWN = 0
The device is in an unknown state.
NM_DEVICE_STATE_UNMANAGED = 10
@@ -883,6 +958,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.u - (read)
Design speed of the device, in megabits/second (Mb/s). +
S390Subchannels - + as - + (read)
+ Array of S/390 subchannels for S/390 or z/Architecture devices.
Carrier - b - (read)
@@ -1351,7 +1430,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.as - (read)
A list of domains this address belongs to.
Searches - as - - (read)
A list of dns searches.
WinsServers - + (read)
A list of dns searches.
DnsOptions - + as - + (read)
+ A list of DNS options that modify the behavior of the DNS + resolver. See resolv.conf(5) manual page for the list of + supported options. +
WinsServers - au - (read)
The Windows Internet Name Service servers associated with the connection. Each address is in network byte order.
@@ -1395,7 +1480,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.as - (read)
A list of domains this address belongs to.
Searches - as - - (read)
A list of dns searches.
+ (read)
A list of dns searches.
DnsOptions - + as - + (read)
+ A list of DNS options that modify the behavior of the DNS + resolver. See resolv.conf(5) manual page for the list of + supported options. +

org.freedesktop.NetworkManager.DHCP4Config

Options and configuration returned by the IPv4 DHCP server. diff --git a/docs/api/network-manager-docs.xml b/docs/api/network-manager-docs.xml index 0f9c7dbb..e8c99460 100644 --- a/docs/api/network-manager-docs.xml +++ b/docs/api/network-manager-docs.xml @@ -51,7 +51,7 @@ This part documents the properties and value types of each "Setting" object that composes the basic unit of NetworkManager configuration, the "Connection". Each Connection object is simply a dictionary mapping - setting names (like "wimax" or "bluetooth") to a dictionary of + setting names (like "802-3-ethernet" or "bluetooth") to a dictionary of key/value pairs that represents each itself. diff --git a/docs/api/settings-spec.xml b/docs/api/settings-spec.xml index 5247d409..70b885b4 100644 --- a/docs/api/settings-spec.xml +++ b/docs/api/settings-spec.xml @@ -63,6 +63,7 @@ interface-namestringDeprecated in favor of connection.interface-name, but can be used for backward-compatibility with older daemons, to set the bridge's interface name. mac-addressbyte arrayIf specified, the MAC address of bridge. When creating a new bridge, this MAC address will be set. When matching an existing (outside NetworkManager created) bridge, this MAC address must match. max-ageuint3220The Spanning Tree Protocol (STP) maximum message age, in seconds. + multicast-snoopingbooleanTRUEControls whether IGMP snooping is enabled for this bridge. Note that if snooping was automatically disabled due to hash collisions, the system may refuse to enable the feature until the collisions are resolved. namestringbridgeThe setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired". priorityuint3232768Sets the Spanning Tree Protocol (STP) priority for this bridge. Lower values are "better"; the lowest priority bridge will be elected the root bridge. stpbooleanTRUEControls whether Spanning Tree Protocol (STP) is enabled for this bridge. @@ -87,8 +88,9 @@ gateway-ping-timeoutuint320If greater than zero, delay success of IP addressing until either the timeout is reached, or an IP gateway replies to a ping. idstringA human readable unique identifier for the connection, like "Work Wi-Fi" or "T-Mobile 3G". interface-namestringThe name of the network interface this connection is bound to. If not set, then the connection can be attached to any interface of the appropriate type (subject to restrictions imposed by other settings). For software devices this specifies the name of the created device. For connection types where interface names cannot easily be made persistent (e.g. mobile broadband or USB Ethernet), this property should not be used. Setting this property restricts the interfaces a connection can be used with, and if interface names change or are reordered the connection may be applied to the wrong interface. + lldpint32-1Whether LLDP is enabled for the connection. masterstringInterface name of the master device or UUID of the master connection. - meteredNMMetered (int32)Whether the connection is metered. + meteredNMMetered (int32)Whether the connection is metered. When updating this property on a currently activated connection, the change takes effect immediately. namestringconnectionThe setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired". permissionsarray of string[]An array of strings defining what access a given user has to this connection. If this is NULL or empty, all users are allowed to access this connection. Otherwise a user is allowed to access this connection if and only if they are in this list. Each entry is of the form "[type]:[id]:[reserved]"; for example, "user:dcbw:blah". At this time only the "user" [type] is allowed. Any other values are ignored and reserved for future use. [id] is the username that this permission refers to, which may not contain the ":" character. Any [reserved] information present must be ignored and is reserved for future use. All of [type], [id], and [reserved] must be valid UTF-8. read-onlybooleanFALSEFALSE if the connection can be modified using the provided settings service's D-Bus interface with the right privileges, or TRUE if the connection is read-only and cannot be modified. @@ -97,7 +99,7 @@ timestampuint640The time, in seconds since the Unix Epoch, that the connection was last _successfully_ fully activated. NetworkManager updates the connection timestamp periodically when the connection is active to ensure that an active connection has the latest timestamp. The property is only meant for reading (changes to this property will not be preserved). typestringBase type of the connection. For hardware-dependent connections, should contain the setting name of the hardware-type specific setting (ie, "802-3-ethernet" or "802-11-wireless" or "bluetooth", etc), and for non-hardware dependent connections like VPN or otherwise, should contain the setting name of that setting type (ie, "vpn" or "bridge", etc). uuidstringA universally unique identifier for the connection, for example generated with libuuid. It should be assigned when the connection is created, and never changed as long as the connection still applies to the same network. For example, it should not be changed when the "id" property or NMSettingIP4Config changes, but might need to be re-created when the Wi-Fi SSID, mobile broadband network provider, or "type" property changes. The UUID must be in the format "2815492f-7e56-435e-b2e9-246bd7cdc664" (ie, contains only hexadecimal characters and "-"). - zonestringThe trust level of a the connection. Free form case-insensitive string (for example "Home", "Work", "Public"). NULL or unspecified zone means the connection will be placed in the default zone as defined by the firewall. + zonestringThe trust level of a the connection. Free form case-insensitive string (for example "Home", "Work", "Public"). NULL or unspecified zone means the connection will be placed in the default zone as defined by the firewall. When updating this property on a currently activated connection, the change takes effect immediately.
dcb settingKey NameValue TypeDefault ValueValue Descriptionapp-fcoe-flagsNMSettingDcbFlags (uint32)Specifies the NMSettingDcbFlags for the DCB FCoE application. Flags may be any combination of NM_SETTING_DCB_FLAG_ENABLE (0x1), NM_SETTING_DCB_FLAG_ADVERTISE (0x2), and NM_SETTING_DCB_FLAG_WILLING (0x4). @@ -122,6 +124,7 @@
gsm settingKey NameValue TypeDefault ValueValue DescriptionapnstringThe GPRS Access Point Name specifying the APN used when establishing a data session with the GSM-based network. The APN often determines how the user will be billed for their network usage and whether the user has access to the Internet or just a provider-specific walled-garden, so it is important to use the correct APN for the user's mobile broadband plan. The APN may only be composed of the characters a-z, 0-9, ., and - per GSM 03.60 Section 14.9. + device-idstringThe device unique identifier (as given by the WWAN management service) which this connection applies to. If given, the connection will only apply to the specified device.home-onlybooleanFALSEWhen TRUE, only connections to the home network will be allowed. Connections to roaming networks will not be made.namestringgsmThe setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired".network-idstringThe Network ID (GSM LAI format, ie MCC-MNC) to force specific network registration. If the Network ID is specified, NetworkManager will attempt to force the device to register only on the specified network. This can be used to ensure that the device does not roam when direct roaming control of the device is not otherwise possible. @@ -130,6 +133,8 @@ password-flagsNMSettingSecretFlags (uint32)Flags indicating how to handle the "password" property.pinstringIf the SIM is locked with a PIN it must be unlocked before any other operations are requested. Specify the PIN here to allow operation of the device.pin-flagsNMSettingSecretFlags (uint32)Flags indicating how to handle the "pin" property. + sim-idstringThe SIM card unique identifier (as given by the WWAN management service) which this connection applies to. If given, the connection will apply to any device also allowed by "device-id" which contains a SIM card matching the given identifier. + sim-operator-idstringA MCC/MNC string like "310260" or "21601" identifying the specific mobile network operator which this connection applies to. If given, the connection will apply to any device also allowed by "device-id" and "sim-id" which contains a SIM card provisioined by the given operator.usernamestringThe username used to authenticate with the network, if required. Many providers do not require a username, or accept any username. But if a username is required, it is specified here.
infiniband settingKey NameValue TypeDefault ValueValue Description @@ -144,9 +149,12 @@ address-dataarray of vardictArray of IPv4 addresses. Each address dictionary contains at least 'address' and 'prefix' entries, containing the IP address as a string, and the prefix length as a uint32. Additional attributes may also exist on some addresses.addressesarray of array of uint32[]Deprecated in favor of the 'address-data' and 'gateway' properties, but this can be used for backward-compatibility with older daemons. Note that if you send this property the daemon will ignore 'address-data' and 'gateway'. Array of IPv4 address structures. Each IPv4 address structure is composed of 3 32-bit values; the first being the IPv4 address (network byte order), the second the prefix (1 - 32), and last the IPv4 gateway (network byte order). The gateway may be left as 0 if no gateway exists for that subnet.dhcp-client-idstringA string sent to the DHCP server to identify the local machine which the DHCP server may use to customize the DHCP lease and options. - dhcp-hostnamestringIf the "dhcp-send-hostname" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease. + dhcp-fqdnstringIf the "dhcp-send-hostname" property is TRUE, then the specified FQDN will be sent to the DHCP server when acquiring a lease. This property and "dhcp-hostname" are mutually exclusive and cannot be set at the same time. + dhcp-hostnamestringIf the "dhcp-send-hostname" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease. This property and "dhcp-fqdn" are mutually exclusive and cannot be set at the same time.dhcp-send-hostnamebooleanTRUEIf TRUE, a hostname is sent to the DHCP server when acquiring a lease. Some DHCP servers use this hostname to update DNS databases, essentially providing a static hostname for the computer. If the "dhcp-hostname" property is NULL and this property is TRUE, the current persistent hostname of the computer is sent. + dhcp-timeoutuint320A timeout for a DHCP transaction in seconds.dnsarray of uint32[]Array of IP addresses of DNS servers (as network-byte-order integers) + dns-optionsarray of string[]Array of DNS options. NULL means that the options are unset and left at the default. In this case NetworkManager will use default options. This is distinct from an empty list of properties.dns-searcharray of string[]Array of DNS search domains.gatewaystringThe gateway associated with this configuration. This is only meaningful if "addresses" is also set.ignore-auto-dnsbooleanFALSEWhen "method" is set to "auto" and this property to TRUE, automatically configured nameservers and search domains are ignored and only nameservers and search domains specified in the "dns" and "dns-search" properties, if any, are used. @@ -160,16 +168,18 @@ routesarray of array of uint32[]Deprecated in favor of the 'route-data' property, but this can be used for backward-compatibility with older daemons. Note that if you send this property the daemon will ignore 'route-data'. Array of IPv4 route structures. Each IPv4 route structure is composed of 4 32-bit values; the first being the destination IPv4 network or address (network byte order), the second the destination network or address prefix (1 - 32), the third being the next-hop (network byte order) if any, and the fourth being the route metric. If the metric is 0, NM will choose an appropriate default metric for the device. (There is no way to explicitly specify an actual metric of 0 with this property.)
ipv6 settingKey NameValue TypeDefault ValueValue Description + addr-gen-modeint321Configure method for creating the address for use with RFC4862 IPv6 Stateless Address Autoconfiguration. The permitted values are: "eui64", "stable-privacy" or unset. If the property is set to "eui64", the addresses will be generated using the interface tokens derived from hardware address. This makes the host part of the address to stay constant, making it possible to track host's presence when it changes networks. The address changes when the interface hardware is replaced. The value of "stable-privacy" enables use of cryptographically secure hash of a secret host-specific key along with the connection identification and the network address as specified by RFC7217. This makes it impossible to use the address track host's presence, and makes the address stable when the network interface hardware is replaced. Leaving this unset causes a default that could be subject to change in future versions to be used. Note that this setting is distinct from the Privacy Extensions as configured by "ip6-privacy" property and it does not affect the temporary addresses configured with this option.address-dataarray of vardictArray of IPv6 addresses. Each address dictionary contains at least 'address' and 'prefix' entries, containing the IP address as a string, and the prefix length as a uint32. Additional attributes may also exist on some addresses.addressesarray of legacy IPv6 address struct (a(ayuay))[]Deprecated in favor of the 'address-data' and 'gateway' properties, but this can be used for backward-compatibility with older daemons. Note that if you send this property the daemon will ignore 'address-data' and 'gateway'. Array of IPv6 address structures. Each IPv6 address structure is composed of an IPv6 address, a prefix length (1 - 128), and an IPv6 gateway address. The gateway may be zeroed out if no gateway exists for that subnet. - dhcp-hostnamestringIf the "dhcp-send-hostname" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease. + dhcp-hostnamestringIf the "dhcp-send-hostname" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease. This property and "dhcp-fqdn" are mutually exclusive and cannot be set at the same time.dhcp-send-hostnamebooleanTRUEIf TRUE, a hostname is sent to the DHCP server when acquiring a lease. Some DHCP servers use this hostname to update DNS databases, essentially providing a static hostname for the computer. If the "dhcp-hostname" property is NULL and this property is TRUE, the current persistent hostname of the computer is sent.dnsarray of byte array[]Array of IP addresses of DNS servers (in network byte order) + dns-optionsarray of string[]Array of DNS options. NULL means that the options are unset and left at the default. In this case NetworkManager will use default options. This is distinct from an empty list of properties.dns-searcharray of string[]Array of DNS search domains.gatewaystringThe gateway associated with this configuration. This is only meaningful if "addresses" is also set.ignore-auto-dnsbooleanFALSEWhen "method" is set to "auto" and this property to TRUE, automatically configured nameservers and search domains are ignored and only nameservers and search domains specified in the "dns" and "dns-search" properties, if any, are used.ignore-auto-routesbooleanFALSEWhen "method" is set to "auto" and this property to TRUE, automatically configured routes are ignored and only routes specified in the "routes" property, if any, are used. - ip6-privacyNMSettingIP6ConfigPrivacy (int32)Configure IPv6 Privacy Extensions for SLAAC, described in RFC4941. If enabled, it makes the kernel generate a temporary IPv6 address in addition to the public one generated from MAC address via modified EUI-64. This enhances privacy, but could cause problems in some applications, on the other hand. The permitted values are: -1: unknown, 0: disabled, 1: enabled (prefer public address), 2: enabled (prefer temporary addresses). Having a per-connection setting set to "-1" (unknown) means fallback to global configuration "ipv6.ip6-privacy". If also global configuration is unspecified or set to "-1", fallback to read "/proc/sys/net/ipv6/conf/default/use_tempaddr". + ip6-privacyNMSettingIP6ConfigPrivacy (int32)Configure IPv6 Privacy Extensions for SLAAC, described in RFC4941. If enabled, it makes the kernel generate a temporary IPv6 address in addition to the public one generated from MAC address via modified EUI-64. This enhances privacy, but could cause problems in some applications, on the other hand. The permitted values are: -1: unknown, 0: disabled, 1: enabled (prefer public address), 2: enabled (prefer temporary addresses). Having a per-connection setting set to "-1" (unknown) means fallback to global configuration "ipv6.ip6-privacy". If also global configuration is unspecified or set to "-1", fallback to read "/proc/sys/net/ipv6/conf/default/use_tempaddr". Note that this setting is distinct from the Stable Privacy addresses that can be enabled with the "addr-gen-mode" property's "stable-privacy" setting as another way of avoiding host tracking with IPv6 addresses.may-failbooleanTRUEIf TRUE, allow overall network configuration to proceed even if the configuration specified by this property times out. Note that at least one IP configuration must succeed or overall network configuration will still fail. For example, in IPv6-only networks, setting this property to TRUE on the NMSettingIP4Config allows the overall network configuration to succeed if IPv4 configuration fails but IPv6 configuration completes successfully.methodstringIP configuration method. NMSettingIP4Config and NMSettingIP6Config both support "auto", "manual", and "link-local". See the subclass-specific documentation for other values. In general, for the "auto" method, properties such as "dns" and "routes" specify information that is added on to the information returned from automatic configuration. The "ignore-auto-routes" and "ignore-auto-dns" properties modify this behavior. For methods that imply no upstream network, such as "shared" or "link-local", these properties must be empty.namestringipv6The setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired". @@ -178,6 +188,28 @@ route-metricint64-1The default metric for routes that don't explicitly specify a metric. The default value -1 means that the metric is choosen automatically based on the device type. The metric applies to dynamic routes, manual (static) routes that don't have an explicit metric setting, address prefix routes, and the default route. Note that for IPv6, the kernel accepts zero (0) but coerces it to 1024 (user default). Hence, setting this property to zero effectively mean setting it to 1024. For IPv4, zero is a regular value for the metric.routesarray of legacy IPv6 route struct (a(ayuayu))[]Deprecated in favor of the 'route-data' property, but this can be used for backward-compatibility with older daemons. Note that if you send this property the daemon will ignore 'route-data'. Array of IPv6 route structures. Each IPv6 route structure is composed of an IPv6 address, a prefix length (1 - 128), an IPv6 next hop address (which may be zeroed out if there is no next hop), and a metric. If the metric is 0, NM will choose an appropriate default metric for the device.
+ ip-tunnel settingKey NameValue TypeDefault ValueValue Description + encapsulation-limituint320How many additional levels of encapsulation are permitted to be prepended to packets. This property applies only to IPv6 tunnels. + flow-labeluint320The flow label to assign to tunnel packets. This property applies only to IPv6 tunnels. + input-keystringThe key used for tunnel input packets; the property is valid only for certain tunnel modes (GRE, IP6GRE). If empty, no key is used. + localstringThe local endpoint of the tunnel; the value can be empty, otherwise it must contain an IPv4 or IPv6 address. + modeuint320The tunneling mode, for example NM_IP_TUNNEL_MODE_IPIP (1) or NM_IP_TUNNEL_MODE_GRE (2). + mtuuint320None + namestringip-tunnelThe setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired". + output-keystringThe key used for tunnel output packets; the property is valid only for certain tunnel modes (GRE, IP6GRE). If empty, no key is used. + parentstringIf given, specifies the parent interface name or parent connection UUID the new device will be bound to so that tunneled packets will only be routed via that interface. + path-mtu-discoverybooleanTRUEWhether to enable Path MTU Discovery on this tunnel. + remotestringThe remote endpoint of the tunnel; the value must contain an IPv4 or IPv6 address. + tosuint320The type of service (IPv4) or traffic class (IPv6) field to be set on tunneled packets. + ttluint320The TTL to assign to tunneled packets. 0 is a special value meaning that packets inherit the TTL value. +
+ macvlan settingKey NameValue TypeDefault ValueValue Description + modeuint320The macvlan mode, which specifies the communication mechanism between multiple macvlans on the same lower device. + namestringmacvlanThe setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired". + parentstringIf given, specifies the parent interface name or parent connection UUID from which this MAC-VLAN interface should be created. If this property is not specified, the connection must contain an "802-3-ethernet" setting with a "mac-address" property. + promiscuousbooleanTRUEWhether the interface should be put in promiscuous mode. + tapbooleanFALSEWhether the interface should be a MACVTAP. +
802-11-olpc-mesh settingKey NameValue TypeDefault ValueValue Descriptionchanneluint320Channel on which the mesh network to join is located.dhcp-anycast-addressbyte arrayAnycast DHCP MAC address used when requesting an IP address via DHCP. The specific anycast address used determines which DHCP server class answers the request. @@ -229,9 +261,18 @@ configstringThe JSON configuration for the team port. The property should contain raw JSON configuration data suitable for teamd, because the value is passed directly to teamd. If not specified, the default configuration is used. See man teamd.conf for the format details.namestringteam-portThe setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired".
+ tun settingKey NameValue TypeDefault ValueValue Description + groupstringThe group ID which will own the device. If set to NULL everyone will be able to use the device. + modeuint321The operating mode of the virtual device. Allowed values are NM_SETTING_TUN_MODE_TUN (1) to create a layer 3 device and NM_SETTING_TUN_MODE_TAP (2) to create an Ethernet-like layer 2 one. + multi-queuebooleanFALSEIf the property is set to TRUE, the interface will support multiple file descriptors (queues) to parallelize packet sending or receiving. Otherwise, the interface will only support a single queue. + namestringtunThe setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired". + ownerstringThe user ID which will own the device. If set to NULL everyone will be able to use the device. + pibooleanFALSEIf TRUE the interface will prepend a 4 byte header describing the physical interface to the packets. + vnet-hdrbooleanFALSEIf TRUE the IFF_VNET_HDR the tunnel packets will include a virtio network header. +
vlan settingKey NameValue TypeDefault ValueValue Descriptionegress-priority-maparray of string[]For outgoing packets, a list of mappings from Linux SKB priorities to 802.1p priorities. The mapping is given in the format "from:to" where both "from" and "to" are unsigned integers, ie "7:3". - flagsNMVlanFlags (uint32)One or more flags which control the behavior and features of the VLAN interface. Flags include NM_VLAN_FLAG_REORDER_HEADERS (0x1) (reordering of output packet headers), NM_VLAN_FLAG_GVRP (0x2) (use of the GVRP protocol), and NM_VLAN_FLAG_LOOSE_BINDING (0x4) (loose binding of the interface to its master device's operating state). + flagsNMVlanFlags (uint32)One or more flags which control the behavior and features of the VLAN interface. Flags include NM_VLAN_FLAG_REORDER_HEADERS (0x1) (reordering of output packet headers), NM_VLAN_FLAG_GVRP (0x2) (use of the GVRP protocol), and NM_VLAN_FLAG_LOOSE_BINDING (0x4) (loose binding of the interface to its master device's operating state). NM_VLAN_FLAG_MVRP (0x8) (use of the MVRP protocol). The default value of this property is NM_VLAN_FLAG_REORDER_HEADERS, but it used to be 0. To preserve backward compatibility, the default-value in the D-Bus API continues to be 0 and a missing property on D-Bus is still considered as 0.iduint320The VLAN identifier that the interface created by this connection should be assigned.ingress-priority-maparray of string[]For incoming packets, a list of mappings from 802.1p priorities to Linux SKB priorities. The mapping is given in the format "from:to" where both "from" and "to" are unsigned integers, ie "7:3".interface-namestringDeprecated in favor of connection.interface-name, but can be used for backward-compatibility with older daemons, to set the vlan's interface name. @@ -244,12 +285,32 @@ persistentbooleanFALSEIf the VPN service supports persistence, and this property is TRUE, the VPN will attempt to stay connected across link changes and outages, until explicitly disconnected.secretsdict of string to string{}Dictionary of key/value pairs of VPN plugin specific secrets like passwords or private keys. Both keys and values must be strings.service-typestringD-Bus service name of the VPN plugin that this setting uses to connect to its network. i.e. org.freedesktop.NetworkManager.vpnc for the vpnc plugin. + timeoutuint320Timeout for the VPN service to establish the connection. Some services may take quite a long time to connect. Value of 0 means a default timeout, which is 60 seconds (unless overriden by vpn.timeout in configuration file). Values greater than zero mean timeout in seconds.user-namestringIf the VPN connection requires a user name for authentication, that name should be provided here. If the connection is available to more than one user, and the VPN requires each user to supply a different name, then leave this property empty. If this property is empty, NetworkManager will automatically supply the username of the user which requested the VPN connection.
+ vxlan settingKey NameValue TypeDefault ValueValue Description + ageinguint320Specifies the lifetime in seconds of FDB entries learnt by the kernel. + destination-portuint328472Specifies the UDP destination port to communicate to the remote VXLAN tunnel endpoint. + iduint320Specifies the VXLAN Network Identifer (or VXLAN Segment Identifier) to use. + l2-missbooleanFALSESpecifies whether netlink LL ADDR miss notifications are generated. + l3-missbooleanFALSESpecifies whether netlink IP ADDR miss notifications are generated. + learningbooleanTRUESpecifies whether unknown source link layer addresses and IP addresses are entered into the VXLAN device forwarding database. + limituint320Specifies the maximum number of FDB entries. A value of zero means that the kernel will store unlimited entries. + localstringIf given, specifies the source IP address to use in outgoing packets. + namestringvxlanThe setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired". + parentstringIf given, specifies the parent interface name or parent connection UUID. + proxybooleanFALSESpecifies whether ARP proxy is turned on. + remotestringSpecifies the unicast destination IP address to use in outgoing packets when the destination link layer address is not known in the VXLAN device forwarding database, or the multicast IP address to join. + rscbooleanFALSESpecifies whether route short circuit is turned on. + source-port-maxuint320Specifies the maximum UDP source port to communicate to the remote VXLAN tunnel endpoint. + source-port-minuint320Specifies the minimum UDP source port to communicate to the remote VXLAN tunnel endpoint. + tosuint320Specifies the TOS value to use in outgoing packets. + ttluint320Specifies the time-to-live value to use in outgoing packets. +
wimax settingKey NameValue TypeDefault ValueValue Description - mac-addressbyte arrayIf specified, this connection will only apply to the WiMAX device whose MAC address matches. This property does not change the MAC address of the device (known as MAC spoofing). + mac-addressbyte arrayIf specified, this connection will only apply to the WiMAX device whose MAC address matches. This property does not change the MAC address of the device (known as MAC spoofing). Deprecated: 1namestringwimaxThe setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired". - network-namestringNetwork Service Provider (NSP) name of the WiMAX network this connection should use. + network-namestringNetwork Service Provider (NSP) name of the WiMAX network this connection should use. Deprecated: 1
802-3-ethernet settingKey NameValue TypeDefault ValueValue Descriptionauto-negotiatebooleanTRUEIf TRUE, allow auto-negotiation of port speed and duplex mode. If FALSE, do not allow auto-negotiation, in which case the "speed" and "duplex" properties should be set. @@ -275,9 +336,11 @@ hiddenbooleanFALSEIf TRUE, indicates this network is a non-broadcasting network that hides its SSID. In this case various workarounds may take place, such as probe-scanning the SSID for more reliable network discovery. However, these workarounds expose inherent insecurities with hidden SSID networks, and thus hidden SSID networks should be used with caution.mac-addressbyte arrayIf specified, this connection will only apply to the Wi-Fi device whose permanent MAC address matches. This property does not change the MAC address of the device (i.e. MAC spoofing).mac-address-blacklistarray of string[]A list of permanent MAC addresses of Wi-Fi devices to which this connection should never apply. Each MAC address should be given in the standard hex-digits-and-colons notation (eg "00:11:22:33:44:55"). + mac-address-randomizationuint320One of NM_SETTING_MAC_RANDOMIZATION_DEFAULT (0) (never randomize unless the user has set a global default to randomize and the supplicant supports randomization), NM_SETTING_MAC_RANDOMIZATION_NEVER (1) (never randomize the MAC address), or NM_SETTING_MAC_RANDOMIZATION_ALWAYS (2) (always randomize the MAC address).modestringWi-Fi network mode; one of "infrastructure", "adhoc" or "ap". If blank, infrastructure is assumed.mtuuint320If non-zero, only transmit packets of the specified size or smaller, breaking larger packets up into multiple Ethernet frames.namestring802-11-wirelessThe setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired". + powersaveuint320If set to FALSE, Wi-Fi power saving behavior is disabled. If set to TRUE, Wi-Fi power saving behavior is enabled. All other values are reserved. Note that even though only boolean values are allowed, the property type is an unsigned integer to allow for future expansion.rateuint320If non-zero, directs the device to only use the specified bitrate for communication with the access point. Units are in Kb/s, ie 5500 = 5.5 Mbit/s. This property is highly driver dependent and not all devices support setting a static bitrate.securityNoneThis property is deprecated, but can be set to the value '802-11-wireless-security' when a wireless security setting is also present in the connection dictionary, for compatibility with very old NetworkManager daemons.seen-bssidsarray of string[]A list of BSSIDs (each BSSID formatted as a MAC address like "00:11:22:33:44:55") that have been detected as part of the Wi-Fi network. NetworkManager internally tracks previously seen BSSIDs. The property is only meant for reading and reflects the BSSID list of NetworkManager. The changes you make to this property will not be preserved. diff --git a/docs/api/spec.html b/docs/api/spec.html index 870e837f..dd4be9bf 100644 --- a/docs/api/spec.html +++ b/docs/api/spec.html @@ -1,4 +1,4 @@ -NetworkManager D-Bus Interface Specification version 1.0.10

NetworkManager D-Bus Interface Specification

Version 1.0.10

Copyright (C) 2008 - 2011 Red Hat, Inc.
Copyright (C) 2008 - 2009 Novell, Inc.
+

NetworkManager D-Bus Interface Specification

Version 1.1.90

Copyright (C) 2008 - 2011 Red Hat, Inc.
Copyright (C) 2008 - 2009 Novell, Inc.

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 @@ -116,10 +116,22 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

- Get the list of network devices. + Get the list of realized network devices.

Returns

devices - ao
- List of object paths of network devices known to the system. + List of object paths of network devices known to the system. This + list does not include device placeholders (see GetAllDevices()). +

GetAllDevices ( + + ) → + ao

+ Get the list of all network devices. +

Returns

devices - + ao
+ List of object paths of network devices and device placeholders + (eg, devices that do not yet exist but which can be automatically + created by NetworkManager if one of their AvailableConnections + was activated).

GetDeviceByIpIface ( s: iface ) → @@ -246,7 +258,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Parameters

level - s
- One of [ERR, WARN, INFO, DEBUG, TRACE]. + One of [ERR, WARN, INFO, DEBUG, TRACE, OFF, KEEP]. + This level is applied to the domains as specified in the domains + argument. Except for the special level "KEEP", all unmentioned + domains are disabled entirely. "KEEP" is special and allows + not to change the current setting except for the specified + domains. E.g. level=KEEP and domains=PLATFORM:DEBUG will only + touch the platform domain.
domains - s
A combination of logging domains separated by commas (','), or "NONE" @@ -332,7 +350,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Properties:

Devices - ao - (read)
- The list of network devices/interfaces NetworkManager knows about. + The list of realized network devices. Realized devices are those which + have backing resources (eg from the kernel or a management daemon like + ModemManager, teamd, etc). +
AllDevices - + ao - + (read)
+ The list of both realized and un-realized network devices. Un-realized + devices are software devices which do not yet have backing resources, + but for which backing resources can be created if the device is + activated.
NetworkingEnabled - b - (read)
@@ -386,8 +413,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.(read) (NM_METERED)
- Wheter the connectivity is metered. This is equivalent to the - metered property of the device associated with the primary + Indicates whether the connectivity is metered. This is equivalent + to the metered property of the device associated with the primary connection.
ActivatingConnection - o - @@ -417,6 +444,18 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.NM_CONNECTIVITY)
The network connectivity state. +
GlobalDnsConfiguration - + a{sv} - + (readwrite)
+ Dictionary of global DNS settings where the key is one of + "searches", "options" and "domains". The values for the + "searches" and "options" keys are string arrays describing the + list of search domains and resolver options, respectively. + The value of the "domains" key is a second-level dictionary, + where each key is a domain name, and each key's value is a + third-level dictionary with the keys "servers" and + "options". "servers" is a string array of DNS servers, + "options" is a string array of domain-specific options.

Enumerated types:

NM_STATE

Describes the overall state of the daemon.
NM_STATE_UNKNOWN = 0
@@ -498,7 +537,23 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
NM_802_11_AP_SEC_NONE = 0x0
Null flag.
NM_802_11_AP_SEC_PAIR_WEP40 = 0x1
Access point supports pairwise 40-bit WEP encryption.
NM_802_11_AP_SEC_PAIR_WEP104 = 0x2
Access point supports pairwise 104-bit WEP encryption.
NM_802_11_AP_SEC_PAIR_TKIP = 0x4
Access point supports pairwise TKIP encryption.
NM_802_11_AP_SEC_PAIR_CCMP = 0x8
Access point supports pairwise CCMP encryption.
NM_802_11_AP_SEC_GROUP_WEP40 = 0x10
Access point supports a group 40-bit WEP cipher.
NM_802_11_AP_SEC_GROUP_WEP104 = 0x20
Access point supports a group 104-bit WEP cipher.
NM_802_11_AP_SEC_GROUP_TKIP = 0x40
Access point supports a group TKIP cipher.
NM_802_11_AP_SEC_GROUP_CCMP = 0x80
Access point supports a group CCMP cipher.
NM_802_11_AP_SEC_KEY_MGMT_PSK = 0x100
Access point supports PSK key management.
NM_802_11_AP_SEC_KEY_MGMT_802_1X = 0x200
Access point supports 802.1x key management.
-

org.freedesktop.NetworkManager.Device

Methods:

Disconnect ( +

org.freedesktop.NetworkManager.Device

Methods:

Reapply ( + a{sa{sv}}: connection, u: flags + ) → + nothing

+ Attempts to update the configuration of a device without deactivating it. + You can either modify the configuration by passing the desired setup via "connection" + argument or just omit the argument to bring it in sync with the connection that + has been activated but could have been modified since. +

Parameters

connection - + a{sa{sv}}
+ The effective connection settings and properties to use. If empty, the connection + settings from the connection that is active on the device will be used. +
flags - + u
+ Flags which would modify the behavior of the Reapply call. + There are no flags defined currently and the users should use the value of 0. +

Disconnect ( ) → nothing

@@ -613,8 +668,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Managed - b - - (read)
- Whether or not this device is managed by NetworkManager. + (readwrite)
+ Whether or not this device is managed by NetworkManager. Setting this + property has a similar effect to configuring the device as unmanaged + via the keyfile.unmanaged-devices setting in NetworkManager.conf. + Changes to this value are not persistent and lost after NetworkManager + restart.
Autoconnect - b - (readwrite)
@@ -628,6 +687,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.(read)
If TRUE, indicates the device is likely missing firmware necessary for its operation. +
NmPluginMissing - + b - + (read)
+ If TRUE, indicates the NetworkManager plugin for the device is likely + missing or misconfigured.
DeviceType - u - (read) @@ -656,6 +720,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Whether the amount of traffic flowing through the device is subject to limitations, for example set by service providers. +
LldpNeighbors - + aa{sv} - + (read)
+ Array of LLDP neighbors; each element is a dictionary mapping + LLDP TLV names to variant boxed values. +
Real - + b - + (read)
+ True if the device exists, or False for placeholder devices that + do not yet exist but could be automatically created by NetworkManager + if one of their AvailableConnections was activated.

Enumerated types:

NM_DEVICE_STATE

NM_DEVICE_STATE_UNKNOWN = 0
The device is in an unknown state.
NM_DEVICE_STATE_UNMANAGED = 10
@@ -883,6 +958,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.u - (read)
Design speed of the device, in megabits/second (Mb/s). +
S390Subchannels - + as - + (read)
+ Array of S/390 subchannels for S/390 or z/Architecture devices.
Carrier - b - (read)
@@ -1351,7 +1430,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.as - (read)
A list of domains this address belongs to.
Searches - as - - (read)
A list of dns searches.
WinsServers - + (read)
A list of dns searches.
DnsOptions - + as - + (read)
+ A list of DNS options that modify the behavior of the DNS + resolver. See resolv.conf(5) manual page for the list of + supported options. +
WinsServers - au - (read)
The Windows Internet Name Service servers associated with the connection. Each address is in network byte order.
@@ -1395,7 +1480,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.as - (read)
A list of domains this address belongs to.
Searches - as - - (read)
A list of dns searches.
+ (read)
A list of dns searches.
DnsOptions - + as - + (read)
+ A list of DNS options that modify the behavior of the DNS + resolver. See resolv.conf(5) manual page for the list of + supported options. +

org.freedesktop.NetworkManager.DHCP4Config

Options and configuration returned by the IPv4 DHCP server. diff --git a/docs/api/version.xml b/docs/api/version.xml index 7ee7020b..69658cdd 100644 --- a/docs/api/version.xml +++ b/docs/api/version.xml @@ -1 +1 @@ -1.0.10 +1.1.90 diff --git a/docs/libnm-glib/Makefile.am b/docs/libnm-glib/Makefile.am index 2d788561..c38e6e34 100644 --- a/docs/libnm-glib/Makefile.am +++ b/docs/libnm-glib/Makefile.am @@ -53,8 +53,8 @@ extra_files = libnm-glib.png # CFLAGS and LDFLAGS for compiling scan program. Only needed # if $(DOC_MODULE).types is non-empty. GTKDOC_CFLAGS = \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ + -I$(top_srcdir)/shared \ + -I$(top_builddir)/shared \ -I$(top_srcdir)/libnm-util \ -I$(top_builddir)/libnm-util \ -I$(top_srcdir)/libnm-glib \ diff --git a/docs/libnm-glib/Makefile.in b/docs/libnm-glib/Makefile.in index a9aa4a0c..3f1a7c24 100644 --- a/docs/libnm-glib/Makefile.in +++ b/docs/libnm-glib/Makefile.in @@ -153,7 +153,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -165,8 +164,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -176,6 +173,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -230,16 +228,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -276,6 +271,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -304,7 +301,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -319,6 +315,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -379,6 +377,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -386,6 +385,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -455,8 +455,8 @@ extra_files = libnm-glib.png # CFLAGS and LDFLAGS for compiling scan program. Only needed # if $(DOC_MODULE).types is non-empty. GTKDOC_CFLAGS = \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ + -I$(top_srcdir)/shared \ + -I$(top_builddir)/shared \ -I$(top_srcdir)/libnm-util \ -I$(top_builddir)/libnm-util \ -I$(top_srcdir)/libnm-glib \ diff --git a/docs/libnm-glib/html/NMAccessPoint.html b/docs/libnm-glib/html/NMAccessPoint.html index b6e6a378..a178775a 100644 --- a/docs/libnm-glib/html/NMAccessPoint.html +++ b/docs/libnm-glib/html/NMAccessPoint.html @@ -121,7 +121,7 @@
+ + + + @@ -368,6 +375,12 @@ + + + + + @@ -454,6 +467,16 @@ + + + + + + + + + + @@ -543,6 +566,10 @@ + + + + @@ -713,13 +740,50 @@ containing all the NMDevices
+

nm_client_get_all_devices ()

+
const GPtrArray *
+nm_client_get_all_devices (NMClient *client);
+

Gets both real devices and device placeholders (eg, software devices which +do not currently exist, but could be created automatically by NetworkManager +if one of their NMDevice::ActivatableConnections was activated). Use +nm_device_is_real() to determine whether each device is a real device or +a placeholder.

+

Use nm_device_get_type() or the NM_IS_DEVICE_XXXX() functions to determine +what kind of device each member of the returned array is, and then you may +use device-specific methods such as nm_device_ethernet_get_hw_address().

+
+

Parameters

+
-gint32 +gint nm_access_point_get_last_seen () @@ -564,7 +564,7 @@ nm_access_point_get_strength (

nm_access_point_get_last_seen ()

-
gint32
+
gint
 nm_access_point_get_last_seen (NMAccessPoint *ap);

Returns the timestamp (in CLOCK_BOOTTIME seconds) for the last time the access point was found in scan results. A value of -1 means the access @@ -588,7 +588,7 @@ point has not been found in a scan.

Returns

the last seen time in seconds

-

Since: 1.0.6

+

Since: 1.2


@@ -825,7 +825,7 @@ access point has not been found in a scan.

Flags: Read

Allowed values: >= -1

Default value: -1

-

Since: 1.0.6

+

Since: 1.2


diff --git a/docs/libnm-glib/html/NMClient.html b/docs/libnm-glib/html/NMClient.html index 1f0d4ae2..865c607a 100644 --- a/docs/libnm-glib/html/NMClient.html +++ b/docs/libnm-glib/html/NMClient.html @@ -82,6 +82,13 @@
const GPtrArray * + +nm_client_get_all_devices () +
NMDevice * Read
+NMObjectArray *all-devicesRead
guint connectivity Read
voidany-device-addedRun First
voidany-device-removedRun First
void device-added Run First
NM_CLIENT_DEVICES
#defineNM_CLIENT_ALL_DEVICES
enum NMClientPermission
+++++ + + + + + +

client

a NMClient

 
+
+
+

Returns

+

a GPtrArray +containing all the NMDevices. The returned array is owned by the +NMClient object and should not be modified.

+

[transfer none][element-type NMDevice]

+
+

Since: 1.2

+
+
+

nm_client_get_device_by_path ()

NMDevice *
 nm_client_get_device_by_path (NMClient *client,
                               const char *object_path);

Gets a NMDevice from a NMClient.

-

Parameters

+

Parameters

@@ -741,7 +805,7 @@ nm_client_get_device_by_path ( -

Returns

+

Returns

the NMDevice for the given object_path or NULL if none is found.

[transfer none]

@@ -755,7 +819,7 @@ nm_client_get_device_by_iface (const char *iface);

Gets a NMDevice from a NMClient.

-

Parameters

+

Parameters

@@ -777,7 +841,7 @@ nm_client_get_device_by_iface (
-

Returns

+

Returns

the NMDevice for the given iface or NULL if none is found.

[transfer none]

@@ -820,7 +884,7 @@ the new connection, not when it finishes. You can used the returned NMActiveConnection object (in particular, “state”) to track the activation to its completion.

-

Parameters

+

Parameters

@@ -898,7 +962,7 @@ the new connection, not when it finishes. You can used the returned NMActiveConnection object (in particular, “state”) to track the activation to its completion.

-

Parameters

+

Parameters

@@ -959,7 +1023,7 @@ nm_client_deactivate_connection (NMActiveConnection *active);

Deactivates an active NMActiveConnection.

-

Parameters

+

Parameters

@@ -988,7 +1052,7 @@ nm_client_deactivate_connection (NMClient *client);

Whether networking is enabled or disabled.

-

Parameters

+

Parameters

@@ -1003,7 +1067,7 @@ nm_client_networking_get_enabled (
-

Returns

+

Returns

TRUE if networking is enabled, FALSE if networking is disabled

@@ -1017,7 +1081,7 @@ nm_client_networking_set_enabled (
-

Parameters

+

Parameters

@@ -1046,7 +1110,7 @@ all controlled interfaces are available for activation.

nm_client_wireless_get_enabled (NMClient *client);

Determines whether the wireless is enabled.

-

Parameters

+

Parameters

@@ -1061,7 +1125,7 @@ nm_client_wireless_get_enabled (
-

Returns

+

Returns

TRUE if wireless is enabled

@@ -1073,7 +1137,7 @@ nm_client_wireless_set_enabled (gboolean enabled);

Enables or disables wireless devices.

-

Parameters

+

Parameters

@@ -1103,7 +1167,7 @@ nm_client_wireless_hardware_get_enabled (NMClient *client);

Determines whether the wireless hardware is enabled.

-

Parameters

+

Parameters

@@ -1118,7 +1182,7 @@ nm_client_wireless_hardware_get_enabled
-

Returns

+

Returns

TRUE if the wireless hardware is enabled

@@ -1129,7 +1193,7 @@ nm_client_wireless_hardware_get_enabled nm_client_wwan_get_enabled (NMClient *client);

Determines whether WWAN is enabled.

-

Parameters

+

Parameters

@@ -1144,7 +1208,7 @@ nm_client_wwan_get_enabled ( -

Returns

+

Returns

TRUE if WWAN is enabled

@@ -1156,7 +1220,7 @@ nm_client_wwan_set_enabled (gboolean enabled);

Enables or disables WWAN devices.

-

Parameters

+

Parameters

@@ -1185,7 +1249,7 @@ nm_client_wwan_set_enabled (NMClient *client);

Determines whether the WWAN hardware is enabled.

-

Parameters

+

Parameters

@@ -1200,7 +1264,7 @@ nm_client_wwan_hardware_get_enabled (
-

Returns

+

Returns

TRUE if the WWAN hardware is enabled

@@ -1211,7 +1275,7 @@ nm_client_wwan_hardware_get_enabled (NMClient *client);

Determines whether WiMAX is enabled.

-

Parameters

+

Parameters

@@ -1226,7 +1290,7 @@ nm_client_wimax_get_enabled ( -

Returns

+

Returns

TRUE if WiMAX is enabled

@@ -1238,7 +1302,7 @@ nm_client_wimax_set_enabled (gboolean enabled);

Enables or disables WiMAX devices.

-

Parameters

+

Parameters

@@ -1267,7 +1331,7 @@ nm_client_wimax_set_enabled (NMClient *client);

Determines whether the WiMAX hardware is enabled.

-

Parameters

+

Parameters

@@ -1282,7 +1346,7 @@ nm_client_wimax_hardware_get_enabled ( -

Returns

+

Returns

TRUE if the WiMAX hardware is enabled

@@ -1293,7 +1357,7 @@ nm_client_wimax_hardware_get_enabled (NMClient *client);

Gets NetworkManager version.

-

Parameters

+

Parameters

@@ -1308,7 +1372,7 @@ nm_client_get_version ( -

Returns

+

Returns

string with the version

@@ -1319,7 +1383,7 @@ nm_client_get_version (NMClient *client);

Gets the current daemon state.

-

Parameters

+

Parameters

@@ -1334,7 +1398,7 @@ nm_client_get_state ( -

Returns

+

Returns

the current NMState

@@ -1346,7 +1410,7 @@ nm_client_get_startup ( -

Parameters

+

Parameters

@@ -1361,7 +1425,7 @@ connections at startup.

-

Returns

+

Returns

whether the daemon is still starting up

Since: 0.9.10

@@ -1373,7 +1437,7 @@ connections at startup.

nm_client_get_manager_running (NMClient *client);

Determines whether the daemon is running.

-

Parameters

+

Parameters

@@ -1388,7 +1452,7 @@ nm_client_get_manager_running (
-

Returns

+

Returns

TRUE if the daemon is running

@@ -1399,7 +1463,7 @@ nm_client_get_manager_running (NMClient *client);

Gets the active connections.

-

Parameters

+

Parameters

@@ -1414,7 +1478,7 @@ nm_client_get_active_connections (
-

Returns

+

Returns

a GPtrArray containing all the active NMActiveConnections. The returned array is owned by the client and should not be modified.

@@ -1429,7 +1493,7 @@ nm_client_sleep (gboolean sleep_);

Deprecated; use nm_client_networking_set_enabled() instead.

-

Parameters

+

Parameters

@@ -1460,7 +1524,7 @@ nm_client_get_permission_result (Requests the result of a specific permission, which indicates whether the client can or cannot perform the action the permission represents

-

Parameters

+

Parameters

@@ -1482,7 +1546,7 @@ client can or cannot perform the action the permission represents

-

Returns

+

Returns

the permission's result, one of NMClientPermissionResult

@@ -1496,7 +1560,7 @@ nm_client_get_logging (GError **error);

Gets NetworkManager current logging level and domains.

-

Parameters

+

Parameters

@@ -1529,7 +1593,7 @@ a list of domains separated by ",".

-

Returns

+

Returns

TRUE on success, FALSE otherwise

Since: 0.9.8

@@ -1544,7 +1608,7 @@ nm_client_set_logging (GError **error);

Sets NetworkManager logging level and/or domains.

-

Parameters

+

Parameters

@@ -1577,7 +1641,7 @@ domains separated by ",". (NULL or an empty string
-

Returns

+

Returns

TRUE on success, FALSE otherwise

Since: 0.9.8

@@ -1592,7 +1656,7 @@ nm_client_get_connectivity (nm_client_check_connectivity_async(), which re-check the connectivity state first before returning any information.

-

Parameters

+

Parameters

@@ -1607,7 +1671,7 @@ connectivity state first before returning any information.

-

Returns

+

Returns

the current connectivity state

Since: 0.9.8.6

@@ -1625,7 +1689,7 @@ the most recent known state without re-checking.

This is a blocking call; use nm_client_check_connectivity_async() if you do not want to block.

-

Parameters

+

Parameters

@@ -1652,7 +1716,7 @@ if you do not want to block.

-

Returns

+

Returns

the (new) current connectivity state

Since: 0.9.8.6

@@ -1671,7 +1735,7 @@ nm_client_check_connectivity_async (nm_client_check_connectivity(), which blocks.

-

Parameters

+

Parameters

@@ -1715,7 +1779,7 @@ nm_client_check_connectivity_finish (Retrieves the result of an nm_client_check_connectivity_async() call.

-

Parameters

+

Parameters

@@ -1742,7 +1806,7 @@ call.

-

Returns

+

Returns

the (new) current connectivity state

Since: 0.9.8.6

@@ -1762,7 +1826,7 @@ route to the VPN endpoint.

If there is no default route, or the default route is over a non-NetworkManager-recognized device, this will return NULL.

-

Parameters

+

Parameters

@@ -1777,7 +1841,7 @@ non-NetworkManager-recognized device, this will return NUL
-

Returns

+

Returns

the appropriate NMActiveConnection, if any.

[transfer none]

@@ -1793,7 +1857,7 @@ nm_client_get_activating_connection (“primary-connection” upon successful activation.

-

Parameters

+

Parameters

@@ -1808,7 +1872,7 @@ currently-activating connection that is expected to become the new
-

Returns

+

Returns

the appropriate NMActiveConnection, if any.

[transfer none]

@@ -1915,11 +1979,17 @@ any.


+

NM_CLIENT_ALL_DEVICES

+
#define NM_CLIENT_ALL_DEVICES "all-devices"
+
+
+
+

enum NMClientPermission

NMClientPermission values indicate various permissions that NetworkManager clients can obtain to perform certain tasks on behalf of the current user.

-

Members

+

Members

@@ -2039,7 +2109,7 @@ clients can obtain to perform certain tasks on behalf of the current user.

NMClientPermissionResult values indicate what authorizations and permissions the user requires to obtain a given NMClientPermission

-

Members

+

Members

@@ -2086,7 +2156,7 @@ the user requires to obtain a given

enum NMClientError

Describes errors that may result from operations involving a NMClient.

-

Members

+

Members

@@ -2140,6 +2210,14 @@ Type: GLib.PtrArray


+

The “all-devices” property

+
  “all-devices”              NMObjectArray *
+

List of both real devices and device placeholders.

+

Flags: Read

+

Since: 1.2

+
+
+

The “connectivity” property

  “connectivity”             guint

The network connectivity state.

@@ -2152,7 +2230,7 @@ Type: GLib.PtrArray

The “devices” property

  “devices”                  NMObjectArray *
-

List of known network devices.

+

List of real network devices. Does not include placeholder devices.

Flags: Read

Since: 0.9.10

@@ -2259,12 +2337,13 @@ see

Signal Details

-

The “device-added” signal

+

The “any-device-added” signal

void
 user_function (NMClient *client,
                GObject  *device,
                gpointer  user_data)
-

Notifies that a NMDevice is added.

+

Notifies that a NMDevice is added. This signal is emitted for both +regular devices and placeholder devices.

Parameters

@@ -2296,12 +2375,13 @@ user_function (
-

The “device-removed” signal

+

The “any-device-removed” signal

void
 user_function (NMClient *client,
                GObject  *device,
                gpointer  user_data)
-

Notifies that a NMDevice is removed.

+

Notifies that a NMDevice is removed. This signal is emitted for both +regular devices and placeholder devices.

Parameters

@@ -2333,6 +2413,82 @@ user_function (
+

The “device-added” signal

+
void
+user_function (NMClient *client,
+               GObject  *device,
+               gpointer  user_data)
+

Notifies that a NMDevice is added. This signal is not emitted for +placeholder devices.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

client

the client that received the signal

 

device

the new device.

[type NMDevice]

user_data

user data set when the signal handler was connected.

 
+
+

Flags: Run First

+
+
+
+

The “device-removed” signal

+
void
+user_function (NMClient *client,
+               GObject  *device,
+               gpointer  user_data)
+

Notifies that a NMDevice is removed. This signal is not emitted for +placeholder devices.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

client

the client that received the signal

 

device

the removed device.

[type NMDevice]

user_data

user data set when the signal handler was connected.

 
+
+

Flags: Run First

+
+
+

The “permission-changed” signal

void
 user_function (NMClient *client,
@@ -2341,7 +2497,7 @@ user_function (gpointer  user_data)

Notifies that a permission has changed

-

Parameters

+

Parameters

diff --git a/docs/libnm-glib/html/NMDevice.html b/docs/libnm-glib/html/NMDevice.html index 79f87a5d..7506b557 100644 --- a/docs/libnm-glib/html/NMDevice.html +++ b/docs/libnm-glib/html/NMDevice.html @@ -140,6 +140,14 @@ + + + + + + + + + + + + + @@ -551,6 +572,10 @@ + + + + @@ -986,12 +1011,43 @@ nm_device_get_managed ( +

nm_device_set_managed ()

+
void
+nm_device_set_managed (NMDevice *device,
+                       gboolean managed);
+

Enables or disables management of NMDevice by NetworkManager.

+
+

Parameters

+
+void + +nm_device_set_managed () +
gboolean @@ -249,6 +257,14 @@
+gboolean + +nm_device_is_real () +
const char * @@ -462,6 +478,11 @@ Read
gbooleanrealRead
guint state Read
#defineNM_DEVICE_REAL
#define NM_DEVICE_MANAGED
+++++ + + + + + + + + + + + + +

device

a NMDevice

 

managed

TRUE to make the device managed by NetworkManager.

 
+
+

Since: 1.2

+
+
+

nm_device_get_autoconnect ()

gboolean
 nm_device_get_autoconnect (NMDevice *device);

Whether the NMDevice can be autoconnected.

-

Parameters

+

Parameters

@@ -1006,7 +1062,7 @@ nm_device_get_autoconnect ( -

Returns

+

Returns

TRUE if the device is allowed to be autoconnected

@@ -1018,7 +1074,7 @@ nm_device_set_autoconnect (gboolean autoconnect);

Enables or disables automatic activation of the NMDevice.

-

Parameters

+

Parameters

@@ -1048,7 +1104,7 @@ nm_device_get_firmware_missing (Indicates that firmware required for the device's operation is likely to be missing.

-

Parameters

+

Parameters

@@ -1063,7 +1119,7 @@ to be missing.

-

Returns

+

Returns

TRUE if firmware required for the device's operation is likely to be missing.

@@ -1078,7 +1134,7 @@ nm_device_get_ip4_config (nm_active_connection_get_ip4_config(), which also works with VPN connections.

-

Parameters

+

Parameters

@@ -1093,7 +1149,7 @@ connections.

-

Returns

+

Returns

the NMIP4Config or NULL if the device is not activated.

[transfer none]

@@ -1108,7 +1164,7 @@ nm_device_get_dhcp4_config (nm_active_connection_get_dhcp4_config(), which also works with VPN connections.

-

Parameters

+

Parameters

@@ -1123,7 +1179,7 @@ connections.

-

Returns

+

Returns

the NMDHCP4Config or NULL if the device is not activated or not using DHCP.

[transfer none]

@@ -1139,7 +1195,7 @@ nm_device_get_ip6_config (nm_active_connection_get_ip6_config(), which also works with VPN connections.

-

Parameters

+

Parameters

@@ -1154,7 +1210,7 @@ connections.

-

Returns

+

Returns

the NMIP6Config or NULL if the device is not activated.

[transfer none]

@@ -1169,7 +1225,7 @@ nm_device_get_dhcp6_config (nm_active_connection_get_dhcp6_config(), which also works with VPN connections.

-

Parameters

+

Parameters

@@ -1184,7 +1240,7 @@ connections.

-

Returns

+

Returns

the NMDHCP6Config or NULL if the device is not activated or not using DHCP.

[transfer none]

@@ -1197,7 +1253,7 @@ using DHCP.

nm_device_get_state (NMDevice *device);

Gets the current NMDevice state.

-

Parameters

+

Parameters

@@ -1212,7 +1268,7 @@ nm_device_get_state ( -

Returns

+

Returns

the current device state

@@ -1226,7 +1282,7 @@ nm_device_get_state_reason (reason argument).

-

Parameters

+

Parameters

@@ -1248,7 +1304,7 @@ the state (reason
-

Returns

+

Returns

the current device state

@@ -1259,7 +1315,7 @@ the state (reason nm_device_get_active_connection (NMDevice *device);

Gets the NMActiveConnection object which owns this device during activation.

-

Parameters

+

Parameters

@@ -1274,7 +1330,7 @@ nm_device_get_active_connection (
-

Returns

+

Returns

the NMActiveConnection or NULL if the device is not part of an active connection.

[transfer none]

@@ -1289,7 +1345,7 @@ nm_device_get_available_connections (device .

-

Parameters

+

Parameters

@@ -1304,7 +1360,7 @@ be activated on device
-

Returns

+

Returns

the GPtrArray containing NMRemoteConnections. This is the internal copy used by the connection, and must not be modified.

@@ -1322,7 +1378,7 @@ an opaque string that can be used to recognize when seemingly-unrelated NMDevices are actually just different virtual ports on a single physical port. (Eg, NPAR / SR-IOV.)

-

Parameters

+

Parameters

@@ -1337,7 +1393,7 @@ ports on a single physical port. (Eg, NPAR / SR-IOV.)

-

Returns

+

Returns

the physical port ID of the device, or NULL if the port ID is unknown. This is the internal string used by the device and must not be modified.

@@ -1351,7 +1407,7 @@ must not be modified.

nm_device_get_mtu (NMDevice *device);

Gets the MTU of the NMDevice.

-

Parameters

+

Parameters

@@ -1366,7 +1422,7 @@ nm_device_get_mtu ( -

Returns

+

Returns

the MTU of the device.

Since: 0.9.10

@@ -1378,7 +1434,7 @@ nm_device_get_mtu (NMDevice *device);

Whether the device is a software device.

-

Parameters

+

Parameters

@@ -1393,7 +1449,7 @@ nm_device_is_software ( -

Returns

+

Returns

TRUE if device is a software device, FALSE if it is a hardware device.

@@ -1401,12 +1457,40 @@ is a software device, FALSE if it is a hardware dev
+

nm_device_is_real ()

+
gboolean
+nm_device_is_real (NMDevice *device);
+
+

Parameters

+
+++++ + + + + + +

device

a NMDevice

 
+
+
+

Returns

+

TRUE if the device exists, or FALSE if it is a placeholder device +that could be automatically created by NetworkManager if one of its +“available-connections” was activated.

+
+

Since: 1.2

+
+
+

nm_device_get_product ()

const char *
 nm_device_get_product (NMDevice *device);

Gets the product string of the NMDevice.

-

Parameters

+

Parameters

@@ -1421,7 +1505,7 @@ nm_device_get_product ( -

Returns

+

Returns

the product name of the device. This is the internal string used by the device, and must not be modified.

@@ -1433,7 +1517,7 @@ device, and must not be modified.

nm_device_get_vendor (NMDevice *device);

Gets the vendor string of the NMDevice.

-

Parameters

+

Parameters

@@ -1448,7 +1532,7 @@ nm_device_get_vendor ( -

Returns

+

Returns

the vendor name of the device. This is the internal string used by the device, and must not be modified.

@@ -1461,7 +1545,7 @@ nm_device_get_description (device , based on its vendor and product names.

-

Parameters

+

Parameters

@@ -1476,7 +1560,7 @@ nm_device_get_description ( -

Returns

+

Returns

a description of device . If either the vendor or the product name is unknown, this returns the interface name.

@@ -1493,7 +1577,7 @@ nm_device_disambiguate_names (devices .

-

Parameters

+

Parameters

@@ -1516,7 +1600,7 @@ devices in devices
-

Returns

+

Returns

the device names.

[transfer full][array zero-terminated=1]

@@ -1541,7 +1625,7 @@ nm_device_disconnect ( -

Parameters

+

Parameters

@@ -1579,7 +1663,7 @@ nm_device_delete (gpointer user_data);

Deletes the software device. Hardware devices can't be deleted.

-

Parameters

+

Parameters

@@ -1626,7 +1710,7 @@ Ethernet, Bluetooth, Wi-Fi WPA connections, or any other connection that is incompatible with the device. To get the full list of connections see nm_remote_settings_list_connections().

-

Parameters

+

Parameters

@@ -1648,7 +1732,7 @@ incompatible with the device. To get the full list of connections see
-

Returns

+

Returns

a list of NMConnection objects that could be activated with the given device . @@ -1673,7 +1757,7 @@ network, and will not be valid if it describes a WPA network, or if it is an Ethernet, Bluetooth, WWAN, etc connection that is incompatible with the device.

-

Parameters

+

Parameters

@@ -1697,7 +1781,7 @@ against

-

Returns

+

Returns

TRUE if the connection may be activated with this device, FALSE if is incompatible with the device's capabilities and characteristics.

@@ -1721,7 +1805,7 @@ device.

compatibility of the given device and connection. But, in addition, it sets GError when FALSE is returned.

-

Parameters

+

Parameters

@@ -1750,7 +1834,7 @@ against

-

Returns

+

Returns

TRUE if the connection may be activated with this device, FALSE if is incompatible with the device's capabilities and characteristics.

@@ -1764,7 +1848,7 @@ nm_device_get_setting_type (device .

-

Parameters

+

Parameters

@@ -1779,7 +1863,7 @@ that can be used on device
-

Returns

+

Returns

device 's associated NMSetting type

@@ -1883,6 +1967,12 @@ that can be used on device

+

NM_DEVICE_REAL

+
#define NM_DEVICE_REAL "real"
+
+
+
+

NM_DEVICE_MANAGED

#define NM_DEVICE_MANAGED "managed"
 
@@ -2127,6 +2217,17 @@ operations like addressing and routing.


+

The “real” property

+
  “real”                     gboolean
+

Whether the device is real or is a placeholder device that could +be created automatically by NetworkManager if one of its +“available-connections” was activated.

+

Flags: Read

+

Default value: FALSE

+

Since: 1.2

+
+
+

The “state” property

  “state”                    guint

The state of the device.

diff --git a/docs/libnm-glib/html/NMDeviceWimax.html b/docs/libnm-glib/html/NMDeviceWimax.html index 3ec917bc..93148ed9 100644 --- a/docs/libnm-glib/html/NMDeviceWimax.html +++ b/docs/libnm-glib/html/NMDeviceWimax.html @@ -276,9 +276,13 @@

nm_device_wimax_error_quark ()

GQuark
 nm_device_wimax_error_quark (void);
+
+

nm_device_wimax_error_quark has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Registers an error quark for NMDeviceWimax if necessary.

-

Returns

+

Returns

the error quark used for NMDeviceWimax errors.

@@ -288,9 +292,13 @@ nm_device_wimax_error_quark (void
GObject *
 nm_device_wimax_new (DBusGConnection *connection,
                      const char *path);
+
+

nm_device_wimax_new has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Creates a new NMDeviceWimax.

-

Parameters

+

Parameters

@@ -312,7 +320,7 @@ nm_device_wimax_new ( -

Returns

+

Returns

a new WiMAX device.

[transfer full]

@@ -322,9 +330,13 @@ nm_device_wimax_new (

nm_device_wimax_get_hw_address ()

const char *
 nm_device_wimax_get_hw_address (NMDeviceWimax *wimax);
+
+

nm_device_wimax_get_hw_address has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Gets the hardware (MAC) address of the NMDeviceWimax

-

Parameters

+

Parameters

@@ -339,7 +351,7 @@ nm_device_wimax_get_hw_address (
-

Returns

+

Returns

the hardware address. This is the internal string used by the device, and must not be modified.

@@ -349,9 +361,13 @@ device, and must not be modified.

nm_device_wimax_get_active_nsp ()

NMWimaxNsp *
 nm_device_wimax_get_active_nsp (NMDeviceWimax *wimax);
+
+

nm_device_wimax_get_active_nsp has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Gets the active NMWimaxNsp.

-

Parameters

+

Parameters

@@ -366,7 +382,7 @@ nm_device_wimax_get_active_nsp (
-

Returns

+

Returns

the access point or NULL if none is active.

[transfer full]

@@ -377,9 +393,13 @@ nm_device_wimax_get_active_nsp (NMWimaxNsp * nm_device_wimax_get_nsp_by_path (NMDeviceWimax *wimax, const char *path); +
+

nm_device_wimax_get_nsp_by_path has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Gets a NMWimaxNsp by path.

-

Parameters

+

Parameters

@@ -401,7 +421,7 @@ nm_device_wimax_get_nsp_by_path (
-

Returns

+

Returns

the access point or NULL if none is found.

[transfer none]

@@ -411,9 +431,13 @@ nm_device_wimax_get_nsp_by_path (

nm_device_wimax_get_nsps ()

const GPtrArray *
 nm_device_wimax_get_nsps (NMDeviceWimax *wimax);
+
+

nm_device_wimax_get_nsps has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Gets all the scanned NSPs of the NMDeviceWimax.

-

Parameters

+

Parameters

@@ -428,7 +452,7 @@ nm_device_wimax_get_nsps ( -

Returns

+

Returns

a GPtrArray containing all the scanned NMWimaxNsps. The returned array is owned by the client and should not be modified.

@@ -440,11 +464,15 @@ The returned array is owned by the client and should not be modified.

nm_device_wimax_get_center_frequency ()

guint
 nm_device_wimax_get_center_frequency (NMDeviceWimax *self);
+
+

nm_device_wimax_get_center_frequency has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Gets the center frequency (in KHz) of the radio channel the device is using to communicate with the network when connected. Has no meaning when the device is not connected.

-

Parameters

+

Parameters

@@ -459,7 +487,7 @@ device is not connected.

-

Returns

+

Returns

the center frequency in KHz, or 0

@@ -468,12 +496,16 @@ device is not connected.

nm_device_wimax_get_rssi ()

gint
 nm_device_wimax_get_rssi (NMDeviceWimax *self);
+
+

nm_device_wimax_get_rssi has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Gets the RSSI of the current radio link in dBm. This value indicates how strong the raw received RF signal from the base station is, but does not indicate the overall quality of the radio link. Has no meaning when the device is not connected.

-

Parameters

+

Parameters

@@ -488,7 +520,7 @@ device is not connected.

-

Returns

+

Returns

the RSSI in dBm, or 0

@@ -497,11 +529,15 @@ device is not connected.

nm_device_wimax_get_cinr ()

gint
 nm_device_wimax_get_cinr (NMDeviceWimax *self);
+
+

nm_device_wimax_get_cinr has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Gets the CINR (Carrier to Interference + Noise Ratio) of the current radio link in dB. CINR is a more accurate measure of radio link quality. Has no meaning when the device is not connected.

-

Parameters

+

Parameters

@@ -516,7 +552,7 @@ meaning when the device is not connected.

-

Returns

+

Returns

the CINR in dB, or 0

@@ -525,11 +561,15 @@ meaning when the device is not connected.

nm_device_wimax_get_tx_power ()

gint
 nm_device_wimax_get_tx_power (NMDeviceWimax *self);
+
+

nm_device_wimax_get_tx_power has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Average power of the last burst transmitted by the device, in units of 0.5 dBm. i.e. a TxPower of -11 represents an actual device TX power of -5.5 dBm. Has no meaning when the device is not connected.

-

Parameters

+

Parameters

@@ -544,7 +584,7 @@ nm_device_wimax_get_tx_power ( -

Returns

+

Returns

the TX power in dBm, or 0

@@ -553,9 +593,13 @@ nm_device_wimax_get_tx_power (

nm_device_wimax_get_bsid ()

const char *
 nm_device_wimax_get_bsid (NMDeviceWimax *self);
+
+

nm_device_wimax_get_bsid has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Gets the ID of the serving Base Station when the device is connected.

-

Parameters

+

Parameters

@@ -570,7 +614,7 @@ nm_device_wimax_get_bsid ( -

Returns

+

Returns

the ID of the serving Base Station, or NULL

@@ -688,6 +732,10 @@ nm_device_wimax_get_bsid (

The “active-nsp” property

  “active-nsp”               NMWimaxNsp *

The active NMWimaxNsp of the device.

+
+

NMDeviceWimax:active-nsp has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Flags: Read


@@ -696,6 +744,10 @@ nm_device_wimax_get_bsid ( “bsid” gchar *

The ID of the serving base station as received from the network. Has no meaning when the device is not connected.

+
+

NMDeviceWimax:bsid has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Flags: Read

Default value: NULL

@@ -706,6 +758,10 @@ no meaning when the device is not connected.

The center frequency (in KHz) of the radio channel the device is using to communicate with the network when connected. Has no meaning when the device is not connected.

+
+

NMDeviceWimax:center-frequency has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Flags: Read

Default value: 0

@@ -716,6 +772,10 @@ device is not connected.

CINR (Carrier to Interference + Noise Ratio) of the current radio link in dB. CINR is a more accurate measure of radio link quality. Has no meaning when the device is not connected.

+
+

NMDeviceWimax:cinr has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Flags: Read

Default value: 0

@@ -724,6 +784,10 @@ meaning when the device is not connected.

The “hw-address” property

  “hw-address”               gchar *

The hardware (MAC) address of the device.

+
+

NMDeviceWimax:hw-address has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Flags: Read

Default value: NULL

@@ -732,6 +796,10 @@ meaning when the device is not connected.

The “nsps” property

  “nsps”                     NMObjectArray *

List of all WiMAX Network Service Providers the device can see.

+
+

NMDeviceWimax:nsps has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Flags: Read

Since: 0.9.10

@@ -743,6 +811,10 @@ meaning when the device is not connected.

the raw received RF signal from the base station is, but does not indicate the overall quality of the radio link. Has no meaning when the device is not connected.

+
+

NMDeviceWimax:rssi has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Flags: Read

Default value: 0

@@ -753,6 +825,10 @@ device is not connected.

Average power of the last burst transmitted by the device, in units of 0.5 dBm. i.e. a TxPower of -11 represents an actual device TX power of -5.5 dBm. Has no meaning when the device is not connected.

+
+

NMDeviceWimax:tx-power has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Flags: Read

Default value: 0

@@ -766,8 +842,12 @@ user_function (< GObject *nsp, gpointer user_data)

Notifies that a NMWimaxNsp is added to the wimax device.

+
+

NMDeviceWimax::nsp-added has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+
-

Parameters

+

Parameters

@@ -803,8 +883,12 @@ user_function (< GObject *nsp, gpointer user_data)

Notifies that a NMWimaxNsp is removed from the wimax device.

+
+

NMDeviceWimax::nsp-removed has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+
-

Parameters

+

Parameters

diff --git a/docs/libnm-glib/html/api-index-full.html b/docs/libnm-glib/html/api-index-full.html index e11ae148..edb606f8 100644 --- a/docs/libnm-glib/html/api-index-full.html +++ b/docs/libnm-glib/html/api-index-full.html @@ -19,6 +19,8 @@  |  D  |  + G +  |  I  |  O @@ -369,6 +371,14 @@

C

+NMClient::any-device-added, object signal in NMClient +
+
+
+NMClient::any-device-removed, object signal in NMClient +
+
+
NMClient::device-added, object signal in NMClient
@@ -389,6 +399,10 @@
+NMClient:all-devices, object property in NMClient +
+
+
NMClient:connectivity, object property in NMClient
@@ -481,6 +495,10 @@
+NM_CLIENT_ALL_DEVICES, macro in NMClient +
+
+
nm_client_check_connectivity, function in NMClient
@@ -521,6 +539,10 @@
+nm_client_get_all_devices, function in NMClient +
+
+
nm_client_get_connectivity, function in NMClient
@@ -758,6 +780,10 @@
+NMDevice:real, object property in NMDevice +
+
+
NMDevice:state, object property in NMDevice
@@ -1462,6 +1488,10 @@
+nm_device_is_real, function in NMDevice +
+
+
nm_device_is_software, function in NMDevice
@@ -1546,10 +1576,18 @@
+NM_DEVICE_REAL, macro in NMDevice +
+
+
nm_device_set_autoconnect, function in NMDevice
+nm_device_set_managed, function in NMDevice +
+
+
NM_DEVICE_STATE, macro in NMDevice
@@ -1841,6 +1879,15 @@ NM_DHCP6_CONFIG_OPTIONS, macro in NMDHCP6Config
+

G

+
+get_editor, macro in NMVpnPluginUiWidget +
+
+
+get_suggested_filename, macro in NMVpnPluginUiWidget +
+

I

NMIP4Config:addresses, object property in NMIP4Config @@ -2383,6 +2430,18 @@
+NMVpnEditorInterface, macro in NMVpnPluginUiWidget +
+
+
+NMVpnEditorPluginCapability, macro in NMVpnPluginUiWidget +
+
+
+NMVpnEditorPluginInterface, macro in NMVpnPluginUiWidget +
+
+
NMVPNPluginError, enum in NMVPNPlugin
@@ -2419,6 +2478,66 @@
+nm_vpn_editor_get_widget, macro in NMVpnPluginUiWidget +
+
+
+NM_VPN_EDITOR_PLUGIN_CAPABILITY_EXPORT, macro in NMVpnPluginUiWidget +
+
+
+NM_VPN_EDITOR_PLUGIN_CAPABILITY_IMPORT, macro in NMVpnPluginUiWidget +
+
+
+NM_VPN_EDITOR_PLUGIN_CAPABILITY_IPV6, macro in NMVpnPluginUiWidget +
+
+
+NM_VPN_EDITOR_PLUGIN_CAPABILITY_NONE, macro in NMVpnPluginUiWidget +
+
+
+NM_VPN_EDITOR_PLUGIN_DESCRIPTION, macro in NMVpnPluginUiWidget +
+
+
+nm_vpn_editor_plugin_export, macro in NMVpnPluginUiWidget +
+
+
+nm_vpn_editor_plugin_factory, macro in NMVpnPluginUiWidget +
+
+
+nm_vpn_editor_plugin_get_capabilities, macro in NMVpnPluginUiWidget +
+
+
+nm_vpn_editor_plugin_get_editor, macro in NMVpnPluginUiWidget +
+
+
+nm_vpn_editor_plugin_get_suggested_filename, macro in NMVpnPluginUiWidget +
+
+
+nm_vpn_editor_plugin_import, macro in NMVpnPluginUiWidget +
+
+
+NM_VPN_EDITOR_PLUGIN_NAME, macro in NMVpnPluginUiWidget +
+
+
+NM_VPN_EDITOR_PLUGIN_SERVICE, macro in NMVpnPluginUiWidget +
+
+
+nm_vpn_editor_update_connection, macro in NMVpnPluginUiWidget +
+
+
NM_VPN_PLUGIN_DBUS_SERVICE_NAME, macro in NMVPNPlugin
diff --git a/docs/libnm-glib/html/index.html b/docs/libnm-glib/html/index.html index b81e2b44..bbb72e4b 100644 --- a/docs/libnm-glib/html/index.html +++ b/docs/libnm-glib/html/index.html @@ -15,7 +15,7 @@

- for libnm-glib 1.0.10 + for libnm-glib 1.1.90 The latest version of this documentation can be found on-line at https://developer.gnome.org/libnm-glib/0.9/. diff --git a/docs/libnm-glib/html/index.sgml b/docs/libnm-glib/html/index.sgml index 80069edb..5d95d5cb 100644 --- a/docs/libnm-glib/html/index.sgml +++ b/docs/libnm-glib/html/index.sgml @@ -12,6 +12,7 @@ + @@ -62,6 +63,7 @@ + @@ -88,6 +90,7 @@ + @@ -103,6 +106,8 @@ + + @@ -182,6 +187,7 @@ + @@ -196,6 +202,7 @@ + @@ -221,6 +228,7 @@ + @@ -256,6 +264,7 @@ + @@ -1032,6 +1041,26 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/docs/libnm-glib/html/libnm-glib-NMVpnPluginUiWidget.html b/docs/libnm-glib/html/libnm-glib-NMVpnPluginUiWidget.html index e4630fed..a4343675 100644 --- a/docs/libnm-glib/html/libnm-glib-NMVpnPluginUiWidget.html +++ b/docs/libnm-glib/html/libnm-glib-NMVpnPluginUiWidget.html @@ -158,6 +158,86 @@ enum NMVpnPluginUiInterfaceProp + +#define +nm_vpn_editor_plugin_factory + + +#define +NMVpnEditorPluginCapability + + +#define +NM_VPN_EDITOR_PLUGIN_CAPABILITY_NONE + + +#define +NM_VPN_EDITOR_PLUGIN_CAPABILITY_IMPORT + + +#define +NM_VPN_EDITOR_PLUGIN_CAPABILITY_EXPORT + + +#define +NM_VPN_EDITOR_PLUGIN_CAPABILITY_IPV6 + + +#define +NM_VPN_EDITOR_PLUGIN_NAME + + +#define +NM_VPN_EDITOR_PLUGIN_DESCRIPTION + + +#define +NM_VPN_EDITOR_PLUGIN_SERVICE + + +#define +NMVpnEditorPluginInterface + + +#define +get_editor + + +#define +get_suggested_filename + + +#define +nm_vpn_editor_plugin_get_editor + + +#define +nm_vpn_editor_plugin_get_capabilities + + +#define +nm_vpn_editor_plugin_import + + +#define +nm_vpn_editor_plugin_export + + +#define +nm_vpn_editor_plugin_get_suggested_filename + + +#define +NMVpnEditorInterface + + +#define +nm_vpn_editor_get_widget + + +#define +nm_vpn_editor_update_connection +

@@ -364,6 +444,126 @@ plugin's VPN service daemon

+
+
+

nm_vpn_editor_plugin_factory

+
#define nm_vpn_editor_plugin_factory nm_vpn_plugin_ui_factory
+
+
+
+
+

NMVpnEditorPluginCapability

+
#define NMVpnEditorPluginCapability NMVpnPluginUiCapability
+
+
+
+
+

NM_VPN_EDITOR_PLUGIN_CAPABILITY_NONE

+
#define NM_VPN_EDITOR_PLUGIN_CAPABILITY_NONE   NM_VPN_PLUGIN_UI_CAPABILITY_NONE
+
+
+
+
+

NM_VPN_EDITOR_PLUGIN_CAPABILITY_IMPORT

+
#define NM_VPN_EDITOR_PLUGIN_CAPABILITY_IMPORT NM_VPN_PLUGIN_UI_CAPABILITY_IMPORT
+
+
+
+
+

NM_VPN_EDITOR_PLUGIN_CAPABILITY_EXPORT

+
#define NM_VPN_EDITOR_PLUGIN_CAPABILITY_EXPORT NM_VPN_PLUGIN_UI_CAPABILITY_EXPORT
+
+
+
+
+

NM_VPN_EDITOR_PLUGIN_CAPABILITY_IPV6

+
#define NM_VPN_EDITOR_PLUGIN_CAPABILITY_IPV6   NM_VPN_PLUGIN_UI_CAPABILITY_IPV6
+
+
+
+
+

NM_VPN_EDITOR_PLUGIN_NAME

+
#define NM_VPN_EDITOR_PLUGIN_NAME        NM_VPN_PLUGIN_UI_INTERFACE_NAME
+
+
+
+
+

NM_VPN_EDITOR_PLUGIN_DESCRIPTION

+
#define NM_VPN_EDITOR_PLUGIN_DESCRIPTION NM_VPN_PLUGIN_UI_INTERFACE_DESC
+
+
+
+
+

NM_VPN_EDITOR_PLUGIN_SERVICE

+
#define NM_VPN_EDITOR_PLUGIN_SERVICE     NM_VPN_PLUGIN_UI_INTERFACE_SERVICE
+
+
+
+
+

NMVpnEditorPluginInterface

+
#define NMVpnEditorPluginInterface NMVpnPluginUiInterface
+
+
+
+
+

get_editor

+
#define get_editor             ui_factory
+
+
+
+
+

get_suggested_filename

+
#define get_suggested_filename get_suggested_name
+
+
+
+
+

nm_vpn_editor_plugin_get_editor

+
#define nm_vpn_editor_plugin_get_editor nm_vpn_plugin_ui_interface_ui_factory
+
+
+
+
+

nm_vpn_editor_plugin_get_capabilities

+
#define nm_vpn_editor_plugin_get_capabilities nm_vpn_plugin_ui_interface_get_capabilities
+
+
+
+
+

nm_vpn_editor_plugin_import

+
#define nm_vpn_editor_plugin_import nm_vpn_plugin_ui_interface_import
+
+
+
+
+

nm_vpn_editor_plugin_export

+
#define nm_vpn_editor_plugin_export nm_vpn_plugin_ui_interface_export
+
+
+
+
+

nm_vpn_editor_plugin_get_suggested_filename

+
#define nm_vpn_editor_plugin_get_suggested_filename nm_vpn_plugin_ui_interface_get_suggested_name
+
+
+
+
+

NMVpnEditorInterface

+
#define NMVpnEditorInterface NMVpnPluginUiWidgetInterface
+
+
+
+
+

nm_vpn_editor_get_widget

+
#define nm_vpn_editor_get_widget nm_vpn_plugin_ui_widget_interface_get_widget
+
+
+
+
+

nm_vpn_editor_update_connection

+
#define nm_vpn_editor_update_connection nm_vpn_plugin_ui_widget_interface_update_connection
+
+

Object Hierarchy

-
    GEnum
+
    GEnum
     ╰── NMConnectionError
     GObject
     ╰── NMConnection
diff --git a/docs/libnm-util/html/NMSetting.html b/docs/libnm-util/html/NMSetting.html
index 83dc3b25..3ce89683 100644
--- a/docs/libnm-util/html/NMSetting.html
+++ b/docs/libnm-util/html/NMSetting.html
@@ -271,7 +271,7 @@
 

Object Hierarchy

-
    GEnum
+
    GEnum
     ├── NMSettingCompareFlags
     ├── NMSettingDiffResult
     ├── NMSettingError
diff --git a/docs/libnm-util/html/NMSetting8021x.html b/docs/libnm-util/html/NMSetting8021x.html
index c36eaff5..05d9516c 100644
--- a/docs/libnm-util/html/NMSetting8021x.html
+++ b/docs/libnm-util/html/NMSetting8021x.html
@@ -923,7 +923,7 @@
 

Object Hierarchy

-
    GEnum
+
    GEnum
     ├── NMSetting8021xCKFormat
     ├── NMSetting8021xCKScheme
     ╰── NMSetting8021xError
diff --git a/docs/libnm-util/html/NMSettingAdsl.html b/docs/libnm-util/html/NMSettingAdsl.html
index a1ecee9b..165177b5 100644
--- a/docs/libnm-util/html/NMSettingAdsl.html
+++ b/docs/libnm-util/html/NMSettingAdsl.html
@@ -236,7 +236,7 @@
 

Object Hierarchy

-
    GEnum
+
    GEnum
     ╰── NMSettingAdslError
     GObject
     ╰── NMSetting
diff --git a/docs/libnm-util/html/NMSettingBluetooth.html b/docs/libnm-util/html/NMSettingBluetooth.html
index 885a378b..b011f98f 100644
--- a/docs/libnm-util/html/NMSettingBluetooth.html
+++ b/docs/libnm-util/html/NMSettingBluetooth.html
@@ -139,7 +139,7 @@
 

Object Hierarchy

-
    GEnum
+
    GEnum
     ╰── NMSettingBluetoothError
     GObject
     ╰── NMSetting
diff --git a/docs/libnm-util/html/NMSettingBond.html b/docs/libnm-util/html/NMSettingBond.html
index ac2fdc8e..8d0e4d48 100644
--- a/docs/libnm-util/html/NMSettingBond.html
+++ b/docs/libnm-util/html/NMSettingBond.html
@@ -244,7 +244,7 @@
 

Object Hierarchy

-
    GEnum
+
    GEnum
     ╰── NMSettingBondError
     GObject
     ╰── NMSetting
diff --git a/docs/libnm-util/html/NMSettingBridge.html b/docs/libnm-util/html/NMSettingBridge.html
index 6eb6900c..71cdd58f 100644
--- a/docs/libnm-util/html/NMSettingBridge.html
+++ b/docs/libnm-util/html/NMSettingBridge.html
@@ -233,7 +233,7 @@
 

Object Hierarchy

-
    GEnum
+
    GEnum
     ╰── NMSettingBridgeError
     GObject
     ╰── NMSetting
diff --git a/docs/libnm-util/html/NMSettingBridgePort.html b/docs/libnm-util/html/NMSettingBridgePort.html
index 53126856..bc204181 100644
--- a/docs/libnm-util/html/NMSettingBridgePort.html
+++ b/docs/libnm-util/html/NMSettingBridgePort.html
@@ -148,7 +148,7 @@
 

Object Hierarchy

-
    GEnum
+
    GEnum
     ╰── NMSettingBridgePortError
     GObject
     ╰── NMSetting
diff --git a/docs/libnm-util/html/NMSettingCdma.html b/docs/libnm-util/html/NMSettingCdma.html
index c96324ad..43980d9d 100644
--- a/docs/libnm-util/html/NMSettingCdma.html
+++ b/docs/libnm-util/html/NMSettingCdma.html
@@ -165,7 +165,7 @@
 

Object Hierarchy

-
    GEnum
+
    GEnum
     ╰── NMSettingCdmaError
     GObject
     ╰── NMSetting
diff --git a/docs/libnm-util/html/NMSettingConnection.html b/docs/libnm-util/html/NMSettingConnection.html
index db0dc6ed..ba73eb00 100644
--- a/docs/libnm-util/html/NMSettingConnection.html
+++ b/docs/libnm-util/html/NMSettingConnection.html
@@ -403,7 +403,7 @@
 

Object Hierarchy

-
    GEnum
+
    GEnum
     ╰── NMSettingConnectionError
     GObject
     ╰── NMSetting
diff --git a/docs/libnm-util/html/NMSettingDcb.html b/docs/libnm-util/html/NMSettingDcb.html
index fd94edf0..5cd1cd53 100644
--- a/docs/libnm-util/html/NMSettingDcb.html
+++ b/docs/libnm-util/html/NMSettingDcb.html
@@ -418,7 +418,7 @@
 

Object Hierarchy

-
    GEnum
+
    GEnum
     ├── NMSettingDcbError
     ╰── NMSettingDcbFlags
     GObject
diff --git a/docs/libnm-util/html/NMSettingGeneric.html b/docs/libnm-util/html/NMSettingGeneric.html
index 18fbdb85..b6cc9066 100644
--- a/docs/libnm-util/html/NMSettingGeneric.html
+++ b/docs/libnm-util/html/NMSettingGeneric.html
@@ -84,7 +84,7 @@
 

Object Hierarchy

-
    GEnum
+
    GEnum
     ╰── NMSettingGenericError
     GObject
     ╰── NMSetting
diff --git a/docs/libnm-util/html/NMSettingGsm.html b/docs/libnm-util/html/NMSettingGsm.html
index 4a1d9629..1e725b02 100644
--- a/docs/libnm-util/html/NMSettingGsm.html
+++ b/docs/libnm-util/html/NMSettingGsm.html
@@ -296,7 +296,7 @@
 

Object Hierarchy

-
    GEnum
+
    GEnum
     ├── NMSettingGsmError
     ├── NMSettingGsmNetworkBand
     ╰── NMSettingGsmNetworkType
diff --git a/docs/libnm-util/html/NMSettingIP4Config.html b/docs/libnm-util/html/NMSettingIP4Config.html
index 59c89182..b14b4721 100644
--- a/docs/libnm-util/html/NMSettingIP4Config.html
+++ b/docs/libnm-util/html/NMSettingIP4Config.html
@@ -495,6 +495,14 @@
 
 
 
+int
+
+
+nm_setting_ip4_config_get_dhcp_timeout ()
+
+
+
+
 gboolean
 
 
@@ -545,6 +553,11 @@
 Read / Write / Construct
 
 
+guint
+dhcp-timeout
+Read / Write
+
+
 
 GArray_guint_ *
 dns
@@ -662,6 +675,10 @@
 
 
 #define
+NM_SETTING_IP4_CONFIG_DHCP_TIMEOUT
+
+
+#define
 NM_SETTING_IP4_CONFIG_NEVER_DEFAULT
 
 
@@ -693,10 +710,10 @@
 

Object Hierarchy

-
    GBoxed
+
    GBoxed
     ├── NMIP4Address
     ╰── NMIP4Route
-    GEnum
+    GEnum
     ╰── NMSettingIP4ConfigError
     GObject
     ╰── NMSetting
@@ -2315,6 +2332,35 @@ property.


+

nm_setting_ip4_config_get_dhcp_timeout ()

+
int
+nm_setting_ip4_config_get_dhcp_timeout
+                               (NMSettingIP4Config *setting);
+

Returns the value contained in the “dhcp-timeout” +property.

+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingIP4Config

 
+
+
+

Returns

+

The number of seconds after which unfinished DHCP transaction +fails or zero for "default".

+
+
+
+

nm_setting_ip4_config_get_never_default ()

gboolean
 nm_setting_ip4_config_get_never_default
@@ -2322,7 +2368,7 @@ nm_setting_ip4_config_get_never_default
 

Returns the value contained in the “never-default” property.

-

Parameters

+

Parameters

@@ -2337,7 +2383,7 @@ property.

-

Returns

+

Returns

TRUE if this connection should never be the default connection for IPv4 addressing

@@ -2350,7 +2396,7 @@ nm_setting_ip4_config_get_may_fail (Returns the value contained in the “may-fail” property.

-

Parameters

+

Parameters

@@ -2365,7 +2411,7 @@ property.

-

Returns

+

Returns

TRUE if this connection doesn't require IPv4 addressing to complete for the connection to succeed.

@@ -2498,6 +2544,12 @@ not valid with the given IP4 method


+

NM_SETTING_IP4_CONFIG_DHCP_TIMEOUT

+
#define NM_SETTING_IP4_CONFIG_DHCP_TIMEOUT       "dhcp-timeout"
+
+
+
+

NM_SETTING_IP4_CONFIG_NEVER_DEFAULT

#define NM_SETTING_IP4_CONFIG_NEVER_DEFAULT      "never-default"
 
@@ -2600,6 +2652,15 @@ providing a static hostname for the computer. If the

+

The “dhcp-timeout” property

+
  “dhcp-timeout”             guint
+

Number of seconds after which the unfinished DHCP transaction fails +or zero for default.

+

Flags: Read / Write

+

Default value: 0

+
+
+

The “dns” property

  “dns”                      GArray_guint_ *

List of DNS servers (network byte order). For the "auto" method, these diff --git a/docs/libnm-util/html/NMSettingIP6Config.html b/docs/libnm-util/html/NMSettingIP6Config.html index 76fd5ef4..eb42de11 100644 --- a/docs/libnm-util/html/NMSettingIP6Config.html +++ b/docs/libnm-util/html/NMSettingIP6Config.html @@ -677,10 +677,10 @@

Object Hierarchy

-
    GBoxed
+
    GBoxed
     ├── NMIP6Address
     ╰── NMIP6Route
-    GEnum
+    GEnum
     ├── NMSettingIP6ConfigError
     ╰── NMSettingIP6ConfigPrivacy
     GObject
diff --git a/docs/libnm-util/html/NMSettingInfiniband.html b/docs/libnm-util/html/NMSettingInfiniband.html
index de8975e2..82db623e 100644
--- a/docs/libnm-util/html/NMSettingInfiniband.html
+++ b/docs/libnm-util/html/NMSettingInfiniband.html
@@ -182,7 +182,7 @@
 

Object Hierarchy

-
    GEnum
+
    GEnum
     ╰── NMSettingInfinibandError
     GObject
     ╰── NMSetting
diff --git a/docs/libnm-util/html/NMSettingOlpcMesh.html b/docs/libnm-util/html/NMSettingOlpcMesh.html
index fbcb946d..d9a5d1d0 100644
--- a/docs/libnm-util/html/NMSettingOlpcMesh.html
+++ b/docs/libnm-util/html/NMSettingOlpcMesh.html
@@ -148,7 +148,7 @@
 

Object Hierarchy

-
    GEnum
+
    GEnum
     ╰── NMSettingOlpcMeshError
     GObject
     ╰── NMSetting
diff --git a/docs/libnm-util/html/NMSettingPPP.html b/docs/libnm-util/html/NMSettingPPP.html
index 543868a4..c66bd595 100644
--- a/docs/libnm-util/html/NMSettingPPP.html
+++ b/docs/libnm-util/html/NMSettingPPP.html
@@ -404,7 +404,7 @@ that require PPP to deliver IP capability

Object Hierarchy

-
    GEnum
+
    GEnum
     ╰── NMSettingPPPError
     GObject
     ╰── NMSetting
diff --git a/docs/libnm-util/html/NMSettingPPPOE.html b/docs/libnm-util/html/NMSettingPPPOE.html
index 0d2355a7..c7abaffe 100644
--- a/docs/libnm-util/html/NMSettingPPPOE.html
+++ b/docs/libnm-util/html/NMSettingPPPOE.html
@@ -165,7 +165,7 @@
 

Object Hierarchy

-
    GEnum
+
    GEnum
     ╰── NMSettingPPPOEError
     GObject
     ╰── NMSetting
diff --git a/docs/libnm-util/html/NMSettingSerial.html b/docs/libnm-util/html/NMSettingSerial.html
index b371e910..43c21e9e 100644
--- a/docs/libnm-util/html/NMSettingSerial.html
+++ b/docs/libnm-util/html/NMSettingSerial.html
@@ -183,7 +183,7 @@ serial communications

Object Hierarchy

-
    GEnum
+
    GEnum
     ╰── NMSettingSerialError
     GObject
     ╰── NMSetting
diff --git a/docs/libnm-util/html/NMSettingTeam.html b/docs/libnm-util/html/NMSettingTeam.html
index 846f6179..2e40a312 100644
--- a/docs/libnm-util/html/NMSettingTeam.html
+++ b/docs/libnm-util/html/NMSettingTeam.html
@@ -131,7 +131,7 @@
 

Object Hierarchy

-
    GEnum
+
    GEnum
     ╰── NMSettingTeamError
     GObject
     ╰── NMSetting
diff --git a/docs/libnm-util/html/NMSettingTeamPort.html b/docs/libnm-util/html/NMSettingTeamPort.html
index 37a4495b..c08a4eb0 100644
--- a/docs/libnm-util/html/NMSettingTeamPort.html
+++ b/docs/libnm-util/html/NMSettingTeamPort.html
@@ -112,7 +112,7 @@
 

Object Hierarchy

-
    GEnum
+
    GEnum
     ╰── NMSettingTeamPortError
     GObject
     ╰── NMSetting
diff --git a/docs/libnm-util/html/NMSettingVPN.html b/docs/libnm-util/html/NMSettingVPN.html
index 020ab7c0..e3243206 100644
--- a/docs/libnm-util/html/NMSettingVPN.html
+++ b/docs/libnm-util/html/NMSettingVPN.html
@@ -247,12 +247,16 @@
 #define
 NM_SETTING_VPN_SECRETS
 
+
+#define
+NMSettingVpn
+
 
 

Object Hierarchy

-
    GEnum
+
    GEnum
     ╰── NMSettingVpnError
     GObject
     ╰── NMSetting
@@ -850,6 +854,12 @@ required

#define NM_SETTING_VPN_SECRETS      "secrets"
 
+
+
+

NMSettingVpn

+
#define NMSettingVpn NMSettingVPN
+
+

Property Details

diff --git a/docs/libnm-util/html/NMSettingVlan.html b/docs/libnm-util/html/NMSettingVlan.html index 87465814..df603abd 100644 --- a/docs/libnm-util/html/NMSettingVlan.html +++ b/docs/libnm-util/html/NMSettingVlan.html @@ -50,6 +50,10 @@ +#define +NM_VLAN_FLAGS_ALL + + NMSetting * @@ -257,7 +261,7 @@

Object Hierarchy

-
    GEnum
+
    GEnum
     ├── NMSettingVlanError
     ├── NMVlanFlags
     ╰── NMVlanPriorityMap
@@ -290,12 +294,17 @@ nm_setting_vlan_error_quark (void
 

+

NM_VLAN_FLAGS_ALL

+
#define             NM_VLAN_FLAGS_ALL
+
+
+

nm_setting_vlan_new ()

NMSetting *
 nm_setting_vlan_new (void);

Creates a new NMSettingVlan object with default values.

-

Returns

+

Returns

the new empty NMSettingVlan object.

[transfer full]

@@ -306,7 +315,7 @@ nm_setting_vlan_new (void<
const char *
 nm_setting_vlan_get_interface_name (NMSettingVlan *setting);
-

Parameters

+

Parameters

@@ -321,7 +330,7 @@ nm_setting_vlan_get_interface_name (
-

Returns

+

Returns

the “interface_name” property of the setting

@@ -331,7 +340,7 @@ nm_setting_vlan_get_interface_name (const char * nm_setting_vlan_get_parent (NMSettingVlan *setting);
-

Parameters

+

Parameters

@@ -346,7 +355,7 @@ nm_setting_vlan_get_parent ( -

Returns

+

Returns

the “parent” property of the setting

@@ -356,7 +365,7 @@ nm_setting_vlan_get_parent (guint32 nm_setting_vlan_get_id (NMSettingVlan *setting);
-

Parameters

+

Parameters

@@ -371,7 +380,7 @@ nm_setting_vlan_get_id ( -

Returns

+

Returns

the “id” property of the setting

@@ -381,7 +390,7 @@ nm_setting_vlan_get_id (guint32 nm_setting_vlan_get_flags (NMSettingVlan *setting);
-

Parameters

+

Parameters

@@ -396,7 +405,7 @@ nm_setting_vlan_get_flags ( -

Returns

+

Returns

the “flags” property of the setting

@@ -410,7 +419,7 @@ nm_setting_vlan_get_num_priorities (“ingress_priority_map” or “egress_priority_map” properties of this setting.

-

Parameters

+

Parameters

@@ -432,7 +441,7 @@ properties of this setting.

-

Returns

+

Returns

return the number of ingress/egress priority entries, -1 if error

@@ -448,7 +457,7 @@ nm_setting_vlan_get_priority (“ingress_priority_map” or “egress_priority_map” properties of this setting.

-

Parameters

+

Parameters

@@ -485,7 +494,7 @@ or
-

Returns

+

Returns

TRUE if a priority map was returned, FALSE if error

@@ -514,7 +523,7 @@ Priority Code Point (PCP) value, and toto is the outgoing 802.1q VLAN Priority Code Point (PCP) value.

-

Parameters

+

Parameters

@@ -548,7 +557,7 @@ to

-

Returns

+

Returns

TRUE if the new priority mapping was successfully added to the list, FALSE if error

@@ -565,7 +574,7 @@ nm_setting_vlan_remove_priority (“ingress_priority_map” or “egress_priority_map” properties.

-

Parameters

+

Parameters

@@ -608,7 +617,7 @@ or
-

Parameters

+

Parameters

@@ -642,7 +651,7 @@ to

-

Returns

+

Returns

TRUE if the priority mapping was found and removed; FALSE if it was not.

Since: 0.9.10

@@ -661,7 +670,7 @@ or
-

Parameters

+

Parameters

@@ -688,7 +697,7 @@ properties.

-

Returns

+

Returns

TRUE if the priority mapping was found and removed; FALSE if it was not.

Since: 0.9.10

@@ -702,7 +711,7 @@ nm_setting_vlan_clear_priorities (Clear all the entires from “ingress_priority_map” or “egress_priority_map” properties.

-

Parameters

+

Parameters

@@ -735,7 +744,7 @@ nm_setting_vlan_add_priority_str (“egress_priority_map” properties. The priority map maps the Linux SKB priorities to 802.1p priorities.

-

Parameters

+

Parameters

@@ -762,7 +771,7 @@ the Linux SKB priorities to 802.1p priorities.

-

Returns

+

Returns

TRUE if the entry was successfully added to the list, or it overwrote the old value, FALSE if error

@@ -933,6 +942,14 @@ to 802.1p priorities used in VLANs.

  + +

NM_VLAN_FLAG_MVRP

+ +

indicates that this interface should use MVRP to register + itself with it's switch

+ +  + @@ -956,9 +973,10 @@ both "from" and "to" are unsigned integers, ie "7:3".

interface. Flags include NM_VLAN_FLAG_REORDER_HEADERS (reordering of output packet headers), NM_VLAN_FLAG_GVRP (use of the GVRP protocol), and NM_VLAN_FLAG_LOOSE_BINDING (loose binding of the interface to its -master device's operating state).

+master device's operating state), NM_VLAN_FLAG_MVRP (use of the MVRP +protocol).

Flags: Read / Write / Construct

-

Default value: 1

+

Default value: 0


diff --git a/docs/libnm-util/html/NMSettingWimax.html b/docs/libnm-util/html/NMSettingWimax.html index 034ebe90..26544076 100644 --- a/docs/libnm-util/html/NMSettingWimax.html +++ b/docs/libnm-util/html/NMSettingWimax.html @@ -131,7 +131,7 @@

Object Hierarchy

-
    GEnum
+
    GEnum
     ╰── NMSettingWimaxError
     GObject
     ╰── NMSetting
@@ -147,6 +147,9 @@
 

Description

The NMSettingWimax object is a NMSetting subclass that describes properties necessary for connection to 802.16e Mobile WiMAX networks.

+

NetworkManager no longer supports WiMAX; while this API remains available for +backward-compatibility reasons, it serves no real purpose, since WiMAX +connections cannot be activated.

Functions

@@ -154,9 +157,13 @@ necessary for connection to 802.16e Mobile WiMAX networks.

nm_setting_wimax_error_quark ()

GQuark
 nm_setting_wimax_error_quark (void);
+
+

nm_setting_wimax_error_quark has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Registers an error quark for NMSettingWimax if necessary.

-

Returns

+

Returns

the error quark used for NMSettingWimax errors.

@@ -165,9 +172,13 @@ nm_setting_wimax_error_quark (voi

nm_setting_wimax_new ()

NMSetting *
 nm_setting_wimax_new (void);
+
+

nm_setting_wimax_new has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Creates a new NMSettingWimax object with default values.

-

Returns

+

Returns

the new empty NMSettingWimax object

@@ -176,10 +187,14 @@ nm_setting_wimax_new (void

nm_setting_wimax_get_network_name ()

const char *
 nm_setting_wimax_get_network_name (NMSettingWimax *setting);
+
+

nm_setting_wimax_get_network_name has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Returns the WiMAX NSP name (ex "Sprint" or "CLEAR") which identifies the specific WiMAX network this setting describes a connection to.

-

Parameters

+

Parameters

@@ -194,7 +209,7 @@ specific WiMAX network this setting describes a connection to.

-

Returns

+

Returns

the WiMAX NSP name

@@ -203,10 +218,14 @@ specific WiMAX network this setting describes a connection to.

nm_setting_wimax_get_mac_address ()

const GByteArray *
 nm_setting_wimax_get_mac_address (NMSettingWimax *setting);
+
+

nm_setting_wimax_get_mac_address has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Returns the MAC address of a WiMAX device which this connection is locked to.

-

Parameters

+

Parameters

@@ -221,7 +240,7 @@ to.

-

Returns

+

Returns

the MAC address

@@ -298,6 +317,10 @@ required

If specified, this connection will only apply to the WiMAX device whose MAC address matches. This property does not change the MAC address of the device (known as MAC spoofing).

+
+

NMSettingWimax:mac-address has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Flags: Read / Write


@@ -306,6 +329,10 @@ device (known as MAC spoofing).

  “network-name”             gchar *

Network Service Provider (NSP) name of the WiMAX network this connection should use.

+
+

NMSettingWimax:network-name has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Flags: Read / Write

Default value: NULL

diff --git a/docs/libnm-util/html/NMSettingWired.html b/docs/libnm-util/html/NMSettingWired.html index 9a6619aa..75184b1b 100644 --- a/docs/libnm-util/html/NMSettingWired.html +++ b/docs/libnm-util/html/NMSettingWired.html @@ -369,7 +369,7 @@

Object Hierarchy

-
    GEnum
+
    GEnum
     ╰── NMSettingWiredError
     GObject
     ╰── NMSetting
diff --git a/docs/libnm-util/html/NMSettingWireless.html b/docs/libnm-util/html/NMSettingWireless.html
index 1f1ac2c2..1db2d508 100644
--- a/docs/libnm-util/html/NMSettingWireless.html
+++ b/docs/libnm-util/html/NMSettingWireless.html
@@ -195,6 +195,14 @@
 
 
 
+guint32
+
+
+nm_setting_wireless_get_powersave ()
+
+
+
+
 gboolean
 
 
@@ -296,6 +304,11 @@
 
 
 guint
+powersave
+Read / Write
+
+
+guint
 rate
 Read / Write / Construct
 
@@ -399,6 +412,10 @@
 
 
 #define
+NM_SETTING_WIRELESS_POWERSAVE
+
+
+#define
 NM_SETTING_WIRELESS_SEC
 
 
@@ -418,7 +435,7 @@
 

Object Hierarchy

-
    GEnum
+
    GEnum
     ╰── NMSettingWirelessError
     GObject
     ╰── NMSetting
@@ -961,6 +978,32 @@ nm_setting_wireless_get_hidden (
 
+

nm_setting_wireless_get_powersave ()

+
guint32
+nm_setting_wireless_get_powersave (NMSettingWireless *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingWireless

 
+
+
+

Returns

+

the “powersave” property of the setting

+
+

Since: 1.2

+
+
+

nm_setting_wireless_add_seen_bssid ()

gboolean
 nm_setting_wireless_add_seen_bssid (NMSettingWireless *setting,
@@ -970,7 +1013,7 @@ NetworkManager now tracks previously seen BSSIDs internally so this function
 no longer has much use. Actually, changes you make using this function will
 not be preserved.

-

Parameters

+

Parameters

@@ -992,7 +1035,7 @@ not be preserved.

-

Returns

+

Returns

TRUE if bssid was already known, FALSE if not

@@ -1004,7 +1047,7 @@ was already known, FALSE if not

nm_setting_wireless_get_num_seen_bssids (NMSettingWireless *setting);
-

Parameters

+

Parameters

@@ -1019,7 +1062,7 @@ nm_setting_wireless_get_num_seen_bssids
-

Returns

+

Returns

the number of BSSIDs in the previously seen BSSID list

@@ -1030,7 +1073,7 @@ nm_setting_wireless_get_num_seen_bssids nm_setting_wireless_get_seen_bssid (NMSettingWireless *setting, guint32 i);
-

Parameters

+

Parameters

@@ -1052,7 +1095,7 @@ nm_setting_wireless_get_seen_bssid (
-

Returns

+

Returns

the BSSID at index i

@@ -1075,7 +1118,7 @@ and mode. Useful for clients that wish to filter a set of connections against a set of access points and determine which connections are compatible with which access points.

-

Parameters

+

Parameters

@@ -1119,7 +1162,7 @@ capabilities

-

Returns

+

Returns

TRUE if the given settings are compatible with the access point's security flags and mode, FALSE if they are not.

@@ -1135,7 +1178,7 @@ nm_setting_wireless_get_security (
-

Parameters

+

Parameters

@@ -1150,7 +1193,7 @@ the presence of NM_SETTING_WIRELESS_SECURITY_SETTING_NAME in the connection.

-

Returns

+

Returns

the “security” property of the setting

@@ -1302,6 +1345,12 @@ set to a value that requires the +

NM_SETTING_WIRELESS_POWERSAVE

+
#define NM_SETTING_WIRELESS_POWERSAVE   "powersave"
+
+ +
+

NM_SETTING_WIRELESS_SEC

#define NM_SETTING_WIRELESS_SEC         "security"
 
@@ -1424,6 +1473,18 @@ breaking larger packets up into multiple Ethernet frames.


+

The “powersave” property

+
  “powersave”                guint
+

If set to FALSE, Wi-Fi power saving behavior is disabled. If set to +TRUE, Wi-Fi power saving behavior is enabled. All other values are +reserved. Note that even though only boolean values are allowed, the +property type is an unsigned integer to allow for future expansion.

+

Flags: Read / Write

+

Default value: 0

+

Since: 1.2

+
+
+

The “rate” property

  “rate”                     guint

If non-zero, directs the device to only use the specified bitrate for diff --git a/docs/libnm-util/html/NMSettingWirelessSecurity.html b/docs/libnm-util/html/NMSettingWirelessSecurity.html index 36b60f5f..d091dda2 100644 --- a/docs/libnm-util/html/NMSettingWirelessSecurity.html +++ b/docs/libnm-util/html/NMSettingWirelessSecurity.html @@ -498,7 +498,7 @@ use WEP, LEAP, WPA or WPA2/RSN security

Object Hierarchy

-
    GEnum
+
    GEnum
     ├── NMSettingWirelessSecurityError
     ╰── NMWepKeyType
     GObject
diff --git a/docs/libnm-util/html/api-index-full.html b/docs/libnm-util/html/api-index-full.html
index b7b0aaf5..cf28ac5a 100644
--- a/docs/libnm-util/html/api-index-full.html
+++ b/docs/libnm-util/html/api-index-full.html
@@ -23,6 +23,8 @@
                      | 
                   D
                      | 
+                  G
+                     | 
                   I
                      | 
                   S
@@ -542,6 +544,74 @@
 
 
+DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UCHAR, macro in nm-dbus-glib-types +
+
+
+DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT, macro in nm-dbus-glib-types +
+
+
+DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS, macro in nm-dbus-glib-types +
+
+
+DBUS_TYPE_G_ARRAY_OF_IP6_ROUTE, macro in nm-dbus-glib-types +
+
+
+DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH, macro in nm-dbus-glib-types +
+
+
+DBUS_TYPE_G_ARRAY_OF_STRING, macro in nm-dbus-glib-types +
+
+
+DBUS_TYPE_G_ARRAY_OF_UINT, macro in nm-dbus-glib-types +
+
+
+DBUS_TYPE_G_IP6_ADDRESS, macro in nm-dbus-glib-types +
+
+
+DBUS_TYPE_G_IP6_ROUTE, macro in nm-dbus-glib-types +
+
+
+DBUS_TYPE_G_LIST_OF_STRING, macro in nm-dbus-glib-types +
+
+
+DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT, macro in nm-dbus-glib-types +
+
+
+DBUS_TYPE_G_MAP_OF_STRING, macro in nm-dbus-glib-types +
+
+
+DBUS_TYPE_G_MAP_OF_VARIANT, macro in nm-dbus-glib-types +
+
+
+DBUS_TYPE_NM_IP_ADDRESS, macro in nm-dbus-glib-types +
+
+
+DBUS_TYPE_NM_IP_ADDRESSES, macro in nm-dbus-glib-types +
+
+
+DBUS_TYPE_NM_IP_ROUTE, macro in nm-dbus-glib-types +
+
+
+DBUS_TYPE_NM_IP_ROUTES, macro in nm-dbus-glib-types +
+
+
NM_DBUS_VPN_ALREADY_STARTED, macro in NetworkManagerVPN
@@ -629,6 +699,47 @@ NMDeviceWifiCapabilities, enum in NetworkManager
+

G

+
+g_value_array_append, macro in nm-gvaluearray-compat +
+
+
+g_value_array_copy, macro in nm-gvaluearray-compat +
+
+
+g_value_array_free, function in nm-gvaluearray-compat +
+
+
+g_value_array_get_nth, macro in nm-gvaluearray-compat +
+
+
+g_value_array_insert, macro in nm-gvaluearray-compat +
+
+
+g_value_array_new, macro in nm-gvaluearray-compat +
+
+
+g_value_array_prepend, macro in nm-gvaluearray-compat +
+
+
+g_value_array_remove, macro in nm-gvaluearray-compat +
+
+
+g_value_array_sort, macro in nm-gvaluearray-compat +
+
+
+g_value_array_sort_with_data, macro in nm-gvaluearray-compat +
+

I

nm_ip4_address_compare, function in NMSettingIP4Config @@ -1348,6 +1459,10 @@
+NMSettingIP4Config:dhcp-timeout, object property in NMSettingIP4Config +
+
+
NMSettingIP4Config:dns, object property in NMSettingIP4Config
@@ -1636,6 +1751,10 @@
+NMSettingVpn, macro in NMSettingVPN +
+
+
NMSettingVPN:data, object property in NMSettingVPN
@@ -1756,6 +1875,10 @@
+NMSettingWireless:powersave, object property in NMSettingWireless +
+
+
NMSettingWireless:rate, object property in NMSettingWireless
@@ -3284,6 +3407,10 @@
+NM_SETTING_IP4_CONFIG_DHCP_TIMEOUT, macro in NMSettingIP4Config +
+
+
NM_SETTING_IP4_CONFIG_DNS, macro in NMSettingIP4Config
@@ -3316,6 +3443,10 @@
+nm_setting_ip4_config_get_dhcp_timeout, function in NMSettingIP4Config +
+
+
nm_setting_ip4_config_get_dns, function in NMSettingIP4Config
@@ -4524,6 +4655,10 @@
+nm_setting_wireless_get_powersave, function in NMSettingWireless +
+
+
nm_setting_wireless_get_rate, function in NMSettingWireless
@@ -4580,6 +4715,10 @@
+NM_SETTING_WIRELESS_POWERSAVE, macro in NMSettingWireless +
+
+
NM_SETTING_WIRELESS_RATE, macro in NMSettingWireless
@@ -5054,6 +5193,10 @@
+NM_VLAN_FLAGS_ALL, macro in NMSettingVlan +
+
+
NMVPNConnectionState, enum in NetworkManagerVPN
diff --git a/docs/libnm-util/html/index.html b/docs/libnm-util/html/index.html index eef425a4..10f811f3 100644 --- a/docs/libnm-util/html/index.html +++ b/docs/libnm-util/html/index.html @@ -15,7 +15,7 @@

- for libnm-util 1.0.10 + for libnm-util 1.1.90 The latest version of this documentation can be found on-line at https://developer.gnome.org/libnm-util/0.9/. diff --git a/docs/libnm-util/html/index.sgml b/docs/libnm-util/html/index.sgml index 77fff963..ab7fa602 100644 --- a/docs/libnm-util/html/index.sgml +++ b/docs/libnm-util/html/index.sgml @@ -313,6 +313,7 @@ + @@ -340,6 +341,7 @@ + @@ -354,6 +356,7 @@ + @@ -863,6 +866,7 @@ + @@ -897,6 +901,7 @@ + @@ -1275,6 +1280,7 @@ + @@ -1296,6 +1302,7 @@ + @@ -1308,6 +1315,7 @@ + @@ -1569,6 +1577,7 @@ + @@ -1725,6 +1734,8 @@ + + diff --git a/docs/libnm-util/html/libnm-util-NetworkManager.html b/docs/libnm-util/html/libnm-util-NetworkManager.html index 1154416a..007d5dfd 100644 --- a/docs/libnm-util/html/libnm-util-NetworkManager.html +++ b/docs/libnm-util/html/libnm-util-NetworkManager.html @@ -770,6 +770,20 @@ GSM/UMTS, or LTE network access protocols

  + +

NM_DEVICE_TYPE_TUN

+ +

a TUN/TAP interface

+ +  + + +

NM_DEVICE_TYPE_IP_TUNNEL

+ +

an IP tunnel interface

+ +  +
diff --git a/docs/libnm-util/html/libnm-util-nm-utils.html b/docs/libnm-util/html/libnm-util-nm-utils.html index 350ba973..9507d0ab 100644 --- a/docs/libnm-util/html/libnm-util-nm-utils.html +++ b/docs/libnm-util/html/libnm-util-nm-utils.html @@ -480,7 +480,7 @@

Object Hierarchy

-
    GEnum
+
    GEnum
     ╰── NMUtilsSecurityType
 
diff --git a/docs/libnm-util/html/libnm-util.devhelp2 b/docs/libnm-util/html/libnm-util.devhelp2 index 2530e827..987b876a 100644 --- a/docs/libnm-util/html/libnm-util.devhelp2 +++ b/docs/libnm-util/html/libnm-util.devhelp2 @@ -266,6 +266,7 @@ + @@ -287,6 +288,7 @@ + @@ -300,6 +302,7 @@ + @@ -466,10 +469,10 @@ - - - - + + + + @@ -598,6 +601,7 @@ + @@ -927,6 +931,7 @@ + @@ -943,6 +948,7 @@ + @@ -954,6 +960,7 @@ + @@ -1155,6 +1162,7 @@ + @@ -1457,6 +1465,7 @@ + @@ -1541,6 +1550,8 @@ + + diff --git a/docs/libnm-util/html/object-tree.html b/docs/libnm-util/html/object-tree.html index 4c668702..9c2eaa40 100644 --- a/docs/libnm-util/html/object-tree.html +++ b/docs/libnm-util/html/object-tree.html @@ -52,7 +52,7 @@ ├── NMSettingWirelessSecurity ╰── NMSettingVPN ╰── NMConnection - GEnum + GEnum ├── NMConnectionError ├── NMSetting8021xCKFormat ├── NMSetting8021xCKScheme @@ -95,7 +95,7 @@ ├── NMVlanFlags ├── NMVlanPriorityMap ╰── NMWepKeyType - GBoxed + GBoxed ├── NMIP4Address ├── NMIP4Route ├── NMIP6Address diff --git a/docs/libnm-util/libnm-util-sections.txt b/docs/libnm-util/libnm-util-sections.txt index 839ba681..00aa60c5 100644 --- a/docs/libnm-util/libnm-util-sections.txt +++ b/docs/libnm-util/libnm-util-sections.txt @@ -203,6 +203,43 @@ NM_TYPE_CONNECTION nm_connection_get_type +
+nm-dbus-glib-types +DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH +DBUS_TYPE_G_ARRAY_OF_STRING +DBUS_TYPE_G_ARRAY_OF_UINT +DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UCHAR +DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT +DBUS_TYPE_G_MAP_OF_VARIANT +DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT +DBUS_TYPE_G_MAP_OF_STRING +DBUS_TYPE_G_LIST_OF_STRING +DBUS_TYPE_G_IP6_ADDRESS +DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS +DBUS_TYPE_G_IP6_ROUTE +DBUS_TYPE_G_ARRAY_OF_IP6_ROUTE +DBUS_TYPE_NM_IP_ADDRESS +DBUS_TYPE_NM_IP_ADDRESSES +DBUS_TYPE_NM_IP_ROUTE +DBUS_TYPE_NM_IP_ROUTES +
+ +
+nm-gvaluearray-compat +g_value_array_get_nth +g_value_array_new +g_value_array_free +g_value_array_copy +g_value_array_prepend +g_value_array_append +g_value_array_insert +g_value_array_remove +g_value_array_sort +g_value_array_sort_with_data + +g_value_array_get_type +
+
nm-setting NMSetting @@ -798,6 +835,7 @@ NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME +NM_SETTING_IP4_CONFIG_DHCP_TIMEOUT NM_SETTING_IP4_CONFIG_NEVER_DEFAULT NM_SETTING_IP4_CONFIG_MAY_FAIL NM_SETTING_IP4_CONFIG_METHOD_AUTO @@ -861,6 +899,7 @@ nm_setting_ip4_config_get_ignore_auto_dns nm_setting_ip4_config_get_dhcp_client_id nm_setting_ip4_config_get_dhcp_send_hostname nm_setting_ip4_config_get_dhcp_hostname +nm_setting_ip4_config_get_dhcp_timeout nm_setting_ip4_config_get_never_default nm_setting_ip4_config_get_may_fail @@ -1179,6 +1218,7 @@ NM_SETTING_VLAN_INGRESS_PRIORITY_MAP NM_SETTING_VLAN_EGRESS_PRIORITY_MAP NMVlanPriorityMap NMVlanFlags +NM_VLAN_FLAGS_ALL nm_setting_vlan_new nm_setting_vlan_get_interface_name nm_setting_vlan_get_parent @@ -1231,6 +1271,7 @@ nm_setting_vpn_add_secret nm_setting_vpn_get_secret nm_setting_vpn_remove_secret nm_setting_vpn_foreach_secret +NMSettingVpn NMSettingVPN NMSettingVPNClass @@ -1340,6 +1381,7 @@ NM_SETTING_WIRELESS_MAC_ADDRESS_BLACKLIST NM_SETTING_WIRELESS_MTU NM_SETTING_WIRELESS_SEEN_BSSIDS NM_SETTING_WIRELESS_HIDDEN +NM_SETTING_WIRELESS_POWERSAVE NM_SETTING_WIRELESS_SEC NM_SETTING_WIRELESS_MODE_ADHOC NM_SETTING_WIRELESS_MODE_AP @@ -1363,6 +1405,7 @@ nm_setting_wireless_remove_mac_blacklist_item_by_value nm_setting_wireless_clear_mac_blacklist_items nm_setting_wireless_get_mtu nm_setting_wireless_get_hidden +nm_setting_wireless_get_powersave nm_setting_wireless_add_seen_bssid nm_setting_wireless_get_num_seen_bssids nm_setting_wireless_get_seen_bssid diff --git a/docs/libnm-util/version.xml b/docs/libnm-util/version.xml index 7ee7020b..69658cdd 100644 --- a/docs/libnm-util/version.xml +++ b/docs/libnm-util/version.xml @@ -1 +1 @@ -1.0.10 +1.1.90 diff --git a/docs/libnm/Makefile.am b/docs/libnm/Makefile.am index 2525856d..5b96d5aa 100644 --- a/docs/libnm/Makefile.am +++ b/docs/libnm/Makefile.am @@ -39,6 +39,7 @@ IGNORE_HFILES= \ nm-dbus-helpers.h \ nm-core-internal.h \ nm-core-types.h \ + nm-core-types-internal.h \ nm-device-private.h \ nm-dhcp4-config.h \ nm-dhcp6-config.h \ @@ -54,6 +55,7 @@ IGNORE_HFILES= \ nm-types.h \ nm-utils-private.h \ nm-vpn-plugin-old.h \ + nm-vpn-service-plugin.h \ nm-core-tests-enum-types.h # Images to copy into HTML directory. diff --git a/docs/libnm/Makefile.in b/docs/libnm/Makefile.in index 7d4cbe91..e58e1db9 100644 --- a/docs/libnm/Makefile.in +++ b/docs/libnm/Makefile.in @@ -153,7 +153,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -165,8 +164,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -176,6 +173,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -230,16 +228,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -276,6 +271,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -304,7 +301,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -319,6 +315,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -379,6 +377,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -386,6 +385,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -442,6 +442,7 @@ IGNORE_HFILES = \ nm-dbus-helpers.h \ nm-core-internal.h \ nm-core-types.h \ + nm-core-types-internal.h \ nm-device-private.h \ nm-dhcp4-config.h \ nm-dhcp6-config.h \ @@ -457,6 +458,7 @@ IGNORE_HFILES = \ nm-types.h \ nm-utils-private.h \ nm-vpn-plugin-old.h \ + nm-vpn-service-plugin.h \ nm-core-tests-enum-types.h diff --git a/docs/libnm/html/NMAccessPoint.html b/docs/libnm/html/NMAccessPoint.html index 4aa880dc..b1469048 100644 --- a/docs/libnm/html/NMAccessPoint.html +++ b/docs/libnm/html/NMAccessPoint.html @@ -282,7 +282,7 @@ nm_access_point_get_flags (NMAccessPoint *ap);

Gets the flags of the access point.

-

Parameters

+

Parameters

@@ -297,7 +297,7 @@ nm_access_point_get_flags ( -

Returns

+

Returns

the flags

@@ -308,7 +308,7 @@ nm_access_point_get_flags (NMAccessPoint *ap);

Gets the WPA (version 1) flags of the access point.

-

Parameters

+

Parameters

@@ -323,7 +323,7 @@ nm_access_point_get_wpa_flags (
-

Returns

+

Returns

the WPA flags

@@ -335,7 +335,7 @@ nm_access_point_get_rsn_flags (Gets the RSN (Robust Secure Network, ie WPA version 2) flags of the access point.

-

Parameters

+

Parameters

@@ -350,7 +350,7 @@ point.

-

Returns

+

Returns

the RSN flags

@@ -361,7 +361,7 @@ point.

nm_access_point_get_ssid (NMAccessPoint *ap);

Gets the SSID of the access point.

-

Parameters

+

Parameters

@@ -376,7 +376,7 @@ nm_access_point_get_ssid ( -

Returns

+

Returns

the GBytes containing the SSID, or NULL if the SSID is unknown.

[transfer none]

@@ -389,7 +389,7 @@ SSID is unknown.

nm_access_point_get_bssid (NMAccessPoint *ap);

Gets the Basic Service Set ID (BSSID) of the Wi-Fi access point.

-

Parameters

+

Parameters

@@ -404,7 +404,7 @@ nm_access_point_get_bssid ( -

Returns

+

Returns

the BSSID of the access point. This is an internal string and must not be modified or freed.

@@ -416,7 +416,7 @@ not be modified or freed.

nm_access_point_get_frequency (NMAccessPoint *ap);

Gets the frequency of the access point.

-

Parameters

+

Parameters

@@ -431,7 +431,7 @@ nm_access_point_get_frequency (
-

Returns

+

Returns

the frequency

@@ -442,7 +442,7 @@ nm_access_point_get_frequency (NMAccessPoint *ap);

Gets the mode of the access point.

-

Parameters

+

Parameters

@@ -457,7 +457,7 @@ nm_access_point_get_mode ( -

Returns

+

Returns

the mode

@@ -468,7 +468,7 @@ nm_access_point_get_mode (NMAccessPoint *ap);

Gets the maximum bit rate of the access point in kbit/s.

-

Parameters

+

Parameters

@@ -483,7 +483,7 @@ nm_access_point_get_max_bitrate (
-

Returns

+

Returns

the maximum bit rate (kbit/s)

@@ -494,7 +494,7 @@ nm_access_point_get_max_bitrate (NMAccessPoint *ap);

Gets the current signal strength of the access point.

-

Parameters

+

Parameters

@@ -509,7 +509,7 @@ nm_access_point_get_strength ( -

Returns

+

Returns

the signal strength

@@ -522,7 +522,7 @@ nm_access_point_get_last_seen (
-

Parameters

+

Parameters

@@ -537,10 +537,10 @@ point has not been found in a scan.

-

Returns

+

Returns

the last seen time in seconds

-

Since: 1.0.6

+

Since: 1.2


@@ -558,7 +558,7 @@ use NMDevice using nm_device_filter_connections() and finally filter that list with this function.

-

Parameters

+

Parameters

@@ -581,7 +581,7 @@ filter.

-

Returns

+

Returns

an array of NMConnections that could be activated with the given ap . The array should @@ -601,7 +601,7 @@ the connection may be activated with that AP. The connection must match the 's SSID, (if given) BSSID, and other attributes like security settings, channel, band, etc.

-

Parameters

+

Parameters

@@ -625,7 +625,7 @@ against

-

Returns

+

Returns

TRUE if the connection may be activated with this Wi-Fi AP, FALSE if it cannot be.

@@ -746,7 +746,7 @@ access point has not been found in a scan.

Flags: Read

Allowed values: >= -1

Default value: -1

-

Since: 1.0.6

+

Since: 1.2


diff --git a/docs/libnm/html/NMActiveConnection.html b/docs/libnm/html/NMActiveConnection.html index a059c180..bcd2410d 100644 --- a/docs/libnm/html/NMActiveConnection.html +++ b/docs/libnm/html/NMActiveConnection.html @@ -348,7 +348,7 @@ nm_active_connection_get_connection (Gets the NMRemoteConnection associated with connection .

-

Parameters

+

Parameters

@@ -363,7 +363,7 @@ nm_active_connection_get_connection (
-

Returns

+

Returns

the NMRemoteConnection which this NMActiveConnection is an active instance of.

[transfer none]

@@ -376,7 +376,7 @@ nm_active_connection_get_connection (NMActiveConnection *connection);

Gets the NMConnection's ID.

-

Parameters

+

Parameters

@@ -391,7 +391,7 @@ nm_active_connection_get_id ( -

Returns

+

Returns

the ID of the NMConnection that backs the NMActiveConnection. This is the internal string used by the connection, and must not be modified.

@@ -403,7 +403,7 @@ This is the internal string used by the connection, and must not be modified.

NMActiveConnection *connection
);

Gets the NMConnection's UUID.

-

Parameters

+

Parameters

@@ -418,7 +418,7 @@ nm_active_connection_get_uuid (
-

Returns

+

Returns

the UUID of the NMConnection that backs the NMActiveConnection. This is the internal string used by the connection, and must not be modified.

@@ -431,7 +431,7 @@ nm_active_connection_get_connection_type (NMActiveConnection *connection);

Gets the NMConnection's type.

-

Parameters

+

Parameters

@@ -446,7 +446,7 @@ nm_active_connection_get_connection_type
-

Returns

+

Returns

the type of the NMConnection that backs the NMActiveConnection. This is the internal string used by the connection, and must not be modified.

@@ -465,7 +465,7 @@ is based on other information. (Eg, if connectionNMAccessPoint, and you can resolve it with nm_device_wifi_get_access_point_by_path().)

-

Parameters

+

Parameters

@@ -480,7 +480,7 @@ resolve it with -

Returns

+

Returns

the specific object's D-Bus path. This is the internal string used by the connection, and must not be modified.

@@ -492,7 +492,7 @@ by the connection, and must not be modified.

nm_active_connection_get_devices (NMActiveConnection *connection);

Gets the NMDevices used for the active connections.

-

Parameters

+

Parameters

@@ -507,7 +507,7 @@ nm_active_connection_get_devices (
-

Returns

+

Returns

the GPtrArray containing NMDevices. This is the internal copy used by the connection, and must not be modified.

[element-type NMDevice]

@@ -520,7 +520,7 @@ This is the internal copy used by the connection, and must not be modified.

nm_active_connection_get_state (NMActiveConnection *connection);

Gets the active connection's state.

-

Parameters

+

Parameters

@@ -535,7 +535,7 @@ nm_active_connection_get_state (
-

Returns

+

Returns

the state

@@ -546,7 +546,7 @@ nm_active_connection_get_state (NMActiveConnection *connection);

Gets the master NMDevice of the connection.

-

Parameters

+

Parameters

@@ -561,7 +561,7 @@ nm_active_connection_get_master (
-

Returns

+

Returns

the master NMDevice of the NMActiveConnection.

[transfer none]

@@ -574,7 +574,7 @@ nm_active_connection_get_default (Whether the active connection is the default IPv4 one (that is, is used for the default IPv4 route and DNS information).

-

Parameters

+

Parameters

@@ -589,7 +589,7 @@ the default IPv4 route and DNS information).

-

Returns

+

Returns

TRUE if the active connection is the default IPv4 connection

@@ -600,7 +600,7 @@ the default IPv4 route and DNS information).

nm_active_connection_get_ip4_config (NMActiveConnection *connection);

Gets the current IPv4 NMIPConfig associated with the NMActiveConnection.

-

Parameters

+

Parameters

@@ -615,7 +615,7 @@ nm_active_connection_get_ip4_config (
-

Returns

+

Returns

the IPv4 NMIPConfig, or NULL if the connection is not in the NM_ACTIVE_CONNECTION_STATE_ACTIVATED state.

[transfer none]

@@ -629,7 +629,7 @@ nm_active_connection_get_dhcp4_config (NMDhcpConfig (if any) associated with the NMActiveConnection.

-

Parameters

+

Parameters

@@ -644,7 +644,7 @@ nm_active_connection_get_dhcp4_config ( -

Returns

+

Returns

the IPv4 NMDhcpConfig, or NULL if the connection does not use DHCP, or is not in the NM_ACTIVE_CONNECTION_STATE_ACTIVATED state.

@@ -659,7 +659,7 @@ nm_active_connection_get_default6 (Whether the active connection is the default IPv6 one (that is, is used for the default IPv6 route and DNS information).

-

Parameters

+

Parameters

@@ -674,7 +674,7 @@ the default IPv6 route and DNS information).

-

Returns

+

Returns

TRUE if the active connection is the default IPv6 connection

@@ -685,7 +685,7 @@ the default IPv6 route and DNS information).

nm_active_connection_get_ip6_config (NMActiveConnection *connection);

Gets the current IPv6 NMIPConfig associated with the NMActiveConnection.

-

Parameters

+

Parameters

@@ -700,7 +700,7 @@ nm_active_connection_get_ip6_config (
-

Returns

+

Returns

the IPv6 NMIPConfig, or NULL if the connection is not in the NM_ACTIVE_CONNECTION_STATE_ACTIVATED state.

[transfer none]

@@ -714,7 +714,7 @@ nm_active_connection_get_dhcp6_config (NMDhcpConfig (if any) associated with the NMActiveConnection.

-

Parameters

+

Parameters

@@ -729,7 +729,7 @@ nm_active_connection_get_dhcp6_config ( -

Returns

+

Returns

the IPv6 NMDhcpConfig, or NULL if the connection does not use DHCPv6, or is not in the NM_ACTIVE_CONNECTION_STATE_ACTIVATED state.

@@ -743,7 +743,7 @@ state.

nm_active_connection_get_vpn (NMActiveConnection *connection);

Whether the active connection is a VPN connection.

-

Parameters

+

Parameters

@@ -758,7 +758,7 @@ nm_active_connection_get_vpn ( -

Returns

+

Returns

TRUE if the active connection is a VPN connection

diff --git a/docs/libnm/html/NMClient.html b/docs/libnm/html/NMClient.html index f5ad56c0..abff5431 100644 --- a/docs/libnm/html/NMClient.html +++ b/docs/libnm/html/NMClient.html @@ -281,6 +281,13 @@
+ + + + @@ -495,6 +502,12 @@ + + + + + @@ -603,6 +616,16 @@ + + + + + + + + + + @@ -703,6 +726,10 @@ + + + + @@ -727,6 +754,14 @@ + + + + + + + + @@ -758,7 +793,7 @@

Object Hierarchy

-
    GEnum
+
    GEnum
     ├── NMClientError
     ├── NMClientPermission
     ╰── NMClientPermissionResult
@@ -1776,13 +1811,50 @@ containing all the NMDevices
 
+

nm_client_get_all_devices ()

+
const GPtrArray *
+nm_client_get_all_devices (NMClient *client);
+

Gets both real devices and device placeholders (eg, software devices which +do not currently exist, but could be created automatically by NetworkManager +if one of their NMDevice::ActivatableConnections was activated). Use +nm_device_is_real() to determine whether each device is a real device or +a placeholder.

+

Use nm_device_get_type() or the NM_IS_DEVICE_XXXX() functions to determine +what kind of device each member of the returned array is, and then you may +use device-specific methods such as nm_device_ethernet_get_hw_address().

+
+

Parameters

+
const GPtrArray * + +nm_client_get_all_devices () +
NMDevice * Read
+GPtrArray *all-devicesRead
gboolean can-modify Read
voidany-device-addedRun First
voidany-device-removedRun First
void connection-added Run First
#defineNM_CLIENT_ALL_DEVICES
#define NM_CLIENT_CONNECTIONS
#defineNM_CLIENT_ANY_DEVICE_ADDED
#defineNM_CLIENT_ANY_DEVICE_REMOVED
#define NM_CLIENT_PERMISSION_CHANGED
+++++ + + + + + +

client

a NMClient

 
+
+
+

Returns

+

a GPtrArray +containing all the NMDevices. The returned array is owned by the +NMClient object and should not be modified.

+

[transfer none][element-type NMDevice]

+
+

Since: 1.2

+ +
+

nm_client_get_device_by_path ()

NMDevice *
 nm_client_get_device_by_path (NMClient *client,
                               const char *object_path);

Gets a NMDevice from a NMClient.

-

Parameters

+

Parameters

@@ -1804,7 +1876,7 @@ nm_client_get_device_by_path ( -

Returns

+

Returns

the NMDevice for the given object_path or NULL if none is found.

[transfer none]

@@ -1818,7 +1890,7 @@ nm_client_get_device_by_iface (const char *iface);

Gets a NMDevice from a NMClient.

-

Parameters

+

Parameters

@@ -1840,7 +1912,7 @@ nm_client_get_device_by_iface (
-

Returns

+

Returns

the NMDevice for the given iface or NULL if none is found.

[transfer none]

@@ -1853,7 +1925,7 @@ or NULL if none is found.

nm_client_get_active_connections (NMClient *client);

Gets the active connections.

-

Parameters

+

Parameters

@@ -1868,7 +1940,7 @@ nm_client_get_active_connections (
-

Returns

+

Returns

a GPtrArray containing all the active NMActiveConnections. The returned array is owned by the client and should not be modified.

@@ -1890,7 +1962,7 @@ route to the VPN endpoint.

If there is no default route, or the default route is over a non-NetworkManager-recognized device, this will return NULL.

-

Parameters

+

Parameters

@@ -1905,7 +1977,7 @@ non-NetworkManager-recognized device, this will return NUL
-

Returns

+

Returns

the appropriate NMActiveConnection, if any.

[transfer none]

@@ -1920,7 +1992,7 @@ nm_client_get_activating_connection (“primary-connection” upon successful activation.

-

Parameters

+

Parameters

@@ -1935,7 +2007,7 @@ currently-activating connection that is expected to become the new
-

Returns

+

Returns

the appropriate NMActiveConnection, if any.

[transfer none]

@@ -1971,7 +2043,7 @@ the new connection, not when it finishes. You can used the returned NMActiveConnection object (in particular, “state”) to track the activation to its completion.

-

Parameters

+

Parameters

@@ -2035,7 +2107,7 @@ nm_client_activate_connection_finish (GError **error);

Gets the result of a call to nm_client_activate_connection_async().

-

Parameters

+

Parameters

@@ -2062,7 +2134,7 @@ nm_client_activate_connection_finish ( -

Returns

+

Returns

the new NMActiveConnection on success, NULL on failure, in which case error will be set.

@@ -2091,7 +2163,7 @@ the new connection, not when it finishes. You can used the returned NMActiveConnection object (in particular, “state”) to track the activation to its completion.

-

Parameters

+

Parameters

@@ -2162,7 +2234,7 @@ nm_client_add_and_activate_connection_finish

You can call nm_active_connection_get_connection() on the returned NMActiveConnection to find the path of the created NMConnection.

-

Parameters

+

Parameters

@@ -2189,7 +2261,7 @@ nm_client_add_and_activate_connection_finish
-

Returns

+

Returns

the new NMActiveConnection on success, NULL on failure, in which case error will be set.

@@ -2206,7 +2278,7 @@ nm_client_deactivate_connection (GError **error);

Deactivates an active NMActiveConnection.

-

Parameters

+

Parameters

@@ -2238,7 +2310,7 @@ nm_client_deactivate_connection (
-

Returns

+

Returns

success or failure

@@ -2253,7 +2325,7 @@ nm_client_deactivate_connection_async (gpointer user_data);

Asynchronously deactivates an active NMActiveConnection.

-

Parameters

+

Parameters

@@ -2301,7 +2373,7 @@ nm_client_deactivate_connection_finish GError **error);

Gets the result of a call to nm_client_deactivate_connection_async().

-

Parameters

+

Parameters

@@ -2328,7 +2400,7 @@ nm_client_deactivate_connection_finish
-

Returns

+

Returns

success or failure

@@ -2338,7 +2410,7 @@ nm_client_deactivate_connection_finish
const GPtrArray *
 nm_client_get_connections (NMClient *client);
-

Parameters

+

Parameters

@@ -2353,7 +2425,7 @@ nm_client_get_connections ( -

Returns

+

Returns

an array containing all connections provided by the remote settings service. The returned array is owned by the NMClient object and should not be modified.

@@ -2369,7 +2441,7 @@ nm_client_get_connection_by_id (Returns the first matching NMRemoteConnection matching a given id .

-

Parameters

+

Parameters

@@ -2391,7 +2463,7 @@ nm_client_get_connection_by_id (
-

Returns

+

Returns

the remote connection object on success, or NULL if no matching object was found.

[transfer none]

@@ -2406,7 +2478,7 @@ nm_client_get_connection_by_path (Returns the NMRemoteConnection representing the connection at path .

-

Parameters

+

Parameters

@@ -2428,7 +2500,7 @@ nm_client_get_connection_by_path (
-

Returns

+

Returns

the remote connection object on success, or NULL if the object was not known.

[transfer none]

@@ -2443,7 +2515,7 @@ nm_client_get_connection_by_uuid (Returns the NMRemoteConnection identified by uuid .

-

Parameters

+

Parameters

@@ -2465,7 +2537,7 @@ nm_client_get_connection_by_uuid (
-

Returns

+

Returns

the remote connection object on success, or NULL if the object was not known.

[transfer none]

@@ -2499,7 +2571,7 @@ identical settings to connection as NetworkManager may perform automatic completion and/or normalization of connection properties.

-

Parameters

+

Parameters

@@ -2552,7 +2624,7 @@ nm_client_add_connection_finish (GError **error);

Gets the result of a call to nm_client_add_connection_async().

-

Parameters

+

Parameters

@@ -2579,7 +2651,7 @@ nm_client_add_connection_finish (
-

Returns

+

Returns

the new NMRemoteConnection on success, NULL on failure, in which case error will be set.

@@ -2608,7 +2680,7 @@ then failures will be set to a NULL-terminated array of the filenames that failed to load.

-

Parameters

+

Parameters

@@ -2646,7 +2718,7 @@ filenames that failed to load.

-

Returns

+

Returns

TRUE if NetworkManager at least tried to load filenames , FALSE if an error occurred (eg, permission denied).

@@ -2665,7 +2737,7 @@ nm_client_load_connections_async (

See nm_client_load_connections() for more details.

-

Parameters

+

Parameters

@@ -2714,7 +2786,7 @@ nm_client_load_connections_finish (Gets the result of an nm_client_load_connections_async() call.

See nm_client_load_connections() for more details.

-

Parameters

+

Parameters

@@ -2747,7 +2819,7 @@ filenames that failed to load.

-

Returns

+

Returns

TRUE if NetworkManager at least tried to load filenames , FALSE if an error occurred (eg, permission denied).

@@ -2764,7 +2836,7 @@ nm_client_reload_connections ( -

Parameters

+

Parameters

@@ -2791,7 +2863,7 @@ the in-memory state matches the on-disk state.

-

Returns

+

Returns

TRUE on success, FALSE on failure

@@ -2807,7 +2879,7 @@ nm_client_reload_connections_async (
-

Parameters

+

Parameters

@@ -2849,7 +2921,7 @@ nm_client_reload_connections_finish (GError **error);

Gets the result of an nm_client_reload_connections_async() call.

-

Parameters

+

Parameters

@@ -2876,7 +2948,7 @@ nm_client_reload_connections_finish (
-

Returns

+

Returns

TRUE on success, FALSE on failure

@@ -2980,6 +3052,12 @@ nm_client_reload_connections_finish (
+

NM_CLIENT_ALL_DEVICES

+
#define NM_CLIENT_ALL_DEVICES "all-devices"
+
+
+
+

NM_CLIENT_CONNECTIONS

#define NM_CLIENT_CONNECTIONS "connections"
 
@@ -3016,6 +3094,18 @@ nm_client_reload_connections_finish (
+

NM_CLIENT_ANY_DEVICE_ADDED

+
#define NM_CLIENT_ANY_DEVICE_ADDED "any-device-added"
+
+
+
+
+

NM_CLIENT_ANY_DEVICE_REMOVED

+
#define NM_CLIENT_ANY_DEVICE_REMOVED "any-device-removed"
+
+
+
+

NM_CLIENT_PERMISSION_CHANGED

#define NM_CLIENT_PERMISSION_CHANGED "permission-changed"
 
@@ -3038,7 +3128,7 @@ nm_client_reload_connections_finish (NMClientPermission values indicate various permissions that NetworkManager clients can obtain to perform certain tasks on behalf of the current user.

-

Members

+

Members

@@ -3158,7 +3248,7 @@ clients can obtain to perform certain tasks on behalf of the current user.

NMClientPermissionResult values indicate what authorizations and permissions the user requires to obtain a given NMClientPermission

-

Members

+

Members

@@ -3207,7 +3297,7 @@ the user requires to obtain a given NMManagerError, NMSettingsError, NMAgentManagerError, and NMConnectionError.

-

Members

+

Members

@@ -3270,6 +3360,15 @@ likely to become the new +

The “all-devices” property

+
  “all-devices”              GPtrArray *
+

List of both real devices and device placeholders.

+

Element-type: NMDevice

+

Flags: Read

+

Since: 1.2

+ +
+

The “can-modify” property

  “can-modify”               gboolean

If TRUE, adding and modifying connections is supported.

@@ -3299,7 +3398,7 @@ permission to read the details of.)

The “devices” property

  “devices”                  GPtrArray *
-

List of known network devices.

+

List of real network devices. Does not include placeholder devices.

Element-type: NMDevice

Flags: Read

@@ -3319,7 +3418,7 @@ modified by calling Whether the connectivity is metered.

Flags: Read

Default value: 0

-

Since: 1.0.6

+

Since: 1.2


@@ -3421,6 +3520,82 @@ see

Signal Details

+

The “any-device-added” signal

+
void
+user_function (NMClient *client,
+               GObject  *device,
+               gpointer  user_data)
+

Notifies that a NMDevice is added. This signal is emitted for both +regular devices and placeholder devices.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

client

the client that received the signal

 

device

the new device.

[type NMDevice]

user_data

user data set when the signal handler was connected.

 
+
+

Flags: Run First

+
+
+
+

The “any-device-removed” signal

+
void
+user_function (NMClient *client,
+               GObject  *device,
+               gpointer  user_data)
+

Notifies that a NMDevice is removed. This signal is emitted for both +regular devices and placeholder devices.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

client

the client that received the signal

 

device

the removed device.

[type NMDevice]

user_data

user data set when the signal handler was connected.

 
+
+

Flags: Run First

+
+
+

The “connection-added” signal

void
 user_function (NMClient           *client,
@@ -3428,7 +3603,7 @@ user_function (gpointer            user_data)

Notifies that a NMConnection has been added.

-

Parameters

+

Parameters

@@ -3465,7 +3640,7 @@ user_function (gpointer user_data)

Notifies that a NMConnection has been removed.

-

Parameters

+

Parameters

@@ -3500,9 +3675,10 @@ user_function (NMClient *client, GObject *device, gpointer user_data) -

Notifies that a NMDevice is added.

+

Notifies that a NMDevice is added. This signal is not emitted for +placeholder devices.

-

Parameters

+

Parameters

@@ -3537,9 +3713,10 @@ user_function (NMClient *client, GObject *device, gpointer user_data) -

Notifies that a NMDevice is removed.

+

Notifies that a NMDevice is removed. This signal is not emitted for +placeholder devices.

-

Parameters

+

Parameters

@@ -3577,7 +3754,7 @@ user_function (gpointer user_data)

Notifies that a permission has changed

-

Parameters

+

Parameters

diff --git a/docs/libnm/html/NMDevice.html b/docs/libnm/html/NMDevice.html index ff38ac07..689c4dec 100644 --- a/docs/libnm/html/NMDevice.html +++ b/docs/libnm/html/NMDevice.html @@ -124,6 +124,14 @@ + + + + + + + + + + + + @@ -263,6 +287,14 @@ + + + + + + + + + + + + + + + + @@ -349,6 +405,61 @@ nm_device_get_setting_type () + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+void + +nm_device_set_managed () +
gboolean @@ -148,6 +156,14 @@
+gboolean + +nm_device_get_nm_plugin_missing () +
NMIPConfig * @@ -229,6 +245,14 @@ gboolean +nm_device_is_real () +
+gboolean + nm_device_is_software ()
+GPtrArray * + +nm_device_get_lldp_neighbors () +
char ** @@ -274,6 +306,30 @@ gboolean +nm_device_reapply () +
+void + +nm_device_reapply_async () +
+gboolean + +nm_device_reapply_finish () +
+gboolean + nm_device_disconnect ()
+NMLldpNeighbor * + +nm_lldp_neighbor_new () +
+void + +nm_lldp_neighbor_ref () +
+void + +nm_lldp_neighbor_unref () +
+char ** + +nm_lldp_neighbor_get_attr_names () +
+gboolean + +nm_lldp_neighbor_get_attr_string_value () +
+gboolean + +nm_lldp_neighbor_get_attr_uint_value () +
const GVariantType * + +nm_lldp_neighbor_get_attr_type () +
@@ -448,6 +559,12 @@ Read + +GPtrArray * +lldp-neighbors +Read + + gboolean managed Read @@ -463,6 +580,11 @@ Read +gboolean +nm-plugin-missing +Read + + gchar * physical-port-id @@ -475,6 +597,11 @@ Read +gboolean +real +Read + + NMDeviceState state Read @@ -514,7 +641,7 @@
-
+

Types and Values

@@ -556,6 +683,10 @@ + + + + @@ -568,6 +699,10 @@ + + + + @@ -618,12 +753,18 @@ + + + +
#defineNM_DEVICE_REAL
#define NM_DEVICE_MANAGED
#defineNM_DEVICE_NM_PLUGIN_MISSING
#define NM_DEVICE_IP4_CONFIG
#define NM_DEVICE_METERED
#defineNM_DEVICE_LLDP_NEIGHBORS

Object Hierarchy

-
    GObject
+
    GBoxed
+    ╰── NMLldpNeighbor
+    GObject
     ╰── NMObject
         ╰── NMDevice
             ├── NMDeviceAdsl
@@ -633,10 +774,14 @@
             ├── NMDeviceEthernet
             ├── NMDeviceGeneric
             ├── NMDeviceInfiniband
+            ├── NMDeviceIPTunnel
+            ├── NMDeviceMacvlan
             ├── NMDeviceModem
             ├── NMDeviceOlpcMesh
             ├── NMDeviceTeam
+            ├── NMDeviceTun
             ├── NMDeviceVlan
+            ├── NMDeviceVxlan
             ├── NMDeviceWifi
             ╰── NMDeviceWimax
 
@@ -652,7 +797,7 @@ nm_device_get_iface (NMDevice *device);

Gets the interface name of the NMDevice.

-

Parameters

+

Parameters

@@ -667,7 +812,7 @@ nm_device_get_iface ( -

Returns

+

Returns

the interface of the device. This is the internal string used by the device, and must not be modified.

@@ -680,7 +825,7 @@ nm_device_get_ip_iface (NMDevice over which IP traffic flows when the device is in the ACTIVATED state.

-

Parameters

+

Parameters

@@ -695,7 +840,7 @@ when the device is in the ACTIVATED state.

-

Returns

+

Returns

the IP traffic interface of the device. This is the internal string used by the device, and must not be modified.

@@ -707,7 +852,7 @@ used by the device, and must not be modified.

nm_device_get_device_type (NMDevice *device);

Returns the numeric type of the NMDevice, ie Ethernet, Wi-Fi, etc.

-

Parameters

+

Parameters

@@ -722,7 +867,7 @@ nm_device_get_device_type ( -

Returns

+

Returns

the device type

@@ -733,7 +878,7 @@ nm_device_get_device_type (NMDevice *device);

Gets the Unique Device Identifier of the NMDevice.

-

Parameters

+

Parameters

@@ -748,7 +893,7 @@ nm_device_get_udi ( -

Returns

+

Returns

the Unique Device Identifier of the device. This identifier may be used to gather more information about the device from various operating system services like udev or sysfs.

@@ -761,7 +906,7 @@ system services like udev or sysfs.

nm_device_get_driver (NMDevice *device);

Gets the driver of the NMDevice.

-

Parameters

+

Parameters

@@ -776,7 +921,7 @@ nm_device_get_driver ( -

Returns

+

Returns

the driver of the device. This is the internal string used by the device, and must not be modified.

@@ -788,7 +933,7 @@ device, and must not be modified.

nm_device_get_driver_version (NMDevice *device);

Gets the driver version of the NMDevice.

-

Parameters

+

Parameters

@@ -803,7 +948,7 @@ nm_device_get_driver_version ( -

Returns

+

Returns

the version of the device driver. This is the internal string used by the device, and must not be modified.

@@ -815,7 +960,7 @@ device, and must not be modified.

nm_device_get_firmware_version (NMDevice *device);

Gets the firmware version of the NMDevice.

-

Parameters

+

Parameters

@@ -830,7 +975,7 @@ nm_device_get_firmware_version (
-

Returns

+

Returns

the firmware version of the device. This is the internal string used by the device, and must not be modified.

@@ -844,7 +989,7 @@ nm_device_get_type_description (device is.

-

Parameters

+

Parameters

@@ -859,7 +1004,7 @@ nm_device_get_type_description (
-

Returns

+

Returns

the type description of the device. This is the internal string used by the device, and must not be modified.

@@ -872,7 +1017,7 @@ nm_device_get_hw_address (device .

-

Parameters

+

Parameters

@@ -887,7 +1032,7 @@ nm_device_get_hw_address ( -

Returns

+

Returns

the current MAC of the device, or NULL. This is the internal string used by the device, and must not be modified.

@@ -899,7 +1044,7 @@ This is the internal string used by the device, and must not be modified.

nm_device_get_capabilities (NMDevice *device);

Gets the device' capabilities.

-

Parameters

+

Parameters

@@ -914,7 +1059,7 @@ nm_device_get_capabilities ( -

Returns

+

Returns

the capabilities

@@ -925,7 +1070,7 @@ nm_device_get_capabilities (NMDevice *device);

Whether the NMDevice is managed by NetworkManager.

-

Parameters

+

Parameters

@@ -940,18 +1085,49 @@ nm_device_get_managed ( -

Returns

+

Returns

TRUE if the device is managed by NetworkManager


+

nm_device_set_managed ()

+
void
+nm_device_set_managed (NMDevice *device,
+                       gboolean managed);
+

Enables or disables management of NMDevice by NetworkManager.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

device

a NMDevice

 

managed

TRUE to make the device managed by NetworkManager.

 
+
+

Since: 1.2

+
+
+

nm_device_get_autoconnect ()

gboolean
 nm_device_get_autoconnect (NMDevice *device);

Whether the NMDevice can be autoconnected.

-

Parameters

+

Parameters

@@ -966,7 +1142,7 @@ nm_device_get_autoconnect ( -

Returns

+

Returns

TRUE if the device is allowed to be autoconnected

@@ -978,7 +1154,7 @@ nm_device_set_autoconnect (gboolean autoconnect);

Enables or disables automatic activation of the NMDevice.

-

Parameters

+

Parameters

@@ -1008,7 +1184,7 @@ nm_device_get_firmware_missing (Indicates that firmware required for the device's operation is likely to be missing.

-

Parameters

+

Parameters

@@ -1023,13 +1199,40 @@ to be missing.

-

Returns

+

Returns

TRUE if firmware required for the device's operation is likely to be missing.


+

nm_device_get_nm_plugin_missing ()

+
gboolean
+nm_device_get_nm_plugin_missing (NMDevice *device);
+

Indicates that the NetworkManager plugin for the device is not installed.

+
+

Parameters

+
+++++ + + + + + +

device

a NMDevice

 
+
+
+

Returns

+

TRUE if the device plugin not installed.

+
+

Since: 1.2

+
+
+

nm_device_get_ip4_config ()

NMIPConfig *
 nm_device_get_ip4_config (NMDevice *device);
@@ -1037,7 +1240,7 @@ nm_device_get_ip4_config (nm_active_connection_get_ip4_config(), which also works with VPN connections.

-

Parameters

+

Parameters

@@ -1052,7 +1255,7 @@ works with VPN connections.

-

Returns

+

Returns

the IPv4 NMIPConfig, or NULL if the device is not activated.

[transfer none]

@@ -1067,7 +1270,7 @@ nm_device_get_dhcp4_config (nm_active_connection_get_dhcp4_config(), which also works with VPN connections.

-

Parameters

+

Parameters

@@ -1082,7 +1285,7 @@ works with VPN connections.

-

Returns

+

Returns

the IPv4 NMDhcpConfig, or NULL if the device is not activated or not using DHCP.

[transfer none]

@@ -1097,7 +1300,7 @@ nm_device_get_ip6_config (nm_active_connection_get_ip6_config(), which also works with VPN connections.

-

Parameters

+

Parameters

@@ -1112,7 +1315,7 @@ works with VPN connections.

-

Returns

+

Returns

the IPv6 NMIPConfig or NULL if the device is not activated.

[transfer none]

@@ -1126,7 +1329,7 @@ nm_device_get_dhcp6_config (nm_active_connection_get_dhcp6_config(), which also works with VPN connections.

-

Parameters

+

Parameters

@@ -1141,7 +1344,7 @@ works with VPN connections.

-

Returns

+

Returns

the IPv6 NMDhcpConfig, or NULL if the device is not activated or not using DHCPv6.

[transfer none]

@@ -1154,7 +1357,7 @@ not activated or not using DHCPv6.

nm_device_get_state (NMDevice *device);

Gets the current NMDevice state.

-

Parameters

+

Parameters

@@ -1169,7 +1372,7 @@ nm_device_get_state ( -

Returns

+

Returns

the current device state

@@ -1180,7 +1383,7 @@ nm_device_get_state (NMDevice *device);

Gets the reason for entering the current NMDevice state.

-

Parameters

+

Parameters

@@ -1195,7 +1398,7 @@ nm_device_get_state_reason ( -

Returns

+

Returns

the reason for entering the current device state

@@ -1206,7 +1409,7 @@ nm_device_get_state_reason (NMDevice *device);

Gets the NMActiveConnection object which owns this device during activation.

-

Parameters

+

Parameters

@@ -1221,7 +1424,7 @@ nm_device_get_active_connection (
-

Returns

+

Returns

the NMActiveConnection or NULL if the device is not part of an active connection.

[transfer none]

@@ -1236,7 +1439,7 @@ nm_device_get_available_connections (device .

-

Parameters

+

Parameters

@@ -1251,7 +1454,7 @@ be activated on device
-

Returns

+

Returns

the GPtrArray containing NMRemoteConnections. This is the internal copy used by the connection, and must not be modified.

@@ -1268,7 +1471,7 @@ an opaque string that can be used to recognize when seemingly-unrelated NMDevices are actually just different virtual ports on a single physical port. (Eg, NPAR / SR-IOV.)

-

Parameters

+

Parameters

@@ -1283,7 +1486,7 @@ ports on a single physical port. (Eg, NPAR / SR-IOV.)

-

Returns

+

Returns

the physical port ID of the device, or NULL if the port ID is unknown. This is the internal string used by the device and must not be modified.

@@ -1296,7 +1499,7 @@ must not be modified.

nm_device_get_mtu (NMDevice *device);

Gets the MTU of the NMDevice.

-

Parameters

+

Parameters

@@ -1311,18 +1514,46 @@ nm_device_get_mtu ( -

Returns

+

Returns

the MTU of the device.


+

nm_device_is_real ()

+
gboolean
+nm_device_is_real (NMDevice *device);
+
+

Parameters

+
+++++ + + + + + +

device

a NMDevice

 
+
+
+

Returns

+

TRUE if the device exists, or FALSE if it is a placeholder device +that could be automatically created by NetworkManager if one of its +“available-connections” was activated.

+
+

Since: 1.2

+
+
+

nm_device_is_software ()

gboolean
 nm_device_is_software (NMDevice *device);

Whether the device is a software device.

-

Parameters

+

Parameters

@@ -1337,7 +1568,7 @@ nm_device_is_software ( -

Returns

+

Returns

TRUE if device is a software device, FALSE if it is a hardware device.

@@ -1349,7 +1580,7 @@ is a software device, FALSE if it is a hardware dev nm_device_get_product (NMDevice *device);

Gets the product string of the NMDevice.

-

Parameters

+

Parameters

@@ -1364,7 +1595,7 @@ nm_device_get_product ( -

Returns

+

Returns

the product name of the device. This is the internal string used by the device, and must not be modified.

@@ -1376,7 +1607,7 @@ device, and must not be modified.

nm_device_get_vendor (NMDevice *device);

Gets the vendor string of the NMDevice.

-

Parameters

+

Parameters

@@ -1391,7 +1622,7 @@ nm_device_get_vendor ( -

Returns

+

Returns

the vendor name of the device. This is the internal string used by the device, and must not be modified.

@@ -1404,7 +1635,7 @@ nm_device_get_description (device , based on its vendor and product names.

-

Parameters

+

Parameters

@@ -1419,7 +1650,7 @@ nm_device_get_description ( -

Returns

+

Returns

a description of device . If either the vendor or the product name is unknown, this returns the interface name.

@@ -1432,7 +1663,7 @@ product name is unknown, this returns the interface name.

nm_device_get_metered (NMDevice *device);

Gets the metered setting of a NMDevice.

-

Parameters

+

Parameters

@@ -1447,10 +1678,41 @@ nm_device_get_metered ( -

Returns

+

Returns

the metered setting.

-

Since: 1.0.6

+

Since: 1.2

+ +
+
+

nm_device_get_lldp_neighbors ()

+
GPtrArray *
+nm_device_get_lldp_neighbors (NMDevice *device);
+

Gets the list of neighbors discovered through LLDP.

+
+

Parameters

+
+++++ + + + + + +

device

a NMDevice

 
+
+
+

Returns

+

the GPtrArray +containing NMLldpNeighbors. This is the internal copy used by the +device and must not be modified. The library never modifies the returned +array and thus it is safe for callers to reference and keep using it.

+

[element-type NMLldpNeighbor][transfer none]

+
+

Since: 1.2


@@ -1462,7 +1724,7 @@ nm_device_disambiguate_names (devices .

-

Parameters

+

Parameters

@@ -1485,13 +1747,167 @@ devices in devices
-

Returns

+

Returns

the device names.

[transfer full][array zero-terminated=1]


+

nm_device_reapply ()

+
gboolean
+nm_device_reapply (NMDevice *device,
+                   NMConnection *connection,
+                   guint flags,
+                   GCancellable *cancellable,
+                   GError **error);
+

Attempts to update device with changes to the currently active connection +made since it was last applied.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

device

a NMDevice

 

connection

the NMConnection to replace the applied settings with or NULL to reuse existing

 

flags

always set this to zero

 

cancellable

a GCancellable, or NULL

 

error

location for a GError, or NULL

 
+
+
+

Returns

+

TRUE on success, FALSE on error, in which case error +will be set.

+
+

Since: 1.2

+
+
+
+

nm_device_reapply_async ()

+
void
+nm_device_reapply_async (NMDevice *device,
+                         NMConnection *connection,
+                         guint flags,
+                         GCancellable *cancellable,
+                         GAsyncReadyCallback callback,
+                         gpointer user_data);
+

Asynchronously begins an attempt to update device with changes to the +currently active connection made since it was last applied.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

device

a NMDevice

 

connection

the NMConnection to replace the applied settings with or NULL to reuse existing

 

flags

always set this to zero

 

cancellable

a GCancellable, or NULL

 

callback

callback to be called when the reapply operation completes

 

user_data

caller-specific data passed to callback +

 
+
+

Since: 1.2

+
+
+
+

nm_device_reapply_finish ()

+
gboolean
+nm_device_reapply_finish (NMDevice *device,
+                          GAsyncResult *result,
+                          GError **error);
+

Gets the result of a call to nm_device_reapply_async().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

device

a NMDevice

 

result

the result passed to the GAsyncReadyCallback

 

error

location for a GError, or NULL

 
+
+
+

Returns

+

TRUE on success, FALSE on error, in which case error +will be set.

+
+

Since: 1.2

+
+
+

nm_device_disconnect ()

gboolean
 nm_device_disconnect (NMDevice *device,
@@ -1501,7 +1917,7 @@ nm_device_disconnect (
-

Parameters

+

Parameters

@@ -1528,7 +1944,7 @@ request.

-

Returns

+

Returns

TRUE on success, FALSE on error, in which case error will be set.

@@ -1545,7 +1961,7 @@ nm_device_disconnect_async ( -

Parameters

+

Parameters

@@ -1587,7 +2003,7 @@ nm_device_disconnect_finish (GError **error);

Gets the result of a call to nm_device_disconnect_async().

-

Parameters

+

Parameters

@@ -1614,7 +2030,7 @@ nm_device_disconnect_finish ( -

Returns

+

Returns

TRUE on success, FALSE on error, in which case error will be set.

@@ -1628,7 +2044,7 @@ nm_device_delete (GError **error);

Deletes the software device. Hardware devices can't be deleted.

-

Parameters

+

Parameters

@@ -1655,7 +2071,7 @@ nm_device_delete ( -

Returns

+

Returns

TRUE on success, FALSE on error, in which case error will be set.

@@ -1671,7 +2087,7 @@ nm_device_delete_async ( -

Parameters

+

Parameters

@@ -1713,7 +2129,7 @@ nm_device_delete_finish (GError **error);

Gets the result of a call to nm_device_delete_async().

-

Parameters

+

Parameters

@@ -1740,7 +2156,7 @@ nm_device_delete_finish ( -

Returns

+

Returns

TRUE on success, FALSE on error, in which case error will be set.

@@ -1762,7 +2178,7 @@ Ethernet, Bluetooth, Wi-Fi WPA connections, or any other connection that is incompatible with the device. To get the full list of connections see nm_client_get_connections().

-

Parameters

+

Parameters

@@ -1784,7 +2200,7 @@ incompatible with the device. To get the full list of connections see
-

Returns

+

Returns

an array of NMConnections that could be activated with the given device . The array @@ -1807,7 +2223,7 @@ network, and will not be valid if it describes a WPA network, or if it is an Ethernet, Bluetooth, WWAN, etc connection that is incompatible with the device.

-

Parameters

+

Parameters

@@ -1831,7 +2247,7 @@ against

-

Returns

+

Returns

TRUE if the connection may be activated with this device, FALSE if is incompatible with the device's capabilities and characteristics.

@@ -1855,7 +2271,7 @@ device.

compatibility of the given device and connection. But, in addition, it sets GError when FALSE is returned.

-

Parameters

+

Parameters

@@ -1884,7 +2300,7 @@ against

-

Returns

+

Returns

TRUE if the connection may be activated with this device, FALSE if is incompatible with the device's capabilities and characteristics.

@@ -1898,7 +2314,7 @@ nm_device_get_setting_type (device .

-

Parameters

+

Parameters

@@ -1913,11 +2329,225 @@ that can be used on device
-

Returns

+

Returns

device 's associated NMSetting type

+
+
+

nm_lldp_neighbor_new ()

+
NMLldpNeighbor *
+nm_lldp_neighbor_new (void);
+

Creates a new NMLldpNeighbor object.

+
+

Returns

+

the new NMLldpNeighbor object.

+

[transfer full]

+
+

Since: 1.2

+
+
+
+

nm_lldp_neighbor_ref ()

+
void
+nm_lldp_neighbor_ref (NMLldpNeighbor *neighbor);
+

Increases the reference count of the object.

+
+

Parameters

+
+++++ + + + + + +

neighbor

the NMLldpNeighbor

 
+
+

Since: 1.2

+
+
+
+

nm_lldp_neighbor_unref ()

+
void
+nm_lldp_neighbor_unref (NMLldpNeighbor *neighbor);
+

Decreases the reference count of the object. If the reference count +reaches zero, the object will be destroyed.

+
+

Parameters

+
+++++ + + + + + +

neighbor

the NMLldpNeighbor

 
+
+

Since: 1.2

+
+
+
+

nm_lldp_neighbor_get_attr_names ()

+
char **
+nm_lldp_neighbor_get_attr_names (NMLldpNeighbor *neighbor);
+

Gets an array of attribute names available for neighbor +.

+
+

Parameters

+
+++++ + + + + + +

neighbor

the NMLldpNeighbor

 
+
+
+

Returns

+

a NULL-terminated array of attribute names.

+

[transfer full]

+
+

Since: 1.2

+
+
+
+

nm_lldp_neighbor_get_attr_string_value ()

+
gboolean
+nm_lldp_neighbor_get_attr_string_value
+                               (NMLldpNeighbor *neighbor,
+                                char *name,
+                                const char **out_value);
+

Gets the string value of attribute with name name + on neighbor +

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

neighbor

the NMLldpNeighbor

 

name

the attribute name

 

out_value

on return, the attribute value.

[out][allow-none][transfer none]
+
+
+

Returns

+

TRUE if a string attribute with name name +was found, FALSE otherwise

+
+

Since: 1.2

+
+
+
+

nm_lldp_neighbor_get_attr_uint_value ()

+
gboolean
+nm_lldp_neighbor_get_attr_uint_value (NMLldpNeighbor *neighbor,
+                                      char *name,
+                                      guint *out_value);
+

Gets the uint value of attribute with name name + on neighbor +

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

neighbor

the NMLldpNeighbor

 

name

the attribute name

 

out_value

on return, the attribute value.

[out][allow-none]
+
+
+

Returns

+

TRUE if a uint attribute with name name +was found, FALSE otherwise

+
+

Since: 1.2

+
+
+
+

nm_lldp_neighbor_get_attr_type ()

+
const GVariantType *
+nm_lldp_neighbor_get_attr_type (NMLldpNeighbor *neighbor,
+                                char *name);
+

Get the type of an attribute.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

neighbor

the NMLldpNeighbor

 

name

the attribute name

 
+
+
+

Returns

+

the GVariantType of the attribute with name name +

+
+

Since: 1.2

+

Types and Values

@@ -1970,6 +2600,12 @@ that can be used on device

+

NM_DEVICE_REAL

+
#define NM_DEVICE_REAL "real"
+
+
+
+

NM_DEVICE_MANAGED

#define NM_DEVICE_MANAGED "managed"
 
@@ -1988,6 +2624,12 @@ that can be used on device

+

NM_DEVICE_NM_PLUGIN_MISSING

+
#define NM_DEVICE_NM_PLUGIN_MISSING "nm-plugin-missing"
+
+
+
+

NM_DEVICE_IP4_CONFIG

#define NM_DEVICE_IP4_CONFIG "ip4-config"
 
@@ -2064,6 +2706,12 @@ that can be used on device
#define NM_DEVICE_METERED "metered"
 
+
+
+

NM_DEVICE_LLDP_NEIGHBORS

+
#define NM_DEVICE_LLDP_NEIGHBORS "lldp-neighbors"
+
+

Property Details

@@ -2184,6 +2832,13 @@ operations like addressing and routing.


+

The “lldp-neighbors” property

+
  “lldp-neighbors”           GPtrArray *
+

The LLDP neighbors.

+

Flags: Read

+
+
+

The “managed” property

  “managed”                  gboolean

Whether the device is managed by NetworkManager.

@@ -2197,7 +2852,7 @@ operations like addressing and routing.

Whether the device is metered.

Flags: Read

Default value: 0

-

Since: 1.0.6

+

Since: 1.2


@@ -2209,6 +2864,16 @@ operations like addressing and routing.


+

The “nm-plugin-missing” property

+
  “nm-plugin-missing”        gboolean
+

When TRUE indicates that the NetworkManager plugin for the device +is not installed.

+

Flags: Read

+

Default value: FALSE

+

Since: 1.2

+
+
+

The “physical-port-id” property

  “physical-port-id”         gchar *

The physical port ID of the device. (See @@ -2226,6 +2891,17 @@ operations like addressing and routing.


+

The “real” property

+
  “real”                     gboolean
+

Whether the device is real or is a placeholder device that could +be created automatically by NetworkManager if one of its +“available-connections” was activated.

+

Flags: Read

+

Default value: FALSE

+

Since: 1.2

+
+
+

The “state” property

  “state”                    NMDeviceState

The state of the device.

@@ -2274,7 +2950,7 @@ user_function (gpointer user_data)

Notifies the state change of a NMDevice.

-

Parameters

+

Parameters

diff --git a/docs/libnm/html/NMDeviceEthernet.html b/docs/libnm/html/NMDeviceEthernet.html index 04e68bda..0b6dc4a2 100644 --- a/docs/libnm/html/NMDeviceEthernet.html +++ b/docs/libnm/html/NMDeviceEthernet.html @@ -71,6 +71,13 @@ nm_device_ethernet_get_carrier () + + + +
const char * const * + +nm_device_ethernet_get_s390_subchannels () +
@@ -101,6 +108,11 @@ Read +GStrv +s390-subchannels +Read + + guint speed Read @@ -132,6 +144,10 @@ #define NM_DEVICE_ETHERNET_CARRIER + +#define +NM_DEVICE_ETHERNET_S390_SUBCHANNELS +
@@ -254,6 +270,36 @@ nm_device_ethernet_get_carrier ( TRUE if the device has carrier

+
+
+

nm_device_ethernet_get_s390_subchannels ()

+
const char * const *
+nm_device_ethernet_get_s390_subchannels
+                               (NMDeviceEthernet *device);
+

Return the list of s390 subchannels if the device supports them.

+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceEthernet

 
+
+
+

Returns

+

array of strings, each specifying +one subchannel the s390 device uses to communicate to the host.

+

[transfer none][element-type utf8]

+
+

Since: 1.2

+

Types and Values

@@ -280,6 +326,12 @@ nm_device_ethernet_get_carrier (#define NM_DEVICE_ETHERNET_CARRIER "carrier"
+
+
+

NM_DEVICE_ETHERNET_S390_SUBCHANNELS

+
#define NM_DEVICE_ETHERNET_S390_SUBCHANNELS "s390-subchannels"
+
+

Property Details

@@ -308,6 +360,15 @@ nm_device_ethernet_get_carrier (
+

The “s390-subchannels” property

+
  “s390-subchannels”         GStrv
+

Identifies subchannels of this network device used for +communication with z/VM or s390 host.

+

Flags: Read

+

Since: 1.2

+
+
+

The “speed” property

  “speed”                    guint

The speed of the device.

diff --git a/docs/libnm/html/NMDeviceIPTunnel.html b/docs/libnm/html/NMDeviceIPTunnel.html new file mode 100644 index 00000000..771b9c45 --- /dev/null +++ b/docs/libnm/html/NMDeviceIPTunnel.html @@ -0,0 +1,739 @@ + + + + +NMDeviceIPTunnel: libnm Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMDeviceIPTunnel

+

NMDeviceIPTunnel

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+NMDevice * + +nm_device_ip_tunnel_get_parent () +
+NMIPTunnelMode + +nm_device_ip_tunnel_get_mode () +
const char * + +nm_device_ip_tunnel_get_local () +
const char * + +nm_device_ip_tunnel_get_remote () +
+guint8 + +nm_device_ip_tunnel_get_ttl () +
+guint8 + +nm_device_ip_tunnel_get_tos () +
+gboolean + +nm_device_ip_tunnel_get_path_mtu_discovery () +
const char * + +nm_device_ip_tunnel_get_input_key () +
const char * + +nm_device_ip_tunnel_get_output_key () +
+guint8 + +nm_device_ip_tunnel_get_encapsulation_limit () +
+guint + +nm_device_ip_tunnel_get_flow_label () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
gucharencapsulation-limitRead
guintflow-labelRead
+gchar *input-keyRead
+gchar *localRead
guintmodeRead
+gchar *output-keyRead
+NMDevice *parentRead
gbooleanpath-mtu-discoveryRead
+gchar *remoteRead
guchartosRead
gucharttlRead
+
+ +
+

Object Hierarchy

+
    GObject
+    ╰── NMObject
+        ╰── NMDevice
+            ╰── NMDeviceIPTunnel
+
+
+
+

Description

+
+
+

Functions

+
+

nm_device_ip_tunnel_get_parent ()

+
NMDevice *
+nm_device_ip_tunnel_get_parent (NMDeviceIPTunnel *device);
+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceIPTunnel

 
+
+
+

Returns

+

the device's parent device.

+

[transfer none]

+
+

Since: 1.2

+
+
+
+

nm_device_ip_tunnel_get_mode ()

+
NMIPTunnelMode
+nm_device_ip_tunnel_get_mode (NMDeviceIPTunnel *device);
+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceIPTunnel

 
+
+
+

Returns

+

the tunneling mode

+
+

Since: 1.2

+
+
+
+

nm_device_ip_tunnel_get_local ()

+
const char *
+nm_device_ip_tunnel_get_local (NMDeviceIPTunnel *device);
+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceIPTunnel

 
+
+
+

Returns

+

the local endpoint of the tunnel

+
+

Since: 1.2

+
+
+
+

nm_device_ip_tunnel_get_remote ()

+
const char *
+nm_device_ip_tunnel_get_remote (NMDeviceIPTunnel *device);
+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceIPTunnel

 
+
+
+

Returns

+

the remote endpoint of the tunnel

+
+

Since: 1.2

+
+
+
+

nm_device_ip_tunnel_get_ttl ()

+
guint8
+nm_device_ip_tunnel_get_ttl (NMDeviceIPTunnel *device);
+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceIPTunnel

 
+
+
+

Returns

+

the TTL assigned to tunneled packets

+
+

Since: 1.2

+
+
+
+

nm_device_ip_tunnel_get_tos ()

+
guint8
+nm_device_ip_tunnel_get_tos (NMDeviceIPTunnel *device);
+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceIPTunnel

 
+
+
+

Returns

+

type of service (IPv4) or traffic class (IPv6) assigned +to tunneled packets.

+
+

Since: 1.2

+
+
+
+

nm_device_ip_tunnel_get_path_mtu_discovery ()

+
gboolean
+nm_device_ip_tunnel_get_path_mtu_discovery
+                               (NMDeviceIPTunnel *device);
+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceIPTunnel

 
+
+
+

Returns

+

whether path MTU discovery is enabled

+
+

Since: 1.2

+
+
+
+

nm_device_ip_tunnel_get_input_key ()

+
const char *
+nm_device_ip_tunnel_get_input_key (NMDeviceIPTunnel *device);
+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceIPTunnel

 
+
+
+

Returns

+

the key used for incoming packets

+
+

Since: 1.2

+
+
+
+

nm_device_ip_tunnel_get_output_key ()

+
const char *
+nm_device_ip_tunnel_get_output_key (NMDeviceIPTunnel *device);
+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceIPTunnel

 
+
+
+

Returns

+

the key used for outgoing packets

+
+

Since: 1.2

+
+
+
+

nm_device_ip_tunnel_get_encapsulation_limit ()

+
guint8
+nm_device_ip_tunnel_get_encapsulation_limit
+                               (NMDeviceIPTunnel *device);
+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceIPTunnel

 
+
+
+

Returns

+

the maximum permitted encapsulation level

+
+

Since: 1.2

+
+
+
+

nm_device_ip_tunnel_get_flow_label ()

+
guint
+nm_device_ip_tunnel_get_flow_label (NMDeviceIPTunnel *device);
+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceIPTunnel

 
+
+
+

Returns

+

the flow label assigned to tunnel packets

+
+

Since: 1.2

+
+
+
+

Types and Values

+
+

NM_DEVICE_IP_TUNNEL_MODE

+
#define NM_DEVICE_IP_TUNNEL_MODE                "mode"
+
+
+
+
+

NM_DEVICE_IP_TUNNEL_PARENT

+
#define NM_DEVICE_IP_TUNNEL_PARENT              "parent"
+
+
+
+
+

NM_DEVICE_IP_TUNNEL_LOCAL

+
#define NM_DEVICE_IP_TUNNEL_LOCAL               "local"
+
+
+
+
+

NM_DEVICE_IP_TUNNEL_REMOTE

+
#define NM_DEVICE_IP_TUNNEL_REMOTE              "remote"
+
+
+
+
+

NM_DEVICE_IP_TUNNEL_TTL

+
#define NM_DEVICE_IP_TUNNEL_TTL                 "ttl"
+
+
+
+
+

NM_DEVICE_IP_TUNNEL_TOS

+
#define NM_DEVICE_IP_TUNNEL_TOS                 "tos"
+
+
+
+
+

NM_DEVICE_IP_TUNNEL_PATH_MTU_DISCOVERY

+
#define NM_DEVICE_IP_TUNNEL_PATH_MTU_DISCOVERY  "path-mtu-discovery"
+
+
+
+
+

NM_DEVICE_IP_TUNNEL_INPUT_KEY

+
#define NM_DEVICE_IP_TUNNEL_INPUT_KEY           "input-key"
+
+
+
+
+

NM_DEVICE_IP_TUNNEL_OUTPUT_KEY

+
#define NM_DEVICE_IP_TUNNEL_OUTPUT_KEY          "output-key"
+
+
+
+
+

NM_DEVICE_IP_TUNNEL_ENCAPSULATION_LIMIT

+
#define NM_DEVICE_IP_TUNNEL_ENCAPSULATION_LIMIT "encapsulation-limit"
+
+
+
+
+

NM_DEVICE_IP_TUNNEL_FLOW_LABEL

+
#define NM_DEVICE_IP_TUNNEL_FLOW_LABEL          "flow-label"
+
+
+
+
+

Property Details

+
+

The “encapsulation-limit” property

+
  “encapsulation-limit”      guchar
+

How many additional levels of encapsulation are permitted to +be prepended to packets. This property applies only to IPv6 +tunnels.

+

Flags: Read

+

Default value: 0

+

Since: 1.2

+
+
+
+

The “flow-label” property

+
  “flow-label”               guint
+

The flow label to assign to tunnel packets. This property +applies only to IPv6 tunnels.

+

Flags: Read

+

Allowed values: <= 1048575

+

Default value: 0

+

Since: 1.2

+
+
+
+

The “input-key” property

+
  “input-key”                gchar *
+

The key used for tunneled input packets, if applicable.

+

Flags: Read

+

Default value: NULL

+

Since: 1.2

+
+
+
+

The “local” property

+
  “local”                    gchar *
+

The local endpoint of the tunnel.

+

Flags: Read

+

Default value: NULL

+

Since: 1.2

+
+
+
+

The “mode” property

+
  “mode”                     guint
+

The tunneling mode of the device.

+

Flags: Read

+

Default value: 0

+

Since: 1.2

+
+
+
+

The “output-key” property

+
  “output-key”               gchar *
+

The key used for tunneled output packets, if applicable.

+

Flags: Read

+

Default value: NULL

+

Since: 1.2

+
+
+
+

The “parent” property

+
  “parent”                   NMDevice *
+

The devices's parent device.

+

Flags: Read

+

Since: 1.2

+
+
+
+

The “path-mtu-discovery” property

+
  “path-mtu-discovery”       gboolean
+

Whether path MTU discovery is enabled on this tunnel.

+

Flags: Read

+

Default value: FALSE

+

Since: 1.2

+
+
+
+

The “remote” property

+
  “remote”                   gchar *
+

The remote endpoint of the tunnel.

+

Flags: Read

+

Default value: NULL

+

Since: 1.2

+
+
+
+

The “tos” property

+
  “tos”                      guchar
+

The type of service (IPv4) or traffic class (IPv6) assigned to +tunneled packets.

+

Flags: Read

+

Default value: 0

+

Since: 1.2

+
+
+
+

The “ttl” property

+
  “ttl”                      guchar
+

The TTL assigned to tunneled packets. 0 is a special value + meaning that packets inherit the TTL value

+

Flags: Read

+

Default value: 0

+

Since: 1.2

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm/html/NMDeviceInfiniband.html b/docs/libnm/html/NMDeviceInfiniband.html index 310d8550..ccfcbef2 100644 --- a/docs/libnm/html/NMDeviceInfiniband.html +++ b/docs/libnm/html/NMDeviceInfiniband.html @@ -7,7 +7,7 @@ - + @@ -22,7 +22,7 @@ Home Up Prev -Next +Next
diff --git a/docs/libnm/html/NMDeviceMacvlan.html b/docs/libnm/html/NMDeviceMacvlan.html new file mode 100644 index 00000000..f5866285 --- /dev/null +++ b/docs/libnm/html/NMDeviceMacvlan.html @@ -0,0 +1,388 @@ + + + + +NMDeviceMacvlan: libnm Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMDeviceMacvlan

+

NMDeviceMacvlan

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+NMDevice * + +nm_device_macvlan_get_parent () +
const char * + +nm_device_macvlan_get_mode () +
+gboolean + +nm_device_macvlan_get_no_promisc () +
+gboolean + +nm_device_macvlan_get_tap () +
const char * + +nm_device_macvlan_get_hw_address () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+gchar *hw-addressRead
+gchar *modeRead
gbooleanno-promiscRead
+NMDevice *parentRead
gbooleantapRead
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + +
#defineNM_DEVICE_MACVLAN_PARENT
#defineNM_DEVICE_MACVLAN_MODE
#defineNM_DEVICE_MACVLAN_NO_PROMISC
#defineNM_DEVICE_MACVLAN_TAP
#defineNM_DEVICE_MACVLAN_HW_ADDRESS
+
+
+

Object Hierarchy

+
    GObject
+    ╰── NMObject
+        ╰── NMDevice
+            ╰── NMDeviceMacvlan
+
+
+
+

Description

+
+
+

Functions

+
+

nm_device_macvlan_get_parent ()

+
NMDevice *
+nm_device_macvlan_get_parent (NMDeviceMacvlan *device);
+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceMacvlan

 
+
+
+

Returns

+

the device's parent device.

+

[transfer none]

+
+

Since: 1.2

+
+
+
+

nm_device_macvlan_get_mode ()

+
const char *
+nm_device_macvlan_get_mode (NMDeviceMacvlan *device);
+

Gets the MACVLAN mode of the device.

+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceMacvlan

 
+
+
+

Returns

+

the MACVLAN mode. This is the internal string used by the +device, and must not be modified.

+
+

Since: 1.2

+
+
+
+

nm_device_macvlan_get_no_promisc ()

+
gboolean
+nm_device_macvlan_get_no_promisc (NMDeviceMacvlan *device);
+

Gets the no-promiscuous flag of the device.

+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceMacvlan

 
+
+
+

Returns

+

the no-promiscuous flag of the device.

+
+

Since: 1.2

+
+
+
+

nm_device_macvlan_get_tap ()

+
gboolean
+nm_device_macvlan_get_tap (NMDeviceMacvlan *device);
+

Gets the device type (MACVLAN or MACVTAP).

+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceMacvlan

 
+
+
+

Returns

+

TRUE if the device is a MACVTAP, FALSE if it is a MACVLAN.

+
+

Since: 1.2

+
+
+
+

nm_device_macvlan_get_hw_address ()

+
const char *
+nm_device_macvlan_get_hw_address (NMDeviceMacvlan *device);
+

Gets the hardware (MAC) address of the NMDeviceMacvlan

+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceMacvlan

 
+
+
+

Returns

+

the hardware address. This is the internal string used by the +device, and must not be modified.

+
+

Since: 1.2

+
+
+
+

Types and Values

+
+

NM_DEVICE_MACVLAN_PARENT

+
#define NM_DEVICE_MACVLAN_PARENT      "parent"
+
+
+
+
+

NM_DEVICE_MACVLAN_MODE

+
#define NM_DEVICE_MACVLAN_MODE        "mode"
+
+
+
+
+

NM_DEVICE_MACVLAN_NO_PROMISC

+
#define NM_DEVICE_MACVLAN_NO_PROMISC  "no-promisc"
+
+
+
+
+

NM_DEVICE_MACVLAN_TAP

+
#define NM_DEVICE_MACVLAN_TAP         "tap"
+
+
+
+
+

NM_DEVICE_MACVLAN_HW_ADDRESS

+
#define NM_DEVICE_MACVLAN_HW_ADDRESS  "hw-address"
+
+
+
+
+

Property Details

+
+

The “hw-address” property

+
  “hw-address”               gchar *
+

The hardware (MAC) address of the device.

+

Flags: Read

+

Default value: NULL

+

Since: 1.2

+
+
+
+

The “mode” property

+
  “mode”                     gchar *
+

The MACVLAN mode.

+

Flags: Read

+

Default value: NULL

+

Since: 1.2

+
+
+
+

The “no-promisc” property

+
  “no-promisc”               gboolean
+

Whether the device has the no-promiscuos flag.

+

Flags: Read

+

Default value: FALSE

+

Since: 1.2

+
+
+
+

The “parent” property

+
  “parent”                   NMDevice *
+

The devices's parent device.

+

Flags: Read

+

Since: 1.2

+
+
+
+

The “tap” property

+
  “tap”                      gboolean
+

Whether the device is a MACVTAP.

+

Flags: Read

+

Default value: FALSE

+

Since: 1.2

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm/html/NMDeviceModem.html b/docs/libnm/html/NMDeviceModem.html index 63f1dbf6..48227b60 100644 --- a/docs/libnm/html/NMDeviceModem.html +++ b/docs/libnm/html/NMDeviceModem.html @@ -6,7 +6,7 @@ - + @@ -21,7 +21,7 @@ Home Up -Prev +Prev Next
@@ -123,7 +123,7 @@ nm_device_modem_get_modem_capabilities supports. Not all capabilities are available concurrently however; some may require a firmware reload or reinitialization.

-

Parameters

+

Parameters

@@ -138,7 +138,7 @@ may require a firmware reload or reinitialization.

-

Returns

+

Returns

the generic access technology families the modem supports

@@ -152,7 +152,7 @@ nm_device_modem_get_current_capabilities supports without a firmware reload or reinitialization. This value represents the network types the modem can immediately connect to.

-

Parameters

+

Parameters

@@ -167,7 +167,7 @@ represents the network types the modem can immediately connect to.

-

Returns

+

Returns

the generic access technology families the modem supports without a firmware reload or other reinitialization

diff --git a/docs/libnm/html/NMDeviceOlpcMesh.html b/docs/libnm/html/NMDeviceOlpcMesh.html index 1e4e036a..92f9a5e6 100644 --- a/docs/libnm/html/NMDeviceOlpcMesh.html +++ b/docs/libnm/html/NMDeviceOlpcMesh.html @@ -138,7 +138,7 @@ nm_device_olpc_mesh_get_hw_address (NMDeviceOlpcMesh *device);

Gets the hardware (MAC) address of the NMDeviceOlpcMesh

-

Parameters

+

Parameters

@@ -153,7 +153,7 @@ nm_device_olpc_mesh_get_hw_address (
-

Returns

+

Returns

the hardware address. This is the internal string used by the device, and must not be modified.

@@ -165,7 +165,7 @@ device, and must not be modified.

nm_device_olpc_mesh_get_companion (NMDeviceOlpcMesh *device);

Gets the companion device of the NMDeviceOlpcMesh.

-

Parameters

+

Parameters

@@ -180,7 +180,7 @@ nm_device_olpc_mesh_get_companion (
-

Returns

+

Returns

the companion of the device of NULL.

[transfer none]

@@ -193,7 +193,7 @@ nm_device_olpc_mesh_get_active_channel (NMDeviceOlpcMesh *device);

Returns the active channel of the NMDeviceOlpcMesh device.

-

Parameters

+

Parameters

@@ -208,7 +208,7 @@ nm_device_olpc_mesh_get_active_channel
-

Returns

+

Returns

active channel of the device

diff --git a/docs/libnm/html/NMDeviceTeam.html b/docs/libnm/html/NMDeviceTeam.html index 9290d518..e166abba 100644 --- a/docs/libnm/html/NMDeviceTeam.html +++ b/docs/libnm/html/NMDeviceTeam.html @@ -7,7 +7,7 @@ - + @@ -22,7 +22,7 @@ Home Up Prev -Next +Next
@@ -137,7 +137,7 @@ nm_device_team_get_hw_address (NMDeviceTeam *device);

Gets the hardware (MAC) address of the NMDeviceTeam

-

Parameters

+

Parameters

@@ -152,7 +152,7 @@ nm_device_team_get_hw_address (
-

Returns

+

Returns

the hardware address. This is the internal string used by the device, and must not be modified.

@@ -164,7 +164,7 @@ device, and must not be modified.

nm_device_team_get_carrier (NMDeviceTeam *device);

Whether the device has carrier.

-

Parameters

+

Parameters

@@ -179,7 +179,7 @@ nm_device_team_get_carrier ( -

Returns

+

Returns

TRUE if the device has carrier

@@ -191,7 +191,7 @@ nm_device_team_get_slaves (device .

-

Parameters

+

Parameters

@@ -206,7 +206,7 @@ nm_device_team_get_slaves ( -

Returns

+

Returns

the GPtrArray containing NMDevices that are slaves of device . This is the internal diff --git a/docs/libnm/html/NMDeviceTun.html b/docs/libnm/html/NMDeviceTun.html new file mode 100644 index 00000000..24157784 --- /dev/null +++ b/docs/libnm/html/NMDeviceTun.html @@ -0,0 +1,490 @@ + + + + +NMDeviceTun: libnm Reference Manual + + + + + + + + + +

+ + + + + + +
+
+
+ + +
+

NMDeviceTun

+

NMDeviceTun

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
const char * + +nm_device_tun_get_hw_address () +
const char * + +nm_device_tun_get_mode () +
+gint64 + +nm_device_tun_get_owner () +
+gint64 + +nm_device_tun_get_group () +
+gboolean + +nm_device_tun_get_no_pi () +
+gboolean + +nm_device_tun_get_vnet_hdr () +
+gboolean + +nm_device_tun_get_multi_queue () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
gint64groupRead
+gchar *hw-addressRead
+gchar *modeRead
gbooleanmulti-queueRead
gbooleanno-piRead
gint64ownerRead
gbooleanvnet-hdrRead
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#defineNM_DEVICE_TUN_HW_ADDRESS
#defineNM_DEVICE_TUN_OWNER
#defineNM_DEVICE_TUN_GROUP
#defineNM_DEVICE_TUN_MODE
#defineNM_DEVICE_TUN_NO_PI
#defineNM_DEVICE_TUN_VNET_HDR
#defineNM_DEVICE_TUN_MULTI_QUEUE
+
+
+

Object Hierarchy

+
    GObject
+    ╰── NMObject
+        ╰── NMDevice
+            ╰── NMDeviceTun
+
+
+
+

Description

+
+
+

Functions

+
+

nm_device_tun_get_hw_address ()

+
const char *
+nm_device_tun_get_hw_address (NMDeviceTun *device);
+

Gets the hardware (MAC) address of the NMDeviceTun

+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceTun

 
+
+
+

Returns

+

the hardware address. This is the internal string used by the +device, and must not be modified.

+
+

Since: 1.2

+
+
+
+

nm_device_tun_get_mode ()

+
const char *
+nm_device_tun_get_mode (NMDeviceTun *device);
+

Returns the TUN/TAP mode for the device.

+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceTun

 
+
+
+

Returns

+

'tun' or 'tap'

+
+

Since: 1.2

+
+
+
+

nm_device_tun_get_owner ()

+
gint64
+nm_device_tun_get_owner (NMDeviceTun *device);
+

Gets the tunnel owner.

+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceTun

 
+
+
+

Returns

+

the uid of the tunnel owner, or -1 if it has no owner.

+
+

Since: 1.2

+
+
+
+

nm_device_tun_get_group ()

+
gint64
+nm_device_tun_get_group (NMDeviceTun *device);
+

Gets the tunnel group.

+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceTun

 
+
+
+

Returns

+

the gid of the tunnel group, or -1 if it has no owner.

+
+

Since: 1.2

+
+
+
+

nm_device_tun_get_no_pi ()

+
gboolean
+nm_device_tun_get_no_pi (NMDeviceTun *device);
+
+
+
+

nm_device_tun_get_vnet_hdr ()

+
gboolean
+nm_device_tun_get_vnet_hdr (NMDeviceTun *device);
+

Returns whether the NMDeviceTun has the IFF_VNET_HDR flag.

+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceTun

 
+
+
+

Returns

+

TRUE if the device has the flag, FALSE otherwise

+
+

Since: 1.2

+
+
+
+

nm_device_tun_get_multi_queue ()

+
gboolean
+nm_device_tun_get_multi_queue (NMDeviceTun *device);
+

Returns whether the NMDeviceTun has the IFF_MULTI_QUEUE flag.

+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceTun

 
+
+
+

Returns

+

TRUE if the device doesn't have the flag, FALSE otherwise

+
+

Since: 1.2

+
+
+
+

Types and Values

+
+

NM_DEVICE_TUN_HW_ADDRESS

+
#define NM_DEVICE_TUN_HW_ADDRESS   "hw-address"
+
+
+
+
+

NM_DEVICE_TUN_OWNER

+
#define NM_DEVICE_TUN_OWNER        "owner"
+
+
+
+
+

NM_DEVICE_TUN_GROUP

+
#define NM_DEVICE_TUN_GROUP        "group"
+
+
+
+
+

NM_DEVICE_TUN_MODE

+
#define NM_DEVICE_TUN_MODE         "mode"
+
+
+
+
+

NM_DEVICE_TUN_NO_PI

+
#define NM_DEVICE_TUN_NO_PI        "no-pi"
+
+
+
+
+

NM_DEVICE_TUN_VNET_HDR

+
#define NM_DEVICE_TUN_VNET_HDR     "vnet-hdr"
+
+
+
+
+

NM_DEVICE_TUN_MULTI_QUEUE

+
#define NM_DEVICE_TUN_MULTI_QUEUE  "multi-queue"
+
+
+
+
+

Property Details

+
+

The “group” property

+
  “group”                    gint64
+

The gid of the tunnel group, or -1 if it has no owner.

+

Flags: Read

+

Allowed values: [-1,4294967295]

+

Default value: -1

+

Since: 1.2

+
+
+
+

The “hw-address” property

+
  “hw-address”               gchar *
+

The hardware (MAC) address of the device.

+

Flags: Read

+

Default value: NULL

+

Since: 1.2

+
+
+
+

The “mode” property

+
  “mode”                     gchar *
+

The tunnel mode, either "tun" or "tap".

+

Flags: Read

+

Default value: NULL

+

Since: 1.2

+
+
+
+

The “multi-queue” property

+
  “multi-queue”              gboolean
+

The tunnel's "TUN_TAP_MQ" flag; true if callers can connect to +the tap device multiple times, for multiple send/receive +queues.

+

Flags: Read

+

Default value: FALSE

+

Since: 1.2

+
+
+
+

The “no-pi” property

+
  “no-pi”                    gboolean
+

The tunnel's "TUN_NO_PI" flag; true if no protocol info is +prepended to the tunnel packets.

+

Flags: Read

+

Default value: FALSE

+

Since: 1.2

+
+
+
+

The “owner” property

+
  “owner”                    gint64
+

The uid of the tunnel owner, or -1 if it has no owner.

+

Flags: Read

+

Allowed values: [-1,4294967295]

+

Default value: -1

+

Since: 1.2

+
+
+
+

The “vnet-hdr” property

+
  “vnet-hdr”                 gboolean
+

The tunnel's "TUN_VNET_HDR" flag; true if the tunnel packets +include a virtio network header.

+

Flags: Read

+

Default value: FALSE

+

Since: 1.2

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm/html/NMDeviceVlan.html b/docs/libnm/html/NMDeviceVlan.html index 1101eb80..08ab3bf0 100644 --- a/docs/libnm/html/NMDeviceVlan.html +++ b/docs/libnm/html/NMDeviceVlan.html @@ -6,8 +6,8 @@ - - + + @@ -21,8 +21,8 @@ Home Up -Prev -Next +Prev +Next
@@ -155,7 +155,7 @@ nm_device_vlan_get_hw_address (NMDeviceVlan *device);

Gets the hardware (MAC) address of the NMDeviceVlan

-

Parameters

+

Parameters

@@ -170,7 +170,7 @@ nm_device_vlan_get_hw_address (
-

Returns

+

Returns

the hardware address. This is the internal string used by the device, and must not be modified.

@@ -182,7 +182,7 @@ device, and must not be modified.

nm_device_vlan_get_carrier (NMDeviceVlan *device);

Whether the device has carrier.

-

Parameters

+

Parameters

@@ -197,7 +197,7 @@ nm_device_vlan_get_carrier ( -

Returns

+

Returns

TRUE if the device has carrier

@@ -207,7 +207,7 @@ nm_device_vlan_get_carrier (NMDevice * nm_device_vlan_get_parent (NMDeviceVlan *device);
-

Parameters

+

Parameters

@@ -222,7 +222,7 @@ nm_device_vlan_get_parent ( -

Returns

+

Returns

the device's parent device.

[transfer none]

@@ -233,7 +233,7 @@ nm_device_vlan_get_parent (guint nm_device_vlan_get_vlan_id (NMDeviceVlan *device);
-

Parameters

+

Parameters

@@ -248,7 +248,7 @@ nm_device_vlan_get_vlan_id ( -

Returns

+

Returns

the device's VLAN ID

diff --git a/docs/libnm/html/NMDeviceVxlan.html b/docs/libnm/html/NMDeviceVxlan.html new file mode 100644 index 00000000..074a37fb --- /dev/null +++ b/docs/libnm/html/NMDeviceVxlan.html @@ -0,0 +1,1151 @@ + + + + +NMDeviceVxlan: libnm Reference Manual + + + + + + + + + +
+ + + + + + +
+
+
+ + +
+

NMDeviceVxlan

+

NMDeviceVxlan

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
const char * + +nm_device_vxlan_get_hw_address () +
+gboolean + +nm_device_vxlan_get_carrier () +
+NMDevice * + +nm_device_vxlan_get_parent () +
+guint + +nm_device_vxlan_get_id () +
const char * + +nm_device_vxlan_get_group () +
const char * + +nm_device_vxlan_get_local () +
+guint + +nm_device_vxlan_get_src_port_min () +
+guint + +nm_device_vxlan_get_src_port_max () +
+guint + +nm_device_vxlan_get_dst_port () +
+gboolean + +nm_device_vxlan_get_learning () +
+guint + +nm_device_vxlan_get_ageing () +
+guint + +nm_device_vxlan_get_tos () +
+guint + +nm_device_vxlan_get_ttl () +
+guint + +nm_device_vxlan_get_limit () +
+gboolean + +nm_device_vxlan_get_proxy () +
+gboolean + +nm_device_vxlan_get_rsc () +
+gboolean + +nm_device_vxlan_get_l2miss () +
+gboolean + +nm_device_vxlan_get_l3miss () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
guintageingRead
gbooleancarrierRead
guintdst-portRead
+gchar *groupRead
+gchar *hw-addressRead
guintidRead
gbooleanl2missRead
gbooleanl3missRead
gbooleanlearningRead
guintlimitRead
+gchar *localRead
+NMDevice *parentRead
gbooleanproxyRead
gbooleanrscRead
guintsrc-port-maxRead
guintsrc-port-minRead
guchartosRead
gucharttlRead
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#defineNM_DEVICE_VXLAN_HW_ADDRESS
#defineNM_DEVICE_VXLAN_CARRIER
#defineNM_DEVICE_VXLAN_PARENT
#defineNM_DEVICE_VXLAN_ID
#defineNM_DEVICE_VXLAN_GROUP
#defineNM_DEVICE_VXLAN_LOCAL
#defineNM_DEVICE_VXLAN_SRC_PORT_MIN
#defineNM_DEVICE_VXLAN_SRC_PORT_MAX
#defineNM_DEVICE_VXLAN_LEARNING
#defineNM_DEVICE_VXLAN_AGEING
#defineNM_DEVICE_VXLAN_TOS
#defineNM_DEVICE_VXLAN_TTL
#defineNM_DEVICE_VXLAN_LIMIT
#defineNM_DEVICE_VXLAN_PROXY
#defineNM_DEVICE_VXLAN_RSC
#defineNM_DEVICE_VXLAN_L2MISS
#defineNM_DEVICE_VXLAN_L3MISS
#defineNM_DEVICE_VXLAN_DST_PORT
+
+
+

Object Hierarchy

+
    GObject
+    ╰── NMObject
+        ╰── NMDevice
+            ╰── NMDeviceVxlan
+
+
+
+

Description

+
+
+

Functions

+
+

nm_device_vxlan_get_hw_address ()

+
const char *
+nm_device_vxlan_get_hw_address (NMDeviceVxlan *device);
+

Gets the hardware (MAC) address of the NMDeviceVxlan

+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceVxlan

 
+
+
+

Returns

+

the hardware address. This is the internal string used by the +device, and must not be modified.

+
+

Since: 1.2

+
+
+
+

nm_device_vxlan_get_carrier ()

+
gboolean
+nm_device_vxlan_get_carrier (NMDeviceVxlan *device);
+

Whether the device has carrier.

+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceVxlan

 
+
+
+

Returns

+

TRUE if the device has carrier.

+
+

Since: 1.2

+
+
+
+

nm_device_vxlan_get_parent ()

+
NMDevice *
+nm_device_vxlan_get_parent (NMDeviceVxlan *device);
+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceVxlan

 
+
+
+

Returns

+

the device's parent device.

+

[transfer none]

+
+

Since: 1.2

+
+
+
+

nm_device_vxlan_get_id ()

+
guint
+nm_device_vxlan_get_id (NMDeviceVxlan *device);
+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceVxlan

 
+
+
+

Returns

+

the device's VXLAN ID.

+
+

Since: 1.2

+
+
+
+

nm_device_vxlan_get_group ()

+
const char *
+nm_device_vxlan_get_group (NMDeviceVxlan *device);
+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceVxlan

 
+
+
+

Returns

+

The unicast destination IP address or the multicast +IP address joined

+
+

Since: 1.2

+
+
+
+

nm_device_vxlan_get_local ()

+
const char *
+nm_device_vxlan_get_local (NMDeviceVxlan *device);
+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceVxlan

 
+
+
+

Returns

+

the source IP address to use in outgoing packets

+
+

Since: 1.2

+
+
+
+

nm_device_vxlan_get_src_port_min ()

+
guint
+nm_device_vxlan_get_src_port_min (NMDeviceVxlan *device);
+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceVxlan

 
+
+
+

Returns

+

the minimum UDP source port

+
+

Since: 1.2

+
+
+
+

nm_device_vxlan_get_src_port_max ()

+
guint
+nm_device_vxlan_get_src_port_max (NMDeviceVxlan *device);
+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceVxlan

 
+
+
+

Returns

+

the maximum UDP source port

+
+

Since: 1.2

+
+
+
+

nm_device_vxlan_get_dst_port ()

+
guint
+nm_device_vxlan_get_dst_port (NMDeviceVxlan *device);
+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceVxlan

 
+
+
+

Returns

+

the UDP destination port

+
+

Since: 1.2

+
+
+
+

nm_device_vxlan_get_learning ()

+
gboolean
+nm_device_vxlan_get_learning (NMDeviceVxlan *device);
+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceVxlan

 
+
+
+

Returns

+

whether address learning is enabled

+
+

Since: 1.2

+
+
+
+

nm_device_vxlan_get_ageing ()

+
guint
+nm_device_vxlan_get_ageing (NMDeviceVxlan *device);
+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceVxlan

 
+
+
+

Returns

+

the lifetime in seconds of FDB entries learnt by the kernel

+
+

Since: 1.2

+
+
+
+

nm_device_vxlan_get_tos ()

+
guint
+nm_device_vxlan_get_tos (NMDeviceVxlan *device);
+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceVxlan

 
+
+
+

Returns

+

the TOS value to use in outgoing packets

+
+

Since: 1.2

+
+
+
+

nm_device_vxlan_get_ttl ()

+
guint
+nm_device_vxlan_get_ttl (NMDeviceVxlan *device);
+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceVxlan

 
+
+
+

Returns

+

the time-to-live value to use in outgoing packets

+
+

Since: 1.2

+
+
+
+

nm_device_vxlan_get_limit ()

+
guint
+nm_device_vxlan_get_limit (NMDeviceVxlan *device);
+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceVxlan

 
+
+
+

Returns

+

the maximum number of entries that can be added to the +forwarding table

+
+

Since: 1.2

+
+
+
+

nm_device_vxlan_get_proxy ()

+
gboolean
+nm_device_vxlan_get_proxy (NMDeviceVxlan *device);
+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceVxlan

 
+
+
+

Returns

+

whether ARP proxy is turned on

+
+

Since: 1.2

+
+
+
+

nm_device_vxlan_get_rsc ()

+
gboolean
+nm_device_vxlan_get_rsc (NMDeviceVxlan *device);
+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceVxlan

 
+
+
+

Returns

+

whether route short circuit is turned on

+
+

Since: 1.2

+
+
+
+

nm_device_vxlan_get_l2miss ()

+
gboolean
+nm_device_vxlan_get_l2miss (NMDeviceVxlan *device);
+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceVxlan

 
+
+
+

Returns

+

whether netlink LL ADDR miss notifications are generated

+
+

Since: 1.2

+
+
+
+

nm_device_vxlan_get_l3miss ()

+
gboolean
+nm_device_vxlan_get_l3miss (NMDeviceVxlan *device);
+
+

Parameters

+
+++++ + + + + + +

device

a NMDeviceVxlan

 
+
+
+

Returns

+

wether netlink IP ADDR miss notifications are generated

+
+

Since: 1.2

+
+
+
+

Types and Values

+
+

NM_DEVICE_VXLAN_HW_ADDRESS

+
#define NM_DEVICE_VXLAN_HW_ADDRESS    "hw-address"
+
+
+
+
+

NM_DEVICE_VXLAN_CARRIER

+
#define NM_DEVICE_VXLAN_CARRIER       "carrier"
+
+
+
+
+

NM_DEVICE_VXLAN_PARENT

+
#define NM_DEVICE_VXLAN_PARENT        "parent"
+
+
+
+
+

NM_DEVICE_VXLAN_ID

+
#define NM_DEVICE_VXLAN_ID            "id"
+
+
+
+
+

NM_DEVICE_VXLAN_GROUP

+
#define NM_DEVICE_VXLAN_GROUP         "group"
+
+
+
+
+

NM_DEVICE_VXLAN_LOCAL

+
#define NM_DEVICE_VXLAN_LOCAL         "local"
+
+
+
+
+

NM_DEVICE_VXLAN_SRC_PORT_MIN

+
#define NM_DEVICE_VXLAN_SRC_PORT_MIN  "src-port-min"
+
+
+
+
+

NM_DEVICE_VXLAN_SRC_PORT_MAX

+
#define NM_DEVICE_VXLAN_SRC_PORT_MAX  "src-port-max"
+
+
+
+
+

NM_DEVICE_VXLAN_LEARNING

+
#define NM_DEVICE_VXLAN_LEARNING      "learning"
+
+
+
+
+

NM_DEVICE_VXLAN_AGEING

+
#define NM_DEVICE_VXLAN_AGEING        "ageing"
+
+
+
+
+

NM_DEVICE_VXLAN_TOS

+
#define NM_DEVICE_VXLAN_TOS           "tos"
+
+
+
+
+

NM_DEVICE_VXLAN_TTL

+
#define NM_DEVICE_VXLAN_TTL           "ttl"
+
+
+
+
+

NM_DEVICE_VXLAN_LIMIT

+
#define NM_DEVICE_VXLAN_LIMIT         "limit"
+
+
+
+
+

NM_DEVICE_VXLAN_PROXY

+
#define NM_DEVICE_VXLAN_PROXY         "proxy"
+
+
+
+
+

NM_DEVICE_VXLAN_RSC

+
#define NM_DEVICE_VXLAN_RSC           "rsc"
+
+
+
+
+

NM_DEVICE_VXLAN_L2MISS

+
#define NM_DEVICE_VXLAN_L2MISS        "l2miss"
+
+
+
+
+

NM_DEVICE_VXLAN_L3MISS

+
#define NM_DEVICE_VXLAN_L3MISS        "l3miss"
+
+
+
+
+

NM_DEVICE_VXLAN_DST_PORT

+
#define NM_DEVICE_VXLAN_DST_PORT      "dst-port"
+
+
+
+
+

Property Details

+
+

The “ageing” property

+
  “ageing”                   guint
+

The lifetime in seconds of FDB entries learnt by the kernel.

+

Flags: Read

+

Default value: 0

+

Since: 1.2

+
+
+
+

The “carrier” property

+
  “carrier”                  gboolean
+

Whether the device has carrier.

+

Flags: Read

+

Default value: FALSE

+

Since: 1.2

+
+
+
+

The “dst-port” property

+
  “dst-port”                 guint
+

The UDP destination port used to communicate with the remote VXLAN tunnel +endpoint.

+

Flags: Read

+

Allowed values: <= 65535

+

Default value: 0

+

Since: 1.2

+
+
+
+

The “group” property

+
  “group”                    gchar *
+

The unicast destination IP address used in outgoing packets when the +destination link layer address is not known in the VXLAN device +forwarding database or the multicast IP address joined.

+

Flags: Read

+

Default value: NULL

+

Since: 1.2

+
+
+
+

The “hw-address” property

+
  “hw-address”               gchar *
+

The hardware (MAC) address of the device.

+

Flags: Read

+

Default value: NULL

+

Since: 1.2

+
+
+
+

The “id” property

+
  “id”                       guint
+

The device's VXLAN ID.

+

Flags: Read

+

Allowed values: <= 16777215

+

Default value: 0

+

Since: 1.2

+
+
+
+

The “l2miss” property

+
  “l2miss”                   gboolean
+

Whether netlink LL ADDR miss notifications are generated.

+

Flags: Read

+

Default value: FALSE

+

Since: 1.2

+
+
+
+

The “l3miss” property

+
  “l3miss”                   gboolean
+

Whether netlink IP ADDR miss notifications are generated.

+

Flags: Read

+

Default value: FALSE

+

Since: 1.2

+
+
+
+

The “learning” property

+
  “learning”                 gboolean
+

Whether unknown source link layer addresses and IP addresses are entered +into the VXLAN device forwarding database.

+

Flags: Read

+

Default value: TRUE

+

Since: 1.2

+
+
+
+

The “limit” property

+
  “limit”                    guint
+

The maximum number of entries that can be added to the forwarding table.

+

Flags: Read

+

Default value: 0

+

Since: 1.2

+
+
+
+

The “local” property

+
  “local”                    gchar *
+

The source IP address to use in outgoing packets.

+

Flags: Read

+

Default value: NULL

+

Since: 1.2

+
+
+
+

The “parent” property

+
  “parent”                   NMDevice *
+

The devices's parent device.

+

Flags: Read

+

Since: 1.2

+
+
+
+

The “proxy” property

+
  “proxy”                    gboolean
+

Whether ARP proxy is turned on.

+

Flags: Read

+

Default value: FALSE

+

Since: 1.2

+
+
+
+

The “rsc” property

+
  “rsc”                      gboolean
+

Whether route short circuit is turned on.

+

Flags: Read

+

Default value: FALSE

+

Since: 1.2

+
+
+
+

The “src-port-max” property

+
  “src-port-max”             guint
+

The maximum UDP source port used to communicate with the remote VXLAN +tunnel endpoint.

+

Flags: Read

+

Allowed values: <= 65535

+

Default value: 0

+

Since: 1.2

+
+
+
+

The “src-port-min” property

+
  “src-port-min”             guint
+

The minimum UDP source port used to communicate with the remote VXLAN +tunnel endpoint.

+

Flags: Read

+

Allowed values: <= 65535

+

Default value: 0

+

Since: 1.2

+
+
+
+

The “tos” property

+
  “tos”                      guchar
+

The TOS value to use in outgoing packets.

+

Flags: Read

+

Default value: 0

+

Since: 1.2

+
+
+
+

The “ttl” property

+
  “ttl”                      guchar
+

The time-to-live value to use in outgoing packets.

+

Flags: Read

+

Default value: 0

+

Since: 1.2

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm/html/NMDeviceWifi.html b/docs/libnm/html/NMDeviceWifi.html index 776aba14..c9c6128c 100644 --- a/docs/libnm/html/NMDeviceWifi.html +++ b/docs/libnm/html/NMDeviceWifi.html @@ -6,7 +6,7 @@ - + @@ -22,7 +22,7 @@ Home Up -Prev +Prev Next
@@ -277,7 +277,7 @@ nm_device_wifi_get_hw_address (NMDeviceWifi *device);

Gets the actual hardware (MAC) address of the NMDeviceWifi

-

Parameters

+

Parameters

@@ -292,7 +292,7 @@ nm_device_wifi_get_hw_address (
-

Returns

+

Returns

the actual hardware address. This is the internal string used by the device, and must not be modified.

@@ -305,7 +305,7 @@ nm_device_wifi_get_permanent_hw_address (NMDeviceWifi *device);

Gets the permanent hardware (MAC) address of the NMDeviceWifi

-

Parameters

+

Parameters

@@ -320,7 +320,7 @@ nm_device_wifi_get_permanent_hw_address
-

Returns

+

Returns

the permanent hardware address. This is the internal string used by the device, and must not be modified.

@@ -332,7 +332,7 @@ device, and must not be modified.

nm_device_wifi_get_mode (NMDeviceWifi *device);

Gets the NMDeviceWifi mode.

-

Parameters

+

Parameters

@@ -347,7 +347,7 @@ nm_device_wifi_get_mode ( -

Returns

+

Returns

the mode

@@ -358,7 +358,7 @@ nm_device_wifi_get_mode (NMDeviceWifi *device);

Gets the bit rate of the NMDeviceWifi in kbit/s.

-

Parameters

+

Parameters

@@ -373,7 +373,7 @@ nm_device_wifi_get_bitrate ( -

Returns

+

Returns

the bit rate (kbit/s)

@@ -384,7 +384,7 @@ nm_device_wifi_get_bitrate (NMDeviceWifi *device);

Gets the Wi-Fi capabilities of the NMDeviceWifi.

-

Parameters

+

Parameters

@@ -399,7 +399,7 @@ nm_device_wifi_get_capabilities (
-

Returns

+

Returns

the capabilities

@@ -411,7 +411,7 @@ nm_device_wifi_get_active_access_point (NMDeviceWifi *device);

Gets the active NMAccessPoint.

-

Parameters

+

Parameters

@@ -426,7 +426,7 @@ nm_device_wifi_get_active_access_point
-

Returns

+

Returns

the access point or NULL if none is active.

[transfer none]

@@ -440,7 +440,7 @@ nm_device_wifi_get_access_point_by_path const char *path);

Gets a NMAccessPoint by path.

-

Parameters

+

Parameters

@@ -462,7 +462,7 @@ nm_device_wifi_get_access_point_by_path
-

Returns

+

Returns

the access point or NULL if none is found.

[transfer none]

@@ -474,7 +474,7 @@ nm_device_wifi_get_access_point_by_path nm_device_wifi_get_access_points (NMDeviceWifi *device);

Gets all the scanned access points of the NMDeviceWifi.

-

Parameters

+

Parameters

@@ -489,7 +489,7 @@ nm_device_wifi_get_access_points (
-

Returns

+

Returns

a GPtrArray containing all the scanned NMAccessPoints. The returned array is owned by the client and should not be modified.

@@ -508,7 +508,7 @@ nm_device_wifi_request_scan ( -

Parameters

+

Parameters

@@ -535,7 +535,7 @@ after that for the scan to complete.

-

Returns

+

Returns

TRUE on success, FALSE on error, in which case error will be set.

@@ -560,7 +560,7 @@ for the scanning. The argument is the dictionary passed to -

Parameters

+

Parameters

@@ -592,12 +592,12 @@ D-Bus call. Valid otions inside the dictionary are:
-

Returns

+

Returns

TRUE on success, FALSE on error, in which case error will be set.

-

Since: 1.0.6

+

Since: 1.2


@@ -613,7 +613,7 @@ nm_device_wifi_request_scan_async (
-

Parameters

+

Parameters

@@ -668,7 +668,7 @@ for the scanning. The argument is the dictionary passed to -

Parameters

+

Parameters

@@ -705,7 +705,7 @@ D-Bus call. Valid otions inside the dictionary are:
-

Since: 1.0.6

+

Since: 1.2


@@ -716,7 +716,7 @@ nm_device_wifi_request_scan_finish (GError **error);

Gets the result of a call to nm_device_wifi_request_scan_async().

-

Parameters

+

Parameters

@@ -743,7 +743,7 @@ nm_device_wifi_request_scan_finish (
-

Returns

+

Returns

TRUE on success, FALSE on error, in which case error will be set.

@@ -860,7 +860,7 @@ user_function (gpointer user_data)

Notifies that a NMAccessPoint is added to the Wi-Fi device.

-

Parameters

+

Parameters

@@ -897,7 +897,7 @@ user_function (gpointer user_data)

Notifies that a NMAccessPoint is removed from the Wi-Fi device.

-

Parameters

+

Parameters

diff --git a/docs/libnm/html/NMDeviceWimax.html b/docs/libnm/html/NMDeviceWimax.html index 4fc7c558..24c99f8e 100644 --- a/docs/libnm/html/NMDeviceWimax.html +++ b/docs/libnm/html/NMDeviceWimax.html @@ -252,9 +252,13 @@

nm_device_wimax_get_hw_address ()

const char *
 nm_device_wimax_get_hw_address (NMDeviceWimax *wimax);
+
+

nm_device_wimax_get_hw_address has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Gets the hardware (MAC) address of the NMDeviceWimax

-

Parameters

+

Parameters

@@ -269,7 +273,7 @@ nm_device_wimax_get_hw_address (
-

Returns

+

Returns

the hardware address. This is the internal string used by the device, and must not be modified.

@@ -279,9 +283,13 @@ device, and must not be modified.

nm_device_wimax_get_active_nsp ()

NMWimaxNsp *
 nm_device_wimax_get_active_nsp (NMDeviceWimax *wimax);
+
+

nm_device_wimax_get_active_nsp has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Gets the active NMWimaxNsp.

-

Parameters

+

Parameters

@@ -296,7 +304,7 @@ nm_device_wimax_get_active_nsp (
-

Returns

+

Returns

the access point or NULL if none is active.

[transfer full]

@@ -307,9 +315,13 @@ nm_device_wimax_get_active_nsp (NMWimaxNsp * nm_device_wimax_get_nsp_by_path (NMDeviceWimax *wimax, const char *path); +
+

nm_device_wimax_get_nsp_by_path has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Gets a NMWimaxNsp by path.

-

Parameters

+

Parameters

@@ -331,7 +343,7 @@ nm_device_wimax_get_nsp_by_path (
-

Returns

+

Returns

the access point or NULL if none is found.

[transfer none]

@@ -341,9 +353,13 @@ nm_device_wimax_get_nsp_by_path (

nm_device_wimax_get_nsps ()

const GPtrArray *
 nm_device_wimax_get_nsps (NMDeviceWimax *wimax);
+
+

nm_device_wimax_get_nsps has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Gets all the scanned NSPs of the NMDeviceWimax.

-

Parameters

+

Parameters

@@ -358,7 +374,7 @@ nm_device_wimax_get_nsps ( -

Returns

+

Returns

a GPtrArray containing all the scanned NMWimaxNsps. The returned array is owned by the client and should not be modified.

@@ -370,11 +386,15 @@ The returned array is owned by the client and should not be modified.

nm_device_wimax_get_center_frequency ()

guint
 nm_device_wimax_get_center_frequency (NMDeviceWimax *self);
+
+

nm_device_wimax_get_center_frequency has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Gets the center frequency (in KHz) of the radio channel the device is using to communicate with the network when connected. Has no meaning when the device is not connected.

-

Parameters

+

Parameters

@@ -389,7 +409,7 @@ device is not connected.

-

Returns

+

Returns

the center frequency in KHz, or 0

@@ -398,12 +418,16 @@ device is not connected.

nm_device_wimax_get_rssi ()

gint
 nm_device_wimax_get_rssi (NMDeviceWimax *self);
+
+

nm_device_wimax_get_rssi has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Gets the RSSI of the current radio link in dBm. This value indicates how strong the raw received RF signal from the base station is, but does not indicate the overall quality of the radio link. Has no meaning when the device is not connected.

-

Parameters

+

Parameters

@@ -418,7 +442,7 @@ device is not connected.

-

Returns

+

Returns

the RSSI in dBm, or 0

@@ -427,11 +451,15 @@ device is not connected.

nm_device_wimax_get_cinr ()

gint
 nm_device_wimax_get_cinr (NMDeviceWimax *self);
+
+

nm_device_wimax_get_cinr has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Gets the CINR (Carrier to Interference + Noise Ratio) of the current radio link in dB. CINR is a more accurate measure of radio link quality. Has no meaning when the device is not connected.

-

Parameters

+

Parameters

@@ -446,7 +474,7 @@ meaning when the device is not connected.

-

Returns

+

Returns

the CINR in dB, or 0

@@ -455,11 +483,15 @@ meaning when the device is not connected.

nm_device_wimax_get_tx_power ()

gint
 nm_device_wimax_get_tx_power (NMDeviceWimax *self);
+
+

nm_device_wimax_get_tx_power has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Average power of the last burst transmitted by the device, in units of 0.5 dBm. i.e. a TxPower of -11 represents an actual device TX power of -5.5 dBm. Has no meaning when the device is not connected.

-

Parameters

+

Parameters

@@ -474,7 +506,7 @@ nm_device_wimax_get_tx_power ( -

Returns

+

Returns

the TX power in dBm, or 0

@@ -483,9 +515,13 @@ nm_device_wimax_get_tx_power (

nm_device_wimax_get_bsid ()

const char *
 nm_device_wimax_get_bsid (NMDeviceWimax *self);
+
+

nm_device_wimax_get_bsid has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Gets the ID of the serving Base Station when the device is connected.

-

Parameters

+

Parameters

@@ -500,7 +536,7 @@ nm_device_wimax_get_bsid ( -

Returns

+

Returns

the ID of the serving Base Station, or NULL

@@ -561,6 +597,10 @@ nm_device_wimax_get_bsid (

The “active-nsp” property

  “active-nsp”               NMWimaxNsp *

The active NMWimaxNsp of the device.

+
+

NMDeviceWimax:active-nsp has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Flags: Read


@@ -569,6 +609,10 @@ nm_device_wimax_get_bsid ( “bsid” gchar *

The ID of the serving base station as received from the network. Has no meaning when the device is not connected.

+
+

NMDeviceWimax:bsid has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Flags: Read

Default value: NULL

@@ -579,6 +623,10 @@ no meaning when the device is not connected.

The center frequency (in KHz) of the radio channel the device is using to communicate with the network when connected. Has no meaning when the device is not connected.

+
+

NMDeviceWimax:center-frequency has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Flags: Read

Default value: 0

@@ -589,6 +637,10 @@ device is not connected.

CINR (Carrier to Interference + Noise Ratio) of the current radio link in dB. CINR is a more accurate measure of radio link quality. Has no meaning when the device is not connected.

+
+

NMDeviceWimax:cinr has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Flags: Read

Default value: 0

@@ -597,6 +649,10 @@ meaning when the device is not connected.

The “hw-address” property

  “hw-address”               gchar *

The hardware (MAC) address of the device.

+
+

NMDeviceWimax:hw-address has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Flags: Read

Default value: NULL

@@ -616,6 +672,10 @@ meaning when the device is not connected.

the raw received RF signal from the base station is, but does not indicate the overall quality of the radio link. Has no meaning when the device is not connected.

+
+

NMDeviceWimax:rssi has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Flags: Read

Default value: 0

@@ -626,6 +686,10 @@ device is not connected.

Average power of the last burst transmitted by the device, in units of 0.5 dBm. i.e. a TxPower of -11 represents an actual device TX power of -5.5 dBm. Has no meaning when the device is not connected.

+
+

NMDeviceWimax:tx-power has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Flags: Read

Default value: 0

@@ -639,8 +703,12 @@ user_function (< GObject *nsp, gpointer user_data)

Notifies that a NMWimaxNsp is added to the wimax device.

+
+

NMDeviceWimax::nsp-added has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+
-

Parameters

+

Parameters

@@ -676,8 +744,12 @@ user_function (< GObject *nsp, gpointer user_data)

Notifies that a NMWimaxNsp is removed from the wimax device.

+
+

NMDeviceWimax::nsp-removed has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+
-

Parameters

+

Parameters

diff --git a/docs/libnm/html/NMDhcpConfig.html b/docs/libnm/html/NMDhcpConfig.html index a1e97a8a..b506c4b1 100644 --- a/docs/libnm/html/NMDhcpConfig.html +++ b/docs/libnm/html/NMDhcpConfig.html @@ -127,7 +127,7 @@ nm_dhcp_config_get_family (NMDhcpConfig *config);

Gets the IP address family of the configuration

-

Parameters

+

Parameters

@@ -142,7 +142,7 @@ nm_dhcp_config_get_family ( -

Returns

+

Returns

the IP address family; either AF_INET or AF_INET6

@@ -154,7 +154,7 @@ nm_dhcp_config_get_family (NMDhcpConfig *config);

Gets all the options contained in the configuration.

-

Parameters

+

Parameters

@@ -169,7 +169,7 @@ nm_dhcp_config_get_options ( -

Returns

+

Returns

the GHashTable containing strings for keys and values. This is the internal copy used by the configuration, and must not be modified.

@@ -184,7 +184,7 @@ nm_dhcp_config_get_one_option (const char *option);

Gets one option by option name.

-

Parameters

+

Parameters

@@ -206,7 +206,7 @@ nm_dhcp_config_get_one_option (
-

Returns

+

Returns

the configuration option's value. This is the internal string used by the configuration, and must not be modified.

diff --git a/docs/libnm/html/NMIPConfig.html b/docs/libnm/html/NMIPConfig.html index 9a32ecb6..b21fc882 100644 --- a/docs/libnm/html/NMIPConfig.html +++ b/docs/libnm/html/NMIPConfig.html @@ -219,7 +219,7 @@ nm_ip_config_get_family (NMIPConfig *config);

Gets the IP address family

-

Parameters

+

Parameters

@@ -234,7 +234,7 @@ nm_ip_config_get_family ( -

Returns

+

Returns

the IP address family; either AF_INET or AF_INET6

@@ -246,7 +246,7 @@ nm_ip_config_get_family (NMIPConfig *config);

Gets the IP gateway address.

-

Parameters

+

Parameters

@@ -261,7 +261,7 @@ nm_ip_config_get_gateway ( -

Returns

+

Returns

the IP address of the gateway.

[transfer none]

@@ -273,7 +273,7 @@ nm_ip_config_get_gateway (NMIPConfig *config);

Gets the IP addresses (containing the address, prefix, and gateway).

-

Parameters

+

Parameters

@@ -288,10 +288,11 @@ nm_ip_config_get_addresses ( -

Returns

+

Returns

the GPtrArray containing NMIPAddresses. This is the internal copy used by the -configuration and must not be modified.

+configuration and must not be modified. The library never modifies the +returned array and thus it is safe for callers to reference and keep using it.

[element-type NMIPAddress][transfer none]

@@ -302,7 +303,7 @@ configuration and must not be modified.

nm_ip_config_get_routes (NMIPConfig *config);

Gets the routes.

-

Parameters

+

Parameters

@@ -317,10 +318,11 @@ nm_ip_config_get_routes ( -

Returns

+

Returns

the GPtrArray containing NMIPRoutes. This is the internal copy used by the configuration, and must -not be modified.

+not be modified. The library never modifies the returned array and thus it is +safe for callers to reference and keep using it.

[element-type NMIPRoute][transfer none]

@@ -331,7 +333,7 @@ not be modified.

nm_ip_config_get_nameservers (NMIPConfig *config);

Gets the domain name servers (DNS).

-

Parameters

+

Parameters

@@ -346,7 +348,7 @@ nm_ip_config_get_nameservers ( -

Returns

+

Returns

the array of nameserver IP addresses.

[transfer none]

@@ -358,7 +360,7 @@ nm_ip_config_get_nameservers (NMIPConfig *config);

Gets the domain names.

-

Parameters

+

Parameters

@@ -373,7 +375,7 @@ nm_ip_config_get_domains ( -

Returns

+

Returns

the array of domains. (This is never NULL, though it may be 0-length).

[transfer none]

@@ -386,7 +388,7 @@ nm_ip_config_get_domains (NMIPConfig *config);

Gets the DNS searches.

-

Parameters

+

Parameters

@@ -401,7 +403,7 @@ nm_ip_config_get_searches ( -

Returns

+

Returns

the array of DNS search strings. (This is never NULL, though it may be 0-length).

[transfer none]

@@ -414,7 +416,7 @@ nm_ip_config_get_searches (NMIPConfig *config);

Gets the Windows Internet Name Service servers (WINS).

-

Parameters

+

Parameters

@@ -429,7 +431,7 @@ nm_ip_config_get_wins_servers (
-

Returns

+

Returns

the arry of WINS server IP address strings. (This is never NULL, though it may be 0-length.).

[transfer none]

diff --git a/docs/libnm/html/NMRemoteConnection.html b/docs/libnm/html/NMRemoteConnection.html index d413162d..dac135b3 100644 --- a/docs/libnm/html/NMRemoteConnection.html +++ b/docs/libnm/html/NMRemoteConnection.html @@ -230,7 +230,7 @@ NetworkManager. If save_to_disk is TRUE, the updated connection will be saved to disk; if FALSE, then only the in-memory representation will be changed.

-

Parameters

+

Parameters

@@ -262,7 +262,7 @@ disk; if FALSE, then only the in-memory representat
-

Returns

+

Returns

TRUE on success, FALSE on error, in which case error will be set.

@@ -284,7 +284,7 @@ nm_remote_connection_commit_changes_async be saved to disk; if FALSE, then only the in-memory representation will be changed.

-

Parameters

+

Parameters

@@ -332,7 +332,7 @@ nm_remote_connection_commit_changes_finish GError **error);

Gets the result of a call to nm_remote_connection_commit_changes_async().

-

Parameters

+

Parameters

@@ -359,7 +359,7 @@ nm_remote_connection_commit_changes_finish
-

Returns

+

Returns

TRUE on success, FALSE on error, in which case error will be set.

@@ -374,7 +374,7 @@ nm_remote_connection_save ( -

Parameters

+

Parameters

@@ -401,7 +401,7 @@ been written to disk, or if the connection has never been saved.

-

Returns

+

Returns

TRUE on success, FALSE on error, in which case error will be set.

@@ -417,7 +417,7 @@ nm_remote_connection_save_async (Saves the connection to disk if the connection has changes that have not yet been written to disk, or if the connection has never been saved.

-

Parameters

+

Parameters

@@ -459,7 +459,7 @@ nm_remote_connection_save_finish (GError **error);

Gets the result of a call to nm_remote_connection_save_async().

-

Parameters

+

Parameters

@@ -486,7 +486,7 @@ nm_remote_connection_save_finish (
-

Returns

+

Returns

TRUE on success, FALSE on error, in which case error will be set.

@@ -500,7 +500,7 @@ nm_remote_connection_delete (GError **error);

Deletes the connection.

-

Parameters

+

Parameters

@@ -527,7 +527,7 @@ nm_remote_connection_delete ( -

Returns

+

Returns

TRUE on success, FALSE on error, in which case error will be set.

@@ -542,7 +542,7 @@ nm_remote_connection_delete_async (gpointer user_data);

Asynchronously deletes the connection.

-

Parameters

+

Parameters

@@ -584,7 +584,7 @@ nm_remote_connection_delete_finish (GError **error);

Gets the result of a call to nm_remote_connection_delete_async().

-

Parameters

+

Parameters

@@ -611,7 +611,7 @@ nm_remote_connection_delete_finish (
-

Returns

+

Returns

TRUE on success, FALSE on error, in which case error will be set.

@@ -627,7 +627,7 @@ nm_remote_connection_get_secrets (Request the connection's secrets. Note that this is a blocking D-Bus call, not a simple property accessor.

-

Parameters

+

Parameters

@@ -659,7 +659,7 @@ not a simple property accessor.

-

Returns

+

Returns

a GVariant of type NM_VARIANT_TYPE_CONNECTION containing connection 's secrets, or NULL on error.

@@ -677,7 +677,7 @@ nm_remote_connection_get_secrets_async gpointer user_data);

Asynchronously requests the connection's secrets.

-

Parameters

+

Parameters

@@ -725,7 +725,7 @@ nm_remote_connection_get_secrets_finish GError **error);

Gets the result of a call to nm_remote_connection_get_secrets_async().

-

Parameters

+

Parameters

@@ -752,7 +752,7 @@ nm_remote_connection_get_secrets_finish
-

Returns

+

Returns

a GVariant of type NM_VARIANT_TYPE_CONNECTION containing connection 's secrets, or NULL on error.

@@ -765,7 +765,7 @@ containing connection
gboolean
 nm_remote_connection_get_unsaved (NMRemoteConnection *connection);
-

Parameters

+

Parameters

@@ -780,7 +780,7 @@ nm_remote_connection_get_unsaved (
-

Returns

+

Returns

TRUE if the remote connection contains changes that have not been saved to disk, FALSE if the connection is the same as its on-disk representation.

@@ -800,7 +800,7 @@ non-visible connections to callers, but it is possible for a connection's visibility to change after you already have a reference to it.)

-

Parameters

+

Parameters

@@ -815,7 +815,7 @@ reference to it.)

-

Returns

+

Returns

TRUE if the remote connection is visible to the current user, FALSE if not.

diff --git a/docs/libnm/html/NMSetting.html b/docs/libnm/html/NMSetting.html index 565947a4..65b56b96 100644 --- a/docs/libnm/html/NMSetting.html +++ b/docs/libnm/html/NMSetting.html @@ -105,6 +105,14 @@ gboolean +nm_setting_verify_secrets () + + + + +gboolean + + nm_setting_compare () @@ -195,6 +203,10 @@ NMSettingCompareFlags +enum +NMSettingMacRandomization + + struct NMSetting @@ -207,10 +219,11 @@

Object Hierarchy

-
    GEnum
+
    GEnum
     ├── NMSettingCompareFlags
-    ╰── NMSettingDiffResult
-    GFlags
+    ├── NMSettingDiffResult
+    ╰── NMSettingMacRandomization
+    GFlags
     ╰── NMSettingSecretFlags
     GObject
     ╰── NMSetting
@@ -226,15 +239,19 @@
         ├── NMSettingGeneric
         ├── NMSettingGsm
         ├── NMSettingInfiniband
+        ├── NMSettingIPTunnel
         ├── NMSettingIPConfig
+        ├── NMSettingMacvlan
         ├── NMSettingOlpcMesh
         ├── NMSettingPpp
         ├── NMSettingPppoe
         ├── NMSettingSerial
         ├── NMSettingTeamPort
         ├── NMSettingTeam
+        ├── NMSettingTun
         ├── NMSettingVlan
         ├── NMSettingVpn
+        ├── NMSettingVxlan
         ├── NMSettingWimax
         ├── NMSettingWired
         ├── NMSettingWirelessSecurity
@@ -494,6 +511,54 @@ is being verified in isolation. 


+

nm_setting_verify_secrets ()

+
gboolean
+nm_setting_verify_secrets (NMSetting *setting,
+                           NMConnection *connection,
+                           GError **error);
+

Verifies the secrets in the setting. +The returned GError contains information about which secret of the setting +failed validation, and in what way that secret failed validation. +The secret validation is done separately from main setting validation, because +in some cases connection failure is not desired just for the secrets.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

setting

the NMSetting to verify secrets in

 

connection

the NMConnection that setting +came from, or +NULL if setting +is being verified in isolation.

[allow-none]

error

location to store error, or NULL

 
+
+
+

Returns

+

TRUE if the setting secrets are valid, FALSE if they are not

+
+

Since: 1.2

+
+
+

nm_setting_compare ()

gboolean
 nm_setting_compare (NMSetting *a,
@@ -503,7 +568,7 @@ nm_setting_compare (NMSettingCompareFlags
 for a description of each flag's behavior.

-

Parameters

+

Parameters

@@ -530,7 +595,7 @@ for a description of each flag's behavior.

-

Returns

+

Returns

TRUE if the comparison succeeds, FALSE if it does not

@@ -550,7 +615,7 @@ of each setting that differ from the other are added to NMSettingDiffResult values.

-

Parameters

+

Parameters

@@ -592,7 +657,7 @@ in and the settings differ, a new one is created and returned.

-

Returns

+

Returns

TRUE if the settings contain the same values, FALSE if they do not

@@ -606,7 +671,7 @@ nm_setting_enumerate_values (NMSetting object, calling the supplied user function for each property.

-

Parameters

+

Parameters

@@ -643,7 +708,7 @@ nm_setting_to_string ( -

Parameters

+

Parameters

@@ -658,7 +723,7 @@ output format is not guaranteed to be stable and may change at any time.

-

Returns

+

Returns

an allocated string containing a textual representation of the setting's properties and values (including secrets!), which the caller should free with g_free()

@@ -675,7 +740,7 @@ nm_setting_get_secret_flags (NMSettingSecretFlags describing how to handle that secret.

-

Parameters

+

Parameters

@@ -707,7 +772,7 @@ handle that secret.

-

Returns

+

Returns

TRUE on success (if the given secret name was a valid property of this setting, and if that property is secret), FALSE if not

@@ -723,7 +788,7 @@ nm_setting_set_secret_flags (NMSettingSecretFlags describing how to handle that secret.

-

Parameters

+

Parameters

@@ -755,7 +820,7 @@ handle that secret.

-

Returns

+

Returns

TRUE on success (if the given secret name was a valid property of this setting, and if that property is secret), FALSE if not

@@ -770,7 +835,7 @@ nm_setting_get_dbus_property_type (GObject property.

-

Parameters

+

Parameters

@@ -793,7 +858,7 @@ to get the type of

-

Returns

+

Returns

the D-Bus marshalling type of property on setting .

@@ -970,6 +1035,45 @@ two connections.


+

enum NMSettingMacRandomization

+

Controls if and how the MAC address of a device is randomzied.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + +

NM_SETTING_MAC_RANDOMIZATION_DEFAULT

+

the default value, which unless +overridden by user-controlled defaults configuration, is "never".

+
 

NM_SETTING_MAC_RANDOMIZATION_NEVER

+

the device's MAC address is always used.

+
 

NM_SETTING_MAC_RANDOMIZATION_ALWAYS

+

a random MAC address is used.

+
 
+
+
+
+

struct NMSetting

struct NMSetting;

The NMSetting struct contains only private data. @@ -980,7 +1084,7 @@ It should only be accessed through the functions described below.

enum NMSettingDiffResult

These values indicate the result of a setting difference operation.

-

Members

+

Members

diff --git a/docs/libnm/html/NMSetting8021x.html b/docs/libnm/html/NMSetting8021x.html index 38a438bd..41c3a2f9 100644 --- a/docs/libnm/html/NMSetting8021x.html +++ b/docs/libnm/html/NMSetting8021x.html @@ -51,6 +51,14 @@ + + + +
const char *
 nm_setting_802_1x_get_subject_match (NMSetting8021x *setting);
-

Parameters

+

Parameters

+NMSetting8021xCKScheme + +nm_setting_802_1x_check_cert_scheme () +
guint32 @@ -915,7 +923,7 @@

Object Hierarchy

-
    GEnum
+
    GEnum
     ├── NMSetting8021xCKFormat
     ╰── NMSetting8021xCKScheme
     GObject
@@ -958,6 +966,50 @@ nm_setting_802_1x_new (void
 
+

nm_setting_802_1x_check_cert_scheme ()

+
NMSetting8021xCKScheme
+nm_setting_802_1x_check_cert_scheme (gconstpointer pdata,
+                                     gsize length,
+                                     GError **error);
+

Determines and verifies the blob type. +When setting certificate properties of NMSetting8021x +the blob must be not UNKNOWN (or NULL).

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

pdata

the data pointer.

[allow-none]

length

the length of the data

 

error

(out): validation reason.

[allow-none]
+
+
+

Returns

+

the scheme of the blob or NM_SETTING_802_1X_CK_SCHEME_UNKNOWN. +For NULL it also returns NM_SETTING_802_1X_CK_SCHEME_UNKNOWN.

+
+

Since: 1.2

+
+
+

nm_setting_802_1x_get_num_eap_methods ()

guint32
 nm_setting_802_1x_get_num_eap_methods (NMSetting8021x *setting);
@@ -967,7 +1019,7 @@ network. Generally only one EAP method is used. Use the functions and nm_setting_802_1x_remove_eap_method() for adding, removing, and retrieving allowed EAP methods.

-

Parameters

+

Parameters

@@ -982,7 +1034,7 @@ allowed EAP methods.

-

Returns

+

Returns

the number of allowed EAP methods

@@ -995,7 +1047,7 @@ nm_setting_802_1x_get_eap_method (Returns the name of the allowed EAP method at index i .

-

Parameters

+

Parameters

@@ -1017,7 +1069,7 @@ nm_setting_802_1x_get_eap_method (
-

Returns

+

Returns

the name of the allowed EAP method at index i

@@ -1032,7 +1084,7 @@ nm_setting_802_1x_add_eap_method (“eap” property for a list of allowed EAP methods.

-

Parameters

+

Parameters

@@ -1054,7 +1106,7 @@ allowed EAP methods.

-

Returns

+

Returns

TRUE if the EAP method was successfully added, FALSE if it was not a valid method or if it was already allowed.

@@ -1067,7 +1119,7 @@ nm_setting_802_1x_remove_eap_method (guint32 i);

Removes the allowed EAP method at the specified index.

-

Parameters

+

Parameters

@@ -1099,7 +1151,7 @@ nm_setting_802_1x_remove_eap_method_by_value

Removes the allowed EAP method method .

-

Parameters

+

Parameters

@@ -1121,7 +1173,7 @@ nm_setting_802_1x_remove_eap_method_by_value
-

Returns

+

Returns

TRUE if the EAP method was founs and removed, FALSE if it was not.

@@ -1132,7 +1184,7 @@ nm_setting_802_1x_remove_eap_method_by_value nm_setting_802_1x_clear_eap_methods (NMSetting8021x *setting);

Clears all allowed EAP methods.

-

Parameters

+

Parameters

@@ -1155,7 +1207,7 @@ nm_setting_802_1x_get_identity (Returns the identifier used by some EAP methods (like TLS) to authenticate the user. Often this is a username or login name.

-

Parameters

+

Parameters

@@ -1170,7 +1222,7 @@ authenticate the user. Often this is a username or login name.

-

Returns

+

Returns

the user identifier

@@ -1185,7 +1237,7 @@ authenticate the user in the outer unencrypted "phase 1" authentication. The inner "phase 2" authentication will use the “identity” in a secure form, if applicable for that EAP method.

-

Parameters

+

Parameters

@@ -1200,7 +1252,7 @@ a secure form, if applicable for that EAP method.

-

Returns

+

Returns

the anonymous identifier

@@ -1211,7 +1263,7 @@ a secure form, if applicable for that EAP method.

nm_setting_802_1x_get_pac_file (NMSetting8021x *setting);

Returns the file containing PAC credentials used by EAP-FAST method.

-

Parameters

+

Parameters

@@ -1226,7 +1278,7 @@ nm_setting_802_1x_get_pac_file (
-

Returns

+

Returns

the PAC file

@@ -1242,7 +1294,7 @@ properties are ignored if the -

Parameters

+

Parameters

@@ -1257,7 +1309,7 @@ of these properties.

-

Returns

+

Returns

TRUE if a system CA certificate path should be used, FALSE if not

@@ -1272,7 +1324,7 @@ which the supplicant can then add to the verification chain. This may be used in addition to the “ca-cert” property to add more CA certificates for verifying the network to client.

-

Parameters

+

Parameters

@@ -1287,7 +1339,7 @@ certificates for verifying the network to client.

-

Returns

+

Returns

the CA certificate directory path

@@ -1302,7 +1354,7 @@ certificates which the supplicant can then add to the verification chain. This may be used in addition to the “phase2-ca-cert” property to add more CA certificates for verifying the network to client.

-

Parameters

+

Parameters

@@ -1317,7 +1369,7 @@ to add more CA certificates for verifying the network to client.

-

Returns

+

Returns

the "phase 2" CA certificate directory path

@@ -1330,7 +1382,7 @@ nm_setting_802_1x_get_ca_cert_scheme (NM_SETTING_802_1X_CK_SCHEME_BLOB, use nm_setting_802_1x_get_ca_cert_blob(); if NM_SETTING_802_1X_CK_SCHEME_PATH, use nm_setting_802_1x_get_ca_cert_path().

-

Parameters

+

Parameters

@@ -1345,7 +1397,7 @@ if -

Returns

+

Returns

scheme used to store the CA certificate (blob or path)

@@ -1361,7 +1413,7 @@ CA certificate allow it to be unset. Note that lack of a CA certificate reduces security by allowing man-in-the-middle attacks, because the identity of the network cannot be confirmed by the client.

-

Parameters

+

Parameters

@@ -1376,7 +1428,7 @@ of the network cannot be confirmed by the client.

-

Returns

+

Returns

the CA certificate data.

[transfer none]

@@ -1393,7 +1445,7 @@ CA certificate allow it to be unset. Note that lack of a CA certificate reduces security by allowing man-in-the-middle attacks, because the identity of the network cannot be confirmed by the client.

-

Parameters

+

Parameters

@@ -1408,7 +1460,7 @@ of the network cannot be confirmed by the client.

-

Returns

+

Returns

path to the CA certificate file

@@ -1426,7 +1478,7 @@ with the raw certificate data if using the NM_SETTING_802_1X_CK_SCHEME_PATH scheme.

-

Parameters

+

Parameters

@@ -1468,7 +1520,7 @@ clears the CA certificate.

-

Returns

+

Returns

TRUE if the operation succeeded, FALSE if it was unsuccessful

@@ -1478,7 +1530,7 @@ clears the CA certificate.

@@ -1493,7 +1545,7 @@ nm_setting_802_1x_get_subject_match (
-

Returns

+

Returns

the “subject-match” property. This is the substring to be matched against the subject of the authentication server certificate, or NULL no subject verification is to be @@ -1509,7 +1561,7 @@ nm_setting_802_1x_get_num_altsubject_matches

Returns the number of entries in the “altsubject-matches” property of this setting.

-

Parameters

+

Parameters

@@ -1524,7 +1576,7 @@ nm_setting_802_1x_get_num_altsubject_matches
-

Returns

+

Returns

the number of altsubject-matches entries.

@@ -1538,7 +1590,7 @@ nm_setting_802_1x_get_altsubject_match

Returns the altSubjectName match at index i .

-

Parameters

+

Parameters

@@ -1560,7 +1612,7 @@ nm_setting_802_1x_get_altsubject_match
-

Returns

+

Returns

the altSubjectName match at index i

@@ -1576,7 +1628,7 @@ nm_setting_802_1x_add_altsubject_match match is added, the altSubjectName of the remote authentication server is not verified.

-

Parameters

+

Parameters

@@ -1598,7 +1650,7 @@ server is not verified.

-

Returns

+

Returns

TRUE if the alternative subject name match was successfully added, FALSE if it was already allowed.

@@ -1612,7 +1664,7 @@ nm_setting_802_1x_remove_altsubject_match guint32 i);

Removes the allowed altSubjectName at the specified index.

-

Parameters

+

Parameters

@@ -1644,7 +1696,7 @@ nm_setting_802_1x_remove_altsubject_match_by_value

Removes the allowed altSubjectName altsubject_match .

-

Parameters

+

Parameters

@@ -1666,7 +1718,7 @@ nm_setting_802_1x_remove_altsubject_match_by_value
-

Returns

+

Returns

TRUE if the alternative subject name match was found and removed, FALSE if it was not.

@@ -1679,7 +1731,7 @@ nm_setting_802_1x_clear_altsubject_matches (NMSetting8021x *setting);

Clears all altSubjectName matches.

-

Parameters

+

Parameters

@@ -1704,7 +1756,7 @@ nm_setting_802_1x_get_client_cert_scheme is NM_SETTING_802_1X_CK_SCHEME_BLOB, use nm_setting_802_1x_get_client_cert_blob(); if NM_SETTING_802_1X_CK_SCHEME_PATH, use nm_setting_802_1x_get_client_cert_path().

-

Parameters

+

Parameters

@@ -1719,7 +1771,7 @@ if -

Returns

+

Returns

scheme used to store the client certificate (blob or path)

@@ -1733,7 +1785,7 @@ nm_setting_802_1x_get_client_cert_blob when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x authentication method.

-

Parameters

+

Parameters

@@ -1748,7 +1800,7 @@ authentication method.

-

Returns

+

Returns

the client certificate data.

[transfer none]

@@ -1763,7 +1815,7 @@ nm_setting_802_1x_get_client_cert_path when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x authentication method.

-

Parameters

+

Parameters

@@ -1778,7 +1830,7 @@ authentication method.

-

Returns

+

Returns

path to the client certificate file

@@ -1799,7 +1851,7 @@ file if using the
-

Parameters

+

Parameters

@@ -1842,7 +1894,7 @@ clears the client certificate.

-

Returns

+

Returns

TRUE if the operation succeeded, FALSE if it was unsuccessful

@@ -1852,7 +1904,7 @@ clears the client certificate.

const char *
 nm_setting_802_1x_get_phase1_peapver (NMSetting8021x *setting);
-

Parameters

+

Parameters

@@ -1867,7 +1919,7 @@ nm_setting_802_1x_get_phase1_peapver ( -

Returns

+

Returns

the "phase 1" PEAP version to be used when authenticating with EAP-PEAP as contained in the “phase1-peapver” property. Valid values are NULL (unset), "0" (PEAP version 0), and "1" (PEAP version 1).

@@ -1880,7 +1932,7 @@ values are NULL (unset), "0" (PEAP version 0), and nm_setting_802_1x_get_phase1_peaplabel (NMSetting8021x *setting);
-

Parameters

+

Parameters

@@ -1895,7 +1947,7 @@ nm_setting_802_1x_get_phase1_peaplabel
-

Returns

+

Returns

whether the "phase 1" PEAP label is new-style or old-style, to be used when authenticating with EAP-PEAP, as contained in the “phase1-peaplabel” property. Valid values are NULL (unset), @@ -1910,7 +1962,7 @@ wpa_supplicant documentation for more details.

nm_setting_802_1x_get_phase1_fast_provisioning (NMSetting8021x *setting);
-

Parameters

+

Parameters

@@ -1925,7 +1977,7 @@ nm_setting_802_1x_get_phase1_fast_provisioning
-

Returns

+

Returns

whether "phase 1" PEAP fast provisioning should be used, as specified by the “phase1-fast-provisioning” property. See the wpa_supplicant documentation for more details.

@@ -1937,7 +1989,7 @@ wpa_supplicant documentation for more details.

const char *
 nm_setting_802_1x_get_phase2_auth (NMSetting8021x *setting);
-

Parameters

+

Parameters

@@ -1952,7 +2004,7 @@ nm_setting_802_1x_get_phase2_auth (
-

Returns

+

Returns

the "phase 2" non-EAP (ex MD5) allowed authentication method as specified by the “phase2-auth” property.

@@ -1963,7 +2015,7 @@ specified by the const char * nm_setting_802_1x_get_phase2_autheap (NMSetting8021x *setting);
-

Parameters

+

Parameters

@@ -1978,7 +2030,7 @@ nm_setting_802_1x_get_phase2_autheap ( -

Returns

+

Returns

the "phase 2" EAP-based (ex TLS) allowed authentication method as specified by the “phase2-autheap” property.

@@ -1994,7 +2046,7 @@ returned scheme is nm_setting_802_1x_get_ca_cert_blob(); if NM_SETTING_802_1X_CK_SCHEME_PATH, use nm_setting_802_1x_get_ca_cert_path().

-

Parameters

+

Parameters

@@ -2009,7 +2061,7 @@ use -

Returns

+

Returns

scheme used to store the "phase 2" CA certificate (blob or path)

@@ -2026,7 +2078,7 @@ CA certificate allow it to be unset. Note that lack of a CA certificate reduces security by allowing man-in-the-middle attacks, because the identity of the network cannot be confirmed by the client.

-

Parameters

+

Parameters

@@ -2041,7 +2093,7 @@ of the network cannot be confirmed by the client.

-

Returns

+

Returns

the "phase 2" CA certificate data.

[transfer none]

@@ -2059,7 +2111,7 @@ CA certificate allow it to be unset. Note that lack of a CA certificate reduces security by allowing man-in-the-middle attacks, because the identity of the network cannot be confirmed by the client.

-

Parameters

+

Parameters

@@ -2074,7 +2126,7 @@ of the network cannot be confirmed by the client.

-

Returns

+

Returns

path to the "phase 2" CA certificate file

@@ -2092,7 +2144,7 @@ property with the raw certificate data if using the NM_SETTING_802_1X_CK_SCHEME_BLOB scheme, or with the path to the certificate file if using the NM_SETTING_802_1X_CK_SCHEME_PATH scheme.

-

Parameters

+

Parameters

@@ -2134,7 +2186,7 @@ clears the "phase2" CA certificate.

-

Returns

+

Returns

TRUE if the operation succeeded, FALSE if it was unsuccessful

@@ -2145,7 +2197,7 @@ clears the "phase2" CA certificate.

nm_setting_802_1x_get_phase2_subject_match (NMSetting8021x *setting);
-

Parameters

+

Parameters

@@ -2160,7 +2212,7 @@ nm_setting_802_1x_get_phase2_subject_match
-

Returns

+

Returns

the “phase2-subject-match” property. This is the substring to be matched against the subject of the "phase 2" authentication server certificate, or NULL no subject verification @@ -2176,7 +2228,7 @@ nm_setting_802_1x_get_num_phase2_altsubject_matches

Returns the number of entries in the “phase2-altsubject-matches” property of this setting.

-

Parameters

+

Parameters

@@ -2191,7 +2243,7 @@ nm_setting_802_1x_get_num_phase2_altsubject_matches
-

Returns

+

Returns

the number of phase2-altsubject-matches entries.

@@ -2205,7 +2257,7 @@ nm_setting_802_1x_get_phase2_altsubject_match

Returns the "phase 2" altSubjectName match at index i .

-

Parameters

+

Parameters

@@ -2227,7 +2279,7 @@ nm_setting_802_1x_get_phase2_altsubject_match
-

Returns

+

Returns

the "phase 2" altSubjectName match at index i

@@ -2243,7 +2295,7 @@ nm_setting_802_1x_add_phase2_altsubject_match at least one match is added, the altSubjectName of the "phase 2" remote authentication server is not verified.

-

Parameters

+

Parameters

@@ -2266,7 +2318,7 @@ connection

-

Returns

+

Returns

TRUE if the "phase 2" alternative subject name match was successfully added, FALSE if it was already allowed.

@@ -2280,7 +2332,7 @@ nm_setting_802_1x_remove_phase2_altsubject_match guint32 i);

Removes the allowed "phase 2" altSubjectName at the specified index.

-

Parameters

+

Parameters

@@ -2312,7 +2364,7 @@ nm_setting_802_1x_remove_phase2_altsubject_match_by_value

Removes the allowed "phase 2" altSubjectName phase2_altsubject_match .

-

Parameters

+

Parameters

@@ -2334,7 +2386,7 @@ nm_setting_802_1x_remove_phase2_altsubject_match_by_value
-

Returns

+

Returns

TRUE if the alternative subject name match for "phase 2" was found and removed, FALSE if it was not.

@@ -2347,7 +2399,7 @@ nm_setting_802_1x_clear_phase2_altsubject_matches (NMSetting8021x *setting);

Clears all "phase 2" altSubjectName matches.

-

Parameters

+

Parameters

@@ -2374,7 +2426,7 @@ returned scheme is NM_SETTING_802_1X_CK_SCHEME_PATH, use nm_setting_802_1x_get_client_cert_path().

-

Parameters

+

Parameters

@@ -2389,7 +2441,7 @@ returned scheme is -

Returns

+

Returns

scheme used to store the "phase 2" client certificate (blob or path)

@@ -2403,7 +2455,7 @@ nm_setting_802_1x_get_phase2_client_cert_blob when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x authentication method.

-

Parameters

+

Parameters

@@ -2418,7 +2470,7 @@ authentication method.

-

Returns

+

Returns

the "phase 2" client certificate data.

[transfer none]

@@ -2433,7 +2485,7 @@ nm_setting_802_1x_get_phase2_client_cert_path when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x authentication method.

-

Parameters

+

Parameters

@@ -2448,7 +2500,7 @@ authentication method.

-

Returns

+

Returns

path to the "phase 2" client certificate file

@@ -2470,7 +2522,7 @@ file if using the
-

Parameters

+

Parameters

@@ -2513,7 +2565,7 @@ clears the "phase2" client certificate.

-

Returns

+

Returns

TRUE if the operation succeeded, FALSE if it was unsuccessful

@@ -2523,7 +2575,7 @@ clears the "phase2" client certificate.

const char *
 nm_setting_802_1x_get_password (NMSetting8021x *setting);
-

Parameters

+

Parameters

@@ -2538,7 +2590,7 @@ nm_setting_802_1x_get_password (
-

Returns

+

Returns

the password used by the authentication method, if any, as specified by the “password” property

@@ -2549,7 +2601,7 @@ by the NMSettingSecretFlags nm_setting_802_1x_get_password_flags (NMSetting8021x *setting);
-

Parameters

+

Parameters

@@ -2564,7 +2616,7 @@ nm_setting_802_1x_get_password_flags ( -

Returns

+

Returns

the NMSettingSecretFlags pertaining to the “password”

@@ -2574,7 +2626,7 @@ nm_setting_802_1x_get_password_flags (GBytes * nm_setting_802_1x_get_password_raw (NMSetting8021x *setting);
-

Parameters

+

Parameters

@@ -2589,7 +2641,7 @@ nm_setting_802_1x_get_password_raw (
-

Returns

+

Returns

the password used by the authentication method as a UTF-8-encoded array of bytes, as specified by the “password-raw” property.

@@ -2603,7 +2655,7 @@ UTF-8-encoded array of bytes, as specified by the nm_setting_802_1x_get_password_raw_flags (NMSetting8021x *setting);
-

Parameters

+

Parameters

@@ -2618,7 +2670,7 @@ nm_setting_802_1x_get_password_raw_flags
-

Returns

+

Returns

the NMSettingSecretFlags pertaining to the “password-raw”

@@ -2629,7 +2681,7 @@ nm_setting_802_1x_get_password_raw_flags
const char *
 nm_setting_802_1x_get_pin (NMSetting8021x *setting);
-

Parameters

+

Parameters

@@ -2644,7 +2696,7 @@ nm_setting_802_1x_get_pin ( -

Returns

+

Returns

the PIN used by the authentication method, if any, as specified by the “pin” property

@@ -2655,7 +2707,7 @@ by the NMSettingSecretFlags nm_setting_802_1x_get_pin_flags (NMSetting8021x *setting);
-

Parameters

+

Parameters

@@ -2670,7 +2722,7 @@ nm_setting_802_1x_get_pin_flags (
-

Returns

+

Returns

the NMSettingSecretFlags pertaining to the “pin”

@@ -2687,7 +2739,7 @@ nm_setting_802_1x_get_private_key_scheme NM_SETTING_802_1X_CK_SCHEME_PATH, use nm_setting_802_1x_get_client_cert_path().

-

Parameters

+

Parameters

@@ -2702,7 +2754,7 @@ nm_setting_802_1x_get_private_key_scheme
-

Returns

+

Returns

scheme used to store the private key (blob or path)

@@ -2719,7 +2771,7 @@ authentication method.

unencrypted private key data may be readable by unprivileged users. Private keys should always be encrypted with a private key password.

-

Parameters

+

Parameters

@@ -2734,7 +2786,7 @@ keys should always be encrypted with a private key password.

-

Returns

+

Returns

the private key data.

[transfer none]

@@ -2749,7 +2801,7 @@ nm_setting_802_1x_get_private_key_path when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x authentication method.

-

Parameters

+

Parameters

@@ -2764,7 +2816,7 @@ authentication method.

-

Returns

+

Returns

path to the private key file

@@ -2802,7 +2854,7 @@ unencrypted private key data using the BLOB scheme may be readable by unprivileged users. Private keys should always be encrypted with a private key password to prevent unauthorized access to unencrypted private key data.

-

Parameters

+

Parameters

@@ -2851,7 +2903,7 @@ an error is returned.

-

Returns

+

Returns

TRUE if the operation succeeded, FALSE if it was unsuccessful

@@ -2862,7 +2914,7 @@ an error is returned.

nm_setting_802_1x_get_private_key_password (NMSetting8021x *setting);
-

Parameters

+

Parameters

@@ -2877,7 +2929,7 @@ nm_setting_802_1x_get_private_key_password
-

Returns

+

Returns

the private key password used to decrypt the private key if previously set with nm_setting_802_1x_set_private_key(), or the “private-key-password” property.

@@ -2890,7 +2942,7 @@ previously set with NMSetting8021x *setting
);
-

Parameters

+

Parameters

@@ -2905,7 +2957,7 @@ nm_setting_802_1x_get_private_key_password_flags
-

Returns

+

Returns

the NMSettingSecretFlags pertaining to the “private-key-password”

@@ -2917,7 +2969,7 @@ nm_setting_802_1x_get_private_key_password_flags nm_setting_802_1x_get_private_key_format (NMSetting8021x *setting);
-

Parameters

+

Parameters

@@ -2932,7 +2984,7 @@ nm_setting_802_1x_get_private_key_format
-

Returns

+

Returns

the data format of the private key data stored in the “private-key” property

@@ -2949,7 +3001,7 @@ scheme is NM_SETTING_802_1X_CK_SCHEME_PATH, use nm_setting_802_1x_get_client_cert_path().

-

Parameters

+

Parameters

@@ -2964,7 +3016,7 @@ scheme is -

Returns

+

Returns

scheme used to store the "phase 2" private key (blob or path)

@@ -2981,7 +3033,7 @@ authentication method.

unencrypted private key data may be readable by unprivileged users. Private keys should always be encrypted with a private key password.

-

Parameters

+

Parameters

@@ -2996,7 +3048,7 @@ keys should always be encrypted with a private key password.

-

Returns

+

Returns

the "phase 2" private key data.

[transfer none]

@@ -3011,7 +3063,7 @@ nm_setting_802_1x_get_phase2_private_key_path when EAP-TLS is used as either the "phase 1" or "phase 2" 802.1x authentication method.

-

Parameters

+

Parameters

@@ -3026,7 +3078,7 @@ authentication method.

-

Returns

+

Returns

path to the "phase 2" private key file

@@ -3065,7 +3117,7 @@ thus unencrypted private key data using the BLOB scheme may be readable by unprivileged users. Private keys should always be encrypted with a private key password to prevent unauthorized access to unencrypted private key data.

-

Parameters

+

Parameters

@@ -3115,7 +3167,7 @@ an error is returned.

-

Returns

+

Returns

TRUE if the operation succeeded, FALSE if it was unsuccessful

@@ -3126,7 +3178,7 @@ an error is returned.

nm_setting_802_1x_get_phase2_private_key_password (NMSetting8021x *setting);
-

Parameters

+

Parameters

@@ -3141,7 +3193,7 @@ nm_setting_802_1x_get_phase2_private_key_password
-

Returns

+

Returns

the private key password used to decrypt the private key if previously set with nm_setting_802_1x_set_phase2_private_key() or the “phase2-private-key-password” property.

@@ -3154,7 +3206,7 @@ previously set with NMSetting8021x *setting
);
-

Parameters

+

Parameters

@@ -3169,7 +3221,7 @@ nm_setting_802_1x_get_phase2_private_key_password_flags
-

Returns

+

Returns

the NMSettingSecretFlags pertaining to the “phase2-private-key-password”

@@ -3181,7 +3233,7 @@ nm_setting_802_1x_get_phase2_private_key_password_flags nm_setting_802_1x_get_phase2_private_key_format (NMSetting8021x *setting);
-

Parameters

+

Parameters

@@ -3196,7 +3248,7 @@ nm_setting_802_1x_get_phase2_private_key_format
-

Returns

+

Returns

the data format of the "phase 2" private key data stored in the “phase2-private-key” property

diff --git a/docs/libnm/html/NMSettingBridge.html b/docs/libnm/html/NMSettingBridge.html index 05bbe151..a5286057 100644 --- a/docs/libnm/html/NMSettingBridge.html +++ b/docs/libnm/html/NMSettingBridge.html @@ -104,6 +104,14 @@ nm_setting_bridge_get_ageing_time () + + +gboolean + + +nm_setting_bridge_get_multicast_snooping () + +
@@ -143,6 +151,11 @@ Read / Write / Construct +gboolean +multicast-snooping +Read / Write / Construct + + guint priority Read / Write / Construct @@ -195,6 +208,10 @@ #define NM_SETTING_BRIDGE_AGEING_TIME + +#define +NM_SETTING_BRIDGE_MULTICAST_SNOOPING + @@ -398,6 +415,33 @@ nm_setting_bridge_get_ageing_time ( the “ageing-time” property of the setting

+
+
+

nm_setting_bridge_get_multicast_snooping ()

+
gboolean
+nm_setting_bridge_get_multicast_snooping
+                               (NMSettingBridge *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingBridge

 
+
+
+

Returns

+

the “multicast-snooping” property of the setting

+
+

Since: 1.2

+

Types and Values

@@ -448,6 +492,12 @@ nm_setting_bridge_get_ageing_time (#define NM_SETTING_BRIDGE_AGEING_TIME "ageing-time"
+
+
+

NM_SETTING_BRIDGE_MULTICAST_SNOOPING

+
#define NM_SETTING_BRIDGE_MULTICAST_SNOOPING "multicast-snooping"
+
+

Property Details

@@ -498,6 +548,18 @@ NetworkManager created) bridge, this MAC address must match.


+

The “multicast-snooping” property

+
  “multicast-snooping”       gboolean
+

Controls whether IGMP snooping is enabled for this bridge. +Note that if snooping was automatically disabled due to hash collisions, +the system may refuse to enable the feature until the collisions are +resolved.

+

Flags: Read / Write / Construct

+

Default value: TRUE

+

Since: 1.2

+
+
+

The “priority” property

  “priority”                 guint

Sets the Spanning Tree Protocol (STP) priority for this bridge. Lower diff --git a/docs/libnm/html/NMSettingConnection.html b/docs/libnm/html/NMSettingConnection.html index f6ab97cc..8c845502 100644 --- a/docs/libnm/html/NMSettingConnection.html +++ b/docs/libnm/html/NMSettingConnection.html @@ -249,6 +249,14 @@ nm_setting_connection_get_metered () + + +NMSettingConnectionLldp + + +nm_setting_connection_get_lldp () + +

@@ -294,6 +302,11 @@ Read / Write +gint +lldp +Read / Write / Construct + + gchar * master @@ -440,10 +453,18 @@ NM_SETTING_CONNECTION_METERED +#define +NM_SETTING_CONNECTION_LLDP + + enum NMSettingConnectionAutoconnectSlaves +enum +NMSettingConnectionLldp + + struct NMSettingConnection @@ -452,8 +473,9 @@

Object Hierarchy

-
    GEnum
-    ╰── NMSettingConnectionAutoconnectSlaves
+
    GEnum
+    ├── NMSettingConnectionAutoconnectSlaves
+    ╰── NMSettingConnectionLldp
     GObject
     ╰── NMSetting
         ╰── NMSettingConnection
@@ -1089,7 +1111,7 @@ nm_setting_connection_get_autoconnect_slaves
 

whether slaves of the connection should be activated together with the connection.

-

Since: 1.0.4

+

Since: 1.2


@@ -1305,7 +1327,35 @@ nm_setting_connection_get_metered (

Returns

the “metered” property of the setting.

-

Since: 1.0.6

+

Since: 1.2

+ +
+
+

nm_setting_connection_get_lldp ()

+
NMSettingConnectionLldp
+nm_setting_connection_get_lldp (NMSettingConnection *setting);
+

Returns the “lldp” property of the connection.

+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingConnection

 
+
+
+

Returns

+

a NMSettingConnectionLldp which indicates whether LLDP must be +enabled for the connection.

+
+

Since: 1.2

@@ -1431,11 +1481,17 @@ nm_setting_connection_get_metered (
+

NM_SETTING_CONNECTION_LLDP

+
#define NM_SETTING_CONNECTION_LLDP           "lldp"
+
+
+
+

enum NMSettingConnectionAutoconnectSlaves

NMSettingConnectionAutoconnectSlaves values indicate whether slave connections should be activated when master is activated.

-

Members

+

Members

@@ -1472,6 +1528,44 @@ should be activated when master is activated.


+

enum NMSettingConnectionLldp

+

NMSettingConnectionLldp values indicate whether LLDP should be enabled.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + +

NM_SETTING_CONNECTION_LLDP_DEFAULT

+

default value

+
 

NM_SETTING_CONNECTION_LLDP_DISABLE

+

disable LLDP

+
 

NM_SETTING_CONNECTION_LLDP_ENABLE_RX

+

enable reception of LLDP frames

+
 
+
+
+
+

struct NMSettingConnection

struct NMSettingConnection;

The NMSettingConnection struct contains only private data. @@ -1514,7 +1608,7 @@ If -1 (default) is set, global connection.autoconnect-slaves is read to determine the real value. If it is default as well, this fallbacks to 0.

Flags: Read / Write / Construct

Default value: NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_DEFAULT

-

Since: 1.0.4

+

Since: 1.2


@@ -1553,6 +1647,15 @@ connection may be applied to the wrong interface.


+

The “lldp” property

+
  “lldp”                     gint
+

Whether LLDP is enabled for the connection.

+

Flags: Read / Write / Construct

+

Default value: -1

+

Since: 1.2

+
+
+

The “master” property

  “master”                   gchar *

Interface name of the master device or UUID of the master connection.

@@ -1564,9 +1667,11 @@ connection may be applied to the wrong interface.

The “metered” property

  “metered”                  NMMetered

Whether the connection is metered.

+

When updating this property on a currently activated connection, +the change takes effect immediately.

Flags: Read / Write

Default value: NM_METERED_UNKNOWN

-

Since: 1.0.6

+

Since: 1.2


diff --git a/docs/libnm/html/NMSettingDcb.html b/docs/libnm/html/NMSettingDcb.html index 9cafb09a..a662d108 100644 --- a/docs/libnm/html/NMSettingDcb.html +++ b/docs/libnm/html/NMSettingDcb.html @@ -402,7 +402,7 @@

Object Hierarchy

-
    GFlags
+
    GFlags
     ╰── NMSettingDcbFlags
     GObject
     ╰── NMSetting
diff --git a/docs/libnm/html/NMSettingGsm.html b/docs/libnm/html/NMSettingGsm.html
index bee69df6..50ac79d3 100644
--- a/docs/libnm/html/NMSettingGsm.html
+++ b/docs/libnm/html/NMSettingGsm.html
@@ -100,6 +100,27 @@
 
 
 
+const char *
+
+
+nm_setting_gsm_get_device_id ()
+
+
+
+const char *
+
+
+nm_setting_gsm_get_sim_id ()
+
+
+
+const char *
+
+
+nm_setting_gsm_get_sim_operator_id ()
+
+
+
 
 NMSettingSecretFlags
 
@@ -134,6 +155,12 @@
 Read / Write
 
 
+
+gchar *
+device-id
+Read / Write
+
+
 gboolean
 home-only
 Read / Write
@@ -175,6 +202,18 @@
 
 
 gchar *
+sim-id
+Read / Write
+
+
+
+gchar *
+sim-operator-id
+Read / Write
+
+
+
+gchar *
 username
 Read / Write
 
@@ -229,6 +268,18 @@
 #define
 NM_SETTING_GSM_HOME_ONLY
 
+
+#define
+NM_SETTING_GSM_DEVICE_ID
+
+
+#define
+NM_SETTING_GSM_SIM_ID
+
+
+#define
+NM_SETTING_GSM_SIM_OPERATOR_ID
+
 
 
@@ -434,11 +485,89 @@ nm_setting_gsm_get_home_only ( +

nm_setting_gsm_get_device_id ()

+
const char *
+nm_setting_gsm_get_device_id (NMSettingGsm *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingGsm

 
+
+
+

Returns

+

the “device-id” property of the setting

+
+

Since: 1.2

+ +
+
+

nm_setting_gsm_get_sim_id ()

+
const char *
+nm_setting_gsm_get_sim_id (NMSettingGsm *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingGsm

 
+
+
+

Returns

+

the “sim-id” property of the setting

+
+

Since: 1.2

+
+
+
+

nm_setting_gsm_get_sim_operator_id ()

+
const char *
+nm_setting_gsm_get_sim_operator_id (NMSettingGsm *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingGsm

 
+
+
+

Returns

+

the “sim-operator-id” property of the setting

+
+

Since: 1.2

+
+
+

nm_setting_gsm_get_pin_flags ()

NMSettingSecretFlags
 nm_setting_gsm_get_pin_flags (NMSettingGsm *setting);
-

Parameters

+

Parameters

@@ -453,7 +582,7 @@ nm_setting_gsm_get_pin_flags ( -

Returns

+

Returns

the NMSettingSecretFlags pertaining to the “pin”

@@ -463,7 +592,7 @@ nm_setting_gsm_get_pin_flags (NMSettingSecretFlags nm_setting_gsm_get_password_flags (NMSettingGsm *setting);
-

Parameters

+

Parameters

@@ -478,7 +607,7 @@ nm_setting_gsm_get_password_flags (
-

Returns

+

Returns

the NMSettingSecretFlags pertaining to the “password”

@@ -493,55 +622,73 @@ nm_setting_gsm_get_password_flags (

NM_SETTING_GSM_NUMBER

-
#define NM_SETTING_GSM_NUMBER         "number"
+
#define NM_SETTING_GSM_NUMBER          "number"
 

NM_SETTING_GSM_USERNAME

-
#define NM_SETTING_GSM_USERNAME       "username"
+
#define NM_SETTING_GSM_USERNAME        "username"
 

NM_SETTING_GSM_PASSWORD

-
#define NM_SETTING_GSM_PASSWORD       "password"
+
#define NM_SETTING_GSM_PASSWORD        "password"
 

NM_SETTING_GSM_PASSWORD_FLAGS

-
#define NM_SETTING_GSM_PASSWORD_FLAGS "password-flags"
+
#define NM_SETTING_GSM_PASSWORD_FLAGS  "password-flags"
 

NM_SETTING_GSM_APN

-
#define NM_SETTING_GSM_APN            "apn"
+
#define NM_SETTING_GSM_APN             "apn"
 

NM_SETTING_GSM_NETWORK_ID

-
#define NM_SETTING_GSM_NETWORK_ID     "network-id"
+
#define NM_SETTING_GSM_NETWORK_ID      "network-id"
 

NM_SETTING_GSM_PIN

-
#define NM_SETTING_GSM_PIN            "pin"
+
#define NM_SETTING_GSM_PIN             "pin"
 

NM_SETTING_GSM_PIN_FLAGS

-
#define NM_SETTING_GSM_PIN_FLAGS      "pin-flags"
+
#define NM_SETTING_GSM_PIN_FLAGS       "pin-flags"
 

NM_SETTING_GSM_HOME_ONLY

-
#define NM_SETTING_GSM_HOME_ONLY      "home-only"
+
#define NM_SETTING_GSM_HOME_ONLY       "home-only"
+
+
+
+
+

NM_SETTING_GSM_DEVICE_ID

+
#define NM_SETTING_GSM_DEVICE_ID       "device-id"
+
+
+
+
+

NM_SETTING_GSM_SIM_ID

+
#define NM_SETTING_GSM_SIM_ID          "sim-id"
+
+
+
+
+

NM_SETTING_GSM_SIM_OPERATOR_ID

+
#define NM_SETTING_GSM_SIM_OPERATOR_ID "sim-operator-id"
 
@@ -562,6 +709,17 @@ The APN may only be composed of the characters a-z, 0-9, ., and - per GSM
+

The “device-id” property

+
  “device-id”                gchar *
+

The device unique identifier (as given by the WWAN management service) +which this connection applies to. If given, the connection will only +apply to the specified device.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 1.2

+
+
+

The “home-only” property

  “home-only”                gboolean

When TRUE, only connections to the home network will be allowed. @@ -628,6 +786,31 @@ device.


+

The “sim-id” property

+
  “sim-id”                   gchar *
+

The SIM card unique identifier (as given by the WWAN management service) +which this connection applies to. If given, the connection will apply +to any device also allowed by “device-id” which contains a +SIM card matching the given identifier.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 1.2

+
+
+
+

The “sim-operator-id” property

+
  “sim-operator-id”          gchar *
+

A MCC/MNC string like "310260" or "21601" identifying the specific +mobile network operator which this connection applies to. If given, +the connection will apply to any device also allowed by +“device-id” and “sim-id” which contains a SIM +card provisioined by the given operator.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 1.2

+
+
+

The “username” property

  “username”                 gchar *

The username used to authenticate with the network, if required. Many diff --git a/docs/libnm/html/NMSettingIP4Config.html b/docs/libnm/html/NMSettingIP4Config.html index 9a40fd47..dd9b7c2d 100644 --- a/docs/libnm/html/NMSettingIP4Config.html +++ b/docs/libnm/html/NMSettingIP4Config.html @@ -6,7 +6,7 @@ - + @@ -21,7 +21,7 @@

- +
Home UpPrevPrev Next
@@ -56,6 +56,21 @@ nm_setting_ip4_config_get_dhcp_client_id () + + +int + + +nm_setting_ip4_config_get_dhcp_timeout () + + + +const char * + + +nm_setting_ip4_config_get_dhcp_fqdn () + +
@@ -67,12 +82,25 @@ - + + gchar * dhcp-client-id Read / Write - + + + +gchar * +dhcp-fqdn +Read / Write + + +guint +dhcp-timeout +Read / Write + +
@@ -93,6 +121,14 @@ #define +NM_SETTING_IP4_CONFIG_DHCP_TIMEOUT + + +#define +NM_SETTING_IP4_CONFIG_DHCP_FQDN + + +#define NM_SETTING_IP4_CONFIG_METHOD_AUTO @@ -149,7 +185,7 @@ connection.

nm_setting_ip4_config_new (void);

Creates a new NMSettingIP4Config object with default values.

-

Returns

+

Returns

the new empty NMSettingIP4Config object.

[transfer full]

@@ -163,7 +199,7 @@ nm_setting_ip4_config_get_dhcp_client_id

Returns the value contained in the “dhcp-client-id” property.

-

Parameters

+

Parameters

@@ -178,11 +214,69 @@ property.

-

Returns

+

Returns

the configured Client ID to send to the DHCP server when requesting addresses via DHCP.

+
+
+

nm_setting_ip4_config_get_dhcp_timeout ()

+
int
+nm_setting_ip4_config_get_dhcp_timeout
+                               (NMSettingIP4Config *setting);
+

Returns the value contained in the “dhcp-timeout” +property.

+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingIP4Config

 
+
+
+

Returns

+

the configured DHCP timeout in seconds. 0 = default for +the particular kind of device.

+
+

Since: 1.2

+
+
+
+

nm_setting_ip4_config_get_dhcp_fqdn ()

+
const char *
+nm_setting_ip4_config_get_dhcp_fqdn (NMSettingIP4Config *setting);
+

Returns the value contained in the “dhcp-fqdn” +property.

+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingIP4Config

 
+
+
+

Returns

+

the configured FQDN to send to the DHCP server

+
+

Since: 1.2

+

Types and Values

@@ -199,6 +293,18 @@ addresses via DHCP.


+

NM_SETTING_IP4_CONFIG_DHCP_TIMEOUT

+
#define NM_SETTING_IP4_CONFIG_DHCP_TIMEOUT       "dhcp-timeout"
+
+
+
+
+

NM_SETTING_IP4_CONFIG_DHCP_FQDN

+
#define NM_SETTING_IP4_CONFIG_DHCP_FQDN          "dhcp-fqdn"
+
+
+
+

NM_SETTING_IP4_CONFIG_METHOD_AUTO

#define NM_SETTING_IP4_CONFIG_METHOD_AUTO       "auto"
 
@@ -252,6 +358,26 @@ DHCP server may use to customize the DHCP lease and options.

Flags: Read / Write

Default value: NULL

+
+
+

The “dhcp-fqdn” property

+
  “dhcp-fqdn”                gchar *
+

If the “dhcp-send-hostname” property is TRUE, then the +specified FQDN will be sent to the DHCP server when acquiring a lease. This +property and “dhcp-hostname” are mutually exclusive and +cannot be set at the same time.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 1.2

+
+
+
+

The “dhcp-timeout” property

+
  “dhcp-timeout”             guint
+

A timeout for a DHCP transaction in seconds.

+

Flags: Read / Write

+

Default value: 0

+
@@ -68,11 +76,18 @@ - + + +gint +addr-gen-mode +Read / Write / Construct + + NMSettingIP6ConfigPrivacy ip6-privacy Read / Write / Construct - + +
@@ -93,6 +108,10 @@ #define +NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE + + +#define NM_SETTING_IP6_CONFIG_METHOD_IGNORE @@ -119,12 +138,17 @@ enum NMSettingIP6ConfigPrivacy + +enum +NMSettingIP6ConfigAddrGenMode +

Object Hierarchy

-
    GEnum
+
    GEnum
+    ├── NMSettingIP6ConfigAddrGenMode
     ╰── NMSettingIP6ConfigPrivacy
     GObject
     ╰── NMSetting
@@ -157,7 +181,7 @@ supported.

nm_setting_ip6_config_new (void);

Creates a new NMSettingIP6Config object with default values.

-

Returns

+

Returns

the new empty NMSettingIP6Config object.

[transfer full]

@@ -170,7 +194,7 @@ nm_setting_ip6_config_get_ip6_privacy (“ip6-privacy” property.

-

Parameters

+

Parameters

@@ -185,10 +209,39 @@ property.

-

Returns

+

Returns

IPv6 Privacy Extensions configuration value (NMSettingIP6ConfigPrivacy).

+
+
+

nm_setting_ip6_config_get_addr_gen_mode ()

+
NMSettingIP6ConfigAddrGenMode
+nm_setting_ip6_config_get_addr_gen_mode
+                               (NMSettingIP6Config *setting);
+

Returns the value contained in the “addr-gen-mode” +property.

+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingIP6Config

 
+
+
+

Returns

+

IPv6 Address Generation Mode.

+
+

Since: 1.2

+

Types and Values

@@ -205,6 +258,12 @@ property.


+

NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE

+
#define NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE "addr-gen-mode"
+
+
+
+

NM_SETTING_IP6_CONFIG_METHOD_IGNORE

#define NM_SETTING_IP6_CONFIG_METHOD_IGNORE     "ignore"
 
@@ -263,7 +322,7 @@ supported for IPv6)

NMSettingIP6ConfigPrivacy values indicate if and how IPv6 Privacy Extensions are used (RFC4941).

-

Members

+

Members

@@ -305,10 +364,74 @@ are enabled and temporary addresses are preferred over public addresses

+
+
+

enum NMSettingIP6ConfigAddrGenMode

+

NMSettingIP6ConfigAddrGenMode controls how the the Interface Identifier for +RFC4862 Stateless Address Autoconfiguration is created.

+
+

Members

+
+++++ + + + + + + + + + + + + +

NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_EUI64

+

The Interface Identifier is derived +from the interface hardware address.

+
 

NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_STABLE_PRIVACY

+

The Interface Identifier +is created by using a cryptographically secure hash of a secret host-specific +key along with the connection identification and the network address as +specified by RFC7217.

+
 
+
+

Since: 1.2

+

Property Details

+

The “addr-gen-mode” property

+
  “addr-gen-mode”            gint
+

Configure method for creating the address for use with RFC4862 IPv6 +Stateless Address Autoconfiguration. The permitted values are: "eui64", +"stable-privacy" or unset.

+

If the property is set to "eui64", the addresses will be generated +using the interface tokens derived from hardware address. This makes +the host part of the address to stay constant, making it possible +to track host's presence when it changes networks. The address changes +when the interface hardware is replaced.

+

The value of "stable-privacy" enables use of cryptographically +secure hash of a secret host-specific key along with the connection +identification and the network address as specified by RFC7217. +This makes it impossible to use the address track host's presence, +and makes the address stable when the network interface hardware is +replaced.

+

Leaving this unset causes a default that could be subject to change +in future versions to be used.

+

Note that this setting is distinct from the Privacy Extensions as +configured by "ip6-privacy" property and it does not affect the +temporary addresses configured with this option.

+

Flags: Read / Write / Construct

+

Default value: 1

+

Since: 1.2

+
+
+

The “ip6-privacy” property

  “ip6-privacy”              NMSettingIP6ConfigPrivacy

Configure IPv6 Privacy Extensions for SLAAC, described in RFC4941. If @@ -322,6 +445,9 @@ addresses).

global configuration "ipv6.ip6-privacy".

If also global configuration is unspecified or set to "-1", fallback to read "/proc/sys/net/ipv6/conf/default/use_tempaddr".

+

Note that this setting is distinct from the Stable Privacy addresses +that can be enabled with the "addr-gen-mode" property's "stable-privacy" +setting as another way of avoiding host tracking with IPv6 addresses.

Flags: Read / Write / Construct

Default value: NM_SETTING_IP6_CONFIG_PRIVACY_UNKNOWN

diff --git a/docs/libnm/html/NMSettingIPConfig.html b/docs/libnm/html/NMSettingIPConfig.html index 35289f40..228ff69f 100644 --- a/docs/libnm/html/NMSettingIPConfig.html +++ b/docs/libnm/html/NMSettingIPConfig.html @@ -6,8 +6,8 @@ - - + + @@ -21,8 +21,8 @@ Home Up -Prev -Next +Prev +Next
@@ -449,6 +449,69 @@ guint +nm_setting_ip_config_get_num_dns_options () + + + + +gboolean + + +nm_setting_ip_config_has_dns_options () + + + +const char * + + +nm_setting_ip_config_get_dns_option () + + + + +gint + + +nm_setting_ip_config_next_valid_dns_option () + + + + +gboolean + + +nm_setting_ip_config_add_dns_option () + + + + +void + + +nm_setting_ip_config_remove_dns_option () + + + + +gboolean + + +nm_setting_ip_config_remove_dns_option_by_value () + + + + +void + + +nm_setting_ip_config_clear_dns_options () + + + + +guint + + nm_setting_ip_config_get_num_addresses () @@ -638,6 +701,11 @@ GStrv +dns-options +Read / Write + + +GStrv dns-search Read / Write @@ -709,6 +777,10 @@ #define +NM_SETTING_IP_CONFIG_DNS_OPTIONS + + +#define NM_SETTING_IP_CONFIG_ADDRESSES @@ -747,12 +819,68 @@ #define NM_SETTING_IP_CONFIG_MAY_FAIL + +#define +NM_SETTING_DNS_OPTION_DEBUG + + +#define +NM_SETTING_DNS_OPTION_NDOTS + + +#define +NM_SETTING_DNS_OPTION_TIMEOUT + + +#define +NM_SETTING_DNS_OPTION_ATTEMPTS + + +#define +NM_SETTING_DNS_OPTION_ROTATE + + +#define +NM_SETTING_DNS_OPTION_NO_CHECK_NAMES + + +#define +NM_SETTING_DNS_OPTION_INET6 + + +#define +NM_SETTING_DNS_OPTION_IP6_BYTESTRING + + +#define +NM_SETTING_DNS_OPTION_IP6_DOTINT + + +#define +NM_SETTING_DNS_OPTION_NO_IP6_DOTINT + + +#define +NM_SETTING_DNS_OPTION_EDNS0 + + +#define +NM_SETTING_DNS_OPTION_SINGLE_REQUEST + + +#define +NM_SETTING_DNS_OPTION_SINGLE_REQUEST_REOPEN + + +#define +NM_SETTING_DNS_OPTION_NO_TLD_QUERY +

Object Hierarchy

-
    GBoxed
+
    GBoxed
     ├── NMIPAddress
     ╰── NMIPRoute
     GObject
@@ -784,7 +912,7 @@ nm_ip_address_new (int fam
                    GError **error);

Creates a new NMIPAddress object.

-

Parameters

+

Parameters

@@ -817,7 +945,7 @@ nm_ip_address_new (int fam
-

Returns

+

Returns

the new NMIPAddress object, or NULL on error.

[transfer full]

@@ -835,7 +963,7 @@ nm_ip_address_new_binary (intfamily .

-

Parameters

+

Parameters

@@ -868,7 +996,7 @@ correct size for family
-

Returns

+

Returns

the new NMIPAddress object, or NULL on error.

[transfer full]

@@ -880,7 +1008,7 @@ correct size for family nm_ip_address_ref (NMIPAddress *address);

Increases the reference count of the object.

-

Parameters

+

Parameters

@@ -903,7 +1031,7 @@ nm_ip_address_unref ( -

Parameters

+

Parameters

@@ -927,7 +1055,7 @@ nm_ip_address_equal (NMIPAddress objects contain the same address and prefix (attributes are not compared).

-

Parameters

+

Parameters

@@ -950,7 +1078,7 @@ to.

-

Returns

+

Returns

TRUE if the objects contain the same values, FALSE if they do not.

@@ -962,7 +1090,7 @@ nm_ip_address_dup (address

-

Parameters

+

Parameters

@@ -977,7 +1105,7 @@ nm_ip_address_dup ( -

Returns

+

Returns

a copy of address .

[transfer full]

@@ -991,7 +1119,7 @@ nm_ip_address_get_family ( -

Parameters

+

Parameters

@@ -1006,7 +1134,7 @@ object.

-

Returns

+

Returns

the IP address family

@@ -1017,7 +1145,7 @@ object.

nm_ip_address_get_address (NMIPAddress *address);

Gets the IP address property of this address object.

-

Parameters

+

Parameters

@@ -1032,7 +1160,7 @@ nm_ip_address_get_address ( -

Returns

+

Returns

the IP address

@@ -1048,7 +1176,7 @@ nm_ip_address_set_address (nm_utils_ipaddr_valid() to check it.

-

Parameters

+

Parameters

@@ -1082,7 +1210,7 @@ nm_ip_address_get_address_binary (

[skip]

-

Parameters

+

Parameters

@@ -1116,7 +1244,7 @@ nm_ip_address_set_address_binary (

[skip]

-

Parameters

+

Parameters

@@ -1146,7 +1274,7 @@ nm_ip_address_get_prefix (
-

Parameters

+

Parameters

@@ -1161,7 +1289,7 @@ object.

-

Returns

+

Returns

the IP address prefix

@@ -1173,7 +1301,7 @@ nm_ip_address_set_prefix (guint prefix);

Sets the IP address prefix property of this address object.

-

Parameters

+

Parameters

@@ -1203,7 +1331,7 @@ nm_ip_address_get_attribute_names (Gets an array of attribute names defined on address .

-

Parameters

+

Parameters

@@ -1218,7 +1346,7 @@ nm_ip_address_get_attribute_names (
-

Returns

+

Returns

a NULL-terminated array of attribute names,.

[transfer full]

@@ -1233,7 +1361,7 @@ nm_ip_address_get_attribute (address

-

Parameters

+

Parameters

@@ -1255,7 +1383,7 @@ nm_ip_address_get_attribute ( -

Returns

+

Returns

the value of the attribute with name name on address @@ -1274,7 +1402,7 @@ nm_ip_address_set_attribute (address to the given value.

-

Parameters

+

Parameters

@@ -1313,7 +1441,7 @@ nm_ip_route_new (int famil GError **error);

Creates a new NMIPRoute object.

-

Parameters

+

Parameters

@@ -1356,7 +1484,7 @@ nm_ip_route_new (int famil
-

Returns

+

Returns

the new NMIPRoute object, or NULL on error.

[transfer full]

@@ -1377,7 +1505,7 @@ nm_ip_route_new_binary (intfamily .

-

Parameters

+

Parameters

@@ -1420,7 +1548,7 @@ point to buffers of the correct size for family
-

Returns

+

Returns

the new NMIPRoute object, or NULL on error.

[transfer full]

@@ -1432,7 +1560,7 @@ point to buffers of the correct size for familyNMIPRoute *route);

Increases the reference count of the object.

-

Parameters

+

Parameters

@@ -1455,7 +1583,7 @@ nm_ip_route_unref ( -

Parameters

+

Parameters

@@ -1479,7 +1607,7 @@ nm_ip_route_equal (NMIPRoute objects contain the same destination, prefix, next hop, and metric. (Attributes are not compared.)

-

Parameters

+

Parameters

@@ -1502,7 +1630,7 @@ to.

-

Returns

+

Returns

TRUE if the objects contain the same values, FALSE if they do not.

@@ -1514,7 +1642,7 @@ nm_ip_route_dup (route

-

Parameters

+

Parameters

@@ -1529,7 +1657,7 @@ nm_ip_route_dup ( -

Returns

+

Returns

a copy of route .

[transfer full]

@@ -1543,7 +1671,7 @@ nm_ip_route_get_family ( -

Parameters

+

Parameters

@@ -1558,7 +1686,7 @@ object.

-

Returns

+

Returns

the IP address family

@@ -1569,7 +1697,7 @@ object.

nm_ip_route_get_dest (NMIPRoute *route);

Gets the IP destination address property of this route object.

-

Parameters

+

Parameters

@@ -1584,7 +1712,7 @@ nm_ip_route_get_dest ( -

Returns

+

Returns

the IP address of the route's destination

@@ -1600,7 +1728,7 @@ nm_ip_route_set_dest (nm_utils_ipaddr_valid() to check it.

-

Parameters

+

Parameters

@@ -1634,7 +1762,7 @@ nm_ip_route_get_dest_binary ([skip]

-

Parameters

+

Parameters

@@ -1668,7 +1796,7 @@ nm_ip_route_set_dest_binary ([skip]

-

Parameters

+

Parameters

@@ -1697,7 +1825,7 @@ nm_ip_route_set_dest_binary (NMIPRoute *route);

Gets the IP prefix (ie "24" or "30" etc) of this route.

-

Parameters

+

Parameters

@@ -1712,7 +1840,7 @@ nm_ip_route_get_prefix ( -

Returns

+

Returns

the IP prefix

@@ -1724,7 +1852,7 @@ nm_ip_route_set_prefix (guint prefix);

Sets the prefix property of this route object.

-

Parameters

+

Parameters

@@ -1754,7 +1882,7 @@ nm_ip_route_get_next_hop (NULL if the route has no next hop.

-

Parameters

+

Parameters

@@ -1769,7 +1897,7 @@ route has no next hop.

-

Returns

+

Returns

the IP address of the next hop, or NULL if this is a device route.

@@ -1786,7 +1914,7 @@ nm_ip_route_set_next_hop (nm_utils_ipaddr_valid() to check it.

-

Parameters

+

Parameters

@@ -1820,7 +1948,7 @@ nm_ip_route_get_next_hop_binary (

[skip]

-

Parameters

+

Parameters

@@ -1842,7 +1970,7 @@ nm_ip_route_get_next_hop_binary (
-

Returns

+

Returns

TRUE if route has a next hop, FALSE if not (in which case next_hop @@ -1862,7 +1990,7 @@ nm_ip_route_set_next_hop_binary (

[skip]

-

Parameters

+

Parameters

@@ -1893,7 +2021,7 @@ nm_ip_route_get_metric (
-

Parameters

+

Parameters

@@ -1908,7 +2036,7 @@ indicate "better" or more preferred routes; -1 indicates "default"
-

Returns

+

Returns

the route metric

@@ -1920,7 +2048,7 @@ nm_ip_route_set_metric (gint64 metric);

Sets the metric property of this route object.

-

Parameters

+

Parameters

@@ -1950,7 +2078,7 @@ nm_ip_route_get_attribute_names (Gets an array of attribute names defined on route .

-

Parameters

+

Parameters

@@ -1965,7 +2093,7 @@ nm_ip_route_get_attribute_names (
-

Returns

+

Returns

a NULL-terminated array of attribute names.

[transfer full]

@@ -1980,7 +2108,7 @@ nm_ip_route_get_attribute (route

-

Parameters

+

Parameters

@@ -2002,7 +2130,7 @@ nm_ip_route_get_attribute ( -

Returns

+

Returns

the value of the attribute with name name on route @@ -2021,7 +2149,7 @@ nm_ip_route_set_attribute (route to the given value.

-

Parameters

+

Parameters

@@ -2054,7 +2182,7 @@ nm_ip_route_set_attribute (const char * nm_setting_ip_config_get_method (NMSettingIPConfig *setting);
-

Parameters

+

Parameters

@@ -2069,7 +2197,7 @@ nm_setting_ip_config_get_method (
-

Returns

+

Returns

the “method” property of the setting; see NMSettingIP4Config and NMSettingIP6Config for details of the methods available with each type.

@@ -2081,7 +2209,7 @@ methods available with each type.

guint
 nm_setting_ip_config_get_num_dns (NMSettingIPConfig *setting);
-

Parameters

+

Parameters

@@ -2096,7 +2224,7 @@ nm_setting_ip_config_get_num_dns (
-

Returns

+

Returns

the number of configured DNS servers

@@ -2105,9 +2233,9 @@ nm_setting_ip_config_get_num_dns (

nm_setting_ip_config_get_dns ()

const char *
 nm_setting_ip_config_get_dns (NMSettingIPConfig *setting,
-                              int i);
+ int idx);
-

Parameters

+

Parameters

@@ -2121,7 +2249,7 @@ nm_setting_ip_config_get_dns (  - + @@ -2129,8 +2257,8 @@ nm_setting_ip_config_get_dns ( -

Returns

-

the IP address of the DNS server at index i +

Returns

+

the IP address of the DNS server at index idx

@@ -2142,7 +2270,7 @@ nm_setting_ip_config_add_dns (const char *dns);

Adds a new DNS server to the setting.

-

Parameters

+

Parameters

i

idx

index number of the DNS server to return

 
@@ -2164,7 +2292,7 @@ nm_setting_ip_config_add_dns ( -

Returns

+

Returns

TRUE if the DNS server was added; FALSE if the server was already known

@@ -2174,11 +2302,11 @@ known

nm_setting_ip_config_remove_dns ()

void
 nm_setting_ip_config_remove_dns (NMSettingIPConfig *setting,
-                                 int i);
-

Removes the DNS server at index i + int idx); +

Removes the DNS server at index idx .

-

Parameters

+

Parameters

@@ -2192,7 +2320,7 @@ nm_setting_ip_config_remove_dns (  - + @@ -2210,7 +2338,7 @@ nm_setting_ip_config_remove_dns_by_value

Removes the DNS server dns .

-

Parameters

+

Parameters

i

idx

index number of the DNS server to remove

 
@@ -2232,7 +2360,7 @@ nm_setting_ip_config_remove_dns_by_value
-

Returns

+

Returns

TRUE if the DNS server was found and removed; FALSE if it was not.

@@ -2243,7 +2371,7 @@ nm_setting_ip_config_remove_dns_by_value nm_setting_ip_config_clear_dns (NMSettingIPConfig *setting);

Removes all configured DNS servers.

-

Parameters

+

Parameters

@@ -2265,7 +2393,7 @@ nm_setting_ip_config_clear_dns (NMSettingIPConfig *setting);
-

Parameters

+

Parameters

@@ -2280,7 +2408,7 @@ nm_setting_ip_config_get_num_dns_searches
-

Returns

+

Returns

the number of configured DNS search domains

@@ -2289,9 +2417,9 @@ nm_setting_ip_config_get_num_dns_searches

nm_setting_ip_config_get_dns_search ()

const char *
 nm_setting_ip_config_get_dns_search (NMSettingIPConfig *setting,
-                                     int i);
+ int idx);
-

Parameters

+

Parameters

@@ -2305,7 +2433,7 @@ nm_setting_ip_config_get_dns_search (  - + @@ -2313,8 +2441,8 @@ nm_setting_ip_config_get_dns_search (
-

Returns

-

the DNS search domain at index i +

Returns

+

the DNS search domain at index idx

@@ -2326,7 +2454,7 @@ nm_setting_ip_config_add_dns_search (const char *dns_search);

Adds a new DNS search domain to the setting.

-

Parameters

+

Parameters

i

idx

index number of the DNS search domain to return

 
@@ -2348,7 +2476,7 @@ nm_setting_ip_config_add_dns_search (
-

Returns

+

Returns

TRUE if the DNS search domain was added; FALSE if the search domain was already known

@@ -2359,11 +2487,11 @@ domain was already known

void
 nm_setting_ip_config_remove_dns_search
                                (NMSettingIPConfig *setting,
-                                int i);
-

Removes the DNS search domain at index i + int idx); +

Removes the DNS search domain at index idx .

-

Parameters

+

Parameters

@@ -2377,7 +2505,7 @@ nm_setting_ip_config_remove_dns_search - + @@ -2395,7 +2523,7 @@ nm_setting_ip_config_remove_dns_search_by_value

Removes the DNS search domain dns_search .

-

Parameters

+

Parameters

 

i

idx

index number of the DNS search domain

 
@@ -2417,7 +2545,7 @@ nm_setting_ip_config_remove_dns_search_by_value
-

Returns

+

Returns

TRUE if the DNS search domain was found and removed; FALSE if it was not.

Since 0.9.10

@@ -2430,7 +2558,60 @@ nm_setting_ip_config_clear_dns_searches (NMSettingIPConfig *setting);

Removes all configured DNS search domains.

-

Parameters

+

Parameters

+
+++++ + + + + + +

setting

the NMSettingIPConfig

 
+
+ +
+
+

nm_setting_ip_config_get_num_dns_options ()

+
guint
+nm_setting_ip_config_get_num_dns_options
+                               (NMSettingIPConfig *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingIPConfig

 
+
+
+

Returns

+

the number of configured DNS options

+
+

Since: 1.2

+
+
+
+

nm_setting_ip_config_has_dns_options ()

+
gboolean
+nm_setting_ip_config_has_dns_options (NMSettingIPConfig *setting);
+

NMSettingIPConfig can have a list of dns-options. If the list +is empty, there are two similar (but differentiated) states. +Either the options are explicitly set to have no values, +or the options are left undefined. The latter means to use +a default configuration, while the former explicitly means "no-options".

+
+

Parameters

@@ -2444,6 +2625,220 @@ nm_setting_ip_config_clear_dns_searches
+
+

Returns

+

whether DNS options are initalized or left unset (the default).

+
+
+
+
+

nm_setting_ip_config_get_dns_option ()

+
const char *
+nm_setting_ip_config_get_dns_option (NMSettingIPConfig *setting,
+                                     guint idx);
+
+

Parameters

+
+++++ + + + + + + + + + + + + +

setting

the NMSettingIPConfig

 

idx

index number of the DNS option

 
+
+
+

Returns

+

the DNS option at index idx +

+
+

Since: 1.2

+
+
+
+

nm_setting_ip_config_next_valid_dns_option ()

+
gint
+nm_setting_ip_config_next_valid_dns_option
+                               (NMSettingIPConfig *setting,
+                                guint idx);
+
+

Parameters

+
+++++ + + + + + + + + + + + + +

setting

the NMSettingIPConfig

 

idx

index to start the search from

 
+
+
+

Returns

+

the index, greater or equal than idx +, of the first valid +DNS option, or -1 if no valid option is found

+
+

Since: 1.2

+
+
+
+

nm_setting_ip_config_add_dns_option ()

+
gboolean
+nm_setting_ip_config_add_dns_option (NMSettingIPConfig *setting,
+                                     const char *dns_option);
+

Adds a new DNS option to the setting.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

setting

the NMSettingIPConfig

 

dns_option

the DNS option to add

 
+
+
+

Returns

+

TRUE if the DNS option was added; FALSE otherwise

+
+

Since: 1.2

+
+
+
+

nm_setting_ip_config_remove_dns_option ()

+
void
+nm_setting_ip_config_remove_dns_option
+                               (NMSettingIPConfig *setting,
+                                int idx);
+

Removes the DNS option at index idx +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

setting

the NMSettingIPConfig

 

idx

index number of the DNS option

 
+
+

Since: 1.2

+
+
+
+

nm_setting_ip_config_remove_dns_option_by_value ()

+
gboolean
+nm_setting_ip_config_remove_dns_option_by_value
+                               (NMSettingIPConfig *setting,
+                                const char *dns_option);
+

Removes the DNS option dns_option +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

setting

the NMSettingIPConfig

 

dns_option

the DNS option to remove

 
+
+
+

Returns

+

TRUE if the DNS option was found and removed; FALSE if it was not.

+
+

Since: 1.2

+
+
+
+

nm_setting_ip_config_clear_dns_options ()

+
void
+nm_setting_ip_config_clear_dns_options
+                               (NMSettingIPConfig *setting,
+                                gboolean is_set);
+

Removes all configured DNS options.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

setting

the NMSettingIPConfig

 

is_set

the dns-options can be either empty or unset (default). +Specify how to clear the options.

 
+
+

Since: 1.2


@@ -2452,7 +2847,7 @@ nm_setting_ip_config_clear_dns_searches nm_setting_ip_config_get_num_addresses (NMSettingIPConfig *setting);
-

Parameters

+

Parameters

@@ -2467,7 +2862,7 @@ nm_setting_ip_config_get_num_addresses
-

Returns

+

Returns

the number of configured addresses

@@ -2476,9 +2871,9 @@ nm_setting_ip_config_get_num_addresses

nm_setting_ip_config_get_address ()

NMIPAddress *
 nm_setting_ip_config_get_address (NMSettingIPConfig *setting,
-                                  int i);
+ int idx);
-

Parameters

+

Parameters

@@ -2492,7 +2887,7 @@ nm_setting_ip_config_get_address (  - + @@ -2500,8 +2895,8 @@ nm_setting_ip_config_get_address (
-

Returns

-

the address at index i +

Returns

+

the address at index idx .

[transfer none]

@@ -2515,7 +2910,7 @@ nm_setting_ip_config_add_address (Adds a new IP address and associated information to the setting. The given address is duplicated internally and is not changed by this function.

-

Parameters

+

Parameters

i

idx

index number of the address to return

 
@@ -2537,7 +2932,7 @@ given address is duplicated internally and is not changed by this function.

-

Returns

+

Returns

TRUE if the address was added; FALSE if the address was already known.

@@ -2547,11 +2942,11 @@ known.

nm_setting_ip_config_remove_address ()

void
 nm_setting_ip_config_remove_address (NMSettingIPConfig *setting,
-                                     int i);
-

Removes the address at index i + int idx); +

Removes the address at index idx .

-

Parameters

+

Parameters

@@ -2565,7 +2960,7 @@ nm_setting_ip_config_remove_address (  - + @@ -2583,7 +2978,7 @@ nm_setting_ip_config_remove_address_by_value

Removes the address address .

-

Parameters

+

Parameters

i

idx

index number of the address to remove

 
@@ -2605,7 +3000,7 @@ nm_setting_ip_config_remove_address_by_value
-

Returns

+

Returns

TRUE if the address was found and removed; FALSE if it was not.

@@ -2616,7 +3011,7 @@ nm_setting_ip_config_remove_address_by_value nm_setting_ip_config_clear_addresses (NMSettingIPConfig *setting);

Removes all configured addresses.

-

Parameters

+

Parameters

@@ -2637,7 +3032,7 @@ nm_setting_ip_config_clear_addresses (const char * nm_setting_ip_config_get_gateway (NMSettingIPConfig *setting);
-

Parameters

+

Parameters

@@ -2652,7 +3047,7 @@ nm_setting_ip_config_get_gateway (
-

Returns

+

Returns

the IP address of the gateway associated with this configuration, or NULL.

@@ -2663,7 +3058,7 @@ nm_setting_ip_config_get_gateway (guint nm_setting_ip_config_get_num_routes (NMSettingIPConfig *setting);
-

Parameters

+

Parameters

@@ -2678,7 +3073,7 @@ nm_setting_ip_config_get_num_routes (
-

Returns

+

Returns

the number of configured routes

@@ -2687,9 +3082,9 @@ nm_setting_ip_config_get_num_routes (

nm_setting_ip_config_get_route ()

NMIPRoute *
 nm_setting_ip_config_get_route (NMSettingIPConfig *setting,
-                                int i);
+ int idx);
-

Parameters

+

Parameters

@@ -2703,7 +3098,7 @@ nm_setting_ip_config_get_route (  - + @@ -2711,8 +3106,8 @@ nm_setting_ip_config_get_route (
-

Returns

-

the route at index i +

Returns

+

the route at index idx .

[transfer none]

@@ -2726,7 +3121,7 @@ nm_setting_ip_config_add_route (Adds a new route and associated information to the setting. The given route is duplicated internally and is not changed by this function.

-

Parameters

+

Parameters

i

idx

index number of the route to return

 
@@ -2748,7 +3143,7 @@ given route is duplicated internally and is not changed by this function.

-

Returns

+

Returns

TRUE if the route was added; FALSE if the route was already known.

@@ -2757,11 +3152,11 @@ given route is duplicated internally and is not changed by this function.

nm_setting_ip_config_remove_route ()

void
 nm_setting_ip_config_remove_route (NMSettingIPConfig *setting,
-                                   int i);
-

Removes the route at index i + int idx); +

Removes the route at index idx .

-

Parameters

+

Parameters

@@ -2775,7 +3170,7 @@ nm_setting_ip_config_remove_route (  - + @@ -2793,7 +3188,7 @@ nm_setting_ip_config_remove_route_by_value

Removes the route route .

-

Parameters

+

Parameters

i

idx

index number of the route

 
@@ -2815,7 +3210,7 @@ nm_setting_ip_config_remove_route_by_value
-

Returns

+

Returns

TRUE if the route was found and removed; FALSE if it was not.

@@ -2826,7 +3221,7 @@ nm_setting_ip_config_remove_route_by_value nm_setting_ip_config_clear_routes (NMSettingIPConfig *setting);

Removes all configured routes.

-

Parameters

+

Parameters

@@ -2849,7 +3244,7 @@ nm_setting_ip_config_get_route_metric (“route-metric” property.

-

Parameters

+

Parameters

@@ -2864,7 +3259,7 @@ property.

-

Returns

+

Returns

the route metric that is used for routes that don't explicitly specify a metric. See “route-metric” for more details.

@@ -2878,7 +3273,7 @@ nm_setting_ip_config_get_ignore_auto_routes

Returns the value contained in the “ignore-auto-routes” property.

-

Parameters

+

Parameters

@@ -2893,7 +3288,7 @@ property.

-

Returns

+

Returns

TRUE if automatically configured (ie via DHCP) routes should be ignored.

@@ -2907,7 +3302,7 @@ nm_setting_ip_config_get_ignore_auto_dns

Returns the value contained in the “ignore-auto-dns” property.

-

Parameters

+

Parameters

@@ -2922,7 +3317,7 @@ property.

-

Returns

+

Returns

TRUE if automatically configured (ie via DHCP) DNS information should be ignored.

@@ -2936,7 +3331,7 @@ nm_setting_ip_config_get_dhcp_hostname

Returns the value contained in the “dhcp-hostname” property.

-

Parameters

+

Parameters

@@ -2951,7 +3346,7 @@ property.

-

Returns

+

Returns

the configured hostname to send to the DHCP server

@@ -2964,7 +3359,7 @@ nm_setting_ip_config_get_dhcp_send_hostname

Returns the value contained in the “dhcp-send-hostname” property.

-

Parameters

+

Parameters

@@ -2979,7 +3374,7 @@ property.

-

Returns

+

Returns

TRUE if NetworkManager should send the machine hostname to the DHCP server when requesting addresses to allow the server to automatically update DNS information for this machine.

@@ -2994,7 +3389,7 @@ nm_setting_ip_config_get_never_default

Returns the value contained in the “never-default” property.

-

Parameters

+

Parameters

@@ -3009,7 +3404,7 @@ property.

-

Returns

+

Returns

TRUE if this connection should never be the default connection

@@ -3022,7 +3417,7 @@ nm_setting_ip_config_get_may_fail (Returns the value contained in the “may-fail” property.

-

Parameters

+

Parameters

@@ -3037,7 +3432,7 @@ property.

-

Returns

+

Returns

TRUE if this connection doesn't require this type of IP addressing to complete for the connection to succeed.

@@ -3064,6 +3459,12 @@ addressing to complete for the connection to succeed.


+

NM_SETTING_IP_CONFIG_DNS_OPTIONS

+
#define NM_SETTING_IP_CONFIG_DNS_OPTIONS        "dns-options"
+
+
+
+

NM_SETTING_IP_CONFIG_ADDRESSES

#define NM_SETTING_IP_CONFIG_ADDRESSES          "addresses"
 
@@ -3122,6 +3523,90 @@ addressing to complete for the connection to succeed.

#define NM_SETTING_IP_CONFIG_MAY_FAIL           "may-fail"
 
+
+
+

NM_SETTING_DNS_OPTION_DEBUG

+
#define NM_SETTING_DNS_OPTION_DEBUG                     "debug"
+
+
+
+
+

NM_SETTING_DNS_OPTION_NDOTS

+
#define NM_SETTING_DNS_OPTION_NDOTS                     "ndots"
+
+
+
+
+

NM_SETTING_DNS_OPTION_TIMEOUT

+
#define NM_SETTING_DNS_OPTION_TIMEOUT                   "timeout"
+
+
+
+
+

NM_SETTING_DNS_OPTION_ATTEMPTS

+
#define NM_SETTING_DNS_OPTION_ATTEMPTS                  "attempts"
+
+
+
+
+

NM_SETTING_DNS_OPTION_ROTATE

+
#define NM_SETTING_DNS_OPTION_ROTATE                    "rotate"
+
+
+
+
+

NM_SETTING_DNS_OPTION_NO_CHECK_NAMES

+
#define NM_SETTING_DNS_OPTION_NO_CHECK_NAMES            "no-check-names"
+
+
+
+
+

NM_SETTING_DNS_OPTION_INET6

+
#define NM_SETTING_DNS_OPTION_INET6                     "inet6"
+
+
+
+
+

NM_SETTING_DNS_OPTION_IP6_BYTESTRING

+
#define NM_SETTING_DNS_OPTION_IP6_BYTESTRING            "ip6-bytestring"
+
+
+
+
+

NM_SETTING_DNS_OPTION_IP6_DOTINT

+
#define NM_SETTING_DNS_OPTION_IP6_DOTINT                "ip6-dotint"
+
+
+
+
+

NM_SETTING_DNS_OPTION_NO_IP6_DOTINT

+
#define NM_SETTING_DNS_OPTION_NO_IP6_DOTINT             "no-ip6-dotint"
+
+
+
+
+

NM_SETTING_DNS_OPTION_EDNS0

+
#define NM_SETTING_DNS_OPTION_EDNS0                     "edns0"
+
+
+
+
+

NM_SETTING_DNS_OPTION_SINGLE_REQUEST

+
#define NM_SETTING_DNS_OPTION_SINGLE_REQUEST            "single-request"
+
+
+
+
+

NM_SETTING_DNS_OPTION_SINGLE_REQUEST_REOPEN

+
#define NM_SETTING_DNS_OPTION_SINGLE_REQUEST_REOPEN     "single-request-reopen"
+
+
+
+
+

NM_SETTING_DNS_OPTION_NO_TLD_QUERY

+
#define NM_SETTING_DNS_OPTION_NO_TLD_QUERY              "no-tld-query"
+
+

Property Details

@@ -3137,7 +3622,9 @@ addressing to complete for the connection to succeed.

The “dhcp-hostname” property

  “dhcp-hostname”            gchar *

If the “dhcp-send-hostname” property is TRUE, then the -specified name will be sent to the DHCP server when acquiring a lease.

+specified name will be sent to the DHCP server when acquiring a lease. +This property and “dhcp-fqdn” are mutually exclusive and +cannot be set at the same time.

Flags: Read / Write

Default value: NULL

@@ -3162,6 +3649,17 @@ providing a static hostname for the computer. If the
+

The “dns-options” property

+
  “dns-options”              GStrv
+

Array of DNS options.

+

NULL means that the options are unset and left at the default. +In this case NetworkManager will use default options. This is +distinct from an empty list of properties.

+

Flags: Read / Write

+

Since: 1.2

+
+
+

The “dns-search” property

  “dns-search”               GStrv

Array of DNS search domains.

diff --git a/docs/libnm/html/NMSettingIPTunnel.html b/docs/libnm/html/NMSettingIPTunnel.html new file mode 100644 index 00000000..795afe74 --- /dev/null +++ b/docs/libnm/html/NMSettingIPTunnel.html @@ -0,0 +1,844 @@ + + + + +NMSettingIPTunnel: libnm Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMSettingIPTunnel

+

NMSettingIPTunnel — Describes connection properties for IP tunnel devices

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+NMSetting * + +nm_setting_ip_tunnel_new () +
const char * + +nm_setting_ip_tunnel_get_parent () +
+NMIPTunnelMode + +nm_setting_ip_tunnel_get_mode () +
const char * + +nm_setting_ip_tunnel_get_local () +
const char * + +nm_setting_ip_tunnel_get_remote () +
+guint + +nm_setting_ip_tunnel_get_ttl () +
+guint + +nm_setting_ip_tunnel_get_tos () +
+gboolean + +nm_setting_ip_tunnel_get_path_mtu_discovery () +
const char * + +nm_setting_ip_tunnel_get_input_key () +
const char * + +nm_setting_ip_tunnel_get_output_key () +
+guint + +nm_setting_ip_tunnel_get_encapsulation_limit () +
+guint + +nm_setting_ip_tunnel_get_flow_label () +
+guint + +nm_setting_ip_tunnel_get_mtu () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
guintencapsulation-limitRead / Write / Construct
guintflow-labelRead / Write / Construct
+gchar *input-keyRead / Write
+gchar *localRead / Write
guintmodeRead / Write
guintmtuRead / Write / Construct
+gchar *output-keyRead / Write
+gchar *parentRead / Write
gbooleanpath-mtu-discoveryRead / Write / Construct
+gchar *remoteRead / Write
guinttosRead / Write / Construct
guintttlRead / Write / Construct
+
+ +
+

Object Hierarchy

+
    GObject
+    ╰── NMSetting
+        ╰── NMSettingIPTunnel
+
+
+
+

Description

+
+
+

Functions

+
+

nm_setting_ip_tunnel_new ()

+
NMSetting *
+nm_setting_ip_tunnel_new (void);
+

Creates a new NMSettingIPTunnel object with default values.

+
+

Returns

+

the new empty NMSettingIPTunnel object.

+

[transfer full]

+
+

Since: 1.2

+
+
+
+

nm_setting_ip_tunnel_get_parent ()

+
const char *
+nm_setting_ip_tunnel_get_parent (NMSettingIPTunnel *setting);
+

Returns the “parent” property of the setting

+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingIPTunnel

 
+
+
+

Returns

+

the parent device

+
+

Since: 1.2

+
+
+
+

nm_setting_ip_tunnel_get_mode ()

+
NMIPTunnelMode
+nm_setting_ip_tunnel_get_mode (NMSettingIPTunnel *setting);
+

Returns the “mode” property of the setting.

+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingIPTunnel

 
+
+
+

Returns

+

the tunnel mode

+
+

Since: 1.2

+
+
+
+

nm_setting_ip_tunnel_get_local ()

+
const char *
+nm_setting_ip_tunnel_get_local (NMSettingIPTunnel *setting);
+

Returns the “local” property of the setting.

+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingIPTunnel

 
+
+
+

Returns

+

the local endpoint

+
+

Since: 1.2

+
+
+
+

nm_setting_ip_tunnel_get_remote ()

+
const char *
+nm_setting_ip_tunnel_get_remote (NMSettingIPTunnel *setting);
+

Returns the “remote” property of the setting.

+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingIPTunnel

 
+
+
+

Returns

+

the remote endpoint

+
+

Since: 1.2

+
+
+
+

nm_setting_ip_tunnel_get_ttl ()

+
guint
+nm_setting_ip_tunnel_get_ttl (NMSettingIPTunnel *setting);
+

Returns the “ttl” property of the setting.

+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingIPTunnel

 
+
+
+

Returns

+

the Time-to-live value

+
+

Since: 1.2

+
+
+
+

nm_setting_ip_tunnel_get_tos ()

+
guint
+nm_setting_ip_tunnel_get_tos (NMSettingIPTunnel *setting);
+

Returns the “tos” property of the setting.

+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingIPTunnel

 
+
+
+

Returns

+

the TOS value

+
+

Since: 1.2

+
+
+
+

nm_setting_ip_tunnel_get_path_mtu_discovery ()

+
gboolean
+nm_setting_ip_tunnel_get_path_mtu_discovery
+                               (NMSettingIPTunnel *setting);
+

Returns the “path-mtu-discovery” property of the setting.

+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingIPTunnel

 
+
+
+

Returns

+

whether path MTU discovery is enabled

+
+

Since: 1.2

+
+
+
+

nm_setting_ip_tunnel_get_input_key ()

+
const char *
+nm_setting_ip_tunnel_get_input_key (NMSettingIPTunnel *setting);
+

Returns the “input-key” property of the setting.

+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingIPTunnel

 
+
+
+

Returns

+

the input key

+
+

Since: 1.2

+
+
+
+

nm_setting_ip_tunnel_get_output_key ()

+
const char *
+nm_setting_ip_tunnel_get_output_key (NMSettingIPTunnel *setting);
+

Returns the “output-key” property of the setting.

+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingIPTunnel

 
+
+
+

Returns

+

the output key

+
+

Since: 1.2

+
+
+
+

nm_setting_ip_tunnel_get_encapsulation_limit ()

+
guint
+nm_setting_ip_tunnel_get_encapsulation_limit
+                               (NMSettingIPTunnel *setting);
+

Returns the “encapsulation-limit” property of the setting.

+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingIPTunnel

 
+
+
+

Returns

+

the encapsulation limit value

+
+

Since: 1.2

+
+
+
+

nm_setting_ip_tunnel_get_flow_label ()

+
guint
+nm_setting_ip_tunnel_get_flow_label (NMSettingIPTunnel *setting);
+

Returns the “flow-label” property of the setting.

+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingIPTunnel

 
+
+
+

Returns

+

the flow label value

+
+

Since: 1.2

+
+
+
+

nm_setting_ip_tunnel_get_mtu ()

+
guint
+nm_setting_ip_tunnel_get_mtu (NMSettingIPTunnel *setting);
+

Returns the “mtu” property of the setting.

+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingIPTunnel

 
+
+
+

Returns

+

the MTU

+
+

Since: 1.2

+
+
+
+

Types and Values

+
+

NM_SETTING_IP_TUNNEL_SETTING_NAME

+
#define NM_SETTING_IP_TUNNEL_SETTING_NAME        "ip-tunnel"
+
+
+
+
+

NM_SETTING_IP_TUNNEL_PARENT

+
#define NM_SETTING_IP_TUNNEL_PARENT              "parent"
+
+
+
+
+

NM_SETTING_IP_TUNNEL_MODE

+
#define NM_SETTING_IP_TUNNEL_MODE                "mode"
+
+
+
+
+

NM_SETTING_IP_TUNNEL_LOCAL

+
#define NM_SETTING_IP_TUNNEL_LOCAL               "local"
+
+
+
+
+

NM_SETTING_IP_TUNNEL_REMOTE

+
#define NM_SETTING_IP_TUNNEL_REMOTE              "remote"
+
+
+
+
+

NM_SETTING_IP_TUNNEL_TTL

+
#define NM_SETTING_IP_TUNNEL_TTL                 "ttl"
+
+
+
+
+

NM_SETTING_IP_TUNNEL_TOS

+
#define NM_SETTING_IP_TUNNEL_TOS                 "tos"
+
+
+
+
+

NM_SETTING_IP_TUNNEL_PATH_MTU_DISCOVERY

+
#define NM_SETTING_IP_TUNNEL_PATH_MTU_DISCOVERY  "path-mtu-discovery"
+
+
+
+
+

NM_SETTING_IP_TUNNEL_INPUT_KEY

+
#define NM_SETTING_IP_TUNNEL_INPUT_KEY           "input-key"
+
+
+
+
+

NM_SETTING_IP_TUNNEL_OUTPUT_KEY

+
#define NM_SETTING_IP_TUNNEL_OUTPUT_KEY          "output-key"
+
+
+
+
+

NM_SETTING_IP_TUNNEL_ENCAPSULATION_LIMIT

+
#define NM_SETTING_IP_TUNNEL_ENCAPSULATION_LIMIT "encapsulation-limit"
+
+
+
+
+

NM_SETTING_IP_TUNNEL_FLOW_LABEL

+
#define NM_SETTING_IP_TUNNEL_FLOW_LABEL          "flow-label"
+
+
+
+
+

NM_SETTING_IP_TUNNEL_MTU

+
#define NM_SETTING_IP_TUNNEL_MTU                 "mtu"
+
+
+
+
+

Property Details

+
+

The “encapsulation-limit” property

+
  “encapsulation-limit”      guint
+

How many additional levels of encapsulation are permitted to be prepended +to packets. This property applies only to IPv6 tunnels.

+

Flags: Read / Write / Construct

+

Allowed values: <= 255

+

Default value: 0

+

Since: 1.2

+
+
+
+

The “flow-label” property

+
  “flow-label”               guint
+

The flow label to assign to tunnel packets. This property applies only to +IPv6 tunnels.

+

Flags: Read / Write / Construct

+

Allowed values: <= 1048575

+

Default value: 0

+

Since: 1.2

+
+
+
+

The “input-key” property

+
  “input-key”                gchar *
+

The key used for tunnel input packets; the property is valid only for +certain tunnel modes (GRE, IP6GRE). If empty, no key is used.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 1.2

+
+
+
+

The “local” property

+
  “local”                    gchar *
+

The local endpoint of the tunnel; the value can be empty, otherwise it +must contain an IPv4 or IPv6 address.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 1.2

+
+
+
+

The “mode” property

+
  “mode”                     guint
+

The tunneling mode, for example NM_IP_TUNNEL_MODE_IPIP or +NM_IP_TUNNEL_MODE_GRE.

+

Flags: Read / Write

+

Default value: 0

+

Since: 1.2

+
+
+
+

The “mtu” property

+
  “mtu”                      guint
+

Flags: Read / Write / Construct

+

Default value: 0

+
+
+
+

The “output-key” property

+
  “output-key”               gchar *
+

The key used for tunnel output packets; the property is valid only for +certain tunnel modes (GRE, IP6GRE). If empty, no key is used.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 1.2

+
+
+
+

The “parent” property

+
  “parent”                   gchar *
+

If given, specifies the parent interface name or parent connection UUID +the new device will be bound to so that tunneled packets will only be +routed via that interface.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 1.2

+
+
+
+

The “path-mtu-discovery” property

+
  “path-mtu-discovery”       gboolean
+

Whether to enable Path MTU Discovery on this tunnel.

+

Flags: Read / Write / Construct

+

Default value: TRUE

+

Since: 1.2

+
+
+
+

The “remote” property

+
  “remote”                   gchar *
+

The remote endpoint of the tunnel; the value must contain an IPv4 or IPv6 +address.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 1.2

+
+
+
+

The “tos” property

+
  “tos”                      guint
+

The type of service (IPv4) or traffic class (IPv6) field to be set on +tunneled packets.

+

Flags: Read / Write / Construct

+

Allowed values: <= 255

+

Default value: 0

+

Since: 1.2

+
+
+
+

The “ttl” property

+
  “ttl”                      guint
+

The TTL to assign to tunneled packets. 0 is a special value meaning that +packets inherit the TTL value.

+

Flags: Read / Write / Construct

+

Allowed values: <= 255

+

Default value: 0

+

Since: 1.2

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm/html/NMSettingInfiniband.html b/docs/libnm/html/NMSettingInfiniband.html index 4ab10c02..985657f0 100644 --- a/docs/libnm/html/NMSettingInfiniband.html +++ b/docs/libnm/html/NMSettingInfiniband.html @@ -7,7 +7,7 @@ - + @@ -22,7 +22,7 @@ Home Up Prev -Next +Next
diff --git a/docs/libnm/html/NMSettingMacvlan.html b/docs/libnm/html/NMSettingMacvlan.html new file mode 100644 index 00000000..c96ffbb4 --- /dev/null +++ b/docs/libnm/html/NMSettingMacvlan.html @@ -0,0 +1,433 @@ + + + + +NMSettingMacvlan: libnm Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMSettingMacvlan

+

NMSettingMacvlan — Describes connection properties for macvlan interfaces

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+NMSetting * + +nm_setting_macvlan_new () +
const char * + +nm_setting_macvlan_get_parent () +
+NMSettingMacvlanMode + +nm_setting_macvlan_get_mode () +
+gboolean + +nm_setting_macvlan_get_promiscuous () +
+gboolean + +nm_setting_macvlan_get_tap () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +
guintmodeRead / Write / Construct
+gchar *parentRead / Write / Construct
gbooleanpromiscuousRead / Write / Construct
gbooleantapRead / Write / Construct
+
+
+

Types and Values

+ +
+
+

Object Hierarchy

+
    GEnum
+    ╰── NMSettingMacvlanMode
+    GObject
+    ╰── NMSetting
+        ╰── NMSettingMacvlan
+
+
+
+

Description

+

The NMSettingMacvlan object is a NMSetting subclass that describes properties +necessary for connection to macvlan interfaces.

+
+
+

Functions

+
+

nm_setting_macvlan_new ()

+
NMSetting *
+nm_setting_macvlan_new (void);
+

Creates a new NMSettingMacvlan object with default values.

+
+

Returns

+

the new empty NMSettingMacvlan object.

+

[transfer full]

+
+

Since: 1.2

+
+
+
+

nm_setting_macvlan_get_parent ()

+
const char *
+nm_setting_macvlan_get_parent (NMSettingMacvlan *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingMacvlan

 
+
+
+

Returns

+

the “parent” property of the setting

+
+

Since: 1.2

+
+
+
+

nm_setting_macvlan_get_mode ()

+
NMSettingMacvlanMode
+nm_setting_macvlan_get_mode (NMSettingMacvlan *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingMacvlan

 
+
+
+

Returns

+

the “mode” property of the setting

+
+

Since: 1.2

+
+
+
+

nm_setting_macvlan_get_promiscuous ()

+
gboolean
+nm_setting_macvlan_get_promiscuous (NMSettingMacvlan *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingMacvlan

 
+
+
+

Returns

+

the “promiscuous” property of the setting

+
+

Since: 1.2

+
+
+
+

nm_setting_macvlan_get_tap ()

+
gboolean
+nm_setting_macvlan_get_tap (NMSettingMacvlan *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingMacvlan

 
+
+
+

Returns

+

the “tap” property of the setting

+
+

Since: 1.2

+
+
+
+

Types and Values

+
+

NM_SETTING_MACVLAN_SETTING_NAME

+
#define NM_SETTING_MACVLAN_SETTING_NAME         "macvlan"
+
+
+
+
+

NM_SETTING_MACVLAN_PARENT

+
#define NM_SETTING_MACVLAN_PARENT               "parent"
+
+
+
+
+

NM_SETTING_MACVLAN_MODE

+
#define NM_SETTING_MACVLAN_MODE                 "mode"
+
+
+
+
+

NM_SETTING_MACVLAN_PROMISCUOUS

+
#define NM_SETTING_MACVLAN_PROMISCUOUS          "promiscuous"
+
+
+
+
+

NM_SETTING_MACVLAN_TAP

+
#define NM_SETTING_MACVLAN_TAP                  "tap"
+
+
+
+
+

enum NMSettingMacvlanMode

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

NM_SETTING_MACVLAN_MODE_UNKNOWN

+

unknown/unset mode

+
 

NM_SETTING_MACVLAN_MODE_VEPA

+

Virtual Ethernet Port Aggregator mode

+
 

NM_SETTING_MACVLAN_MODE_BRIDGE

+

bridge mode

+
 

NM_SETTING_MACVLAN_MODE_PRIVATE

+

private mode

+
 

NM_SETTING_MACVLAN_MODE_PASSTHRU

+

passthru mode

+
 

NM_SETTING_MACVLAN_MODE_SOURCE

+

source mode

+
 

_NM_SETTING_MACVLAN_MODE_NUM

  

NM_SETTING_MACVLAN_MODE_LAST

  
+
+
+
+
+

Property Details

+
+

The “mode” property

+
  “mode”                     guint
+

The macvlan mode, which specifies the communication mechanism between multiple +macvlans on the same lower device.

+

Flags: Read / Write / Construct

+

Default value: 0

+

Since: 1.2

+
+
+
+

The “parent” property

+
  “parent”                   gchar *
+

If given, specifies the parent interface name or parent connection UUID +from which this MAC-VLAN interface should be created. If this property is +not specified, the connection must contain an NMSettingWired setting +with a “mac-address” property.

+

Flags: Read / Write / Construct

+

Default value: NULL

+

Since: 1.2

+
+
+
+

The “promiscuous” property

+
  “promiscuous”              gboolean
+

Whether the interface should be put in promiscuous mode.

+

Flags: Read / Write / Construct

+

Default value: TRUE

+

Since: 1.2

+
+
+
+

The “tap” property

+
  “tap”                      gboolean
+

Whether the interface should be a MACVTAP.

+

Flags: Read / Write / Construct

+

Default value: FALSE

+

Since: 1.2

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm/html/NMSettingOlpcMesh.html b/docs/libnm/html/NMSettingOlpcMesh.html index b8d90183..df0c5bf8 100644 --- a/docs/libnm/html/NMSettingOlpcMesh.html +++ b/docs/libnm/html/NMSettingOlpcMesh.html @@ -6,7 +6,7 @@ - + @@ -21,7 +21,7 @@ Home Up -Prev +Prev Next
@@ -29,7 +29,7 @@

NMSettingOlpcMesh

-

NMSettingOlpcMesh

+

NMSettingOlpcMesh — Describes connection properties for OLPC-Mesh devices

@@ -140,6 +140,8 @@

Description

+

The NMSettingOlpcMesh object is a NMSetting subclass that describes properties +necessary for connection to OLPC-Mesh devices.

Functions

@@ -149,7 +151,7 @@ nm_setting_olpc_mesh_new (void);

Creates a new NMSettingOlpcMesh object with default values.

-

Returns

+

Returns

the new empty NMSettingOlpcMesh object

@@ -159,7 +161,7 @@ nm_setting_olpc_mesh_new (voidGBytes * nm_setting_olpc_mesh_get_ssid (NMSettingOlpcMesh *setting);
-

Returns

+

Returns

.

[transfer none]

diff --git a/docs/libnm/html/NMSettingPpp.html b/docs/libnm/html/NMSettingPpp.html index 2ea94443..a9eb83f6 100644 --- a/docs/libnm/html/NMSettingPpp.html +++ b/docs/libnm/html/NMSettingPpp.html @@ -407,7 +407,7 @@ cable and DSL modems and some mobile broadband devices.

nm_setting_ppp_new (void);

Creates a new NMSettingPpp object with default values.

-

Returns

+

Returns

the new empty NMSettingPpp object.

[transfer full]

@@ -418,7 +418,7 @@ nm_setting_ppp_new (voidgboolean nm_setting_ppp_get_noauth (NMSettingPpp *setting);
-

Parameters

+

Parameters

@@ -433,7 +433,7 @@ nm_setting_ppp_get_noauth ( -

Returns

+

Returns

the “noauth” property of the setting

@@ -443,7 +443,7 @@ nm_setting_ppp_get_noauth (gboolean nm_setting_ppp_get_refuse_eap (NMSettingPpp *setting);
-

Parameters

+

Parameters

@@ -458,7 +458,7 @@ nm_setting_ppp_get_refuse_eap (
-

Returns

+

Returns

the “refuse-eap” property of the setting

@@ -468,7 +468,7 @@ nm_setting_ppp_get_refuse_eap (gboolean nm_setting_ppp_get_refuse_pap (NMSettingPpp *setting);
-

Parameters

+

Parameters

@@ -483,7 +483,7 @@ nm_setting_ppp_get_refuse_pap (
-

Returns

+

Returns

the “refuse-pap” property of the setting

@@ -493,7 +493,7 @@ nm_setting_ppp_get_refuse_pap (gboolean nm_setting_ppp_get_refuse_chap (NMSettingPpp *setting);
-

Parameters

+

Parameters

@@ -508,7 +508,7 @@ nm_setting_ppp_get_refuse_chap (
-

Returns

+

Returns

the “refuse-chap” property of the setting

@@ -518,7 +518,7 @@ nm_setting_ppp_get_refuse_chap (gboolean nm_setting_ppp_get_refuse_mschap (NMSettingPpp *setting);
-

Parameters

+

Parameters

@@ -533,7 +533,7 @@ nm_setting_ppp_get_refuse_mschap (
-

Returns

+

Returns

the “refuse-mschap” property of the setting

@@ -543,7 +543,7 @@ nm_setting_ppp_get_refuse_mschap (gboolean nm_setting_ppp_get_refuse_mschapv2 (NMSettingPpp *setting);
-

Parameters

+

Parameters

@@ -558,7 +558,7 @@ nm_setting_ppp_get_refuse_mschapv2 (
-

Returns

+

Returns

the “refuse-mschapv2” property of the setting

@@ -568,7 +568,7 @@ nm_setting_ppp_get_refuse_mschapv2 (gboolean nm_setting_ppp_get_nobsdcomp (NMSettingPpp *setting);
-

Parameters

+

Parameters

@@ -583,7 +583,7 @@ nm_setting_ppp_get_nobsdcomp ( -

Returns

+

Returns

the “nobsdcomp” property of the setting

@@ -593,7 +593,7 @@ nm_setting_ppp_get_nobsdcomp (gboolean nm_setting_ppp_get_nodeflate (NMSettingPpp *setting);
-

Parameters

+

Parameters

@@ -608,7 +608,7 @@ nm_setting_ppp_get_nodeflate ( -

Returns

+

Returns

the “nodeflate” property of the setting

@@ -618,7 +618,7 @@ nm_setting_ppp_get_nodeflate (gboolean nm_setting_ppp_get_no_vj_comp (NMSettingPpp *setting);
-

Parameters

+

Parameters

@@ -633,7 +633,7 @@ nm_setting_ppp_get_no_vj_comp (
-

Returns

+

Returns

the “no-vj-comp” property of the setting

@@ -643,7 +643,7 @@ nm_setting_ppp_get_no_vj_comp (gboolean nm_setting_ppp_get_require_mppe (NMSettingPpp *setting);
-

Parameters

+

Parameters

@@ -658,7 +658,7 @@ nm_setting_ppp_get_require_mppe (
-

Returns

+

Returns

the “require-mppe” property of the setting

@@ -668,7 +668,7 @@ nm_setting_ppp_get_require_mppe (gboolean nm_setting_ppp_get_require_mppe_128 (NMSettingPpp *setting);
-

Parameters

+

Parameters

@@ -683,7 +683,7 @@ nm_setting_ppp_get_require_mppe_128 (
-

Returns

+

Returns

the “require-mppe-128” property of the setting

@@ -693,7 +693,7 @@ nm_setting_ppp_get_require_mppe_128 (gboolean nm_setting_ppp_get_mppe_stateful (NMSettingPpp *setting);
-

Parameters

+

Parameters

@@ -708,7 +708,7 @@ nm_setting_ppp_get_mppe_stateful (
-

Returns

+

Returns

the “mppe-stateful” property of the setting

@@ -718,7 +718,7 @@ nm_setting_ppp_get_mppe_stateful (gboolean nm_setting_ppp_get_crtscts (NMSettingPpp *setting);
-

Parameters

+

Parameters

@@ -733,7 +733,7 @@ nm_setting_ppp_get_crtscts ( -

Returns

+

Returns

the “crtscts” property of the setting

@@ -743,7 +743,7 @@ nm_setting_ppp_get_crtscts (guint32 nm_setting_ppp_get_baud (NMSettingPpp *setting);
-

Parameters

+

Parameters

@@ -758,7 +758,7 @@ nm_setting_ppp_get_baud ( -

Returns

+

Returns

the “baud” property of the setting

@@ -768,7 +768,7 @@ nm_setting_ppp_get_baud (guint32 nm_setting_ppp_get_mru (NMSettingPpp *setting);
-

Parameters

+

Parameters

@@ -783,7 +783,7 @@ nm_setting_ppp_get_mru ( -

Returns

+

Returns

the “mru” property of the setting

@@ -793,7 +793,7 @@ nm_setting_ppp_get_mru (guint32 nm_setting_ppp_get_mtu (NMSettingPpp *setting);
-

Parameters

+

Parameters

@@ -808,7 +808,7 @@ nm_setting_ppp_get_mtu ( -

Returns

+

Returns

the “mtu” property of the setting

@@ -818,7 +818,7 @@ nm_setting_ppp_get_mtu (guint32 nm_setting_ppp_get_lcp_echo_failure (NMSettingPpp *setting);
-

Parameters

+

Parameters

@@ -833,7 +833,7 @@ nm_setting_ppp_get_lcp_echo_failure (
-

Returns

+

Returns

the “lcp-echo-failure” property of the setting

@@ -843,7 +843,7 @@ nm_setting_ppp_get_lcp_echo_failure (guint32 nm_setting_ppp_get_lcp_echo_interval (NMSettingPpp *setting);
-

Parameters

+

Parameters

@@ -858,7 +858,7 @@ nm_setting_ppp_get_lcp_echo_interval ( -

Returns

+

Returns

the “lcp-echo-interval” property of the setting

diff --git a/docs/libnm/html/NMSettingPppoe.html b/docs/libnm/html/NMSettingPppoe.html index 6155a548..232cb5b4 100644 --- a/docs/libnm/html/NMSettingPppoe.html +++ b/docs/libnm/html/NMSettingPppoe.html @@ -168,7 +168,7 @@ to provide IP transport, for example cable or DSL modems.

nm_setting_pppoe_new (void);

Creates a new NMSettingPppoe object with default values.

-

Returns

+

Returns

the new empty NMSettingPppoe object.

[transfer full]

@@ -179,7 +179,7 @@ nm_setting_pppoe_new (void
const char *
 nm_setting_pppoe_get_service (NMSettingPppoe *setting);
-

Parameters

+

Parameters

@@ -194,7 +194,7 @@ nm_setting_pppoe_get_service ( -

Returns

+

Returns

the “service” property of the setting

@@ -204,7 +204,7 @@ nm_setting_pppoe_get_service (const char * nm_setting_pppoe_get_username (NMSettingPppoe *setting);
-

Parameters

+

Parameters

@@ -219,7 +219,7 @@ nm_setting_pppoe_get_username (
-

Returns

+

Returns

the “username” property of the setting

@@ -229,7 +229,7 @@ nm_setting_pppoe_get_username (const char * nm_setting_pppoe_get_password (NMSettingPppoe *setting);
-

Parameters

+

Parameters

@@ -244,7 +244,7 @@ nm_setting_pppoe_get_password (
-

Returns

+

Returns

the “password” property of the setting

@@ -254,7 +254,7 @@ nm_setting_pppoe_get_password (NMSettingSecretFlags nm_setting_pppoe_get_password_flags (NMSettingPppoe *setting);
-

Parameters

+

Parameters

@@ -269,7 +269,7 @@ nm_setting_pppoe_get_password_flags (
-

Returns

+

Returns

the NMSettingSecretFlags pertaining to the “password”

diff --git a/docs/libnm/html/NMSettingSerial.html b/docs/libnm/html/NMSettingSerial.html index ca4a38b3..41240d6b 100644 --- a/docs/libnm/html/NMSettingSerial.html +++ b/docs/libnm/html/NMSettingSerial.html @@ -171,7 +171,7 @@ serial communications

Object Hierarchy

-
    GEnum
+
    GEnum
     ╰── NMSettingSerialParity
     GObject
     ╰── NMSetting
@@ -192,7 +192,7 @@ such as mobile broadband or analog telephone connections.

nm_setting_serial_new (void);

Creates a new NMSettingSerial object with default values.

-

Returns

+

Returns

the new empty NMSettingSerial object.

[transfer full]

@@ -203,7 +203,7 @@ nm_setting_serial_new (voidguint nm_setting_serial_get_baud (NMSettingSerial *setting);
-

Parameters

+

Parameters

@@ -218,7 +218,7 @@ nm_setting_serial_get_baud ( -

Returns

+

Returns

the “baud” property of the setting

@@ -228,7 +228,7 @@ nm_setting_serial_get_baud (guint nm_setting_serial_get_bits (NMSettingSerial *setting);
-

Parameters

+

Parameters

@@ -243,7 +243,7 @@ nm_setting_serial_get_bits ( -

Returns

+

Returns

the “bits” property of the setting

@@ -253,7 +253,7 @@ nm_setting_serial_get_bits (NMSettingSerialParity nm_setting_serial_get_parity (NMSettingSerial *setting);
-

Parameters

+

Parameters

@@ -268,7 +268,7 @@ nm_setting_serial_get_parity ( -

Returns

+

Returns

the “parity” property of the setting

@@ -278,7 +278,7 @@ nm_setting_serial_get_parity (guint nm_setting_serial_get_stopbits (NMSettingSerial *setting);
-

Parameters

+

Parameters

@@ -293,7 +293,7 @@ nm_setting_serial_get_stopbits (
-

Returns

+

Returns

the “stopbits” property of the setting

@@ -303,7 +303,7 @@ nm_setting_serial_get_stopbits (guint64 nm_setting_serial_get_send_delay (NMSettingSerial *setting);
-

Parameters

+

Parameters

@@ -318,7 +318,7 @@ nm_setting_serial_get_send_delay (
-

Returns

+

Returns

the “send-delay” property of the setting

@@ -335,7 +335,7 @@ nm_setting_serial_get_send_delay (

enum NMSettingSerialParity

The parity setting of a serial port.

-

Members

+

Members

diff --git a/docs/libnm/html/NMSettingTeam.html b/docs/libnm/html/NMSettingTeam.html index bd678358..56fd8330 100644 --- a/docs/libnm/html/NMSettingTeam.html +++ b/docs/libnm/html/NMSettingTeam.html @@ -114,7 +114,7 @@ necessary for team connections.

nm_setting_team_new (void);

Creates a new NMSettingTeam object with default values.

-

Returns

+

Returns

the new empty NMSettingTeam object.

[transfer full]

@@ -125,7 +125,7 @@ nm_setting_team_new (void<
const char *
 nm_setting_team_get_config (NMSettingTeam *setting);
-

Parameters

+

Parameters

@@ -140,7 +140,7 @@ nm_setting_team_get_config ( -

Returns

+

Returns

the “config” property of the setting

diff --git a/docs/libnm/html/NMSettingTeamPort.html b/docs/libnm/html/NMSettingTeamPort.html index fbe09ce0..77e59635 100644 --- a/docs/libnm/html/NMSettingTeamPort.html +++ b/docs/libnm/html/NMSettingTeamPort.html @@ -7,7 +7,7 @@ - + @@ -22,7 +22,7 @@
- +
Home Up PrevNextNext
@@ -114,7 +114,7 @@ optional properties that apply to team ports.

nm_setting_team_port_new (void);

Creates a new NMSettingTeamPort object with default values.

-

Returns

+

Returns

the new empty NMSettingTeamPort object.

[transfer full]

@@ -125,7 +125,7 @@ nm_setting_team_port_new (voidconst char * nm_setting_team_port_get_config (NMSettingTeamPort *setting);
-

Parameters

+

Parameters

@@ -140,7 +140,7 @@ nm_setting_team_port_get_config (
-

Returns

+

Returns

the “config” property of the setting

diff --git a/docs/libnm/html/NMSettingTun.html b/docs/libnm/html/NMSettingTun.html new file mode 100644 index 00000000..b6be30d1 --- /dev/null +++ b/docs/libnm/html/NMSettingTun.html @@ -0,0 +1,525 @@ + + + + +NMSettingTun: libnm Reference Manual + + + + + + + + + +
+ + + + + + +
+
+
+ + +
+

NMSettingTun

+

NMSettingTun — Describes connection properties for TUN/TAP interfaces

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+NMSetting * + +nm_setting_tun_new () +
+NMSettingTunMode + +nm_setting_tun_get_mode () +
const char * + +nm_setting_tun_get_owner () +
const char * + +nm_setting_tun_get_group () +
+gboolean + +nm_setting_tun_get_pi () +
+gboolean + +nm_setting_tun_get_vnet_hdr () +
+gboolean + +nm_setting_tun_get_multi_queue () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+gchar *groupRead / Write
guintmodeRead / Write / Construct
gbooleanmulti-queueRead / Write
+gchar *ownerRead / Write
gbooleanpiRead / Write
gbooleanvnet-hdrRead / Write
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#defineNM_SETTING_TUN_SETTING_NAME
#defineNM_SETTING_TUN_MODE
#defineNM_SETTING_TUN_OWNER
#defineNM_SETTING_TUN_GROUP
#defineNM_SETTING_TUN_PI
#defineNM_SETTING_TUN_VNET_HDR
#defineNM_SETTING_TUN_MULTI_QUEUE
enumNMSettingTunMode
+
+
+

Object Hierarchy

+
    GEnum
+    ╰── NMSettingTunMode
+    GObject
+    ╰── NMSetting
+        ╰── NMSettingTun
+
+
+
+

Description

+

The NMSettingTun object is a NMSetting subclass that describes properties +necessary for connection to TUN/TAP interfaces.

+
+
+

Functions

+
+

nm_setting_tun_new ()

+
NMSetting *
+nm_setting_tun_new (void);
+

Creates a new NMSettingTun object with default values.

+
+

Returns

+

the new empty NMSettingTun object.

+

[transfer full]

+
+

Since: 1.2

+
+
+
+

nm_setting_tun_get_mode ()

+
NMSettingTunMode
+nm_setting_tun_get_mode (NMSettingTun *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingTun

 
+
+
+

Returns

+

the “mode” property of the setting

+
+

Since: 1.2

+
+
+
+

nm_setting_tun_get_owner ()

+
const char *
+nm_setting_tun_get_owner (NMSettingTun *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingTun

 
+
+
+

Returns

+

the “owner” property of the setting

+
+

Since: 1.2

+
+
+
+

nm_setting_tun_get_group ()

+
const char *
+nm_setting_tun_get_group (NMSettingTun *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingTun

 
+
+
+

Returns

+

the “group” property of the setting

+
+

Since: 1.2

+
+
+
+

nm_setting_tun_get_pi ()

+
gboolean
+nm_setting_tun_get_pi (NMSettingTun *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingTun

 
+
+
+

Returns

+

the “pi” property of the setting

+
+

Since: 1.2

+
+
+
+

nm_setting_tun_get_vnet_hdr ()

+
gboolean
+nm_setting_tun_get_vnet_hdr (NMSettingTun *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingTun

 
+
+
+

Returns

+

the “vnet_hdr” property of the setting

+
+

Since: 1.2

+
+
+
+

nm_setting_tun_get_multi_queue ()

+
gboolean
+nm_setting_tun_get_multi_queue (NMSettingTun *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingTun

 
+
+
+

Returns

+

the “multi-queue” property of the setting

+
+

Since: 1.2

+
+
+
+

Types and Values

+
+

NM_SETTING_TUN_SETTING_NAME

+
#define NM_SETTING_TUN_SETTING_NAME         "tun"
+
+
+
+
+

NM_SETTING_TUN_MODE

+
#define NM_SETTING_TUN_MODE                 "mode"
+
+
+
+
+

NM_SETTING_TUN_OWNER

+
#define NM_SETTING_TUN_OWNER                "owner"
+
+
+
+
+

NM_SETTING_TUN_GROUP

+
#define NM_SETTING_TUN_GROUP                "group"
+
+
+
+
+

NM_SETTING_TUN_PI

+
#define NM_SETTING_TUN_PI                   "pi"
+
+
+
+
+

NM_SETTING_TUN_VNET_HDR

+
#define NM_SETTING_TUN_VNET_HDR             "vnet-hdr"
+
+
+
+
+

NM_SETTING_TUN_MULTI_QUEUE

+
#define NM_SETTING_TUN_MULTI_QUEUE          "multi-queue"
+
+
+
+
+

enum NMSettingTunMode

+

NMSettingTunMode values indicate the device type (TUN/TAP)

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + +

NM_SETTING_TUN_MODE_UNKNOWN

+

an unknown device type

+
 

NM_SETTING_TUN_MODE_TUN

+

a TUN device

+
 

NM_SETTING_TUN_MODE_TAP

+

a TAP device

+
 
+
+
+
+
+

Property Details

+
+

The “group” property

+
  “group”                    gchar *
+

The group ID which will own the device. If set to NULL everyone +will be able to use the device.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 1.2

+
+
+
+

The “mode” property

+
  “mode”                     guint
+

The operating mode of the virtual device. Allowed values are +NM_SETTING_TUN_MODE_TUN to create a layer 3 device and +NM_SETTING_TUN_MODE_TAP to create an Ethernet-like layer 2 +one.

+

Flags: Read / Write / Construct

+

Default value: 1

+

Since: 1.2

+
+
+
+

The “multi-queue” property

+
  “multi-queue”              gboolean
+

If the property is set to TRUE, the interface will support +multiple file descriptors (queues) to parallelize packet +sending or receiving. Otherwise, the interface will only +support a single queue.

+

Flags: Read / Write

+

Default value: FALSE

+

Since: 1.2

+
+
+
+

The “owner” property

+
  “owner”                    gchar *
+

The user ID which will own the device. If set to NULL everyone +will be able to use the device.

+

Flags: Read / Write

+

Default value: NULL

+

Since: 1.2

+
+
+
+

The “pi” property

+
  “pi”                       gboolean
+

If TRUE the interface will prepend a 4 byte header describing the +physical interface to the packets.

+

Flags: Read / Write

+

Default value: FALSE

+

Since: 1.2

+
+
+
+

The “vnet-hdr” property

+
  “vnet-hdr”                 gboolean
+

If TRUE the IFF_VNET_HDR the tunnel packets will include a virtio +network header.

+

Flags: Read / Write

+

Default value: FALSE

+

Since: 1.2

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm/html/NMSettingVlan.html b/docs/libnm/html/NMSettingVlan.html index f261e7f3..ecb33d1e 100644 --- a/docs/libnm/html/NMSettingVlan.html +++ b/docs/libnm/html/NMSettingVlan.html @@ -6,7 +6,7 @@ - + @@ -21,7 +21,7 @@ Home Up -Prev +Prev Next
@@ -42,6 +42,10 @@ +#define +NM_VLAN_FLAGS_ALL + + NMSetting * @@ -222,9 +226,9 @@

Object Hierarchy

-
    GEnum
+
    GEnum
     ╰── NMVlanPriorityMap
-    GFlags
+    GFlags
     ╰── NMVlanFlags
     GObject
     ╰── NMSetting
@@ -239,12 +243,17 @@ necessary for connection to VLAN interfaces.

Functions

+

NM_VLAN_FLAGS_ALL

+
#define             NM_VLAN_FLAGS_ALL
+
+
+

nm_setting_vlan_new ()

NMSetting *
 nm_setting_vlan_new (void);

Creates a new NMSettingVlan object with default values.

-

Returns

+

Returns

the new empty NMSettingVlan object.

[transfer full]

@@ -255,7 +264,7 @@ nm_setting_vlan_new (void<
const char *
 nm_setting_vlan_get_parent (NMSettingVlan *setting);
-

Parameters

+

Parameters

@@ -270,7 +279,7 @@ nm_setting_vlan_get_parent ( -

Returns

+

Returns

the “parent” property of the setting

@@ -280,7 +289,7 @@ nm_setting_vlan_get_parent (guint32 nm_setting_vlan_get_id (NMSettingVlan *setting);
-

Parameters

+

Parameters

@@ -295,7 +304,7 @@ nm_setting_vlan_get_id ( -

Returns

+

Returns

the “id” property of the setting

@@ -305,7 +314,7 @@ nm_setting_vlan_get_id (guint32 nm_setting_vlan_get_flags (NMSettingVlan *setting);
-

Parameters

+

Parameters

@@ -320,7 +329,7 @@ nm_setting_vlan_get_flags ( -

Returns

+

Returns

the “flags” property of the setting

@@ -334,7 +343,7 @@ nm_setting_vlan_get_num_priorities (“ingress_priority_map” or “egress_priority_map” properties of this setting.

-

Parameters

+

Parameters

@@ -356,7 +365,7 @@ properties of this setting.

-

Returns

+

Returns

return the number of ingress/egress priority entries, -1 if error

@@ -372,7 +381,7 @@ nm_setting_vlan_get_priority (“ingress_priority_map” or “egress_priority_map” properties of this setting.

-

Parameters

+

Parameters

@@ -409,7 +418,7 @@ or
-

Returns

+

Returns

TRUE if a priority map was returned, FALSE if error

@@ -438,7 +447,7 @@ Priority Code Point (PCP) value, and toto is the outgoing 802.1q VLAN Priority Code Point (PCP) value.

-

Parameters

+

Parameters

@@ -472,7 +481,7 @@ to

-

Returns

+

Returns

TRUE if the new priority mapping was successfully added to the list, FALSE if error

@@ -489,7 +498,7 @@ nm_setting_vlan_remove_priority (“ingress_priority_map” or “egress_priority_map” properties.

-

Parameters

+

Parameters

@@ -532,7 +541,7 @@ or
-

Parameters

+

Parameters

@@ -566,7 +575,7 @@ to

-

Returns

+

Returns

TRUE if the priority mapping was found and removed; FALSE if it was not.

@@ -584,7 +593,7 @@ or
-

Parameters

+

Parameters

@@ -611,7 +620,7 @@ properties.

-

Returns

+

Returns

TRUE if the priority mapping was found and removed; FALSE if it was not.

@@ -624,7 +633,7 @@ nm_setting_vlan_clear_priorities (Clear all the entires from “ingress_priority_map” or “egress_priority_map” properties.

-

Parameters

+

Parameters

@@ -657,7 +666,7 @@ nm_setting_vlan_add_priority_str (“egress_priority_map” properties. The priority map maps the Linux SKB priorities to 802.1p priorities.

-

Parameters

+

Parameters

@@ -684,7 +693,7 @@ the Linux SKB priorities to 802.1p priorities.

-

Returns

+

Returns

TRUE if the entry was successfully added to the list, or it overwrote the old value, FALSE if error

@@ -733,7 +742,7 @@ overwrote the old value, FALSE if error

A selector for traffic priority maps; these map Linux SKB priorities to 802.1p priorities used in VLANs.

-

Members

+

Members

@@ -764,7 +773,7 @@ to 802.1p priorities used in VLANs.

enum NMVlanFlags

NMVlanFlags values control the behavior of the VLAN interface.

-

Members

+

Members

@@ -797,6 +806,14 @@ to 802.1p priorities used in VLANs.

+ + + + +
 

NM_VLAN_FLAG_MVRP

+

indicates that this interface should use MVRP to register + itself with it's switch

+
 
@@ -820,7 +837,12 @@ both "from" and "to" are unsigned integers, ie "7:3".

interface. Flags include NM_VLAN_FLAG_REORDER_HEADERS (reordering of output packet headers), NM_VLAN_FLAG_GVRP (use of the GVRP protocol), and NM_VLAN_FLAG_LOOSE_BINDING (loose binding of the interface to its -master device's operating state).

+master device's operating state). NM_VLAN_FLAG_MVRP (use of the MVRP +protocol).

+

The default value of this property is NM_VLAN_FLAG_REORDER_HEADERS, +but it used to be 0. To preserve backward compatibility, the default-value +in the D-Bus API continues to be 0 and a missing property on D-Bus +is still considered as 0.

Flags: Read / Write / Construct

Default value: NM_VLAN_FLAG_REORDER_HEADERS

diff --git a/docs/libnm/html/NMSettingVpn.html b/docs/libnm/html/NMSettingVpn.html index ba0b0304..a3413677 100644 --- a/docs/libnm/html/NMSettingVpn.html +++ b/docs/libnm/html/NMSettingVpn.html @@ -7,7 +7,7 @@ - + @@ -22,7 +22,7 @@ Home Up Prev -Next +Next
@@ -157,6 +157,14 @@ nm_setting_vpn_foreach_secret () + + +guint32 + + +nm_setting_vpn_get_timeout () + +
@@ -193,6 +201,11 @@ Read / Write +guint +timeout +Read / Write + + gchar * user-name @@ -233,6 +246,10 @@ #define NM_SETTING_VPN_SECRETS + +#define +NM_SETTING_VPN_TIMEOUT +
@@ -262,7 +279,7 @@ properties.

const char *value, gpointer user_data);
-

Parameters

+

Parameters

@@ -297,7 +314,7 @@ properties.

nm_setting_vpn_new (void);

Creates a new NMSettingVpn object with default values.

-

Returns

+

Returns

the new empty NMSettingVpn object.

[transfer full]

@@ -310,7 +327,7 @@ nm_setting_vpn_get_service_type (Returns the service name of the VPN, which identifies the specific VPN plugin that should be used to connect to this VPN.

-

Parameters

+

Parameters

@@ -325,7 +342,7 @@ plugin that should be used to connect to this VPN.

-

Returns

+

Returns

the VPN plugin's service name

@@ -335,7 +352,7 @@ plugin that should be used to connect to this VPN.

const char *
 nm_setting_vpn_get_user_name (NMSettingVpn *setting);
-

Parameters

+

Parameters

@@ -350,7 +367,7 @@ nm_setting_vpn_get_user_name ( -

Returns

+

Returns

the “user-name” property of the setting

@@ -360,7 +377,7 @@ nm_setting_vpn_get_user_name (gboolean nm_setting_vpn_get_persistent (NMSettingVpn *setting);
-

Parameters

+

Parameters

@@ -375,7 +392,7 @@ nm_setting_vpn_get_persistent (
-

Returns

+

Returns

the “persistent” property of the setting

@@ -386,7 +403,7 @@ nm_setting_vpn_get_persistent (NMSettingVpn *setting);

Gets number of key/value pairs of VPN configuration data.

-

Parameters

+

Parameters

@@ -401,7 +418,7 @@ nm_setting_vpn_get_num_data_items (
-

Returns

+

Returns

the number of VPN plugin specific configuration data items

@@ -418,7 +435,7 @@ nm_setting_vpn_add_data_item (nm_setting_vpn_add_secret() is for.

-

Parameters

+

Parameters

@@ -456,7 +473,7 @@ nm_setting_vpn_get_data_item (nm_setting_vpn_add_data_item().

-

Parameters

+

Parameters

@@ -478,7 +495,7 @@ by -

Returns

+

Returns

the data item, if any

@@ -491,7 +508,7 @@ nm_setting_vpn_remove_data_item (Deletes a key/value relationship previously established by nm_setting_vpn_add_data_item().

-

Parameters

+

Parameters

@@ -513,7 +530,7 @@ nm_setting_vpn_remove_data_item (
-

Returns

+

Returns

TRUE if the data item was found and removed from the internal list, FALSE if it was not.

@@ -530,7 +547,7 @@ and modify data items inside func , though any additions or removals made during iteration will not be part of the iteration.

-

Parameters

+

Parameters

@@ -565,7 +582,7 @@ during iteration will not be part of the iteration.

nm_setting_vpn_get_num_secrets (NMSettingVpn *setting);

Gets number of VPN plugin specific secrets in the setting.

-

Parameters

+

Parameters

@@ -580,7 +597,7 @@ nm_setting_vpn_get_num_secrets (
-

Returns

+

Returns

the number of VPN plugin specific secrets

@@ -596,7 +613,7 @@ nm_setting_vpn_add_secret ( -

Parameters

+

Parameters

@@ -634,7 +651,7 @@ nm_setting_vpn_get_secret (nm_setting_vpn_add_secret().

-

Parameters

+

Parameters

@@ -656,7 +673,7 @@ by -

Returns

+

Returns

the secret, if any

@@ -669,7 +686,7 @@ nm_setting_vpn_remove_secret (nm_setting_vpn_add_secret().

-

Parameters

+

Parameters

@@ -691,7 +708,7 @@ nm_setting_vpn_remove_secret ( -

Returns

+

Returns

TRUE if the secret was found and removed from the internal list, FALSE if it was not.

@@ -708,7 +725,7 @@ and modify secrets inside func , though any additions or removals made during iteration will not be part of the iteration.

-

Parameters

+

Parameters

@@ -736,6 +753,32 @@ iteration will not be part of the iteration.

+
+
+

nm_setting_vpn_get_timeout ()

+
guint32
+nm_setting_vpn_get_timeout (NMSettingVpn *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingVpn

 
+
+
+

Returns

+

the “timeout” property of the setting

+
+

Since: 1.2

+

Types and Values

@@ -774,6 +817,12 @@ iteration will not be part of the iteration.

#define NM_SETTING_VPN_SECRETS      "secrets"
 
+
+
+

NM_SETTING_VPN_TIMEOUT

+
#define NM_SETTING_VPN_TIMEOUT      "timeout"
+
+

Property Details

@@ -816,6 +865,19 @@ plugin.


+

The “timeout” property

+
  “timeout”                  guint
+

Timeout for the VPN service to establish the connection. Some services +may take quite a long time to connect. +Value of 0 means a default timeout, which is 60 seconds (unless overriden +by vpn.timeout in configuration file). Values greater than zero mean +timeout in seconds.

+

Flags: Read / Write

+

Default value: 0

+

Since: 1.2

+
+
+

The “user-name” property

  “user-name”                gchar *

If the VPN connection requires a user name for authentication, that name diff --git a/docs/libnm/html/NMSettingVxlan.html b/docs/libnm/html/NMSettingVxlan.html new file mode 100644 index 00000000..5e5d0c60 --- /dev/null +++ b/docs/libnm/html/NMSettingVxlan.html @@ -0,0 +1,1067 @@ + + + + +NMSettingVxlan: libnm Reference Manual + + + + + + + + + + + + + + + + +

+
+
+ + +
+

NMSettingVxlan

+

NMSettingVxlan — Describes connection properties for VXLAN interfaces

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+NMSetting * + +nm_setting_vxlan_new () +
const char * + +nm_setting_vxlan_get_parent () +
+guint + +nm_setting_vxlan_get_id () +
const char * + +nm_setting_vxlan_get_local () +
const char * + +nm_setting_vxlan_get_remote () +
+guint + +nm_setting_vxlan_get_source_port_min () +
+guint + +nm_setting_vxlan_get_source_port_max () +
+guint + +nm_setting_vxlan_get_destination_port () +
+guint + +nm_setting_vxlan_get_tos () +
+guint + +nm_setting_vxlan_get_ttl () +
+guint + +nm_setting_vxlan_get_ageing () +
+guint + +nm_setting_vxlan_get_limit () +
+gboolean + +nm_setting_vxlan_get_proxy () +
+gboolean + +nm_setting_vxlan_get_learning () +
+gboolean + +nm_setting_vxlan_get_rsc () +
+gboolean + +nm_setting_vxlan_get_l2_miss () +
+gboolean + +nm_setting_vxlan_get_l3_miss () +
+
+
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
guintageingRead / Write / Construct
guintdestination-portRead / Write / Construct
guintidRead / Write / Construct
gbooleanl2-missRead / Write / Construct
gbooleanl3-missRead / Write / Construct
gbooleanlearningRead / Write / Construct
guintlimitRead / Write / Construct
+gchar *localRead / Write / Construct
+gchar *parentRead / Write / Construct
gbooleanproxyRead / Write / Construct
+gchar *remoteRead / Write / Construct
gbooleanrscRead / Write / Construct
guintsource-port-maxRead / Write / Construct
guintsource-port-minRead / Write / Construct
guinttosRead / Write / Construct
guintttlRead / Write / Construct
+
+
+

Types and Values

+ +
+
+

Object Hierarchy

+
    GObject
+    ╰── NMSetting
+        ╰── NMSettingVxlan
+
+
+
+

Description

+

The NMSettingVxlan object is a NMSetting subclass that describes properties +necessary for connection to VXLAN interfaces.

+
+
+

Functions

+
+

nm_setting_vxlan_new ()

+
NMSetting *
+nm_setting_vxlan_new (void);
+

Creates a new NMSettingVxlan object with default values.

+
+

Returns

+

the new empty NMSettingVxlan object.

+

[transfer full]

+
+

Since: 1.2

+
+
+
+

nm_setting_vxlan_get_parent ()

+
const char *
+nm_setting_vxlan_get_parent (NMSettingVxlan *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingVxlan

 
+
+
+

Returns

+

the “parent” property of the setting

+
+

Since: 1.2

+
+
+
+

nm_setting_vxlan_get_id ()

+
guint
+nm_setting_vxlan_get_id (NMSettingVxlan *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingVxlan

 
+
+
+

Returns

+

the “id” property of the setting

+
+

Since: 1.2

+
+
+
+

nm_setting_vxlan_get_local ()

+
const char *
+nm_setting_vxlan_get_local (NMSettingVxlan *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingVxlan

 
+
+
+

Returns

+

the “local” property of the setting

+
+

Since: 1.2

+
+
+
+

nm_setting_vxlan_get_remote ()

+
const char *
+nm_setting_vxlan_get_remote (NMSettingVxlan *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingVxlan

 
+
+
+

Returns

+

the “remote” property of the setting

+
+

Since: 1.2

+
+
+
+

nm_setting_vxlan_get_source_port_min ()

+
guint
+nm_setting_vxlan_get_source_port_min (NMSettingVxlan *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingVxlan

 
+
+
+

Returns

+

the “source-port-min” property of the setting

+
+

Since: 1.2

+
+
+
+

nm_setting_vxlan_get_source_port_max ()

+
guint
+nm_setting_vxlan_get_source_port_max (NMSettingVxlan *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingVxlan

 
+
+
+

Returns

+

the “source-port-max” property of the setting

+
+

Since: 1.2

+
+
+
+

nm_setting_vxlan_get_destination_port ()

+
guint
+nm_setting_vxlan_get_destination_port (NMSettingVxlan *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingVxlan

 
+
+
+

Returns

+

the “destination-port” property of the setting

+
+

Since: 1.2

+
+
+
+

nm_setting_vxlan_get_tos ()

+
guint
+nm_setting_vxlan_get_tos (NMSettingVxlan *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingVxlan

 
+
+
+

Returns

+

the “tos” property of the setting

+
+

Since: 1.2

+
+
+
+

nm_setting_vxlan_get_ttl ()

+
guint
+nm_setting_vxlan_get_ttl (NMSettingVxlan *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingVxlan

 
+
+
+

Returns

+

the “ttl” property of the setting

+
+

Since: 1.2

+
+
+
+

nm_setting_vxlan_get_ageing ()

+
guint
+nm_setting_vxlan_get_ageing (NMSettingVxlan *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingVxlan

 
+
+
+

Returns

+

the “ageing” property of the setting

+
+

Since: 1.2

+
+
+
+

nm_setting_vxlan_get_limit ()

+
guint
+nm_setting_vxlan_get_limit (NMSettingVxlan *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingVxlan

 
+
+
+

Returns

+

the “limit” property of the setting

+
+

Since: 1.2

+
+
+
+

nm_setting_vxlan_get_proxy ()

+
gboolean
+nm_setting_vxlan_get_proxy (NMSettingVxlan *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingVxlan

 
+
+
+

Returns

+

the “proxy” property of the setting

+
+

Since: 1.2

+
+
+
+

nm_setting_vxlan_get_learning ()

+
gboolean
+nm_setting_vxlan_get_learning (NMSettingVxlan *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingVxlan

 
+
+
+

Returns

+

the “learning” property of the setting

+
+

Since: 1.2

+
+
+
+

nm_setting_vxlan_get_rsc ()

+
gboolean
+nm_setting_vxlan_get_rsc (NMSettingVxlan *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingVxlan

 
+
+
+

Returns

+

the “rsc” property of the setting

+
+

Since: 1.2

+
+
+
+

nm_setting_vxlan_get_l2_miss ()

+
gboolean
+nm_setting_vxlan_get_l2_miss (NMSettingVxlan *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingVxlan

 
+
+
+

Returns

+

the “l2_miss” property of the setting

+
+

Since: 1.2

+
+
+
+

nm_setting_vxlan_get_l3_miss ()

+
gboolean
+nm_setting_vxlan_get_l3_miss (NMSettingVxlan *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingVxlan

 
+
+
+

Returns

+

the “l3_miss” property of the setting

+
+

Since: 1.2

+
+
+
+

Types and Values

+
+

NM_SETTING_VXLAN_SETTING_NAME

+
#define NM_SETTING_VXLAN_SETTING_NAME       "vxlan"
+
+
+
+
+

NM_SETTING_VXLAN_PARENT

+
#define NM_SETTING_VXLAN_PARENT             "parent"
+
+
+
+
+

NM_SETTING_VXLAN_ID

+
#define NM_SETTING_VXLAN_ID                 "id"
+
+
+
+
+

NM_SETTING_VXLAN_LOCAL

+
#define NM_SETTING_VXLAN_LOCAL              "local"
+
+
+
+
+

NM_SETTING_VXLAN_REMOTE

+
#define NM_SETTING_VXLAN_REMOTE             "remote"
+
+
+
+
+

NM_SETTING_VXLAN_SOURCE_PORT_MIN

+
#define NM_SETTING_VXLAN_SOURCE_PORT_MIN    "source-port-min"
+
+
+
+
+

NM_SETTING_VXLAN_SOURCE_PORT_MAX

+
#define NM_SETTING_VXLAN_SOURCE_PORT_MAX    "source-port-max"
+
+
+
+
+

NM_SETTING_VXLAN_DESTINATION_PORT

+
#define NM_SETTING_VXLAN_DESTINATION_PORT   "destination-port"
+
+
+
+
+

NM_SETTING_VXLAN_TOS

+
#define NM_SETTING_VXLAN_TOS                "tos"
+
+
+
+
+

NM_SETTING_VXLAN_TTL

+
#define NM_SETTING_VXLAN_TTL                "ttl"
+
+
+
+
+

NM_SETTING_VXLAN_AGEING

+
#define NM_SETTING_VXLAN_AGEING             "ageing"
+
+
+
+
+

NM_SETTING_VXLAN_LIMIT

+
#define NM_SETTING_VXLAN_LIMIT              "limit"
+
+
+
+
+

NM_SETTING_VXLAN_PROXY

+
#define NM_SETTING_VXLAN_PROXY              "proxy"
+
+
+
+
+

NM_SETTING_VXLAN_LEARNING

+
#define NM_SETTING_VXLAN_LEARNING           "learning"
+
+
+
+
+

NM_SETTING_VXLAN_RSC

+
#define NM_SETTING_VXLAN_RSC                "rsc"
+
+
+
+
+

NM_SETTING_VXLAN_L2_MISS

+
#define NM_SETTING_VXLAN_L2_MISS            "l2-miss"
+
+
+
+
+

NM_SETTING_VXLAN_L3_MISS

+
#define NM_SETTING_VXLAN_L3_MISS            "l3-miss"
+
+
+
+
+

Property Details

+
+

The “ageing” property

+
  “ageing”                   guint
+

Specifies the lifetime in seconds of FDB entries learnt by the kernel.

+

Flags: Read / Write / Construct

+

Allowed values: <= G_MAXINT

+

Default value: 300

+

Since: 1.2

+
+
+
+

The “destination-port” property

+
  “destination-port”         guint
+

Specifies the UDP destination port to communicate to the remote VXLAN +tunnel endpoint.

+

Flags: Read / Write / Construct

+

Allowed values: <= 65535

+

Default value: 8472

+

Since: 1.2

+
+
+
+

The “id” property

+
  “id”                       guint
+

Specifies the VXLAN Network Identifer (or VXLAN Segment Identifier) to +use.

+

Flags: Read / Write / Construct

+

Allowed values: <= 16777215

+

Default value: 0

+

Since: 1.2

+
+
+
+

The “l2-miss” property

+
  “l2-miss”                  gboolean
+

Specifies whether netlink LL ADDR miss notifications are generated.

+

Flags: Read / Write / Construct

+

Default value: FALSE

+

Since: 1.2

+
+
+
+

The “l3-miss” property

+
  “l3-miss”                  gboolean
+

Specifies whether netlink IP ADDR miss notifications are generated.

+

Flags: Read / Write / Construct

+

Default value: FALSE

+

Since: 1.2

+
+
+
+

The “learning” property

+
  “learning”                 gboolean
+

Specifies whether unknown source link layer addresses and IP addresses +are entered into the VXLAN device forwarding database.

+

Flags: Read / Write / Construct

+

Default value: TRUE

+

Since: 1.2

+
+
+
+

The “limit” property

+
  “limit”                    guint
+

Specifies the maximum number of FDB entries. A value of zero means that +the kernel will store unlimited entries.

+

Flags: Read / Write / Construct

+

Allowed values: <= G_MAXINT

+

Default value: 0

+

Since: 1.2

+
+
+
+

The “local” property

+
  “local”                    gchar *
+

If given, specifies the source IP address to use in outgoing packets.

+

Flags: Read / Write / Construct

+

Default value: NULL

+

Since: 1.2

+
+
+
+

The “parent” property

+
  “parent”                   gchar *
+

If given, specifies the parent interface name or parent connection UUID.

+

Flags: Read / Write / Construct

+

Default value: NULL

+

Since: 1.2

+
+
+
+

The “proxy” property

+
  “proxy”                    gboolean
+

Specifies whether ARP proxy is turned on.

+

Flags: Read / Write / Construct

+

Default value: FALSE

+

Since: 1.2

+
+
+
+

The “remote” property

+
  “remote”                   gchar *
+

Specifies the unicast destination IP address to use in outgoing packets +when the destination link layer address is not known in the VXLAN device +forwarding database, or the multicast IP address to join.

+

Flags: Read / Write / Construct

+

Default value: NULL

+

Since: 1.2

+
+
+
+

The “rsc” property

+
  “rsc”                      gboolean
+

Specifies whether route short circuit is turned on.

+

Flags: Read / Write / Construct

+

Default value: FALSE

+

Since: 1.2

+
+
+
+

The “source-port-max” property

+
  “source-port-max”          guint
+

Specifies the maximum UDP source port to communicate to the remote VXLAN +tunnel endpoint.

+

Flags: Read / Write / Construct

+

Allowed values: <= 65535

+

Default value: 0

+

Since: 1.2

+
+
+
+

The “source-port-min” property

+
  “source-port-min”          guint
+

Specifies the minimum UDP source port to communicate to the remote VXLAN +tunnel endpoint.

+

Flags: Read / Write / Construct

+

Allowed values: <= 65535

+

Default value: 0

+

Since: 1.2

+
+
+
+

The “tos” property

+
  “tos”                      guint
+

Specifies the TOS value to use in outgoing packets.

+

Flags: Read / Write / Construct

+

Allowed values: <= 255

+

Default value: 0

+

Since: 1.2

+
+
+
+

The “ttl” property

+
  “ttl”                      guint
+

Specifies the time-to-live value to use in outgoing packets.

+

Flags: Read / Write / Construct

+

Allowed values: <= 255

+

Default value: 0

+

Since: 1.2

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm/html/NMSettingWimax.html b/docs/libnm/html/NMSettingWimax.html index b4843dd7..d1ea1056 100644 --- a/docs/libnm/html/NMSettingWimax.html +++ b/docs/libnm/html/NMSettingWimax.html @@ -6,7 +6,7 @@ - + @@ -21,7 +21,7 @@ Home Up -Prev +Prev Next
@@ -124,6 +124,9 @@

Description

The NMSettingWimax object is a NMSetting subclass that describes properties necessary for connection to 802.16e Mobile WiMAX networks.

+

NetworkManager no longer supports WiMAX; while this API remains available for +backward-compatibility reasons, it serves no real purpose, since WiMAX +connections cannot be activated.

Functions

@@ -131,9 +134,13 @@ necessary for connection to 802.16e Mobile WiMAX networks.

nm_setting_wimax_new ()

NMSetting *
 nm_setting_wimax_new (void);
+
+

nm_setting_wimax_new has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Creates a new NMSettingWimax object with default values.

-

Returns

+

Returns

the new empty NMSettingWimax object

@@ -142,10 +149,14 @@ nm_setting_wimax_new (void

nm_setting_wimax_get_network_name ()

const char *
 nm_setting_wimax_get_network_name (NMSettingWimax *setting);
+
+

nm_setting_wimax_get_network_name has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Returns the WiMAX NSP name (ex "Sprint" or "CLEAR") which identifies the specific WiMAX network this setting describes a connection to.

-

Parameters

+

Parameters

@@ -160,7 +171,7 @@ specific WiMAX network this setting describes a connection to.

-

Returns

+

Returns

the WiMAX NSP name

@@ -169,10 +180,14 @@ specific WiMAX network this setting describes a connection to.

nm_setting_wimax_get_mac_address ()

const char *
 nm_setting_wimax_get_mac_address (NMSettingWimax *setting);
+
+

nm_setting_wimax_get_mac_address has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Returns the MAC address of a WiMAX device which this connection is locked to.

-

Parameters

+

Parameters

@@ -187,7 +202,7 @@ to.

-

Returns

+

Returns

the MAC address

@@ -220,6 +235,10 @@ to.

If specified, this connection will only apply to the WiMAX device whose MAC address matches. This property does not change the MAC address of the device (known as MAC spoofing).

+
+

NMSettingWimax:mac-address has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Flags: Read / Write

Default value: NULL

@@ -229,6 +248,10 @@ device (known as MAC spoofing).

  “network-name”             gchar *

Network Service Provider (NSP) name of the WiMAX network this connection should use.

+
+

NMSettingWimax:network-name has been deprecated since version 1.2 and should not be used in newly-written code.

+

WiMAX is no longer supported.

+

Flags: Read / Write

Default value: NULL

diff --git a/docs/libnm/html/NMSettingWired.html b/docs/libnm/html/NMSettingWired.html index 1bc895c4..ea814585 100644 --- a/docs/libnm/html/NMSettingWired.html +++ b/docs/libnm/html/NMSettingWired.html @@ -390,7 +390,7 @@

Object Hierarchy

-
    GFlags
+
    GFlags
     ╰── NMSettingWiredWakeOnLan
     GObject
     ╰── NMSetting
@@ -410,7 +410,7 @@ necessary for connection to Ethernet networks.

nm_setting_wired_new (void);

Creates a new NMSettingWired object with default values.

-

Returns

+

Returns

the new empty NMSettingWired object.

[transfer full]

@@ -421,7 +421,7 @@ nm_setting_wired_new (void
const char *
 nm_setting_wired_get_port (NMSettingWired *setting);
-

Parameters

+

Parameters

@@ -436,7 +436,7 @@ nm_setting_wired_get_port ( -

Returns

+

Returns

the “port” property of the setting

@@ -446,7 +446,7 @@ nm_setting_wired_get_port (guint32 nm_setting_wired_get_speed (NMSettingWired *setting);
-

Parameters

+

Parameters

@@ -461,7 +461,7 @@ nm_setting_wired_get_speed ( -

Returns

+

Returns

the “speed” property of the setting

@@ -471,7 +471,7 @@ nm_setting_wired_get_speed (const char * nm_setting_wired_get_duplex (NMSettingWired *setting);
-

Parameters

+

Parameters

@@ -486,7 +486,7 @@ nm_setting_wired_get_duplex ( -

Returns

+

Returns

the “duplex” property of the setting

@@ -496,7 +496,7 @@ nm_setting_wired_get_duplex (gboolean nm_setting_wired_get_auto_negotiate (NMSettingWired *setting);
-

Parameters

+

Parameters

@@ -511,7 +511,7 @@ nm_setting_wired_get_auto_negotiate (
-

Returns

+

Returns

the “auto-negotiate” property of the setting

@@ -521,7 +521,7 @@ nm_setting_wired_get_auto_negotiate (const char * nm_setting_wired_get_mac_address (NMSettingWired *setting);
-

Parameters

+

Parameters

@@ -536,7 +536,7 @@ nm_setting_wired_get_mac_address (
-

Returns

+

Returns

the “mac-address” property of the setting

@@ -547,7 +547,7 @@ nm_setting_wired_get_mac_address (NMSettingWired *setting);
-

Parameters

+

Parameters

@@ -562,7 +562,7 @@ nm_setting_wired_get_cloned_mac_address
-

Returns

+

Returns

the “cloned-mac-address” property of the setting

@@ -573,7 +573,7 @@ nm_setting_wired_get_cloned_mac_address nm_setting_wired_get_mac_address_blacklist (NMSettingWired *setting);
-

Parameters

+

Parameters

@@ -588,7 +588,7 @@ nm_setting_wired_get_mac_address_blacklist
-

Returns

+

Returns

the “mac-address-blacklist” property of the setting

@@ -599,7 +599,7 @@ nm_setting_wired_get_mac_address_blacklist nm_setting_wired_get_num_mac_blacklist_items (NMSettingWired *setting);
-

Parameters

+

Parameters

@@ -614,7 +614,7 @@ nm_setting_wired_get_num_mac_blacklist_items
-

Returns

+

Returns

the number of blacklisted MAC addresses

@@ -626,7 +626,7 @@ nm_setting_wired_get_mac_blacklist_item (NMSettingWired *setting, guint32 idx);
-

Parameters

+

Parameters

@@ -648,7 +648,7 @@ nm_setting_wired_get_mac_blacklist_item
-

Returns

+

Returns

the blacklisted MAC address string (hex-digits-and-colons notation) at index idx

@@ -663,7 +663,7 @@ nm_setting_wired_add_mac_blacklist_item const char *mac);

Adds a new MAC address to the “mac-address-blacklist” property.

-

Parameters

+

Parameters

@@ -685,7 +685,7 @@ nm_setting_wired_add_mac_blacklist_item
-

Returns

+

Returns

TRUE if the MAC address was added; FALSE if the MAC address is invalid or was already present

@@ -700,7 +700,7 @@ nm_setting_wired_remove_mac_blacklist_item

Removes the MAC address at index idx from the blacklist.

-

Parameters

+

Parameters

@@ -732,7 +732,7 @@ nm_setting_wired_remove_mac_blacklist_item_by_value

Removes the MAC address mac from the blacklist.

-

Parameters

+

Parameters

@@ -755,7 +755,7 @@ the blacklist

-

Returns

+

Returns

TRUE if the MAC address was found and removed; FALSE if it was not.

@@ -767,7 +767,7 @@ nm_setting_wired_clear_mac_blacklist_items (NMSettingWired *setting);

Removes all blacklisted MAC addresses.

-

Parameters

+

Parameters

@@ -788,7 +788,7 @@ nm_setting_wired_clear_mac_blacklist_items
guint32
 nm_setting_wired_get_mtu (NMSettingWired *setting);
-

Parameters

+

Parameters

@@ -803,7 +803,7 @@ nm_setting_wired_get_mtu ( -

Returns

+

Returns

the “mtu” property of the setting

@@ -816,7 +816,7 @@ nm_setting_wired_get_s390_subchannels ( -

Parameters

+

Parameters

@@ -831,7 +831,7 @@ conjunction with that device.

-

Returns

+

Returns

array of strings, each specifying one subchannel the s390 device uses to communicate to the host.

[transfer none][element-type utf8]

@@ -845,7 +845,7 @@ nm_setting_wired_get_s390_nettype (Returns the s390 device type this connection should apply to. Will be one of 'qeth', 'lcs', or 'ctc'.

-

Parameters

+

Parameters

@@ -860,7 +860,7 @@ of 'qeth', 'lcs', or 'ctc'.

-

Returns

+

Returns

the s390 device type

@@ -873,7 +873,7 @@ nm_setting_wired_get_num_s390_options (nm_setting_wired_get_s390_option().

-

Parameters

+

Parameters

@@ -888,7 +888,7 @@ option individually using -

Returns

+

Returns

the number of s390-specific device options

@@ -906,7 +906,7 @@ are *not* guaranteed to be static across modifications to options done by and should not be used to refer to options except for short periods of time such as during option iteration.

-

Parameters

+

Parameters

@@ -942,7 +942,7 @@ modified.

-

Returns

+

Returns

TRUE on success if the index was valid and an option was found, FALSE if the index was invalid (ie, greater than the number of options currently held by the setting)

@@ -959,7 +959,7 @@ nm_setting_wired_get_s390_option_by_key key , if it exists.

-

Parameters

+

Parameters

@@ -981,7 +981,7 @@ nm_setting_wired_get_s390_option_by_key
-

Returns

+

Returns

the value, or NULL if the key/value pair was never added to the setting; the value is owned by the setting and must not be modified

@@ -998,7 +998,7 @@ of allowed options. Key names may contain only alphanumeric characters (ie [a-zA-Z0-9]). Adding a new key replaces any existing key/value pair that may already exist.

-

Parameters

+

Parameters

@@ -1025,7 +1025,7 @@ may already exist.

-

Returns

+

Returns

TRUE if the option was valid and was added to the internal option list, FALSE if it was not.

@@ -1040,7 +1040,7 @@ nm_setting_wired_remove_s390_option (
-

Parameters

+

Parameters

@@ -1062,7 +1062,7 @@ list.

-

Returns

+

Returns

TRUE if the option was found and removed from the internal option list, FALSE if it was not.

@@ -1075,7 +1075,7 @@ nm_setting_wired_get_valid_s390_options (NMSettingWired *setting);

Returns a list of valid s390 options.

-

Parameters

+

Parameters

@@ -1090,7 +1090,7 @@ nm_setting_wired_get_valid_s390_options
-

Returns

+

Returns

a NULL-terminated array of strings of valid s390 options.

[transfer none]

@@ -1102,7 +1102,7 @@ nm_setting_wired_get_valid_s390_options nm_setting_wired_get_wake_on_lan (NMSettingWired *setting);

Returns the Wake-on-LAN options enabled for the connection

-

Parameters

+

Parameters

@@ -1117,10 +1117,10 @@ nm_setting_wired_get_wake_on_lan (
-

Returns

+

Returns

the Wake-on-LAN options

-

Since: 1.0.6

+

Since: 1.2


@@ -1131,7 +1131,7 @@ nm_setting_wired_get_wake_on_lan_password

Returns the Wake-on-LAN password. This only applies to NM_SETTING_WIRED_WAKE_ON_LAN_MAGIC.

-

Parameters

+

Parameters

@@ -1146,10 +1146,10 @@ nm_setting_wired_get_wake_on_lan_password
-

Returns

+

Returns

the Wake-on-LAN setting password, or NULL if there is no password.

-

Since: 1.0.6

+

Since: 1.2

@@ -1165,7 +1165,7 @@ nm_setting_wired_get_wake_on_lan_password

Options for “wake-on-lan”. Note that not all options are supported by all devices.

-

Members

+

Members

@@ -1263,7 +1263,7 @@ are supported by all devices.

-

Since: 1.0.6

+

Since: 1.2


@@ -1469,7 +1469,7 @@ May be any combination of Since: 1.0.6

+

Since: 1.2


@@ -1480,7 +1480,7 @@ Wake-on-LAN, represented as an Ethernet MAC address. If N no password will be required.

Flags: Read / Write

Default value: NULL

-

Since: 1.0.6

+

Since: 1.2

diff --git a/docs/libnm/html/NMSettingWireless.html b/docs/libnm/html/NMSettingWireless.html index f4cd0050..8a8715e7 100644 --- a/docs/libnm/html/NMSettingWireless.html +++ b/docs/libnm/html/NMSettingWireless.html @@ -188,6 +188,22 @@ +guint32 + + +
nm_setting_wireless_get_powersave () + + + + +NMSettingMacRandomization + + +nm_setting_wireless_get_mac_address_randomization () + + + + gboolean @@ -269,6 +285,11 @@ Read / Write +guint +mac-address-randomization +Read / Write + + gchar * mode @@ -281,6 +302,11 @@ guint +powersave +Read / Write + + +guint rate Read / Write / Construct @@ -369,6 +395,14 @@ #define +NM_SETTING_WIRELESS_POWERSAVE + + +#define +NM_SETTING_WIRELESS_MAC_ADDRESS_RANDOMIZATION + + +#define NM_SETTING_WIRELESS_MODE_ADHOC @@ -402,7 +436,7 @@ necessary for connection to 802.11 Wi-Fi networks.

nm_setting_wireless_new (void);

Creates a new NMSettingWireless object with default values.

-

Returns

+

Returns

the new empty NMSettingWireless object.

[transfer full]

@@ -413,7 +447,7 @@ nm_setting_wireless_new (voidGBytes * nm_setting_wireless_get_ssid (NMSettingWireless *setting);
-

Parameters

+

Parameters

@@ -428,7 +462,7 @@ nm_setting_wireless_get_ssid ( -

Returns

+

Returns

the “ssid” property of the setting.

[transfer none]

@@ -439,7 +473,7 @@ nm_setting_wireless_get_ssid (const char * nm_setting_wireless_get_mode (NMSettingWireless *setting);
-

Parameters

+

Parameters

@@ -454,7 +488,7 @@ nm_setting_wireless_get_mode ( -

Returns

+

Returns

the “mode” property of the setting

@@ -464,7 +498,7 @@ nm_setting_wireless_get_mode (const char * nm_setting_wireless_get_band (NMSettingWireless *setting);
-

Parameters

+

Parameters

@@ -479,7 +513,7 @@ nm_setting_wireless_get_band ( -

Returns

+

Returns

the “band” property of the setting

@@ -489,7 +523,7 @@ nm_setting_wireless_get_band (guint32 nm_setting_wireless_get_channel (NMSettingWireless *setting);
-

Parameters

+

Parameters

@@ -504,7 +538,7 @@ nm_setting_wireless_get_channel (
-

Returns

+

Returns

the “channel” property of the setting

@@ -514,7 +548,7 @@ nm_setting_wireless_get_channel (const char * nm_setting_wireless_get_bssid (NMSettingWireless *setting);
-

Parameters

+

Parameters

@@ -529,7 +563,7 @@ nm_setting_wireless_get_bssid (
-

Returns

+

Returns

the “bssid” property of the setting

@@ -539,7 +573,7 @@ nm_setting_wireless_get_bssid (guint32 nm_setting_wireless_get_rate (NMSettingWireless *setting);
-

Parameters

+

Parameters

@@ -554,7 +588,7 @@ nm_setting_wireless_get_rate ( -

Returns

+

Returns

the “rate” property of the setting

@@ -564,7 +598,7 @@ nm_setting_wireless_get_rate (guint32 nm_setting_wireless_get_tx_power (NMSettingWireless *setting);
-

Parameters

+

Parameters

@@ -579,7 +613,7 @@ nm_setting_wireless_get_tx_power (
-

Returns

+

Returns

the “tx-power” property of the setting

@@ -589,7 +623,7 @@ nm_setting_wireless_get_tx_power (const char * nm_setting_wireless_get_mac_address (NMSettingWireless *setting);
-

Parameters

+

Parameters

@@ -604,7 +638,7 @@ nm_setting_wireless_get_mac_address (
-

Returns

+

Returns

the “mac-address” property of the setting

@@ -615,7 +649,7 @@ nm_setting_wireless_get_mac_address (NMSettingWireless *setting);
-

Parameters

+

Parameters

@@ -630,7 +664,7 @@ nm_setting_wireless_get_cloned_mac_address
-

Returns

+

Returns

the “cloned-mac-address” property of the setting

@@ -641,7 +675,7 @@ nm_setting_wireless_get_cloned_mac_address nm_setting_wireless_get_mac_address_blacklist (NMSettingWireless *setting);
-

Parameters

+

Parameters

@@ -656,7 +690,7 @@ nm_setting_wireless_get_mac_address_blacklist
-

Returns

+

Returns

the “mac-address-blacklist” property of the setting

@@ -667,7 +701,7 @@ nm_setting_wireless_get_mac_address_blacklist nm_setting_wireless_get_num_mac_blacklist_items (NMSettingWireless *setting);
-

Parameters

+

Parameters

@@ -682,7 +716,7 @@ nm_setting_wireless_get_num_mac_blacklist_items
-

Returns

+

Returns

the number of blacklisted MAC addresses

@@ -694,7 +728,7 @@ nm_setting_wireless_get_mac_blacklist_item (NMSettingWireless *setting, guint32 idx);
-

Parameters

+

Parameters

@@ -716,7 +750,7 @@ nm_setting_wireless_get_mac_blacklist_item
-

Returns

+

Returns

the blacklisted MAC address string (hex-digits-and-colons notation) at index idx

@@ -731,7 +765,7 @@ nm_setting_wireless_add_mac_blacklist_item const char *mac);

Adds a new MAC address to the “mac-address-blacklist” property.

-

Parameters

+

Parameters

@@ -753,7 +787,7 @@ nm_setting_wireless_add_mac_blacklist_item
-

Returns

+

Returns

TRUE if the MAC address was added; FALSE if the MAC address is invalid or was already present

@@ -768,7 +802,7 @@ nm_setting_wireless_remove_mac_blacklist_item

Removes the MAC address at index idx from the blacklist.

-

Parameters

+

Parameters

@@ -800,7 +834,7 @@ nm_setting_wireless_remove_mac_blacklist_item_by_value

Removes the MAC address mac from the blacklist.

-

Parameters

+

Parameters

@@ -823,7 +857,7 @@ the blacklist

-

Returns

+

Returns

TRUE if the MAC address was found and removed; FALSE if it was not.

@@ -835,7 +869,7 @@ nm_setting_wireless_clear_mac_blacklist_items (NMSettingWireless *setting);

Removes all blacklisted MAC addresses.

-

Parameters

+

Parameters

@@ -856,7 +890,7 @@ nm_setting_wireless_clear_mac_blacklist_items
guint32
 nm_setting_wireless_get_mtu (NMSettingWireless *setting);
-

Parameters

+

Parameters

@@ -871,7 +905,7 @@ nm_setting_wireless_get_mtu ( -

Returns

+

Returns

the “mtu” property of the setting

@@ -881,7 +915,7 @@ nm_setting_wireless_get_mtu (gboolean nm_setting_wireless_get_hidden (NMSettingWireless *setting);
-

Parameters

+

Parameters

@@ -896,12 +930,66 @@ nm_setting_wireless_get_hidden (
-

Returns

+

Returns

the “hidden” property of the setting


+

nm_setting_wireless_get_powersave ()

+
guint32
+nm_setting_wireless_get_powersave (NMSettingWireless *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingWireless

 
+
+
+

Returns

+

the “powersave” property of the setting

+
+

Since: 1.2

+ +
+
+

nm_setting_wireless_get_mac_address_randomization ()

+
NMSettingMacRandomization
+nm_setting_wireless_get_mac_address_randomization
+                               (NMSettingWireless *setting);
+
+

Parameters

+
+++++ + + + + + +

setting

the NMSettingWireless

 
+
+
+

Returns

+

the “mac-address-randomization” property of the +setting

+
+

Since: 1.2

+
+
+

nm_setting_wireless_add_seen_bssid ()

gboolean
 nm_setting_wireless_add_seen_bssid (NMSettingWireless *setting,
@@ -911,7 +999,7 @@ NetworkManager now tracks previously seen BSSIDs internally so this function
 no longer has much use. Actually, changes you make using this function will
 not be preserved.

-

Parameters

+

Parameters

@@ -933,7 +1021,7 @@ not be preserved.

-

Returns

+

Returns

TRUE if bssid was already known, FALSE if not

@@ -945,7 +1033,7 @@ was already known, FALSE if not

nm_setting_wireless_get_num_seen_bssids (NMSettingWireless *setting);
-

Parameters

+

Parameters

@@ -960,7 +1048,7 @@ nm_setting_wireless_get_num_seen_bssids
-

Returns

+

Returns

the number of BSSIDs in the previously seen BSSID list

@@ -971,7 +1059,7 @@ nm_setting_wireless_get_num_seen_bssids nm_setting_wireless_get_seen_bssid (NMSettingWireless *setting, guint32 i);
-

Parameters

+

Parameters

@@ -993,7 +1081,7 @@ nm_setting_wireless_get_seen_bssid (
-

Returns

+

Returns

the BSSID at index i

@@ -1016,7 +1104,7 @@ and mode. Useful for clients that wish to filter a set of connections against a set of access points and determine which connections are compatible with which access points.

-

Parameters

+

Parameters

@@ -1060,7 +1148,7 @@ capabilities

-

Returns

+

Returns

TRUE if the given settings are compatible with the access point's security flags and mode, FALSE if they are not.

@@ -1153,6 +1241,18 @@ security flags and mode, FALSE if they are not.


+

NM_SETTING_WIRELESS_POWERSAVE

+
#define NM_SETTING_WIRELESS_POWERSAVE   "powersave"
+
+
+
+
+

NM_SETTING_WIRELESS_MAC_ADDRESS_RANDOMIZATION

+
#define NM_SETTING_WIRELESS_MAC_ADDRESS_RANDOMIZATION   "mac-address-randomization"
+
+
+
+

NM_SETTING_WIRELESS_MODE_ADHOC

#define NM_SETTING_WIRELESS_MODE_ADHOC  "adhoc"
 
@@ -1253,6 +1353,19 @@ standard hex-digits-and-colons notation (eg "00:11:22:33:44:55").


+

The “mac-address-randomization” property

+
  “mac-address-randomization” guint
+

One of NM_SETTING_MAC_RANDOMIZATION_DEFAULT (never randomize unless +the user has set a global default to randomize and the supplicant +supports randomization), NM_SETTING_MAC_RANDOMIZATION_NEVER (never +randomize the MAC address), or NM_SETTING_MAC_RANDOMIZATION_ALWAYS +(always randomize the MAC address).

+

Flags: Read / Write

+

Default value: 0

+

Since: 1.2

+
+
+

The “mode” property

  “mode”                     gchar *

Wi-Fi network mode; one of "infrastructure", "adhoc" or "ap". If blank, @@ -1271,6 +1384,18 @@ breaking larger packets up into multiple Ethernet frames.


+

The “powersave” property

+
  “powersave”                guint
+

If set to FALSE, Wi-Fi power saving behavior is disabled. If set to +TRUE, Wi-Fi power saving behavior is enabled. All other values are +reserved. Note that even though only boolean values are allowed, the +property type is an unsigned integer to allow for future expansion.

+

Flags: Read / Write

+

Default value: 0

+

Since: 1.2

+
+
+

The “rate” property

  “rate”                     guint

If non-zero, directs the device to only use the specified bitrate for diff --git a/docs/libnm/html/NMSettingWirelessSecurity.html b/docs/libnm/html/NMSettingWirelessSecurity.html index 1f4d125b..82446ce5 100644 --- a/docs/libnm/html/NMSettingWirelessSecurity.html +++ b/docs/libnm/html/NMSettingWirelessSecurity.html @@ -479,7 +479,7 @@ use WEP, LEAP, WPA or WPA2/RSN security

Object Hierarchy

-
    GEnum
+
    GEnum
     ╰── NMWepKeyType
     GObject
     ╰── NMSetting
@@ -509,7 +509,7 @@ of how Wi-Fi security works, you may want to get copies of the following books.<
 nm_setting_wireless_security_new (void);

Creates a new NMSettingWirelessSecurity object with default values.

-

Returns

+

Returns

the new empty NMSettingWirelessSecurity object.

[transfer full]

@@ -521,7 +521,7 @@ nm_setting_wireless_security_new (NMSettingWirelessSecurity *setting);
-

Parameters

+

Parameters

@@ -536,7 +536,7 @@ nm_setting_wireless_security_get_key_mgmt
-

Returns

+

Returns

the “key-mgmt” property of the setting

@@ -547,7 +547,7 @@ nm_setting_wireless_security_get_key_mgmt nm_setting_wireless_security_get_num_protos (NMSettingWirelessSecurity *setting);
-

Parameters

+

Parameters

@@ -562,7 +562,7 @@ nm_setting_wireless_security_get_num_protos
-

Returns

+

Returns

the number of security protocols this connection allows when connecting to secure Wi-Fi networks

@@ -575,7 +575,7 @@ nm_setting_wireless_security_get_proto (NMSettingWirelessSecurity *setting, guint32 i);
-

Parameters

+

Parameters

@@ -597,7 +597,7 @@ nm_setting_wireless_security_get_proto
-

Returns

+

Returns

the protocol at index i

@@ -616,7 +616,7 @@ protocol list contains only "wpa" but the access point for the SSID specified by this connection only supports WPA2/RSN, the connection cannot be used with the access point.

-

Parameters

+

Parameters

@@ -638,7 +638,7 @@ with the access point.

-

Returns

+

Returns

TRUE if the protocol was new and and was added to the allowed protocol list, or FALSE if it was already in the list

@@ -652,7 +652,7 @@ nm_setting_wireless_security_remove_proto guint32 i);

Removes a protocol from the allowed protocol list.

-

Parameters

+

Parameters

@@ -683,7 +683,7 @@ nm_setting_wireless_security_remove_proto_by_value const char *proto);

Removes a protocol from the allowed protocol list.

-

Parameters

+

Parameters

@@ -705,7 +705,7 @@ nm_setting_wireless_security_remove_proto_by_value
-

Returns

+

Returns

TRUE if the protocol was found and removed; FALSE it it was not.

@@ -718,7 +718,7 @@ nm_setting_wireless_security_clear_protos

Removes all protocols from the allowed list. If there are no protocols specified then all protocols are allowed.

-

Parameters

+

Parameters

@@ -740,7 +740,7 @@ specified then all protocols are allowed.

nm_setting_wireless_security_get_num_pairwise (NMSettingWirelessSecurity *setting);
-

Parameters

+

Parameters

@@ -755,7 +755,7 @@ nm_setting_wireless_security_get_num_pairwise
-

Returns

+

Returns

the number of pairwise encryption algorithms in the allowed list

@@ -769,7 +769,7 @@ nm_setting_wireless_security_get_pairwise

Returns the allowed pairwise encryption algorithm from allowed algorithm list.

-

Parameters

+

Parameters

@@ -791,7 +791,7 @@ list.

-

Returns

+

Returns

the pairwise encryption algorithm at index i

@@ -808,7 +808,7 @@ algorithms. If the list is not empty, then only access points that support one or more of the encryption algorithms in the list will be considered compatible with this connection.

-

Parameters

+

Parameters

@@ -830,7 +830,7 @@ compatible with this connection.

-

Returns

+

Returns

TRUE if the algorithm was added to the list, FALSE if it was already in the list

@@ -845,7 +845,7 @@ nm_setting_wireless_security_remove_pairwise

Removes an encryption algorithm from the allowed pairwise encryption algorithm list.

-

Parameters

+

Parameters

@@ -877,7 +877,7 @@ nm_setting_wireless_security_remove_pairwise_by_value

Removes an encryption algorithm from the allowed pairwise encryption algorithm list.

-

Parameters

+

Parameters

@@ -899,7 +899,7 @@ algorithm list.

-

Returns

+

Returns

TRUE if the encryption algorith was found and removed; FALSE it it was not.

@@ -912,7 +912,7 @@ nm_setting_wireless_security_clear_pairwise

Removes all algorithms from the allowed list. If there are no algorithms specified then all pairwise encryption algorithms are allowed.

-

Parameters

+

Parameters

@@ -934,7 +934,7 @@ specified then all pairwise encryption algorithms are allowed.

nm_setting_wireless_security_get_num_groups (NMSettingWirelessSecurity *setting);
-

Parameters

+

Parameters

@@ -949,7 +949,7 @@ nm_setting_wireless_security_get_num_groups
-

Returns

+

Returns

the number of groupwise encryption algorithms in the allowed list

@@ -963,7 +963,7 @@ nm_setting_wireless_security_get_group

Returns the allowed groupwise encryption algorithm from allowed algorithm list.

-

Parameters

+

Parameters

@@ -985,7 +985,7 @@ list.

-

Returns

+

Returns

the groupwise encryption algorithm at index i

@@ -1002,7 +1002,7 @@ algorithms. If the list is not empty, then only access points that support one or more of the encryption algorithms in the list will be considered compatible with this connection.

-

Parameters

+

Parameters

@@ -1025,7 +1025,7 @@ compatible with this connection.

-

Returns

+

Returns

TRUE if the algorithm was added to the list, FALSE if it was already in the list

@@ -1040,7 +1040,7 @@ nm_setting_wireless_security_remove_group

Removes an encryption algorithm from the allowed groupwise encryption algorithm list.

-

Parameters

+

Parameters

@@ -1072,7 +1072,7 @@ nm_setting_wireless_security_remove_group_by_value

Removes an encryption algorithm from the allowed groupwise encryption algorithm list.

-

Parameters

+

Parameters

@@ -1095,7 +1095,7 @@ algorithm list.

-

Returns

+

Returns

TRUE if the algorithm was found and removed; FALSE it it was not.

@@ -1108,7 +1108,7 @@ nm_setting_wireless_security_clear_groups

Removes all algorithms from the allowed list. If there are no algorithms specified then all groupwise encryption algorithms are allowed.

-

Parameters

+

Parameters

@@ -1129,7 +1129,7 @@ specified then all groupwise encryption algorithms are allowed.

const char *
 nm_setting_wireless_security_get_psk (NMSettingWirelessSecurity *setting);
-

Parameters

+

Parameters

@@ -1144,7 +1144,7 @@ nm_setting_wireless_security_get_psk ( -

Returns

+

Returns

the “psk” property of the setting

@@ -1155,7 +1155,7 @@ nm_setting_wireless_security_get_psk (NMSettingWirelessSecurity *setting);
-

Parameters

+

Parameters

@@ -1170,7 +1170,7 @@ nm_setting_wireless_security_get_psk_flags
-

Returns

+

Returns

the NMSettingSecretFlags pertaining to the “psk”

@@ -1182,7 +1182,7 @@ nm_setting_wireless_security_get_psk_flags nm_setting_wireless_security_get_leap_username (NMSettingWirelessSecurity *setting);
-

Parameters

+

Parameters

@@ -1197,7 +1197,7 @@ nm_setting_wireless_security_get_leap_username
-

Returns

+

Returns

the “leap-username” property of the setting

@@ -1208,7 +1208,7 @@ nm_setting_wireless_security_get_leap_username nm_setting_wireless_security_get_leap_password (NMSettingWirelessSecurity *setting);
-

Parameters

+

Parameters

@@ -1223,7 +1223,7 @@ nm_setting_wireless_security_get_leap_password
-

Returns

+

Returns

the “leap-password” property of the setting

@@ -1234,7 +1234,7 @@ nm_setting_wireless_security_get_leap_password nm_setting_wireless_security_get_leap_password_flags (NMSettingWirelessSecurity *setting);
-

Parameters

+

Parameters

@@ -1249,7 +1249,7 @@ nm_setting_wireless_security_get_leap_password_flags
-

Returns

+

Returns

the NMSettingSecretFlags pertaining to the “leap-password”

@@ -1262,7 +1262,7 @@ nm_setting_wireless_security_get_wep_key (NMSettingWirelessSecurity *setting, guint32 idx);
-

Parameters

+

Parameters

@@ -1284,7 +1284,7 @@ nm_setting_wireless_security_get_wep_key
-

Returns

+

Returns

the WEP key at the given index

@@ -1298,7 +1298,7 @@ nm_setting_wireless_security_set_wep_key const char *key);

Sets a WEP key in the given index.

-

Parameters

+

Parameters

@@ -1334,7 +1334,7 @@ property.

nm_setting_wireless_security_get_wep_tx_keyidx (NMSettingWirelessSecurity *setting);
-

Parameters

+

Parameters

@@ -1349,7 +1349,7 @@ nm_setting_wireless_security_get_wep_tx_keyidx
-

Returns

+

Returns

the “wep-tx-keyidx” property of the setting

@@ -1360,7 +1360,7 @@ nm_setting_wireless_security_get_wep_tx_keyidx nm_setting_wireless_security_get_auth_alg (NMSettingWirelessSecurity *setting);
-

Parameters

+

Parameters

@@ -1375,7 +1375,7 @@ nm_setting_wireless_security_get_auth_alg
-

Returns

+

Returns

the “auth-alg” property of the setting

@@ -1386,7 +1386,7 @@ nm_setting_wireless_security_get_auth_alg nm_setting_wireless_security_get_wep_key_flags (NMSettingWirelessSecurity *setting);
-

Parameters

+

Parameters

@@ -1401,7 +1401,7 @@ nm_setting_wireless_security_get_wep_key_flags
-

Returns

+

Returns

the NMSettingSecretFlags pertaining to the all WEP keys

@@ -1412,7 +1412,7 @@ nm_setting_wireless_security_get_wep_key_flags nm_setting_wireless_security_get_wep_key_type (NMSettingWirelessSecurity *setting);
-

Parameters

+

Parameters

@@ -1427,7 +1427,7 @@ nm_setting_wireless_security_get_wep_key_type
-

Returns

+

Returns

the “wep-key-type” property of the setting

@@ -1452,7 +1452,7 @@ ASCII keys are also valid WEP passphrases, but since passphrases and ASCII keys are hashed differently to determine the actual WEP key the type must be specified.

-

Members

+

Members

diff --git a/docs/libnm/html/NMVpnConnection.html b/docs/libnm/html/NMVpnConnection.html index de3a08b4..b8b766cf 100644 --- a/docs/libnm/html/NMVpnConnection.html +++ b/docs/libnm/html/NMVpnConnection.html @@ -136,7 +136,7 @@ nm_vpn_connection_get_vpn_state (NMVpnConnection *vpn);

Gets the current NMVpnConnection state.

-

Parameters

+

Parameters

@@ -151,7 +151,7 @@ nm_vpn_connection_get_vpn_state (
-

Returns

+

Returns

the VPN state of the active VPN connection.

@@ -162,7 +162,7 @@ nm_vpn_connection_get_vpn_state (NMVpnConnection *vpn);

Gets the VPN login banner of the active NMVpnConnection.

-

Parameters

+

Parameters

@@ -177,7 +177,7 @@ nm_vpn_connection_get_banner ( -

Returns

+

Returns

the VPN login banner of the VPN connection. This is the internal string used by the connection, and must not be modified.

diff --git a/docs/libnm/html/NMVpnEditor.html b/docs/libnm/html/NMVpnEditor.html deleted file mode 100644 index fe188bf4..00000000 --- a/docs/libnm/html/NMVpnEditor.html +++ /dev/null @@ -1,546 +0,0 @@ - - - - -NMVpnEditor: libnm Reference Manual - - - - - - - - - -
- - - - - - -
-
-
- - -
-

NMVpnEditor

-

NMVpnEditor

-
-
-

Functions

-
---- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-NMVpnEditorPlugin * - -(*NMVpnEditorPluginFactory) () -
-NMVpnEditorPlugin * - -nm_vpn_editor_plugin_factory () -
-NMVpnEditor * - -nm_vpn_editor_plugin_get_editor () -
-NMVpnEditorPluginCapability - -nm_vpn_editor_plugin_get_capabilities () -
-NMConnection * - -nm_vpn_editor_plugin_import () -
-gboolean - -nm_vpn_editor_plugin_export () -
-char * - -nm_vpn_editor_plugin_get_suggested_filename () -
-GObject * - -nm_vpn_editor_get_widget () -
-gboolean - -nm_vpn_editor_update_connection () -
-
-
-

Properties

-
----- - - - - - - - - - - - - - - - - - -
-gchar *descriptionRead
-gchar *nameRead
-gchar *serviceRead
-
-
-

Signals

-
----- - - - - - -
voidchangedRun First
-
-
-

Types and Values

- -
-
-

Object Hierarchy

-
    GFlags
-    ╰── NMVpnEditorPluginCapability
-    GInterface
-    ├── NMVpnEditor
-    ╰── NMVpnEditorPlugin
-
-
-
-

Description

-
-
-

Functions

-
-

NMVpnEditorPluginFactory ()

-
NMVpnEditorPlugin *
-(*NMVpnEditorPluginFactory) (GError **error);
-
-
-
-

nm_vpn_editor_plugin_factory ()

-
NMVpnEditorPlugin *
-nm_vpn_editor_plugin_factory (GError **error);
-
-
-
-

nm_vpn_editor_plugin_get_editor ()

-
NMVpnEditor *
-nm_vpn_editor_plugin_get_editor (NMVpnEditorPlugin *plugin,
-                                 NMConnection *connection,
-                                 GError **error);
-
-

Returns

-

.

-

[transfer full]

-
-
-
-
-

nm_vpn_editor_plugin_get_capabilities ()

-
NMVpnEditorPluginCapability
-nm_vpn_editor_plugin_get_capabilities (NMVpnEditorPlugin *plugin);
-
-
-
-

nm_vpn_editor_plugin_import ()

-
NMConnection *
-nm_vpn_editor_plugin_import (NMVpnEditorPlugin *plugin,
-                             const char *path,
-                             GError **error);
-
-

Returns

-

.

-

[transfer full]

-
-
-
-
-

nm_vpn_editor_plugin_export ()

-
gboolean
-nm_vpn_editor_plugin_export (NMVpnEditorPlugin *plugin,
-                             const char *path,
-                             NMConnection *connection,
-                             GError **error);
-
-
-
-

nm_vpn_editor_plugin_get_suggested_filename ()

-
char *
-nm_vpn_editor_plugin_get_suggested_filename
-                               (NMVpnEditorPlugin *plugin,
-                                NMConnection *connection);
-
-
-
-

nm_vpn_editor_get_widget ()

-
GObject *
-nm_vpn_editor_get_widget (NMVpnEditor *editor);
-
-

Returns

-

.

-

[transfer none]

-
-
-
-
-

nm_vpn_editor_update_connection ()

-
gboolean
-nm_vpn_editor_update_connection (NMVpnEditor *editor,
-                                 NMConnection *connection,
-                                 GError **error);
-
-
-
-

Types and Values

-
-

enum NMVpnEditorPluginCapability

-

Flags that indicate certain capabilities of the plugin to editor programs.

-
-

Members

-
----- - - - - - - - - - - - - - - - - - - - - - - -

NM_VPN_EDITOR_PLUGIN_CAPABILITY_NONE

-

unknown or no capability

-
 

NM_VPN_EDITOR_PLUGIN_CAPABILITY_IMPORT

-

the plugin can import new connections

-
 

NM_VPN_EDITOR_PLUGIN_CAPABILITY_EXPORT

-

the plugin can export connections

-
 

NM_VPN_EDITOR_PLUGIN_CAPABILITY_IPV6

-

the plugin supports IPv6 addressing

-
 
-
-
-
-
-

NM_VPN_EDITOR_PLUGIN_NAME

-
#define NM_VPN_EDITOR_PLUGIN_NAME "name"
-
-
-
-
-

NM_VPN_EDITOR_PLUGIN_DESCRIPTION

-
#define NM_VPN_EDITOR_PLUGIN_DESCRIPTION "description"
-
-
-
-
-

NM_VPN_EDITOR_PLUGIN_SERVICE

-
#define NM_VPN_EDITOR_PLUGIN_SERVICE "service"
-
-
-
-
-

NMVpnEditorPluginInterface

-
typedef struct {
-	GTypeInterface g_iface;
-
-	NMVpnEditor * (*get_editor) (NMVpnEditorPlugin *plugin,
-	                             NMConnection *connection,
-	                             GError **error);
-
-	NMVpnEditorPluginCapability (*get_capabilities) (NMVpnEditorPlugin *plugin);
-
-	NMConnection * (*import_from_file) (NMVpnEditorPlugin *plugin,
-	                                    const char *path,
-	                                    GError **error);
-
-	gboolean (*export_to_file) (NMVpnEditorPlugin *plugin,
-	                            const char *path,
-	                            NMConnection *connection,
-	                            GError **error);
-
-	char * (*get_suggested_filename) (NMVpnEditorPlugin *plugin, NMConnection *connection);
-} NMVpnEditorPluginInterface;
-
-

Interface for VPN editor plugins.

-
-

Members

-
----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

GTypeInterface g_iface;

the parent interface

 

get_editor ()

returns an NMVpnEditor, pre-filled with values from connection -if non-NULL.

 

get_capabilities ()

returns a bitmask of capabilities.

 

import_from_file ()

Try to import a connection from the specified path. On -success, return a partial NMConnection object. On error, return NULL and -set error -with additional information. Note that error -can be NULL, in -which case no additional error information should be provided.

 

export_to_file ()

Export the given connection to the specified path. Return -TRUE on success. On error, return FALSE and set error -with additional -error information. Note that error -can be NULL, in which case no -additional error information should be provided.

 

get_suggested_filename ()

For a given connection, return a suggested file -name. Returned value will be NULL or a suggested file name to be freed by -the caller.

 
-
-
-
-
-

NMVpnEditorInterface

-
typedef struct {
-	GTypeInterface g_iface;
-
-	GObject * (*get_widget) (NMVpnEditor *editor);
-
-	void (*placeholder) (void);
-
-	gboolean (*update_connection) (NMVpnEditor *editor,
-	                               NMConnection *connection,
-	                               GError **error);
-
-	void (*changed) (NMVpnEditor *editor);
-} NMVpnEditorInterface;
-
-

Interface for editing a specific NMConnection

-
-

Members

-
----- - - - - - - - - - - - - - - - - - - - - - - - - - - - -

GTypeInterface g_iface;

the parent interface

 

get_widget ()

return the GtkWidget for the VPN editor's UI

 

placeholder ()

not currently used

 

update_connection ()

called to save the user-entered options to the connection -object. Should return FALSE and set error -if the current options are -invalid. error -should contain enough information for the plugin to -determine which UI widget is invalid at a later point in time. For -example, creating unique error codes for what error occurred and populating -the message field of error -with the name of the invalid property.

 

changed ()

emitted when the value of a UI widget changes. May trigger a -validity check via update_connection -to write values to the connection.

 
-
-
-
-
-

Property Details

-
-

The “description” property

-
  “description”              gchar *
-

Longer description of the VPN plugin.

-

Flags: Read

-

Default value: NULL

-
-
-
-

The “name” property

-
  “name”                     gchar *
-

Short display name of the VPN plugin.

-

Flags: Read

-

Default value: NULL

-
-
-
-

The “service” property

-
  “service”                  gchar *
-

D-Bus service name of the plugin's VPN service.

-

Flags: Read

-

Default value: NULL

-
-
-
-

Signal Details

-
-

The “changed” signal

-
void
-user_function (NMVpnEditor *nmvpneditor,
-               gpointer     user_data)
-

Flags: Run First

-
-
-
- - - \ No newline at end of file diff --git a/docs/libnm/html/NMVpnEditorPlugin.html b/docs/libnm/html/NMVpnEditorPlugin.html new file mode 100644 index 00000000..61c3c4a4 --- /dev/null +++ b/docs/libnm/html/NMVpnEditorPlugin.html @@ -0,0 +1,540 @@ + + + + +NMVpnEditorPlugin: libnm Reference Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

NMVpnEditorPlugin

+

NMVpnEditorPlugin

+
+ +
+

Properties

+
+++++ + + + + + + + + + + + + + + + + + +
+gchar *descriptionRead
+gchar *nameRead
+gchar *serviceRead
+
+
+

Signals

+
+++++ + + + + + +
voidchangedRun First
+
+
+

Types and Values

+ +
+
+

Object Hierarchy

+
    GFlags
+    ╰── NMVpnEditorPluginCapability
+    GInterface
+    ├── NMVpnEditor
+    ╰── NMVpnEditorPlugin
+
+
+
+

Prerequisites

+

+NMVpnEditor requires + GObject.

+
+
+

Description

+
+
+

Functions

+
+

NMVpnEditorPluginFactory ()

+
NMVpnEditorPlugin *
+(*NMVpnEditorPluginFactory) (GError **error);
+
+
+
+

nm_vpn_editor_plugin_factory ()

+
NMVpnEditorPlugin *
+nm_vpn_editor_plugin_factory (GError **error);
+
+
+
+

nm_vpn_editor_plugin_get_editor ()

+
NMVpnEditor *
+nm_vpn_editor_plugin_get_editor (NMVpnEditorPlugin *plugin,
+                                 NMConnection *connection,
+                                 GError **error);
+
+

Returns

+

.

+

[transfer full]

+
+
+
+
+

nm_vpn_editor_plugin_get_capabilities ()

+
NMVpnEditorPluginCapability
+nm_vpn_editor_plugin_get_capabilities (NMVpnEditorPlugin *plugin);
+
+
+
+

nm_vpn_editor_plugin_import ()

+
NMConnection *
+nm_vpn_editor_plugin_import (NMVpnEditorPlugin *plugin,
+                             const char *path,
+                             GError **error);
+
+

Returns

+

.

+

[transfer full]

+
+
+
+
+

nm_vpn_editor_plugin_export ()

+
gboolean
+nm_vpn_editor_plugin_export (NMVpnEditorPlugin *plugin,
+                             const char *path,
+                             NMConnection *connection,
+                             GError **error);
+
+
+
+

nm_vpn_editor_plugin_get_suggested_filename ()

+
char *
+nm_vpn_editor_plugin_get_suggested_filename
+                               (NMVpnEditorPlugin *plugin,
+                                NMConnection *connection);
+
+
+
+

nm_vpn_editor_plugin_load_from_file ()

+
NMVpnEditorPlugin *
+nm_vpn_editor_plugin_load_from_file (const char *plugin_filename,
+                                     const char *check_service,
+                                     int check_owner,
+                                     NMUtilsCheckFilePredicate check_file,
+                                     gpointer user_data,
+                                     GError **error);
+

Load the shared libary plugin_filename + and create a new +NMVpnEditorPlugin instace via the NMVpnEditorPluginFactory +function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

plugin_filename

The path to the share library to load. +Apply some common heuristics to find the library, such as +appending "so" file ending. +If the path is not an absolute path or no matching module +can be found, lookup inside a directory defined at compile time. +Due to this, check_file +might be called for two different paths.

 

check_service

if not-null, check that the loaded plugin advertises +the given service.

 

check_owner

if non-negative, check whether the file is owned +by UID check_owner +or by root. In this case also check that +the file is not writable by anybody else.

 

check_file

optional callback to validate the file prior to +loading the shared library.

[scope call]

user_data

user data for check_file +

 

error

on failure the error reason.

 
+
+
+

Returns

+

a new plugin instance or NULL on error.

+

[transfer full]

+
+

Since: 1.2

+
+
+
+

Types and Values

+
+

enum NMVpnEditorPluginCapability

+

Flags that indicate certain capabilities of the plugin to editor programs.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

NM_VPN_EDITOR_PLUGIN_CAPABILITY_NONE

+

unknown or no capability

+
 

NM_VPN_EDITOR_PLUGIN_CAPABILITY_IMPORT

+

the plugin can import new connections

+
 

NM_VPN_EDITOR_PLUGIN_CAPABILITY_EXPORT

+

the plugin can export connections

+
 

NM_VPN_EDITOR_PLUGIN_CAPABILITY_IPV6

+

the plugin supports IPv6 addressing

+
 
+
+
+
+
+

NM_VPN_EDITOR_PLUGIN_NAME

+
#define NM_VPN_EDITOR_PLUGIN_NAME "name"
+
+
+
+
+

NM_VPN_EDITOR_PLUGIN_DESCRIPTION

+
#define NM_VPN_EDITOR_PLUGIN_DESCRIPTION "description"
+
+
+
+
+

NM_VPN_EDITOR_PLUGIN_SERVICE

+
#define NM_VPN_EDITOR_PLUGIN_SERVICE "service"
+
+
+
+
+

NMVpnEditorPluginInterface

+
typedef struct {
+	GTypeInterface g_iface;
+
+	NMVpnEditor * (*get_editor) (NMVpnEditorPlugin *plugin,
+	                             NMConnection *connection,
+	                             GError **error);
+
+	NMVpnEditorPluginCapability (*get_capabilities) (NMVpnEditorPlugin *plugin);
+
+	NMConnection * (*import_from_file) (NMVpnEditorPlugin *plugin,
+	                                    const char *path,
+	                                    GError **error);
+
+	gboolean (*export_to_file) (NMVpnEditorPlugin *plugin,
+	                            const char *path,
+	                            NMConnection *connection,
+	                            GError **error);
+
+	char * (*get_suggested_filename) (NMVpnEditorPlugin *plugin, NMConnection *connection);
+} NMVpnEditorPluginInterface;
+
+

Interface for VPN editor plugins.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

GTypeInterface g_iface;

the parent interface

 

get_editor ()

returns an NMVpnEditor, pre-filled with values from connection +if non-NULL.

 

get_capabilities ()

returns a bitmask of capabilities.

 

import_from_file ()

Try to import a connection from the specified path. On +success, return a partial NMConnection object. On error, return NULL and +set error +with additional information. Note that error +can be NULL, in +which case no additional error information should be provided.

 

export_to_file ()

Export the given connection to the specified path. Return +TRUE on success. On error, return FALSE and set error +with additional +error information. Note that error +can be NULL, in which case no +additional error information should be provided.

 

get_suggested_filename ()

For a given connection, return a suggested file +name. Returned value will be NULL or a suggested file name to be freed by +the caller.

 
+
+
+
+
+

NMVpnEditor

+
typedef struct _NMVpnEditor NMVpnEditor;
+
+
+
+

Property Details

+
+

The “description” property

+
  “description”              gchar *
+

Longer description of the VPN plugin.

+

Flags: Read

+

Default value: NULL

+
+
+
+

The “name” property

+
  “name”                     gchar *
+

Short display name of the VPN plugin.

+

Flags: Read

+

Default value: NULL

+
+
+
+

The “service” property

+
  “service”                  gchar *
+

D-Bus service name of the plugin's VPN service.

+

Flags: Read

+

Default value: NULL

+
+
+
+

Signal Details

+
+

The “changed” signal

+
void
+user_function (NMVpnEditor *nmvpneditor,
+               gpointer     user_data)
+

Flags: Run First

+
+
+
+ + + \ No newline at end of file diff --git a/docs/libnm/html/NMWimaxNsp.html b/docs/libnm/html/NMWimaxNsp.html index 52fcc5ec..8a73c9b9 100644 --- a/docs/libnm/html/NMWimaxNsp.html +++ b/docs/libnm/html/NMWimaxNsp.html @@ -140,7 +140,7 @@

Object Hierarchy

-
    GEnum
+
    GEnum
     ╰── NMWimaxNspNetworkType
     GObject
     ╰── NMObject
@@ -158,7 +158,7 @@
 nm_wimax_nsp_get_name (NMWimaxNsp *nsp);

Gets the name of the wimax NSP

-

Parameters

+

Parameters

@@ -173,7 +173,7 @@ nm_wimax_nsp_get_name ( -

Returns

+

Returns

the name

@@ -184,7 +184,7 @@ nm_wimax_nsp_get_name (NMWimaxNsp *nsp);

Gets the WPA signal quality of the wimax NSP.

-

Parameters

+

Parameters

@@ -199,7 +199,7 @@ nm_wimax_nsp_get_signal_quality (
-

Returns

+

Returns

the signal quality

@@ -210,7 +210,7 @@ nm_wimax_nsp_get_signal_quality (NMWimaxNsp *nsp);

Gets the network type of the wimax NSP.

-

Parameters

+

Parameters

@@ -225,7 +225,7 @@ nm_wimax_nsp_get_network_type (
-

Returns

+

Returns

the network type

@@ -240,7 +240,7 @@ return connections which may be activated with the NSP. Any returned connections will match the nsp 's network name and other attributes.

-

Parameters

+

Parameters

@@ -263,7 +263,7 @@ filter.

-

Returns

+

Returns

an array of NMConnections that could be activated with the given nsp . The array should @@ -282,7 +282,7 @@ connection may be activated with that NSP. The connection must match the nsp 's network name and other attributes.

-

Parameters

+

Parameters

@@ -306,7 +306,7 @@ against

-

Returns

+

Returns

TRUE if the connection may be activated with this WiMAX NSP, FALSE if it cannot be.

@@ -336,7 +336,7 @@ against

enum NMWimaxNspNetworkType

WiMAX network type.

-

Members

+

Members

diff --git a/docs/libnm/html/api-index-full.html b/docs/libnm/html/api-index-full.html index f9a2a57e..e63ef7bf 100644 --- a/docs/libnm/html/api-index-full.html +++ b/docs/libnm/html/api-index-full.html @@ -27,6 +27,8 @@  |  K  |  + L +  |  M  |  O @@ -405,11 +407,7 @@
-NM_AVAILABLE_IN_1_0_4, macro in nm-version -
-
-
-NM_AVAILABLE_IN_1_0_6, macro in nm-version +NM_AVAILABLE_IN_1_2, macro in nm-version

B

@@ -419,6 +417,14 @@

C

+NMClient::any-device-added, object signal in NMClient +
+
+
+NMClient::any-device-removed, object signal in NMClient +
+
+
NMClient::connection-added, object signal in NMClient
@@ -447,6 +453,10 @@
+NMClient:all-devices, object property in NMClient +
+
+
NMClient:can-modify, object property in NMClient
@@ -563,6 +573,18 @@
+NM_CLIENT_ALL_DEVICES, macro in NMClient +
+
+
+NM_CLIENT_ANY_DEVICE_ADDED, macro in NMClient +
+
+
+NM_CLIENT_ANY_DEVICE_REMOVED, macro in NMClient +
+
+
NM_CLIENT_CAN_MODIFY, macro in NMClient
@@ -635,6 +657,10 @@
+nm_client_get_all_devices, function in NMClient +
+
+
nm_client_get_connections, function in NMClient
@@ -987,6 +1013,14 @@
+nm_connection_get_setting_ip_tunnel, function in NMConnection +
+
+
+nm_connection_get_setting_macvlan, function in NMConnection +
+
+
nm_connection_get_setting_olpc_mesh, function in NMConnection
@@ -1011,6 +1045,10 @@
+nm_connection_get_setting_tun, function in NMConnection +
+
+
nm_connection_get_setting_vlan, function in NMConnection
@@ -1019,6 +1057,10 @@
+nm_connection_get_setting_vxlan, function in NMConnection +
+
+
nm_connection_get_setting_wimax, function in NMConnection
@@ -1099,6 +1141,10 @@
+nm_connection_verify_secrets, function in NMConnection +
+
+
NMConnectivityState, enum in nm-dbus-interface
@@ -1164,6 +1210,10 @@
+NM_DBUS_INTERFACE_DEVICE_IP_TUNNEL, macro in nm-dbus-interface +
+
+
NM_DBUS_INTERFACE_DEVICE_MACVLAN, macro in nm-dbus-interface
@@ -1392,6 +1442,14 @@ DEFINE_KF_WRAPPER_PROTO, macro in nm-keyfile-utils
+NM_DEPRECATED_IN_1_2, macro in nm-version +
+
+
+NM_DEPRECATED_IN_1_2_FOR, macro in nm-version +
+
+
NMDevice::state-changed, object signal in NMDevice
@@ -1456,6 +1514,10 @@ DEFINE_KF_WRAPPER_PROTO, macro in nm-keyfile-utils
+NMDevice:lldp-neighbors, object property in NMDevice +
+
+
NMDevice:managed, object property in NMDevice
@@ -1468,6 +1530,10 @@ DEFINE_KF_WRAPPER_PROTO, macro in nm-keyfile-utils
+NMDevice:nm-plugin-missing, object property in NMDevice +
+
+
NMDevice:physical-port-id, object property in NMDevice
@@ -1476,6 +1542,10 @@ DEFINE_KF_WRAPPER_PROTO, macro in nm-keyfile-utils
+NMDevice:real, object property in NMDevice +
+
+
NMDevice:state, object property in NMDevice
@@ -1552,6 +1622,10 @@ DEFINE_KF_WRAPPER_PROTO, macro in nm-keyfile-utils
+NMDeviceEthernet:s390-subchannels, object property in NMDeviceEthernet +
+
+
NMDeviceEthernet:speed, object property in NMDeviceEthernet
@@ -1572,6 +1646,70 @@ DEFINE_KF_WRAPPER_PROTO, macro in nm-keyfile-utils
+NMDeviceIPTunnel:encapsulation-limit, object property in NMDeviceIPTunnel +
+
+
+NMDeviceIPTunnel:flow-label, object property in NMDeviceIPTunnel +
+
+
+NMDeviceIPTunnel:input-key, object property in NMDeviceIPTunnel +
+
+
+NMDeviceIPTunnel:local, object property in NMDeviceIPTunnel +
+
+
+NMDeviceIPTunnel:mode, object property in NMDeviceIPTunnel +
+
+
+NMDeviceIPTunnel:output-key, object property in NMDeviceIPTunnel +
+
+
+NMDeviceIPTunnel:parent, object property in NMDeviceIPTunnel +
+
+
+NMDeviceIPTunnel:path-mtu-discovery, object property in NMDeviceIPTunnel +
+
+
+NMDeviceIPTunnel:remote, object property in NMDeviceIPTunnel +
+
+
+NMDeviceIPTunnel:tos, object property in NMDeviceIPTunnel +
+
+
+NMDeviceIPTunnel:ttl, object property in NMDeviceIPTunnel +
+
+
+NMDeviceMacvlan:hw-address, object property in NMDeviceMacvlan +
+
+
+NMDeviceMacvlan:mode, object property in NMDeviceMacvlan +
+
+
+NMDeviceMacvlan:no-promisc, object property in NMDeviceMacvlan +
+
+
+NMDeviceMacvlan:parent, object property in NMDeviceMacvlan +
+
+
+NMDeviceMacvlan:tap, object property in NMDeviceMacvlan +
+
+
NMDeviceModem:current-capabilities, object property in NMDeviceModem
@@ -1616,6 +1754,34 @@ DEFINE_KF_WRAPPER_PROTO, macro in nm-keyfile-utils
+NMDeviceTun:group, object property in NMDeviceTun +
+
+
+NMDeviceTun:hw-address, object property in NMDeviceTun +
+
+
+NMDeviceTun:mode, object property in NMDeviceTun +
+
+
+NMDeviceTun:multi-queue, object property in NMDeviceTun +
+
+
+NMDeviceTun:no-pi, object property in NMDeviceTun +
+
+
+NMDeviceTun:owner, object property in NMDeviceTun +
+
+
+NMDeviceTun:vnet-hdr, object property in NMDeviceTun +
+
+
NMDeviceType, enum in nm-dbus-interface
@@ -1636,6 +1802,78 @@ DEFINE_KF_WRAPPER_PROTO, macro in nm-keyfile-utils
+NMDeviceVxlan:ageing, object property in NMDeviceVxlan +
+
+
+NMDeviceVxlan:carrier, object property in NMDeviceVxlan +
+
+
+NMDeviceVxlan:dst-port, object property in NMDeviceVxlan +
+
+
+NMDeviceVxlan:group, object property in NMDeviceVxlan +
+
+
+NMDeviceVxlan:hw-address, object property in NMDeviceVxlan +
+
+
+NMDeviceVxlan:id, object property in NMDeviceVxlan +
+
+
+NMDeviceVxlan:l2miss, object property in NMDeviceVxlan +
+
+
+NMDeviceVxlan:l3miss, object property in NMDeviceVxlan +
+
+
+NMDeviceVxlan:learning, object property in NMDeviceVxlan +
+
+
+NMDeviceVxlan:limit, object property in NMDeviceVxlan +
+
+
+NMDeviceVxlan:local, object property in NMDeviceVxlan +
+
+
+NMDeviceVxlan:parent, object property in NMDeviceVxlan +
+
+
+NMDeviceVxlan:proxy, object property in NMDeviceVxlan +
+
+
+NMDeviceVxlan:rsc, object property in NMDeviceVxlan +
+
+
+NMDeviceVxlan:src-port-max, object property in NMDeviceVxlan +
+
+
+NMDeviceVxlan:src-port-min, object property in NMDeviceVxlan +
+
+
+NMDeviceVxlan:tos, object property in NMDeviceVxlan +
+
+
+NMDeviceVxlan:ttl, object property in NMDeviceVxlan +
+
+
NMDeviceWifi::access-point-added, object signal in NMDeviceWifi
@@ -1892,6 +2130,10 @@ DEFINE_KF_WRAPPER_PROTO, macro in nm-keyfile-utils
+nm_device_ethernet_get_s390_subchannels, function in NMDeviceEthernet +
+
+
nm_device_ethernet_get_speed, function in NMDeviceEthernet
@@ -1904,6 +2146,10 @@ DEFINE_KF_WRAPPER_PROTO, macro in nm-keyfile-utils
+NM_DEVICE_ETHERNET_S390_SUBCHANNELS, macro in NMDeviceEthernet +
+
+
NM_DEVICE_ETHERNET_SPEED, macro in NMDeviceEthernet
@@ -2000,6 +2246,10 @@ DEFINE_KF_WRAPPER_PROTO, macro in nm-keyfile-utils
+nm_device_get_lldp_neighbors, function in NMDevice +
+
+
nm_device_get_managed, function in NMDevice
@@ -2012,6 +2262,10 @@ DEFINE_KF_WRAPPER_PROTO, macro in nm-keyfile-utils
+nm_device_get_nm_plugin_missing, function in NMDevice +
+
+
nm_device_get_physical_port_id, function in NMDevice
@@ -2076,195 +2330,555 @@ DEFINE_KF_WRAPPER_PROTO, macro in nm-keyfile-utils
-nm_device_is_software, function in NMDevice +NM_DEVICE_IP_TUNNEL_ENCAPSULATION_LIMIT, macro in NMDeviceIPTunnel
-NM_DEVICE_MANAGED, macro in NMDevice +NM_DEVICE_IP_TUNNEL_FLOW_LABEL, macro in NMDeviceIPTunnel
-NM_DEVICE_METERED, macro in NMDevice +nm_device_ip_tunnel_get_encapsulation_limit, function in NMDeviceIPTunnel
-NM_DEVICE_MODEM_CURRENT_CAPABILITIES, macro in NMDeviceModem +nm_device_ip_tunnel_get_flow_label, function in NMDeviceIPTunnel
-nm_device_modem_get_current_capabilities, function in NMDeviceModem +nm_device_ip_tunnel_get_input_key, function in NMDeviceIPTunnel
-nm_device_modem_get_modem_capabilities, function in NMDeviceModem +nm_device_ip_tunnel_get_local, function in NMDeviceIPTunnel
-NM_DEVICE_MODEM_MODEM_CAPABILITIES, macro in NMDeviceModem +nm_device_ip_tunnel_get_mode, function in NMDeviceIPTunnel
-NM_DEVICE_MTU, macro in NMDevice +nm_device_ip_tunnel_get_output_key, function in NMDeviceIPTunnel
-NM_DEVICE_OLPC_MESH_ACTIVE_CHANNEL, macro in NMDeviceOlpcMesh +nm_device_ip_tunnel_get_parent, function in NMDeviceIPTunnel
-NM_DEVICE_OLPC_MESH_COMPANION, macro in NMDeviceOlpcMesh +nm_device_ip_tunnel_get_path_mtu_discovery, function in NMDeviceIPTunnel
-nm_device_olpc_mesh_get_active_channel, function in NMDeviceOlpcMesh +nm_device_ip_tunnel_get_remote, function in NMDeviceIPTunnel
-nm_device_olpc_mesh_get_companion, function in NMDeviceOlpcMesh +nm_device_ip_tunnel_get_tos, function in NMDeviceIPTunnel
-nm_device_olpc_mesh_get_hw_address, function in NMDeviceOlpcMesh +nm_device_ip_tunnel_get_ttl, function in NMDeviceIPTunnel
-NM_DEVICE_OLPC_MESH_HW_ADDRESS, macro in NMDeviceOlpcMesh +NM_DEVICE_IP_TUNNEL_INPUT_KEY, macro in NMDeviceIPTunnel
-NM_DEVICE_PHYSICAL_PORT_ID, macro in NMDevice +NM_DEVICE_IP_TUNNEL_LOCAL, macro in NMDeviceIPTunnel
-NM_DEVICE_PRODUCT, macro in NMDevice +NM_DEVICE_IP_TUNNEL_MODE, macro in NMDeviceIPTunnel
-nm_device_set_autoconnect, function in NMDevice +NM_DEVICE_IP_TUNNEL_OUTPUT_KEY, macro in NMDeviceIPTunnel
-NM_DEVICE_STATE, macro in NMDevice +NM_DEVICE_IP_TUNNEL_PARENT, macro in NMDeviceIPTunnel
-NM_DEVICE_STATE_REASON, macro in NMDevice +NM_DEVICE_IP_TUNNEL_PATH_MTU_DISCOVERY, macro in NMDeviceIPTunnel
-NM_DEVICE_TEAM_CARRIER, macro in NMDeviceTeam +NM_DEVICE_IP_TUNNEL_REMOTE, macro in NMDeviceIPTunnel
-nm_device_team_get_carrier, function in NMDeviceTeam +NM_DEVICE_IP_TUNNEL_TOS, macro in NMDeviceIPTunnel
-nm_device_team_get_hw_address, function in NMDeviceTeam +NM_DEVICE_IP_TUNNEL_TTL, macro in NMDeviceIPTunnel
-nm_device_team_get_slaves, function in NMDeviceTeam +nm_device_is_real, function in NMDevice
-NM_DEVICE_TEAM_HW_ADDRESS, macro in NMDeviceTeam +nm_device_is_software, function in NMDevice
-NM_DEVICE_TEAM_SLAVES, macro in NMDeviceTeam +NM_DEVICE_LLDP_NEIGHBORS, macro in NMDevice
-NM_DEVICE_UDI, macro in NMDevice +nm_device_macvlan_get_hw_address, function in NMDeviceMacvlan
-NM_DEVICE_VENDOR, macro in NMDevice +nm_device_macvlan_get_mode, function in NMDeviceMacvlan
-NM_DEVICE_VLAN_CARRIER, macro in NMDeviceVlan +nm_device_macvlan_get_no_promisc, function in NMDeviceMacvlan
-nm_device_vlan_get_carrier, function in NMDeviceVlan +nm_device_macvlan_get_parent, function in NMDeviceMacvlan
-nm_device_vlan_get_hw_address, function in NMDeviceVlan +nm_device_macvlan_get_tap, function in NMDeviceMacvlan
-nm_device_vlan_get_parent, function in NMDeviceVlan +NM_DEVICE_MACVLAN_HW_ADDRESS, macro in NMDeviceMacvlan
-nm_device_vlan_get_vlan_id, function in NMDeviceVlan +NM_DEVICE_MACVLAN_MODE, macro in NMDeviceMacvlan
-NM_DEVICE_VLAN_HW_ADDRESS, macro in NMDeviceVlan +NM_DEVICE_MACVLAN_NO_PROMISC, macro in NMDeviceMacvlan
-NM_DEVICE_VLAN_PARENT, macro in NMDeviceVlan +NM_DEVICE_MACVLAN_PARENT, macro in NMDeviceMacvlan
-NM_DEVICE_VLAN_VLAN_ID, macro in NMDeviceVlan +NM_DEVICE_MACVLAN_TAP, macro in NMDeviceMacvlan
-NM_DEVICE_WIFI_ACCESS_POINTS, macro in NMDeviceWifi +NM_DEVICE_MANAGED, macro in NMDevice
-NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT, macro in NMDeviceWifi +NM_DEVICE_METERED, macro in NMDevice
-NM_DEVICE_WIFI_BITRATE, macro in NMDeviceWifi +NM_DEVICE_MODEM_CURRENT_CAPABILITIES, macro in NMDeviceModem
-NM_DEVICE_WIFI_CAPABILITIES, macro in NMDeviceWifi +nm_device_modem_get_current_capabilities, function in NMDeviceModem
-nm_device_wifi_get_access_points, function in NMDeviceWifi +nm_device_modem_get_modem_capabilities, function in NMDeviceModem
-nm_device_wifi_get_access_point_by_path, function in NMDeviceWifi +NM_DEVICE_MODEM_MODEM_CAPABILITIES, macro in NMDeviceModem
-nm_device_wifi_get_active_access_point, function in NMDeviceWifi +NM_DEVICE_MTU, macro in NMDevice
-nm_device_wifi_get_bitrate, function in NMDeviceWifi +NM_DEVICE_NM_PLUGIN_MISSING, macro in NMDevice
-nm_device_wifi_get_capabilities, function in NMDeviceWifi +NM_DEVICE_OLPC_MESH_ACTIVE_CHANNEL, macro in NMDeviceOlpcMesh
-nm_device_wifi_get_hw_address, function in NMDeviceWifi +NM_DEVICE_OLPC_MESH_COMPANION, macro in NMDeviceOlpcMesh
-nm_device_wifi_get_mode, function in NMDeviceWifi +nm_device_olpc_mesh_get_active_channel, function in NMDeviceOlpcMesh
-nm_device_wifi_get_permanent_hw_address, function in NMDeviceWifi +nm_device_olpc_mesh_get_companion, function in NMDeviceOlpcMesh
-NM_DEVICE_WIFI_HW_ADDRESS, macro in NMDeviceWifi +nm_device_olpc_mesh_get_hw_address, function in NMDeviceOlpcMesh +
+
+
+NM_DEVICE_OLPC_MESH_HW_ADDRESS, macro in NMDeviceOlpcMesh +
+
+
+NM_DEVICE_PHYSICAL_PORT_ID, macro in NMDevice +
+
+
+NM_DEVICE_PRODUCT, macro in NMDevice +
+
+
+NM_DEVICE_REAL, macro in NMDevice +
+
+
+nm_device_reapply, function in NMDevice +
+
+
+nm_device_reapply_async, function in NMDevice +
+
+
+nm_device_reapply_finish, function in NMDevice +
+
+
+nm_device_set_autoconnect, function in NMDevice +
+
+
+nm_device_set_managed, function in NMDevice +
+
+
+NM_DEVICE_STATE, macro in NMDevice +
+
+
+NM_DEVICE_STATE_REASON, macro in NMDevice +
+
+
+NM_DEVICE_TEAM_CARRIER, macro in NMDeviceTeam +
+
+
+nm_device_team_get_carrier, function in NMDeviceTeam +
+
+
+nm_device_team_get_hw_address, function in NMDeviceTeam +
+
+
+nm_device_team_get_slaves, function in NMDeviceTeam +
+
+
+NM_DEVICE_TEAM_HW_ADDRESS, macro in NMDeviceTeam +
+
+
+NM_DEVICE_TEAM_SLAVES, macro in NMDeviceTeam +
+
+
+nm_device_tun_get_group, function in NMDeviceTun +
+
+
+nm_device_tun_get_hw_address, function in NMDeviceTun +
+
+
+nm_device_tun_get_mode, function in NMDeviceTun +
+
+
+nm_device_tun_get_multi_queue, function in NMDeviceTun +
+
+
+nm_device_tun_get_no_pi, function in NMDeviceTun +
+
+
+nm_device_tun_get_owner, function in NMDeviceTun +
+
+
+nm_device_tun_get_vnet_hdr, function in NMDeviceTun +
+
+
+NM_DEVICE_TUN_GROUP, macro in NMDeviceTun +
+
+
+NM_DEVICE_TUN_HW_ADDRESS, macro in NMDeviceTun +
+
+
+NM_DEVICE_TUN_MODE, macro in NMDeviceTun +
+
+
+NM_DEVICE_TUN_MULTI_QUEUE, macro in NMDeviceTun +
+
+
+NM_DEVICE_TUN_NO_PI, macro in NMDeviceTun +
+
+
+NM_DEVICE_TUN_OWNER, macro in NMDeviceTun +
+
+
+NM_DEVICE_TUN_VNET_HDR, macro in NMDeviceTun +
+
+
+NM_DEVICE_UDI, macro in NMDevice +
+
+
+NM_DEVICE_VENDOR, macro in NMDevice +
+
+
+NM_DEVICE_VLAN_CARRIER, macro in NMDeviceVlan +
+
+
+nm_device_vlan_get_carrier, function in NMDeviceVlan +
+
+
+nm_device_vlan_get_hw_address, function in NMDeviceVlan +
+
+
+nm_device_vlan_get_parent, function in NMDeviceVlan +
+
+
+nm_device_vlan_get_vlan_id, function in NMDeviceVlan +
+
+
+NM_DEVICE_VLAN_HW_ADDRESS, macro in NMDeviceVlan +
+
+
+NM_DEVICE_VLAN_PARENT, macro in NMDeviceVlan +
+
+
+NM_DEVICE_VLAN_VLAN_ID, macro in NMDeviceVlan +
+
+
+NM_DEVICE_VXLAN_AGEING, macro in NMDeviceVxlan +
+
+
+NM_DEVICE_VXLAN_CARRIER, macro in NMDeviceVxlan +
+
+
+NM_DEVICE_VXLAN_DST_PORT, macro in NMDeviceVxlan +
+
+
+nm_device_vxlan_get_ageing, function in NMDeviceVxlan +
+
+
+nm_device_vxlan_get_carrier, function in NMDeviceVxlan +
+
+
+nm_device_vxlan_get_dst_port, function in NMDeviceVxlan +
+
+
+nm_device_vxlan_get_group, function in NMDeviceVxlan +
+
+
+nm_device_vxlan_get_hw_address, function in NMDeviceVxlan +
+
+
+nm_device_vxlan_get_id, function in NMDeviceVxlan +
+
+
+nm_device_vxlan_get_l2miss, function in NMDeviceVxlan +
+
+
+nm_device_vxlan_get_l3miss, function in NMDeviceVxlan +
+
+
+nm_device_vxlan_get_learning, function in NMDeviceVxlan +
+
+
+nm_device_vxlan_get_limit, function in NMDeviceVxlan +
+
+
+nm_device_vxlan_get_local, function in NMDeviceVxlan +
+
+
+nm_device_vxlan_get_parent, function in NMDeviceVxlan +
+
+
+nm_device_vxlan_get_proxy, function in NMDeviceVxlan +
+
+
+nm_device_vxlan_get_rsc, function in NMDeviceVxlan +
+
+
+nm_device_vxlan_get_src_port_max, function in NMDeviceVxlan +
+
+
+nm_device_vxlan_get_src_port_min, function in NMDeviceVxlan +
+
+
+nm_device_vxlan_get_tos, function in NMDeviceVxlan +
+
+
+nm_device_vxlan_get_ttl, function in NMDeviceVxlan +
+
+
+NM_DEVICE_VXLAN_GROUP, macro in NMDeviceVxlan +
+
+
+NM_DEVICE_VXLAN_HW_ADDRESS, macro in NMDeviceVxlan +
+
+
+NM_DEVICE_VXLAN_ID, macro in NMDeviceVxlan +
+
+
+NM_DEVICE_VXLAN_L2MISS, macro in NMDeviceVxlan +
+
+
+NM_DEVICE_VXLAN_L3MISS, macro in NMDeviceVxlan +
+
+
+NM_DEVICE_VXLAN_LEARNING, macro in NMDeviceVxlan +
+
+
+NM_DEVICE_VXLAN_LIMIT, macro in NMDeviceVxlan +
+
+
+NM_DEVICE_VXLAN_LOCAL, macro in NMDeviceVxlan +
+
+
+NM_DEVICE_VXLAN_PARENT, macro in NMDeviceVxlan +
+
+
+NM_DEVICE_VXLAN_PROXY, macro in NMDeviceVxlan +
+
+
+NM_DEVICE_VXLAN_RSC, macro in NMDeviceVxlan +
+
+
+NM_DEVICE_VXLAN_SRC_PORT_MAX, macro in NMDeviceVxlan +
+
+
+NM_DEVICE_VXLAN_SRC_PORT_MIN, macro in NMDeviceVxlan +
+
+
+NM_DEVICE_VXLAN_TOS, macro in NMDeviceVxlan +
+
+
+NM_DEVICE_VXLAN_TTL, macro in NMDeviceVxlan +
+
+
+NM_DEVICE_WIFI_ACCESS_POINTS, macro in NMDeviceWifi +
+
+
+NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT, macro in NMDeviceWifi +
+
+
+NM_DEVICE_WIFI_BITRATE, macro in NMDeviceWifi +
+
+
+NM_DEVICE_WIFI_CAPABILITIES, macro in NMDeviceWifi +
+
+
+nm_device_wifi_get_access_points, function in NMDeviceWifi +
+
+
+nm_device_wifi_get_access_point_by_path, function in NMDeviceWifi +
+
+
+nm_device_wifi_get_active_access_point, function in NMDeviceWifi +
+
+
+nm_device_wifi_get_bitrate, function in NMDeviceWifi +
+
+
+nm_device_wifi_get_capabilities, function in NMDeviceWifi +
+
+
+nm_device_wifi_get_hw_address, function in NMDeviceWifi +
+
+
+nm_device_wifi_get_mode, function in NMDeviceWifi +
+
+
+nm_device_wifi_get_permanent_hw_address, function in NMDeviceWifi +
+
+
+NM_DEVICE_WIFI_HW_ADDRESS, macro in NMDeviceWifi
@@ -2425,6 +3039,10 @@ DEFINE_KF_WRAPPER_PROTO, macro in nm-keyfile-utils
+NMIPTunnelMode, enum in nm-dbus-interface +
+
+
nm_ip_address_dup, function in NMSettingIPConfig
@@ -2713,6 +3331,103 @@ nm_keyfile_read, function in nm-keyfile-internal nm_keyfile_write, function in nm-keyfile-internal
+

L

+
+NM_LLDP_ATTR_CHASSIS_ID, macro in nm-dbus-interface +
+
+
+NM_LLDP_ATTR_CHASSIS_ID_TYPE, macro in nm-dbus-interface +
+
+
+NM_LLDP_ATTR_DESTINATION, macro in nm-dbus-interface +
+
+
+NM_LLDP_ATTR_IEEE_802_1_PPVID, macro in nm-dbus-interface +
+
+
+NM_LLDP_ATTR_IEEE_802_1_PPVID_FLAGS, macro in nm-dbus-interface +
+
+
+NM_LLDP_ATTR_IEEE_802_1_PVID, macro in nm-dbus-interface +
+
+
+NM_LLDP_ATTR_IEEE_802_1_VID, macro in nm-dbus-interface +
+
+
+NM_LLDP_ATTR_IEEE_802_1_VLAN_NAME, macro in nm-dbus-interface +
+
+
+NM_LLDP_ATTR_PORT_DESCRIPTION, macro in nm-dbus-interface +
+
+
+NM_LLDP_ATTR_PORT_ID, macro in nm-dbus-interface +
+
+
+NM_LLDP_ATTR_PORT_ID_TYPE, macro in nm-dbus-interface +
+
+
+NM_LLDP_ATTR_SYSTEM_CAPABILITIES, macro in nm-dbus-interface +
+
+
+NM_LLDP_ATTR_SYSTEM_DESCRIPTION, macro in nm-dbus-interface +
+
+
+NM_LLDP_ATTR_SYSTEM_NAME, macro in nm-dbus-interface +
+
+
+NM_LLDP_DEST_NEAREST_BRIDGE, macro in nm-dbus-interface +
+
+
+NM_LLDP_DEST_NEAREST_CUSTOMER_BRIDGE, macro in nm-dbus-interface +
+
+
+NM_LLDP_DEST_NEAREST_NON_TPMR_BRIDGE, macro in nm-dbus-interface +
+
+
+nm_lldp_neighbor_get_attr_names, function in NMDevice +
+
+
+nm_lldp_neighbor_get_attr_string_value, function in NMDevice +
+
+
+nm_lldp_neighbor_get_attr_type, function in NMDevice +
+
+
+nm_lldp_neighbor_get_attr_uint_value, function in NMDevice +
+
+
+nm_lldp_neighbor_new, function in NMDevice +
+
+
+nm_lldp_neighbor_ref, function in NMDevice +
+
+
+nm_lldp_neighbor_unref, function in NMDevice +
+

M

NMManagerError, enum in nm-errors @@ -3146,6 +3861,10 @@ nm_keyfile_write, function in nm-keyfile-internal
+NMSettingBridge:multicast-snooping, object property in NMSettingBridge +
+
+
NMSettingBridge:priority, object property in NMSettingBridge
@@ -3218,6 +3937,10 @@ nm_keyfile_write, function in nm-keyfile-internal
+NMSettingConnection:lldp, object property in NMSettingConnection +
+
+
NMSettingConnection:master, object property in NMSettingConnection
@@ -3262,6 +3985,10 @@ nm_keyfile_write, function in nm-keyfile-internal
+NMSettingConnectionLldp, enum in NMSettingConnection +
+
+
NMSettingDcb:app-fcoe-flags, object property in NMSettingDcb
@@ -3334,6 +4061,10 @@ nm_keyfile_write, function in nm-keyfile-internal
+NMSettingGsm:device-id, object property in NMSettingGsm +
+
+
NMSettingGsm:home-only, object property in NMSettingGsm
@@ -3362,6 +4093,14 @@ nm_keyfile_write, function in nm-keyfile-internal
+NMSettingGsm:sim-id, object property in NMSettingGsm +
+
+
+NMSettingGsm:sim-operator-id, object property in NMSettingGsm +
+
+
NMSettingGsm:username, object property in NMSettingGsm
@@ -3390,10 +4129,26 @@ nm_keyfile_write, function in nm-keyfile-internal
+NMSettingIP4Config:dhcp-fqdn, object property in NMSettingIP4Config +
+
+
+NMSettingIP4Config:dhcp-timeout, object property in NMSettingIP4Config +
+
+
+NMSettingIP6Config:addr-gen-mode, object property in NMSettingIP6Config +
+
+
NMSettingIP6Config:ip6-privacy, object property in NMSettingIP6Config
+NMSettingIP6ConfigAddrGenMode, enum in NMSettingIP6Config +
+
+
NMSettingIP6ConfigPrivacy, enum in NMSettingIP6Config
@@ -3414,6 +4169,10 @@ nm_keyfile_write, function in nm-keyfile-internal
+NMSettingIPConfig:dns-options, object property in NMSettingIPConfig +
+
+
NMSettingIPConfig:dns-search, object property in NMSettingIPConfig
@@ -3450,6 +4209,78 @@ nm_keyfile_write, function in nm-keyfile-internal
+NMSettingIPTunnel:encapsulation-limit, object property in NMSettingIPTunnel +
+
+
+NMSettingIPTunnel:flow-label, object property in NMSettingIPTunnel +
+
+
+NMSettingIPTunnel:input-key, object property in NMSettingIPTunnel +
+
+
+NMSettingIPTunnel:local, object property in NMSettingIPTunnel +
+
+
+NMSettingIPTunnel:mode, object property in NMSettingIPTunnel +
+
+
+NMSettingIPTunnel:mtu, object property in NMSettingIPTunnel +
+
+
+NMSettingIPTunnel:output-key, object property in NMSettingIPTunnel +
+
+
+NMSettingIPTunnel:parent, object property in NMSettingIPTunnel +
+
+
+NMSettingIPTunnel:path-mtu-discovery, object property in NMSettingIPTunnel +
+
+
+NMSettingIPTunnel:remote, object property in NMSettingIPTunnel +
+
+
+NMSettingIPTunnel:tos, object property in NMSettingIPTunnel +
+
+
+NMSettingIPTunnel:ttl, object property in NMSettingIPTunnel +
+
+
+NMSettingMacRandomization, enum in NMSetting +
+
+
+NMSettingMacvlan:mode, object property in NMSettingMacvlan +
+
+
+NMSettingMacvlan:parent, object property in NMSettingMacvlan +
+
+
+NMSettingMacvlan:promiscuous, object property in NMSettingMacvlan +
+
+
+NMSettingMacvlan:tap, object property in NMSettingMacvlan +
+
+
+NMSettingMacvlanMode, enum in NMSettingMacvlan +
+
+
NMSettingOlpcMesh:channel, object property in NMSettingOlpcMesh
@@ -3598,6 +4429,34 @@ nm_keyfile_write, function in nm-keyfile-internal
+NMSettingTun:group, object property in NMSettingTun +
+
+
+NMSettingTun:mode, object property in NMSettingTun +
+
+
+NMSettingTun:multi-queue, object property in NMSettingTun +
+
+
+NMSettingTun:owner, object property in NMSettingTun +
+
+
+NMSettingTun:pi, object property in NMSettingTun +
+
+
+NMSettingTun:vnet-hdr, object property in NMSettingTun +
+
+
+NMSettingTunMode, enum in NMSettingTun +
+
+
NMSettingValueIterFn, user_function in NMSetting
@@ -3638,10 +4497,78 @@ nm_keyfile_write, function in nm-keyfile-internal
+NMSettingVpn:timeout, object property in NMSettingVpn +
+
+
NMSettingVpn:user-name, object property in NMSettingVpn
+NMSettingVxlan:ageing, object property in NMSettingVxlan +
+
+
+NMSettingVxlan:destination-port, object property in NMSettingVxlan +
+
+
+NMSettingVxlan:id, object property in NMSettingVxlan +
+
+
+NMSettingVxlan:l2-miss, object property in NMSettingVxlan +
+
+
+NMSettingVxlan:l3-miss, object property in NMSettingVxlan +
+
+
+NMSettingVxlan:learning, object property in NMSettingVxlan +
+
+
+NMSettingVxlan:limit, object property in NMSettingVxlan +
+
+
+NMSettingVxlan:local, object property in NMSettingVxlan +
+
+
+NMSettingVxlan:parent, object property in NMSettingVxlan +
+
+
+NMSettingVxlan:proxy, object property in NMSettingVxlan +
+
+
+NMSettingVxlan:remote, object property in NMSettingVxlan +
+
+
+NMSettingVxlan:rsc, object property in NMSettingVxlan +
+
+
+NMSettingVxlan:source-port-max, object property in NMSettingVxlan +
+
+
+NMSettingVxlan:source-port-min, object property in NMSettingVxlan +
+
+
+NMSettingVxlan:tos, object property in NMSettingVxlan +
+
+
+NMSettingVxlan:ttl, object property in NMSettingVxlan +
+
+
NMSettingWimax:mac-address, object property in NMSettingWimax
@@ -3734,6 +4661,10 @@ nm_keyfile_write, function in nm-keyfile-internal
+NMSettingWireless:mac-address-randomization, object property in NMSettingWireless +
+
+
NMSettingWireless:mode, object property in NMSettingWireless
@@ -3742,6 +4673,10 @@ nm_keyfile_write, function in nm-keyfile-internal
+NMSettingWireless:powersave, object property in NMSettingWireless +
+
+
NMSettingWireless:rate, object property in NMSettingWireless
@@ -3858,6 +4793,10 @@ nm_keyfile_write, function in nm-keyfile-internal
+nm_setting_802_1x_check_cert_scheme, function in NMSetting8021x +
+
+
nm_setting_802_1x_clear_altsubject_matches, function in NMSetting8021x
@@ -4482,6 +5421,10 @@ nm_keyfile_write, function in nm-keyfile-internal
+nm_setting_bridge_get_multicast_snooping, function in NMSettingBridge +
+
+
nm_setting_bridge_get_priority, function in NMSettingBridge
@@ -4498,7 +5441,11 @@ nm_keyfile_write, function in nm-keyfile-internal
-NM_SETTING_BRIDGE_MAX_AGE, macro in NMSettingBridge +NM_SETTING_BRIDGE_MAX_AGE, macro in NMSettingBridge +
+
+
+NM_SETTING_BRIDGE_MULTICAST_SNOOPING, macro in NMSettingBridge
@@ -4658,6 +5605,10 @@ nm_keyfile_write, function in nm-keyfile-internal
+nm_setting_connection_get_lldp, function in NMSettingConnection +
+
+
nm_setting_connection_get_master, function in NMSettingConnection
@@ -4714,6 +5665,10 @@ nm_keyfile_write, function in nm-keyfile-internal
+NM_SETTING_CONNECTION_LLDP, macro in NMSettingConnection +
+
+
NM_SETTING_CONNECTION_MASTER, macro in NMSettingConnection
@@ -4946,6 +5901,62 @@ nm_keyfile_write, function in nm-keyfile-internal
+NM_SETTING_DNS_OPTION_ATTEMPTS, macro in NMSettingIPConfig +
+
+
+NM_SETTING_DNS_OPTION_DEBUG, macro in NMSettingIPConfig +
+
+
+NM_SETTING_DNS_OPTION_EDNS0, macro in NMSettingIPConfig +
+
+
+NM_SETTING_DNS_OPTION_INET6, macro in NMSettingIPConfig +
+
+
+NM_SETTING_DNS_OPTION_IP6_BYTESTRING, macro in NMSettingIPConfig +
+
+
+NM_SETTING_DNS_OPTION_IP6_DOTINT, macro in NMSettingIPConfig +
+
+
+NM_SETTING_DNS_OPTION_NDOTS, macro in NMSettingIPConfig +
+
+
+NM_SETTING_DNS_OPTION_NO_CHECK_NAMES, macro in NMSettingIPConfig +
+
+
+NM_SETTING_DNS_OPTION_NO_IP6_DOTINT, macro in NMSettingIPConfig +
+
+
+NM_SETTING_DNS_OPTION_NO_TLD_QUERY, macro in NMSettingIPConfig +
+
+
+NM_SETTING_DNS_OPTION_ROTATE, macro in NMSettingIPConfig +
+
+
+NM_SETTING_DNS_OPTION_SINGLE_REQUEST, macro in NMSettingIPConfig +
+
+
+NM_SETTING_DNS_OPTION_SINGLE_REQUEST_REOPEN, macro in NMSettingIPConfig +
+
+
+NM_SETTING_DNS_OPTION_TIMEOUT, macro in NMSettingIPConfig +
+
+
nm_setting_duplicate, function in NMSetting
@@ -4978,10 +5989,18 @@ nm_keyfile_write, function in nm-keyfile-internal
+NM_SETTING_GSM_DEVICE_ID, macro in NMSettingGsm +
+
+
nm_setting_gsm_get_apn, function in NMSettingGsm
+nm_setting_gsm_get_device_id, function in NMSettingGsm +
+
+
nm_setting_gsm_get_home_only, function in NMSettingGsm
@@ -5010,6 +6029,14 @@ nm_keyfile_write, function in nm-keyfile-internal
+nm_setting_gsm_get_sim_id, function in NMSettingGsm +
+
+
+nm_setting_gsm_get_sim_operator_id, function in NMSettingGsm +
+
+
nm_setting_gsm_get_username, function in NMSettingGsm
@@ -5050,6 +6077,14 @@ nm_keyfile_write, function in nm-keyfile-internal
+NM_SETTING_GSM_SIM_ID, macro in NMSettingGsm +
+
+
+NM_SETTING_GSM_SIM_OPERATOR_ID, macro in NMSettingGsm +
+
+
NM_SETTING_GSM_USERNAME, macro in NMSettingGsm
@@ -5110,10 +6145,26 @@ nm_keyfile_write, function in nm-keyfile-internal
+NM_SETTING_IP4_CONFIG_DHCP_FQDN, macro in NMSettingIP4Config +
+
+
+NM_SETTING_IP4_CONFIG_DHCP_TIMEOUT, macro in NMSettingIP4Config +
+
+
nm_setting_ip4_config_get_dhcp_client_id, function in NMSettingIP4Config
+nm_setting_ip4_config_get_dhcp_fqdn, function in NMSettingIP4Config +
+
+
+nm_setting_ip4_config_get_dhcp_timeout, function in NMSettingIP4Config +
+
+
NM_SETTING_IP4_CONFIG_METHOD_AUTO, macro in NMSettingIP4Config
@@ -5142,6 +6193,14 @@ nm_keyfile_write, function in nm-keyfile-internal
+NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE, macro in NMSettingIP6Config +
+
+
+nm_setting_ip6_config_get_addr_gen_mode, function in NMSettingIP6Config +
+
+
nm_setting_ip6_config_get_ip6_privacy, function in NMSettingIP6Config
@@ -5194,6 +6253,10 @@ nm_keyfile_write, function in nm-keyfile-internal
+nm_setting_ip_config_add_dns_option, function in NMSettingIPConfig +
+
+
nm_setting_ip_config_add_dns_search, function in NMSettingIPConfig
@@ -5202,171 +6265,347 @@ nm_keyfile_write, function in nm-keyfile-internal
-nm_setting_ip_config_clear_addresses, function in NMSettingIPConfig +nm_setting_ip_config_clear_addresses, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_clear_dns, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_clear_dns_options, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_clear_dns_searches, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_clear_routes, function in NMSettingIPConfig +
+
+
+NM_SETTING_IP_CONFIG_DHCP_HOSTNAME, macro in NMSettingIPConfig +
+
+
+NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME, macro in NMSettingIPConfig +
+
+
+NM_SETTING_IP_CONFIG_DNS, macro in NMSettingIPConfig +
+
+
+NM_SETTING_IP_CONFIG_DNS_OPTIONS, macro in NMSettingIPConfig +
+
+
+NM_SETTING_IP_CONFIG_DNS_SEARCH, macro in NMSettingIPConfig +
+
+
+NM_SETTING_IP_CONFIG_GATEWAY, macro in NMSettingIPConfig +
+
+
+nm_setting_ip_config_get_address, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_get_dhcp_hostname, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_get_dhcp_send_hostname, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_get_dns, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_get_dns_option, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_get_dns_search, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_get_gateway, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_get_ignore_auto_dns, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_get_ignore_auto_routes, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_get_may_fail, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_get_method, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_get_never_default, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_get_num_addresses, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_get_num_dns, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_get_num_dns_options, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_get_num_dns_searches, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_get_num_routes, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_get_route, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_get_route_metric, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_has_dns_options, function in NMSettingIPConfig +
+
+
+NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS, macro in NMSettingIPConfig +
+
+
+NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES, macro in NMSettingIPConfig +
+
+
+NM_SETTING_IP_CONFIG_MAY_FAIL, macro in NMSettingIPConfig +
+
+
+NM_SETTING_IP_CONFIG_METHOD, macro in NMSettingIPConfig +
+
+
+NM_SETTING_IP_CONFIG_NEVER_DEFAULT, macro in NMSettingIPConfig +
+
+
+nm_setting_ip_config_next_valid_dns_option, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_remove_address, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_remove_address_by_value, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_remove_dns, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_remove_dns_by_value, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_remove_dns_option, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_remove_dns_option_by_value, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_remove_dns_search, function in NMSettingIPConfig +
+
+
+nm_setting_ip_config_remove_dns_search_by_value, function in NMSettingIPConfig
-nm_setting_ip_config_clear_dns, function in NMSettingIPConfig +nm_setting_ip_config_remove_route, function in NMSettingIPConfig
-nm_setting_ip_config_clear_dns_searches, function in NMSettingIPConfig +nm_setting_ip_config_remove_route_by_value, function in NMSettingIPConfig
-nm_setting_ip_config_clear_routes, function in NMSettingIPConfig +NM_SETTING_IP_CONFIG_ROUTES, macro in NMSettingIPConfig
-NM_SETTING_IP_CONFIG_DHCP_HOSTNAME, macro in NMSettingIPConfig +NM_SETTING_IP_CONFIG_ROUTE_METRIC, macro in NMSettingIPConfig
-NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME, macro in NMSettingIPConfig +NM_SETTING_IP_TUNNEL_ENCAPSULATION_LIMIT, macro in NMSettingIPTunnel
-NM_SETTING_IP_CONFIG_DNS, macro in NMSettingIPConfig +NM_SETTING_IP_TUNNEL_FLOW_LABEL, macro in NMSettingIPTunnel
-NM_SETTING_IP_CONFIG_DNS_SEARCH, macro in NMSettingIPConfig +nm_setting_ip_tunnel_get_encapsulation_limit, function in NMSettingIPTunnel
-NM_SETTING_IP_CONFIG_GATEWAY, macro in NMSettingIPConfig +nm_setting_ip_tunnel_get_flow_label, function in NMSettingIPTunnel
-nm_setting_ip_config_get_address, function in NMSettingIPConfig +nm_setting_ip_tunnel_get_input_key, function in NMSettingIPTunnel
-nm_setting_ip_config_get_dhcp_hostname, function in NMSettingIPConfig +nm_setting_ip_tunnel_get_local, function in NMSettingIPTunnel
-nm_setting_ip_config_get_dhcp_send_hostname, function in NMSettingIPConfig +nm_setting_ip_tunnel_get_mode, function in NMSettingIPTunnel
-nm_setting_ip_config_get_dns, function in NMSettingIPConfig +nm_setting_ip_tunnel_get_mtu, function in NMSettingIPTunnel
-nm_setting_ip_config_get_dns_search, function in NMSettingIPConfig +nm_setting_ip_tunnel_get_output_key, function in NMSettingIPTunnel
-nm_setting_ip_config_get_gateway, function in NMSettingIPConfig +nm_setting_ip_tunnel_get_parent, function in NMSettingIPTunnel
-nm_setting_ip_config_get_ignore_auto_dns, function in NMSettingIPConfig +nm_setting_ip_tunnel_get_path_mtu_discovery, function in NMSettingIPTunnel
-nm_setting_ip_config_get_ignore_auto_routes, function in NMSettingIPConfig +nm_setting_ip_tunnel_get_remote, function in NMSettingIPTunnel
-nm_setting_ip_config_get_may_fail, function in NMSettingIPConfig +nm_setting_ip_tunnel_get_tos, function in NMSettingIPTunnel
-nm_setting_ip_config_get_method, function in NMSettingIPConfig +nm_setting_ip_tunnel_get_ttl, function in NMSettingIPTunnel
-nm_setting_ip_config_get_never_default, function in NMSettingIPConfig +NM_SETTING_IP_TUNNEL_INPUT_KEY, macro in NMSettingIPTunnel
-nm_setting_ip_config_get_num_addresses, function in NMSettingIPConfig +NM_SETTING_IP_TUNNEL_LOCAL, macro in NMSettingIPTunnel
-nm_setting_ip_config_get_num_dns, function in NMSettingIPConfig +NM_SETTING_IP_TUNNEL_MODE, macro in NMSettingIPTunnel
-nm_setting_ip_config_get_num_dns_searches, function in NMSettingIPConfig +NM_SETTING_IP_TUNNEL_MTU, macro in NMSettingIPTunnel
-nm_setting_ip_config_get_num_routes, function in NMSettingIPConfig +nm_setting_ip_tunnel_new, function in NMSettingIPTunnel
-nm_setting_ip_config_get_route, function in NMSettingIPConfig +NM_SETTING_IP_TUNNEL_OUTPUT_KEY, macro in NMSettingIPTunnel
-nm_setting_ip_config_get_route_metric, function in NMSettingIPConfig +NM_SETTING_IP_TUNNEL_PARENT, macro in NMSettingIPTunnel
-NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS, macro in NMSettingIPConfig +NM_SETTING_IP_TUNNEL_PATH_MTU_DISCOVERY, macro in NMSettingIPTunnel
-NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES, macro in NMSettingIPConfig +NM_SETTING_IP_TUNNEL_REMOTE, macro in NMSettingIPTunnel
-NM_SETTING_IP_CONFIG_MAY_FAIL, macro in NMSettingIPConfig +NM_SETTING_IP_TUNNEL_SETTING_NAME, macro in NMSettingIPTunnel
-NM_SETTING_IP_CONFIG_METHOD, macro in NMSettingIPConfig +NM_SETTING_IP_TUNNEL_TOS, macro in NMSettingIPTunnel
-NM_SETTING_IP_CONFIG_NEVER_DEFAULT, macro in NMSettingIPConfig +NM_SETTING_IP_TUNNEL_TTL, macro in NMSettingIPTunnel
-nm_setting_ip_config_remove_address, function in NMSettingIPConfig +nm_setting_lookup_type, function in NMSetting
-nm_setting_ip_config_remove_address_by_value, function in NMSettingIPConfig +nm_setting_macvlan_get_mode, function in NMSettingMacvlan
-nm_setting_ip_config_remove_dns, function in NMSettingIPConfig +nm_setting_macvlan_get_parent, function in NMSettingMacvlan
-nm_setting_ip_config_remove_dns_by_value, function in NMSettingIPConfig +nm_setting_macvlan_get_promiscuous, function in NMSettingMacvlan
-nm_setting_ip_config_remove_dns_search, function in NMSettingIPConfig +nm_setting_macvlan_get_tap, function in NMSettingMacvlan
-nm_setting_ip_config_remove_dns_search_by_value, function in NMSettingIPConfig +NM_SETTING_MACVLAN_MODE, macro in NMSettingMacvlan
-nm_setting_ip_config_remove_route, function in NMSettingIPConfig +nm_setting_macvlan_new, function in NMSettingMacvlan
-nm_setting_ip_config_remove_route_by_value, function in NMSettingIPConfig +NM_SETTING_MACVLAN_PARENT, macro in NMSettingMacvlan
-NM_SETTING_IP_CONFIG_ROUTES, macro in NMSettingIPConfig +NM_SETTING_MACVLAN_PROMISCUOUS, macro in NMSettingMacvlan
-NM_SETTING_IP_CONFIG_ROUTE_METRIC, macro in NMSettingIPConfig +NM_SETTING_MACVLAN_SETTING_NAME, macro in NMSettingMacvlan
-nm_setting_lookup_type, function in NMSetting +NM_SETTING_MACVLAN_TAP, macro in NMSettingMacvlan
@@ -5698,10 +6937,70 @@ nm_keyfile_write, function in nm-keyfile-internal
+nm_setting_tun_get_group, function in NMSettingTun +
+
+
+nm_setting_tun_get_mode, function in NMSettingTun +
+
+
+nm_setting_tun_get_multi_queue, function in NMSettingTun +
+
+
+nm_setting_tun_get_owner, function in NMSettingTun +
+
+
+nm_setting_tun_get_pi, function in NMSettingTun +
+
+
+nm_setting_tun_get_vnet_hdr, function in NMSettingTun +
+
+
+NM_SETTING_TUN_GROUP, macro in NMSettingTun +
+
+
+NM_SETTING_TUN_MODE, macro in NMSettingTun +
+
+
+NM_SETTING_TUN_MULTI_QUEUE, macro in NMSettingTun +
+
+
+nm_setting_tun_new, function in NMSettingTun +
+
+
+NM_SETTING_TUN_OWNER, macro in NMSettingTun +
+
+
+NM_SETTING_TUN_PI, macro in NMSettingTun +
+
+
+NM_SETTING_TUN_SETTING_NAME, macro in NMSettingTun +
+
+
+NM_SETTING_TUN_VNET_HDR, macro in NMSettingTun +
+
+
nm_setting_verify, function in NMSetting
+nm_setting_verify_secrets, function in NMSetting +
+
+
nm_setting_vlan_add_priority, function in NMSettingVlan
@@ -5818,6 +7117,10 @@ nm_keyfile_write, function in nm-keyfile-internal
+nm_setting_vpn_get_timeout, function in NMSettingVpn +
+
+
nm_setting_vpn_get_user_name, function in NMSettingVpn
@@ -5850,10 +7153,150 @@ nm_keyfile_write, function in nm-keyfile-internal
+NM_SETTING_VPN_TIMEOUT, macro in NMSettingVpn +
+
+
NM_SETTING_VPN_USER_NAME, macro in NMSettingVpn
+NM_SETTING_VXLAN_AGEING, macro in NMSettingVxlan +
+
+
+NM_SETTING_VXLAN_DESTINATION_PORT, macro in NMSettingVxlan +
+
+
+nm_setting_vxlan_get_ageing, function in NMSettingVxlan +
+
+
+nm_setting_vxlan_get_destination_port, function in NMSettingVxlan +
+
+
+nm_setting_vxlan_get_id, function in NMSettingVxlan +
+
+
+nm_setting_vxlan_get_l2_miss, function in NMSettingVxlan +
+
+
+nm_setting_vxlan_get_l3_miss, function in NMSettingVxlan +
+
+
+nm_setting_vxlan_get_learning, function in NMSettingVxlan +
+
+
+nm_setting_vxlan_get_limit, function in NMSettingVxlan +
+
+
+nm_setting_vxlan_get_local, function in NMSettingVxlan +
+
+
+nm_setting_vxlan_get_parent, function in NMSettingVxlan +
+
+
+nm_setting_vxlan_get_proxy, function in NMSettingVxlan +
+
+
+nm_setting_vxlan_get_remote, function in NMSettingVxlan +
+
+
+nm_setting_vxlan_get_rsc, function in NMSettingVxlan +
+
+
+nm_setting_vxlan_get_source_port_max, function in NMSettingVxlan +
+
+
+nm_setting_vxlan_get_source_port_min, function in NMSettingVxlan +
+
+
+nm_setting_vxlan_get_tos, function in NMSettingVxlan +
+
+
+nm_setting_vxlan_get_ttl, function in NMSettingVxlan +
+
+
+NM_SETTING_VXLAN_ID, macro in NMSettingVxlan +
+
+
+NM_SETTING_VXLAN_L2_MISS, macro in NMSettingVxlan +
+
+
+NM_SETTING_VXLAN_L3_MISS, macro in NMSettingVxlan +
+
+
+NM_SETTING_VXLAN_LEARNING, macro in NMSettingVxlan +
+
+
+NM_SETTING_VXLAN_LIMIT, macro in NMSettingVxlan +
+
+
+NM_SETTING_VXLAN_LOCAL, macro in NMSettingVxlan +
+
+
+nm_setting_vxlan_new, function in NMSettingVxlan +
+
+
+NM_SETTING_VXLAN_PARENT, macro in NMSettingVxlan +
+
+
+NM_SETTING_VXLAN_PROXY, macro in NMSettingVxlan +
+
+
+NM_SETTING_VXLAN_REMOTE, macro in NMSettingVxlan +
+
+
+NM_SETTING_VXLAN_RSC, macro in NMSettingVxlan +
+
+
+NM_SETTING_VXLAN_SETTING_NAME, macro in NMSettingVxlan +
+
+
+NM_SETTING_VXLAN_SOURCE_PORT_MAX, macro in NMSettingVxlan +
+
+
+NM_SETTING_VXLAN_SOURCE_PORT_MIN, macro in NMSettingVxlan +
+
+
+NM_SETTING_VXLAN_TOS, macro in NMSettingVxlan +
+
+
+NM_SETTING_VXLAN_TTL, macro in NMSettingVxlan +
+
+
nm_setting_wimax_get_mac_address, function in NMSettingWimax
@@ -6094,6 +7537,10 @@ nm_keyfile_write, function in nm-keyfile-internal
+nm_setting_wireless_get_mac_address_randomization, function in NMSettingWireless +
+
+
nm_setting_wireless_get_mac_blacklist_item, function in NMSettingWireless
@@ -6114,6 +7561,10 @@ nm_keyfile_write, function in nm-keyfile-internal
+nm_setting_wireless_get_powersave, function in NMSettingWireless +
+
+
nm_setting_wireless_get_rate, function in NMSettingWireless
@@ -6142,6 +7593,10 @@ nm_keyfile_write, function in nm-keyfile-internal
+NM_SETTING_WIRELESS_MAC_ADDRESS_RANDOMIZATION, macro in NMSettingWireless +
+
+
NM_SETTING_WIRELESS_MODE, macro in NMSettingWireless
@@ -6166,6 +7621,10 @@ nm_keyfile_write, function in nm-keyfile-internal
+NM_SETTING_WIRELESS_POWERSAVE, macro in NMSettingWireless +
+
+
NM_SETTING_WIRELESS_RATE, macro in NMSettingWireless
@@ -6402,6 +7861,10 @@ nm_keyfile_write, function in nm-keyfile-internal
+stat, struct in nm-utils +
+
+
NMState, enum in nm-dbus-interface
@@ -6420,6 +7883,10 @@ NMTestGeneralMetaFlags, enum in test-general-enums

U

+NMUtilsCheckFilePredicate, user_function in nm-utils +
+
+
NMUtilsFileSearchInPathsPredicate, user_function in nm-utils
@@ -6436,6 +7903,14 @@ NMTestGeneralMetaFlags, enum in test-general-enums
+nm_utils_bond_mode_int_to_string, function in nm-utils +
+
+
+nm_utils_bond_mode_string_to_int, function in nm-utils +
+
+
nm_utils_check_virtual_device_compatibility, function in nm-utils
@@ -6444,6 +7919,10 @@ NMTestGeneralMetaFlags, enum in test-general-enums
+nm_utils_enum_get_values, function in nm-utils +
+
+
nm_utils_enum_to_str, function in nm-utils
@@ -6681,6 +8160,10 @@ NMTestGeneralMetaFlags, enum in test-general-enums
+NM_VLAN_FLAGS_ALL, macro in NMSettingVlan +
+
+
NMVpnConnection::vpn-state-changed, object signal in NMVpnConnection
@@ -6701,35 +8184,39 @@ NMTestGeneralMetaFlags, enum in test-general-enums
-NMVpnEditor::changed, object signal in NMVpnEditor +NMVpnEditor, struct in NMVpnEditorPlugin
-NMVpnEditorInterface, struct in NMVpnEditor +NMVpnEditor::changed, object signal in NMVpnEditorPlugin
-NMVpnEditorPlugin:description, object property in NMVpnEditor +NMVpnEditorInterface, struct in NMVpnEditor
-NMVpnEditorPlugin:name, object property in NMVpnEditor +NMVpnEditorPlugin:description, object property in NMVpnEditorPlugin
-NMVpnEditorPlugin:service, object property in NMVpnEditor +NMVpnEditorPlugin:name, object property in NMVpnEditorPlugin
-NMVpnEditorPluginCapability, enum in NMVpnEditor +NMVpnEditorPlugin:service, object property in NMVpnEditorPlugin
-NMVpnEditorPluginFactory, user_function in NMVpnEditor +NMVpnEditorPluginCapability, enum in NMVpnEditorPlugin
-NMVpnEditorPluginInterface, struct in NMVpnEditor +NMVpnEditorPluginFactory, user_function in NMVpnEditorPlugin +
+
+
+NMVpnEditorPluginInterface, struct in NMVpnEditorPlugin
@@ -6773,47 +8260,51 @@ NMTestGeneralMetaFlags, enum in test-general-enums
-nm_vpn_editor_get_widget, function in NMVpnEditor +nm_vpn_editor_get_widget, function in NMVpnEditor +
+
+
+NM_VPN_EDITOR_PLUGIN_DESCRIPTION, macro in NMVpnEditorPlugin
-NM_VPN_EDITOR_PLUGIN_DESCRIPTION, macro in NMVpnEditor +nm_vpn_editor_plugin_export, function in NMVpnEditorPlugin
-nm_vpn_editor_plugin_export, function in NMVpnEditor +nm_vpn_editor_plugin_factory, function in NMVpnEditorPlugin
-nm_vpn_editor_plugin_factory, function in NMVpnEditor +nm_vpn_editor_plugin_get_capabilities, function in NMVpnEditorPlugin
-nm_vpn_editor_plugin_get_capabilities, function in NMVpnEditor +nm_vpn_editor_plugin_get_editor, function in NMVpnEditorPlugin
-nm_vpn_editor_plugin_get_editor, function in NMVpnEditor +nm_vpn_editor_plugin_get_suggested_filename, function in NMVpnEditorPlugin
-nm_vpn_editor_plugin_get_suggested_filename, function in NMVpnEditor +nm_vpn_editor_plugin_import, function in NMVpnEditorPlugin
-nm_vpn_editor_plugin_import, function in NMVpnEditor +nm_vpn_editor_plugin_load_from_file, function in NMVpnEditorPlugin
-NM_VPN_EDITOR_PLUGIN_NAME, macro in NMVpnEditor +NM_VPN_EDITOR_PLUGIN_NAME, macro in NMVpnEditorPlugin
-NM_VPN_EDITOR_PLUGIN_SERVICE, macro in NMVpnEditor +NM_VPN_EDITOR_PLUGIN_SERVICE, macro in NMVpnEditorPlugin
-nm_vpn_editor_update_connection, function in NMVpnEditor +nm_vpn_editor_update_connection, function in NMVpnEditor
@@ -6853,6 +8344,30 @@ NMTestGeneralMetaFlags, enum in test-general-enums
+NM_VPN_PLUGIN_INFO_FILENAME, macro in nm-vpn-plugin-info +
+
+
+NM_VPN_PLUGIN_INFO_KEYFILE, macro in nm-vpn-plugin-info +
+
+
+NM_VPN_PLUGIN_INFO_KF_GROUP_CONNECTION, macro in nm-vpn-plugin-info +
+
+
+NM_VPN_PLUGIN_INFO_KF_GROUP_GNOME, macro in nm-vpn-plugin-info +
+
+
+NM_VPN_PLUGIN_INFO_KF_GROUP_LIBNM, macro in nm-vpn-plugin-info +
+
+
+NM_VPN_PLUGIN_INFO_NAME, macro in nm-vpn-plugin-info +
+
+
NM_VPN_PLUGIN_IP4_CONFIG_ADDRESS, macro in nm-vpn-dbus-interface
diff --git a/docs/libnm/html/ch03.html b/docs/libnm/html/ch03.html index e30c11dc..2bd5219f 100644 --- a/docs/libnm/html/ch03.html +++ b/docs/libnm/html/ch03.html @@ -69,17 +69,23 @@ NMSettingInfiniband — Describes connection properties for IP-over-InfiniBand networks
+NMSettingIP4Config — Describes IPv4 addressing, routing, and name service properties +
+
+NMSettingIP6Config — Describes IPv6 addressing, routing, and name service properties +
+
NMSettingIPConfig — Abstract base class for IPv4 and IPv6 addressing, routing, and name service properties
-NMSettingIP4Config — Describes IPv4 addressing, routing, and name service properties +NMSettingIPTunnel — Describes connection properties for IP tunnel devices
-NMSettingIP6Config — Describes IPv6 addressing, routing, and name service properties +NMSettingMacvlan — Describes connection properties for macvlan interfaces
-NMSettingOlpcMesh +NMSettingOlpcMesh — Describes connection properties for OLPC-Mesh devices
NMSettingPpp — Describes connection properties for devices/networks @@ -99,12 +105,18 @@ serial communications NMSettingTeamPort — Describes connection properties for team ports
+NMSettingTun — Describes connection properties for TUN/TAP interfaces +
+
NMSettingVlan — Describes connection properties for VLAN interfaces
NMSettingVpn — Describes connection properties for Virtual Private Networks
+NMSettingVxlan — Describes connection properties for VXLAN interfaces +
+
NMSettingWimax — Describes 802.16e Mobile WiMAX connection properties
diff --git a/docs/libnm/html/ch04.html b/docs/libnm/html/ch04.html index 6513b1a8..07e8b676 100644 --- a/docs/libnm/html/ch04.html +++ b/docs/libnm/html/ch04.html @@ -48,6 +48,12 @@ NMDeviceInfiniband
+NMDeviceIPTunnel +
+
+NMDeviceMacvlan +
+
NMDeviceModem
@@ -57,9 +63,15 @@ NMDeviceTeam
+NMDeviceTun +
+
NMDeviceVlan
+NMDeviceVxlan +
+
NMDeviceWifi
diff --git a/docs/libnm/html/ch06.html b/docs/libnm/html/ch06.html index 7cbb0f5e..c4aadccf 100644 --- a/docs/libnm/html/ch06.html +++ b/docs/libnm/html/ch06.html @@ -27,7 +27,7 @@ nm-vpn-dbus-interface
-NMVpnEditor +NMVpnEditorPlugin
diff --git a/docs/libnm/html/index.html b/docs/libnm/html/index.html index 2c0ecc72..ee011718 100644 --- a/docs/libnm/html/index.html +++ b/docs/libnm/html/index.html @@ -15,7 +15,7 @@

- for libnm 1.0.10 + for libnm 1.1.90 The latest version of this documentation can be found on-line at https://developer.gnome.org/libnm/1.0/. @@ -114,17 +114,23 @@ NMSettingInfiniband — Describes connection properties for IP-over-InfiniBand networks

+NMSettingIP4Config — Describes IPv4 addressing, routing, and name service properties +
+
+NMSettingIP6Config — Describes IPv6 addressing, routing, and name service properties +
+
NMSettingIPConfig — Abstract base class for IPv4 and IPv6 addressing, routing, and name service properties
-NMSettingIP4Config — Describes IPv4 addressing, routing, and name service properties +NMSettingIPTunnel — Describes connection properties for IP tunnel devices
-NMSettingIP6Config — Describes IPv6 addressing, routing, and name service properties +NMSettingMacvlan — Describes connection properties for macvlan interfaces
-NMSettingOlpcMesh +NMSettingOlpcMesh — Describes connection properties for OLPC-Mesh devices
NMSettingPpp — Describes connection properties for devices/networks @@ -144,12 +150,18 @@ serial communications NMSettingTeamPort — Describes connection properties for team ports
+NMSettingTun — Describes connection properties for TUN/TAP interfaces +
+
NMSettingVlan — Describes connection properties for VLAN interfaces
NMSettingVpn — Describes connection properties for Virtual Private Networks
+NMSettingVxlan — Describes connection properties for VXLAN interfaces +
+
NMSettingWimax — Describes 802.16e Mobile WiMAX connection properties
@@ -190,6 +202,12 @@ use WEP, LEAP, WPA or WPA2/RSN security NMDeviceInfiniband
+NMDeviceIPTunnel +
+
+NMDeviceMacvlan +
+
NMDeviceModem
@@ -199,9 +217,15 @@ use WEP, LEAP, WPA or WPA2/RSN security NMDeviceTeam
+NMDeviceTun +
+
NMDeviceVlan
+NMDeviceVxlan +
+
NMDeviceWifi
@@ -244,7 +268,7 @@ use WEP, LEAP, WPA or WPA2/RSN security nm-vpn-dbus-interface
-NMVpnEditor +NMVpnEditorPlugin
Object Hierarchy
diff --git a/docs/libnm/html/index.sgml b/docs/libnm/html/index.sgml index 4e149c2a..dfe1f677 100644 --- a/docs/libnm/html/index.sgml +++ b/docs/libnm/html/index.sgml @@ -37,6 +37,7 @@ + @@ -78,12 +79,15 @@ + + + @@ -114,6 +118,7 @@ + @@ -133,6 +138,8 @@ + + @@ -283,7 +290,7 @@ - + @@ -315,6 +322,7 @@ + @@ -356,6 +364,10 @@ + + + + @@ -505,6 +517,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -522,6 +562,7 @@ + @@ -551,12 +592,15 @@ + + + @@ -564,6 +608,7 @@ + @@ -600,6 +645,7 @@ + @@ -624,6 +670,10 @@ + + + + @@ -667,6 +717,7 @@ + @@ -688,10 +739,15 @@ + + + + + @@ -700,6 +756,7 @@ + @@ -718,6 +775,7 @@ + @@ -969,6 +1027,7 @@ + @@ -978,12 +1037,14 @@ + + @@ -1122,6 +1183,9 @@ + + + @@ -1135,8 +1199,12 @@ + + + + @@ -1144,6 +1212,8 @@ + + @@ -1172,6 +1242,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1233,6 +1359,14 @@ + + + + + + + + @@ -1257,6 +1391,7 @@ + @@ -1267,11 +1402,26 @@ + + + + + + + + + + + + + + + @@ -1282,50 +1432,85 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1492,6 +1677,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1499,6 +1717,7 @@ + @@ -1525,6 +1744,7 @@ + @@ -1553,6 +1773,7 @@ + @@ -1560,12 +1781,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1683,6 +1965,8 @@ + + @@ -1702,6 +1986,8 @@ + + @@ -1713,8 +1999,10 @@ + + @@ -1803,6 +2091,7 @@ + @@ -1818,9 +2107,11 @@ + + @@ -1831,12 +2122,17 @@ + + + + + @@ -1847,6 +2143,13 @@ + + + + + + + @@ -1856,9 +2159,11 @@ + + @@ -1872,6 +2177,7 @@ + @@ -1888,11 +2194,14 @@ + + + @@ -1976,15 +2285,18 @@ + + + @@ -2015,6 +2327,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2066,6 +2444,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2087,6 +2495,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2421,6 +2892,7 @@ + @@ -2444,8 +2916,11 @@ + + + @@ -2459,6 +2934,7 @@ + @@ -2468,13 +2944,14 @@ + - - + + @@ -2573,41 +3050,41 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/libnm/html/libnm-NMConnection.html b/docs/libnm/html/libnm-NMConnection.html index aa683548..852c8876 100644 --- a/docs/libnm/html/libnm-NMConnection.html +++ b/docs/libnm/html/libnm-NMConnection.html @@ -133,6 +133,14 @@ gboolean +nm_connection_verify_secrets () + + + + +gboolean + + nm_connection_normalize () @@ -356,6 +364,14 @@ +NMSettingIPTunnel * + + +nm_connection_get_setting_ip_tunnel () + + + + NMSettingIPConfig * @@ -372,6 +388,14 @@ +NMSettingMacvlan * + + +nm_connection_get_setting_macvlan () + + + + NMSettingOlpcMesh * @@ -404,6 +428,14 @@ +NMSettingTun * + + +nm_connection_get_setting_tun () + + + + NMSettingVpn * @@ -458,6 +490,14 @@ nm_connection_get_setting_vlan () + + +NMSettingVxlan * + + +nm_connection_get_setting_vxlan () + +
@@ -502,7 +542,7 @@

Object Hierarchy

-
    GFlags
+
    GFlags
     ╰── NMConnectionSerializationFlags
 
@@ -943,6 +983,41 @@ setting and which property failed validation, and how it failed validation.


+

nm_connection_verify_secrets ()

+
gboolean
+nm_connection_verify_secrets (NMConnection *connection,
+                              GError **error);
+

Verifies the secrets in the connection.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

connection

the NMConnection to verify in

 

error

location to store error, or NULL

 
+
+
+

Returns

+

TRUE if the secrets are valid, FALSE if they are not

+
+

Since: 1.2

+
+
+

nm_connection_normalize ()

gboolean
 nm_connection_normalize (NMConnection *connection,
@@ -958,7 +1033,7 @@ is valid. As this function only performs some specific normalization steps
 it cannot repair all connections. If the connection has errors that
 cannot be normalized, the connection will not be modified.

-

Parameters

+

Parameters

@@ -995,7 +1070,7 @@ why the connection is invalid, if the function returns an error.

-

Returns

+

Returns

TRUE if the connection is valid, FALSE if it is not

@@ -1011,7 +1086,7 @@ intended as a guide to what secrets may be required, because in some circumstances, there is no way to conclusively determine exactly which secrets are needed.

-

Parameters

+

Parameters

@@ -1037,7 +1112,7 @@ elements.

-

Returns

+

Returns

the setting name of the NMSetting object which has invalid or missing secrets

@@ -1050,7 +1125,7 @@ nm_connection_clear_secrets ( -

Parameters

+

Parameters

@@ -1076,7 +1151,7 @@ nm_connection_clear_secrets_with_flags

Clears and frees secrets determined by func .

-

Parameters

+

Parameters

@@ -1122,7 +1197,7 @@ returned by secrets .

-

Parameters

+

Parameters

@@ -1155,7 +1230,7 @@ or
-

Returns

+

Returns

TRUE if the secrets were successfully updated, FALSE if the update failed (tried to update secrets for a setting that doesn't exist, etc)

@@ -1170,7 +1245,7 @@ nm_connection_set_path (“path” property.

-

Parameters

+

Parameters

@@ -1200,7 +1275,7 @@ which provides the connection

nm_connection_get_path (NMConnection *connection);

Returns the connection's D-Bus path.

-

Parameters

+

Parameters

@@ -1215,7 +1290,7 @@ nm_connection_get_path ( -

Returns

+

Returns

the D-Bus path of the connection, previously set by a call to nm_connection_set_path().

@@ -1231,7 +1306,7 @@ If the connection contains no NMSettingConnection, it will return -

Parameters

+

Parameters

@@ -1246,7 +1321,7 @@ NetworkManager, this is the name of the created interface.

-

Returns

+

Returns

Name of the kernel interface or NULL

@@ -1262,7 +1337,7 @@ type (ie wired, Wi-Fi, ppp, etc). Checks the type
.

-

Parameters

+

Parameters

@@ -1285,7 +1360,7 @@ property of the connection and matches that against
-

Returns

+

Returns

TRUE if the connection is of the given type , FALSE if not

@@ -1300,7 +1375,7 @@ nm_connection_for_each_setting_value (NMSetting object in the NMConnection, calling the supplied user function for each property.

-

Parameters

+

Parameters

@@ -1337,7 +1412,7 @@ nm_connection_dump ( -

Parameters

+

Parameters

@@ -1359,7 +1434,7 @@ output format is not guaranteed to be stable and may change at any time.

nm_connection_get_uuid (NMConnection *connection);

A shortcut to return the UUID from the connection's NMSettingConnection.

-

Parameters

+

Parameters

@@ -1374,7 +1449,7 @@ nm_connection_get_uuid ( -

Returns

+

Returns

the UUID from the connection's 'connection' setting

@@ -1385,7 +1460,7 @@ nm_connection_get_uuid (NMConnection *connection);

A shortcut to return the ID from the connection's NMSettingConnection.

-

Parameters

+

Parameters

@@ -1400,7 +1475,7 @@ nm_connection_get_id ( -

Returns

+

Returns

the ID from the connection's 'connection' setting

@@ -1411,7 +1486,7 @@ nm_connection_get_id (NMConnection *connection);

A shortcut to return the type from the connection's NMSettingConnection.

-

Parameters

+

Parameters

@@ -1426,7 +1501,7 @@ nm_connection_get_connection_type ( -

Returns

+

Returns

the type from the connection's 'connection' setting

@@ -1439,7 +1514,7 @@ nm_connection_is_virtual ( -

Parameters

+

Parameters

@@ -1454,7 +1529,7 @@ activated even if the device it refers to doesn't exist).

-

Returns

+

Returns

whether connection refers to a virtual device

@@ -1470,7 +1545,7 @@ return for the virtual device that would be created for
-

Parameters

+

Parameters

@@ -1485,7 +1560,7 @@ Eg, "VLAN (eth1.1)".

-

Returns

+

Returns

the name of connection 's device, or NULL if connection @@ -1500,7 +1575,7 @@ is not a virtual connection type.

nm_connection_get_setting_802_1x (NMConnection *connection);

A shortcut to return any NMSetting8021x the connection might contain.

-

Parameters

+

Parameters

@@ -1515,7 +1590,7 @@ nm_connection_get_setting_802_1x ( -

Returns

+

Returns

an NMSetting8021x if the connection contains one, otherwise NULL.

[transfer none]

@@ -1527,7 +1602,7 @@ nm_connection_get_setting_802_1x (NMConnection *connection);

A shortcut to return any NMSettingBluetooth the connection might contain.

-

Parameters

+

Parameters

@@ -1542,7 +1617,7 @@ nm_connection_get_setting_bluetooth ( -

Returns

+

Returns

an NMSettingBluetooth if the connection contains one, otherwise NULL.

[transfer none]

@@ -1554,7 +1629,7 @@ nm_connection_get_setting_bluetooth (NMConnection *connection);

A shortcut to return any NMSettingBond the connection might contain.

-

Parameters

+

Parameters

@@ -1569,7 +1644,7 @@ nm_connection_get_setting_bond ( -

Returns

+

Returns

an NMSettingBond if the connection contains one, otherwise NULL.

[transfer none]

@@ -1581,7 +1656,7 @@ nm_connection_get_setting_bond (NMConnection *connection);

A shortcut to return any NMSettingTeam the connection might contain.

-

Parameters

+

Parameters

@@ -1596,7 +1671,7 @@ nm_connection_get_setting_team ( -

Returns

+

Returns

an NMSettingTeam if the connection contains one, otherwise NULL.

[transfer none]

@@ -1608,7 +1683,7 @@ nm_connection_get_setting_team (NMConnection *connection);

A shortcut to return any NMSettingTeamPort the connection might contain.

-

Parameters

+

Parameters

@@ -1623,7 +1698,7 @@ nm_connection_get_setting_team_port ( -

Returns

+

Returns

an NMSettingTeamPort if the connection contains one, otherwise NULL.

[transfer none]

@@ -1635,7 +1710,7 @@ nm_connection_get_setting_team_port (NMConnection *connection);

A shortcut to return any NMSettingBridge the connection might contain.

-

Parameters

+

Parameters

@@ -1650,7 +1725,7 @@ nm_connection_get_setting_bridge ( -

Returns

+

Returns

an NMSettingBridge if the connection contains one, otherwise NULL.

[transfer none]

@@ -1662,7 +1737,7 @@ nm_connection_get_setting_bridge (NMConnection *connection);

A shortcut to return any NMSettingBridgePort the connection might contain.

-

Parameters

+

Parameters

@@ -1677,7 +1752,7 @@ nm_connection_get_setting_bridge_port ( -

Returns

+

Returns

an NMSettingBridgePort if the connection contains one, otherwise NULL.

[transfer none]

@@ -1689,7 +1764,7 @@ nm_connection_get_setting_bridge_port (NMConnection *connection);

A shortcut to return any NMSettingCdma the connection might contain.

-

Parameters

+

Parameters

@@ -1704,7 +1779,7 @@ nm_connection_get_setting_cdma ( -

Returns

+

Returns

an NMSettingCdma if the connection contains one, otherwise NULL.

[transfer none]

@@ -1716,7 +1791,7 @@ nm_connection_get_setting_cdma (NMConnection *connection);

A shortcut to return any NMSettingConnection the connection might contain.

-

Parameters

+

Parameters

@@ -1731,7 +1806,7 @@ nm_connection_get_setting_connection ( -

Returns

+

Returns

an NMSettingConnection if the connection contains one, otherwise NULL.

[transfer none]

@@ -1743,7 +1818,7 @@ nm_connection_get_setting_connection (NMConnection *connection);

A shortcut to return any NMSettingDcb the connection might contain.

-

Parameters

+

Parameters

@@ -1758,7 +1833,7 @@ nm_connection_get_setting_dcb ( -

Returns

+

Returns

an NMSettingDcb if the connection contains one, otherwise NULL.

[transfer none]

@@ -1770,7 +1845,7 @@ nm_connection_get_setting_dcb (NMConnection *connection);

A shortcut to return any NMSettingGeneric the connection might contain.

-

Parameters

+

Parameters

@@ -1785,7 +1860,7 @@ nm_connection_get_setting_generic ( -

Returns

+

Returns

an NMSettingGeneric if the connection contains one, otherwise NULL.

[transfer none]

@@ -1797,7 +1872,7 @@ nm_connection_get_setting_generic (NMConnection *connection);

A shortcut to return any NMSettingGsm the connection might contain.

-

Parameters

+

Parameters

@@ -1812,7 +1887,7 @@ nm_connection_get_setting_gsm ( -

Returns

+

Returns

an NMSettingGsm if the connection contains one, otherwise NULL.

[transfer none]

@@ -1824,7 +1899,7 @@ nm_connection_get_setting_gsm (NMConnection *connection);

A shortcut to return any NMSettingInfiniband the connection might contain.

-

Parameters

+

Parameters

@@ -1839,13 +1914,41 @@ nm_connection_get_setting_infiniband ( -

Returns

+

Returns

an NMSettingInfiniband if the connection contains one, otherwise NULL.

[transfer none]


+

nm_connection_get_setting_ip_tunnel ()

+
NMSettingIPTunnel *
+nm_connection_get_setting_ip_tunnel (NMConnection *connection);
+

A shortcut to return any NMSettingIPTunnel the connection might contain.

+
+

Parameters

+
+++++ + + + + + +

connection

the NMConnection

 
+
+
+

Returns

+

an NMSettingIPTunnel if the connection contains one, otherwise NULL.

+

[transfer none]

+
+

Since: 1.2

+
+
+

nm_connection_get_setting_ip4_config ()

NMSettingIPConfig *
 nm_connection_get_setting_ip4_config (NMConnection *connection);
@@ -1854,7 +1957,7 @@ nm_connection_get_setting_ip4_config (NMSettingIP4Config.

-

Parameters

+

Parameters

@@ -1869,7 +1972,7 @@ majority of IPv4-setting-related methods are on that type, not
-

Returns

+

Returns

an NMSettingIP4Config if the connection contains one, otherwise NULL.

[type NMSettingIP4Config][transfer none]

@@ -1885,7 +1988,7 @@ nm_connection_get_setting_ip6_config (NMSettingIP6Config.

-

Parameters

+

Parameters

@@ -1900,7 +2003,7 @@ majority of IPv6-setting-related methods are on that type, not
-

Returns

+

Returns

an NMSettingIP6Config if the connection contains one, otherwise NULL.

[type NMSettingIP6Config][transfer none]

@@ -1908,12 +2011,40 @@ connection contains one, otherwise NULL.


+

nm_connection_get_setting_macvlan ()

+
NMSettingMacvlan *
+nm_connection_get_setting_macvlan (NMConnection *connection);
+

A shortcut to return any NMSettingMacvlan the connection might contain.

+
+

Parameters

+
+++++ + + + + + +

connection

the NMConnection

 
+
+
+

Returns

+

an NMSettingMacvlan if the connection contains one, otherwise NULL.

+

[transfer none]

+
+

Since: 1.2

+
+
+

nm_connection_get_setting_olpc_mesh ()

NMSettingOlpcMesh *
 nm_connection_get_setting_olpc_mesh (NMConnection *connection);

A shortcut to return any NMSettingOlpcMesh the connection might contain.

-

Parameters

+

Parameters

@@ -1928,7 +2059,7 @@ nm_connection_get_setting_olpc_mesh ( -

Returns

+

Returns

an NMSettingOlpcMesh if the connection contains one, otherwise NULL.

[transfer none]

@@ -1940,7 +2071,7 @@ nm_connection_get_setting_olpc_mesh (NMConnection *connection);

A shortcut to return any NMSettingPpp the connection might contain.

-

Parameters

+

Parameters

@@ -1955,7 +2086,7 @@ nm_connection_get_setting_ppp ( -

Returns

+

Returns

an NMSettingPpp if the connection contains one, otherwise NULL.

[transfer none]

@@ -1967,7 +2098,7 @@ nm_connection_get_setting_ppp (NMConnection *connection);

A shortcut to return any NMSettingPppoe the connection might contain.

-

Parameters

+

Parameters

@@ -1982,7 +2113,7 @@ nm_connection_get_setting_pppoe ( -

Returns

+

Returns

an NMSettingPppoe if the connection contains one, otherwise NULL.

[transfer none]

@@ -1994,7 +2125,7 @@ nm_connection_get_setting_pppoe (NMConnection *connection);

A shortcut to return any NMSettingSerial the connection might contain.

-

Parameters

+

Parameters

@@ -2009,19 +2140,47 @@ nm_connection_get_setting_serial ( -

Returns

+

Returns

an NMSettingSerial if the connection contains one, otherwise NULL.

[transfer none]


+

nm_connection_get_setting_tun ()

+
NMSettingTun *
+nm_connection_get_setting_tun (NMConnection *connection);
+

A shortcut to return any NMSettingTun the connection might contain.

+
+

Parameters

+
+++++ + + + + + +

connection

the NMConnection

 
+
+
+

Returns

+

an NMSettingTun if the connection contains one, otherwise NULL.

+

[transfer none]

+
+

Since: 1.2

+
+
+

nm_connection_get_setting_vpn ()

NMSettingVpn *
 nm_connection_get_setting_vpn (NMConnection *connection);

A shortcut to return any NMSettingVpn the connection might contain.

-

Parameters

+

Parameters

@@ -2036,7 +2195,7 @@ nm_connection_get_setting_vpn ( -

Returns

+

Returns

an NMSettingVpn if the connection contains one, otherwise NULL.

[transfer none]

@@ -2048,7 +2207,7 @@ nm_connection_get_setting_vpn (NMConnection *connection);

A shortcut to return any NMSettingWimax the connection might contain.

-

Parameters

+

Parameters

@@ -2063,7 +2222,7 @@ nm_connection_get_setting_wimax ( -

Returns

+

Returns

an NMSettingWimax if the connection contains one, otherwise NULL.

[transfer none]

@@ -2075,7 +2234,7 @@ nm_connection_get_setting_wimax (NMConnection *connection);

A shortcut to return any NMSettingAdsl the connection might contain.

-

Parameters

+

Parameters

@@ -2090,7 +2249,7 @@ nm_connection_get_setting_adsl ( -

Returns

+

Returns

an NMSettingAdsl if the connection contains one, otherwise NULL.

[transfer none]

@@ -2102,7 +2261,7 @@ nm_connection_get_setting_adsl (NMConnection *connection);

A shortcut to return any NMSettingWired the connection might contain.

-

Parameters

+

Parameters

@@ -2117,7 +2276,7 @@ nm_connection_get_setting_wired ( -

Returns

+

Returns

an NMSettingWired if the connection contains one, otherwise NULL.

[transfer none]

@@ -2129,7 +2288,7 @@ nm_connection_get_setting_wired (NMConnection *connection);

A shortcut to return any NMSettingWireless the connection might contain.

-

Parameters

+

Parameters

@@ -2144,7 +2303,7 @@ nm_connection_get_setting_wireless ( -

Returns

+

Returns

an NMSettingWireless if the connection contains one, otherwise NULL.

[transfer none]

@@ -2157,7 +2316,7 @@ nm_connection_get_setting_wireless_security (NMConnection *connection);

A shortcut to return any NMSettingWirelessSecurity the connection might contain.

-

Parameters

+

Parameters

@@ -2172,7 +2331,7 @@ nm_connection_get_setting_wireless_security
-

Returns

+

Returns

an NMSettingWirelessSecurity if the connection contains one, otherwise NULL.

[transfer none]

@@ -2184,7 +2343,7 @@ nm_connection_get_setting_wireless_security nm_connection_get_setting_vlan (NMConnection *connection);

A shortcut to return any NMSettingVlan the connection might contain.

-

Parameters

+

Parameters

@@ -2199,11 +2358,39 @@ nm_connection_get_setting_vlan ( -

Returns

+

Returns

an NMSettingVlan if the connection contains one, otherwise NULL.

[transfer none]

+
+
+

nm_connection_get_setting_vxlan ()

+
NMSettingVxlan *
+nm_connection_get_setting_vxlan (NMConnection *connection);
+

A shortcut to return any NMSettingVxlan the connection might contain.

+
+

Parameters

+
+++++ + + + + + +

connection

the NMConnection

 
+
+
+

Returns

+

an NMSettingVxlan if the connection contains one, otherwise NULL.

+

[transfer none]

+
+

Since: 1.2

+

Types and Values

diff --git a/docs/libnm/html/libnm-nm-dbus-interface.html b/docs/libnm/html/libnm-nm-dbus-interface.html index 4029fc6c..dec0c77f 100644 --- a/docs/libnm/html/libnm-nm-dbus-interface.html +++ b/docs/libnm/html/libnm-nm-dbus-interface.html @@ -42,7 +42,7 @@ #define -NM_AVAILABLE_IN_1_0_6 +NM_AVAILABLE_IN_1_2 #define @@ -170,6 +170,10 @@ #define +NM_DBUS_INTERFACE_DEVICE_IP_TUNNEL + + +#define NM_DBUS_INTERFACE_SETTINGS @@ -268,21 +272,94 @@ enum NMSecretAgentCapabilities + +#define +NM_LLDP_ATTR_DESTINATION + + +#define +NM_LLDP_ATTR_CHASSIS_ID_TYPE + + +#define +NM_LLDP_ATTR_CHASSIS_ID + + +#define +NM_LLDP_ATTR_PORT_ID_TYPE + + +#define +NM_LLDP_ATTR_PORT_ID + + +#define +NM_LLDP_ATTR_PORT_DESCRIPTION + + +#define +NM_LLDP_ATTR_SYSTEM_NAME + + +#define +NM_LLDP_ATTR_SYSTEM_DESCRIPTION + + +#define +NM_LLDP_ATTR_SYSTEM_CAPABILITIES + + +#define +NM_LLDP_ATTR_IEEE_802_1_PVID + + +#define +NM_LLDP_ATTR_IEEE_802_1_PPVID + + +#define +NM_LLDP_ATTR_IEEE_802_1_PPVID_FLAGS + + +#define +NM_LLDP_ATTR_IEEE_802_1_VID + + +#define +NM_LLDP_ATTR_IEEE_802_1_VLAN_NAME + + +#define +NM_LLDP_DEST_NEAREST_BRIDGE + + +#define +NM_LLDP_DEST_NEAREST_NON_TPMR_BRIDGE + + +#define +NM_LLDP_DEST_NEAREST_CUSTOMER_BRIDGE + + +enum +NMIPTunnelMode +

Object Hierarchy

-
    GEnum
+
    GEnum
     ├── NM80211Mode
     ├── NMActiveConnectionState
     ├── NMConnectivityState
     ├── NMDeviceState
     ├── NMDeviceStateReason
     ├── NMDeviceType
+    ├── NMIPTunnelMode
     ├── NMMetered
     ╰── NMState
-    GFlags
+    GFlags
     ├── NM80211ApFlags
     ├── NM80211ApSecurityFlags
     ├── NMBluetoothCapabilities
@@ -303,8 +380,8 @@
 

Types and Values

-

NM_AVAILABLE_IN_1_0_6

-
#define             NM_AVAILABLE_IN_1_0_6
+

NM_AVAILABLE_IN_1_2

+
#define             NM_AVAILABLE_IN_1_2

@@ -494,6 +571,12 @@

+

NM_DBUS_INTERFACE_DEVICE_IP_TUNNEL

+
#define NM_DBUS_INTERFACE_DEVICE_IP_TUNNEL  NM_DBUS_INTERFACE_DEVICE ".IPTunnel"
+
+
+
+

NM_DBUS_INTERFACE_SETTINGS

#define NM_DBUS_INTERFACE_SETTINGS        "org.freedesktop.NetworkManager.Settings"
 
@@ -552,7 +635,7 @@

NMState values indicate the current overall networking state.

(Corresponds to the NM_STATE type in nm-manager.xml.)

-

Members

+

Members

@@ -625,7 +708,7 @@

enum NMConnectivityState

(Corresponds to the NM_CONNECTIVITY type in nm-manager.xml.)

-

Members

+

Members

@@ -682,7 +765,7 @@ an NMDevice.

(Corresponds to the NM_DEVICE_TYPE type in nm-device.xml.)

-

Members

+

Members

@@ -803,6 +886,34 @@ GSM/UMTS, or LTE network access protocols

+ + + + + + + + + + + + + + + + + + + +
 

NM_DEVICE_TYPE_TUN

+

a TUN or TAP interface

+
 

NM_DEVICE_TYPE_IP_TUNNEL

+

a IP tunnel interface

+
 

NM_DEVICE_TYPE_MACVLAN

+

a MACVLAN interface

+
 

NM_DEVICE_TYPE_VXLAN

+

a VXLAN interface

+
 
@@ -813,7 +924,7 @@ GSM/UMTS, or LTE network access protocols

General device capability flags.

(Corresponds to the NM_DEVICE_CAP type in nm-device-wifi.xml.)

-

Members

+

Members

@@ -859,7 +970,7 @@ GSM/UMTS, or LTE network access protocols

802.11 specific device encryption and authentication capabilities.

(Corresponds to the NM_802_11_DEVICE_CAP type in nm-device-wifi.xml.)

-

Members

+

Members

@@ -961,7 +1072,7 @@ GSM/UMTS, or LTE network access protocols

802.11 access point flags.

(Corresponds to the NM_802_11_AP_FLAGS type in nm-access-point.xml.)

-

Members

+

Members

@@ -996,7 +1107,7 @@ the current security requirements of an access point as determined from the access point's beacon.

(Corresponds to the NM_802_11_AP_SEC type in nm-access-point.xml.)

-

Members

+

Members

@@ -1098,7 +1209,7 @@ is supported

Indicates the 802.11 mode an access point or device is currently in.

(Corresponds to the NM_802_11_MODE type in generic-types.xml.)

-

Members

+

Members

@@ -1151,7 +1262,7 @@ is supported

Bluetooth device.

(Corresponds to the NM_BT_CAPABILITY type in nm-device-bt.xml.)

-

Members

+

Members

@@ -1193,7 +1304,7 @@ specific access technologies the device supports use the ModemManager D-Bus API.

(Corresponds to the NM_DEVICE_MODEM_CAPABILITY type in nm-device-modem.xml.)

-

Members

+

Members

@@ -1248,7 +1359,7 @@ GPRS, EDGE, UMTS, HSDPA, HSUPA, or HSPA+ packet switched data capability

enum NMDeviceState

(Corresponds to the NM_DEVICE_STATE type in nm-device.xml.)

-

Members

+

Members

@@ -1379,7 +1490,7 @@ GPRS, EDGE, UMTS, HSDPA, HSUPA, or HSPA+ packet switched data capability

Device state change reason codes

(Corresponds to the NM_DEVICE_STATE_REASON type in nm-device.xml.)

-

Members

+

Members

@@ -1837,7 +1948,7 @@ GPRS, EDGE, UMTS, HSDPA, HSUPA, or HSPA+ packet switched data capability

enum NMMetered

(Corresponds to the NM_METERED type in nm-device.xml.)

-

Members

+

Members

@@ -1883,7 +1994,7 @@ GPRS, EDGE, UMTS, HSDPA, HSUPA, or HSPA+ packet switched data capability

-

Since: 1.0.6

+

Since: 1.2


@@ -1893,7 +2004,7 @@ specific network while it is starting, connected, or disconnecting from that network.

(Corresponds to the NM_ACTIVE_CONNECTION_STATE type in nm-active-connection.xml.)

-

Members

+

Members

@@ -1948,7 +2059,7 @@ network.

NMSecretAgentGetSecretsFlags values modify the behavior of a GetSecrets request.

(Corresponds to the NM_SECRET_AGENT_GET_SECRETS_FLAGS type in nm-secret-agent.xml.)

-

Members

+

Members

@@ -2020,7 +2131,7 @@ network.

NMSecretAgentCapabilities indicate various capabilities of the agent.

(Corresponds to the NM_SECRET_AGENT_CAPABILITIES type in nm-secret-agent.xml.)

-

Members

+

Members

@@ -2054,6 +2165,194 @@ VPN plugin authentication dialogs.

+
+
+

NM_LLDP_ATTR_DESTINATION

+
#define NM_LLDP_ATTR_DESTINATION "destination"
+
+
+
+
+

NM_LLDP_ATTR_CHASSIS_ID_TYPE

+
#define NM_LLDP_ATTR_CHASSIS_ID_TYPE "chassis-id-type"
+
+
+
+
+

NM_LLDP_ATTR_CHASSIS_ID

+
#define NM_LLDP_ATTR_CHASSIS_ID "chassis-id"
+
+
+
+
+

NM_LLDP_ATTR_PORT_ID_TYPE

+
#define NM_LLDP_ATTR_PORT_ID_TYPE "port-id-type"
+
+
+
+
+

NM_LLDP_ATTR_PORT_ID

+
#define NM_LLDP_ATTR_PORT_ID "port-id"
+
+
+
+
+

NM_LLDP_ATTR_PORT_DESCRIPTION

+
#define NM_LLDP_ATTR_PORT_DESCRIPTION "port-description"
+
+
+
+
+

NM_LLDP_ATTR_SYSTEM_NAME

+
#define NM_LLDP_ATTR_SYSTEM_NAME "system-name"
+
+
+
+
+

NM_LLDP_ATTR_SYSTEM_DESCRIPTION

+
#define NM_LLDP_ATTR_SYSTEM_DESCRIPTION "system-description"
+
+
+
+
+

NM_LLDP_ATTR_SYSTEM_CAPABILITIES

+
#define NM_LLDP_ATTR_SYSTEM_CAPABILITIES "system-capabilities"
+
+
+
+
+

NM_LLDP_ATTR_IEEE_802_1_PVID

+
#define NM_LLDP_ATTR_IEEE_802_1_PVID "ieee-802-1-pvid"
+
+
+
+
+

NM_LLDP_ATTR_IEEE_802_1_PPVID

+
#define NM_LLDP_ATTR_IEEE_802_1_PPVID "ieee-802-1-ppvid"
+
+
+
+
+

NM_LLDP_ATTR_IEEE_802_1_PPVID_FLAGS

+
#define NM_LLDP_ATTR_IEEE_802_1_PPVID_FLAGS "ieee-802-1-ppvid-flags"
+
+
+
+
+

NM_LLDP_ATTR_IEEE_802_1_VID

+
#define NM_LLDP_ATTR_IEEE_802_1_VID "ieee-802-1-pvid"
+
+
+
+
+

NM_LLDP_ATTR_IEEE_802_1_VLAN_NAME

+
#define NM_LLDP_ATTR_IEEE_802_1_VLAN_NAME "ieee-802-1-vlan-name"
+
+
+
+
+

NM_LLDP_DEST_NEAREST_BRIDGE

+
#define NM_LLDP_DEST_NEAREST_BRIDGE "nearest-bridge"
+
+
+
+
+

NM_LLDP_DEST_NEAREST_NON_TPMR_BRIDGE

+
#define NM_LLDP_DEST_NEAREST_NON_TPMR_BRIDGE "nearest-non-tpmr-bridge"
+
+
+
+
+

NM_LLDP_DEST_NEAREST_CUSTOMER_BRIDGE

+
#define NM_LLDP_DEST_NEAREST_CUSTOMER_BRIDGE "nearest-customer-bridge"
+
+
+
+
+

enum NMIPTunnelMode

+

The tunneling mode.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

NM_IP_TUNNEL_MODE_UKNOWN

  

NM_IP_TUNNEL_MODE_IPIP

+

IP in IP tunnel

+
 

NM_IP_TUNNEL_MODE_GRE

+

GRE tunnel

+
 

NM_IP_TUNNEL_MODE_SIT

+

SIT tunnel

+
 

NM_IP_TUNNEL_MODE_ISATAP

+

ISATAP tunnel

+
 

NM_IP_TUNNEL_MODE_VTI

+

VTI tunnel

+
 

NM_IP_TUNNEL_MODE_IP6IP6

+

IPv6 in IPv6 tunnel

+
 

NM_IP_TUNNEL_MODE_IPIP6

+

IPv4 in IPv6 tunnel

+
 

NM_IP_TUNNEL_MODE_IP6GRE

+

IPv6 GRE tunnel

+
 

NM_IP_TUNNEL_MODE_VTI6

+

IPv6 VTI tunnel

+
 
+
+

Since: 1.2

+

Object Hierarchy

-
    GEnum
+
    GEnum
     ├── NMAgentManagerError
     ├── NMConnectionError
     ├── NMCryptoError
diff --git a/docs/libnm/html/libnm-nm-utils.html b/docs/libnm/html/libnm-nm-utils.html
index 123ff21a..864e8463 100644
--- a/docs/libnm/html/libnm-nm-utils.html
+++ b/docs/libnm/html/libnm-nm-utils.html
@@ -296,6 +296,14 @@
 
 
 
+
+gboolean
+
+
+(*NMUtilsCheckFilePredicate) ()
+
+
+
 const char *
 
 
@@ -475,6 +483,21 @@
 
 
 
+int
+
+
+nm_utils_bond_mode_string_to_int ()
+
+
+
+const char *
+
+
+nm_utils_bond_mode_int_to_string ()
+
+
+
+
 char *
 
 
@@ -489,6 +512,13 @@
 nm_utils_enum_from_str ()
 
 
+
+const char **
+
+
+nm_utils_enum_get_values ()
+
+
 
 
@@ -512,12 +542,16 @@ #define NM_UTILS_INET_ADDRSTRLEN + +struct +stat +

Object Hierarchy

-
    GEnum
+
    GEnum
     ╰── NMUtilsSecurityType
 
@@ -1633,6 +1667,15 @@ nm_utils_file_is_pkcs12 (const ch
+

NMUtilsCheckFilePredicate ()

+
gboolean
+(*NMUtilsCheckFilePredicate) (const char *filename,
+                              const struct stat *stat,
+                              gpointer user_data,
+                              GError **error);
+
+
+

nm_utils_file_search_in_paths ()

const char *
 nm_utils_file_search_in_paths (const char *progname,
@@ -1646,7 +1689,7 @@ nm_utils_file_search_in_paths (const paths
 .

-

Parameters

+

Parameters

@@ -1705,7 +1748,7 @@ function.

-

Returns

+

Returns

the full path to the helper, if found, or NULL if not found. The returned string is not owned by the caller, but later invocations of the function might overwrite it.

@@ -1719,7 +1762,7 @@ invocations of the function might overwrite it.

nm_utils_wifi_freq_to_channel (guint32 freq);

Utility function to translate a Wi-Fi frequency to its corresponding channel.

-

Parameters

+

Parameters

@@ -1734,7 +1777,7 @@ nm_utils_wifi_freq_to_channel (gu
-

Returns

+

Returns

the channel represented by the frequency or 0

@@ -1746,7 +1789,7 @@ nm_utils_wifi_channel_to_freq (gu const char *band);

Utility function to translate a Wi-Fi channel to its corresponding frequency.

-

Parameters

+

Parameters

@@ -1768,7 +1811,7 @@ nm_utils_wifi_channel_to_freq (gu
-

Returns

+

Returns

the frequency represented by the channel of the band, or -1 when the freq is invalid, or 0 when the band is invalid

@@ -1783,7 +1826,7 @@ nm_utils_wifi_find_next_channel ( char *band);

Utility function to find out next/previous Wi-Fi channel for a channel.

-

Parameters

+

Parameters

@@ -1810,7 +1853,7 @@ nm_utils_wifi_find_next_channel (
-

Returns

+

Returns

the next channel in the specified direction or 0

@@ -1822,7 +1865,7 @@ nm_utils_wifi_is_channel_valid (g const char *band);

Utility function to verify Wi-Fi channel validity.

-

Parameters

+

Parameters

@@ -1844,7 +1887,7 @@ nm_utils_wifi_is_channel_valid (g
-

Returns

+

Returns

TRUE or FALSE

@@ -1855,10 +1898,10 @@ nm_utils_wifi_is_channel_valid (g nm_utils_wifi_2ghz_freqs (void);

Utility function to return 2.4 GHz Wi-Fi frequencies (802.11bg band).

-

Returns

+

Returns

zero-terminated array of frequencies numbers (in MHz)

-

Since: 1.0.6

+

Since: 1.2


@@ -1867,10 +1910,10 @@ nm_utils_wifi_2ghz_freqs (voidvoid);

Utility function to return 5 GHz Wi-Fi frequencies (802.11a band).

-

Returns

+

Returns

zero-terminated array of frequencies numbers (in MHz)

-

Since: 1.0.6

+

Since: 1.2


@@ -1883,7 +1926,7 @@ strength suitable for printing to stdout. If the current locale and terminal support it, this will use unicode graphics characters to represent "bars". Otherwise it will use 0 to 4 asterisks.

-

Parameters

+

Parameters

@@ -1898,7 +1941,7 @@ support it, this will use unicode graphics characters to represent
-

Returns

+

Returns

the graphical representation of the access point strength

@@ -1912,7 +1955,7 @@ nm_utils_hwaddr_len (int t

It is an error to call this function with any value other than ARPHRD_ETHER or ARPHRD_INFINIBAND.

-

Parameters

+

Parameters

@@ -1928,7 +1971,7 @@ nm_utils_hwaddr_len (int t
-

Returns

+

Returns

the length.

@@ -1941,7 +1984,7 @@ nm_utils_hwaddr_ntoa (gconstpoint

Converts addr to textual form.

-

Parameters

+

Parameters

@@ -1964,7 +2007,7 @@ nm_utils_hwaddr_ntoa (gconstpoint
-

Returns

+

Returns

the textual form of addr .

[transfer full]

@@ -1980,7 +2023,7 @@ nm_utils_hwaddr_atoba (const char and converts it to binary form in a GByteArray. See nm_utils_hwaddr_aton() if you don't want a GByteArray.

-

Parameters

+

Parameters

@@ -2002,7 +2045,7 @@ nm_utils_hwaddr_atoba (const char
-

Returns

+

Returns

a new GByteArray, or NULL if asc couldn't be parsed.

@@ -2022,7 +2065,7 @@ nm_utils_hwaddr_aton (const char< Bytes in asc can be sepatared by colons (:), or hyphens (-), but not mixed.

-

Parameters

+

Parameters

@@ -2050,7 +2093,7 @@ the size of the buffer in bytes.

-

Returns

+

Returns

buffer , or NULL if asc couldn't be parsed @@ -2068,7 +2111,7 @@ nm_utils_hwaddr_valid (const char to see if it is a valid hardware address of the given length.

-

Parameters

+

Parameters

@@ -2092,7 +2135,7 @@ is expected to convert to
-

Returns

+

Returns

TRUE if asc appears to be a valid hardware address of the indicated length, FALSE if not.

@@ -2109,7 +2152,7 @@ nm_utils_hwaddr_canonical (const length, and if so, returns it in canonical form (uppercase, with leading 0s as needed, and with colons rather than hyphens).

-

Parameters

+

Parameters

@@ -2133,7 +2176,7 @@ is expected to convert to
-

Returns

+

Returns

the canonicalized address if asc appears to be a valid hardware address of the indicated length, NULL if not.

@@ -2180,7 +2223,7 @@ match. (This means that externally-provided address strings do not need to be sanity-checked before comparing them against known good addresses; they are guaranteed to not match if they are invalid.)

-

Parameters

+

Parameters

@@ -2216,7 +2259,7 @@ is ASCII

-

Returns

+

Returns

TRUE if hwaddr1 and hwaddr2 are equivalent, FALSE if they are @@ -2236,7 +2279,7 @@ nm_utils_bin2hexstr (gconstpointe greater than -1, the returned string is terminated at that index (returned_string[final_len] == '\0'),

-

Parameters

+

Parameters

@@ -2264,7 +2307,7 @@ array

-

Returns

+

Returns

the textual form of bytes .

[transfer full]

@@ -2283,7 +2326,7 @@ eg "00:11" or "0:1". Any "0x" at the beginning of h may not start or end with ':'.

-

Parameters

+

Parameters

@@ -2298,7 +2341,7 @@ may not start or end with ':'.

-

Returns

+

Returns

the converted bytes, or NULL on error.

[transfer full]

@@ -2311,7 +2354,7 @@ nm_utils_iface_valid_name (const

This function is a 1:1 copy of the kernel's interface validation function in net/core/dev.c.

-

Parameters

+

Parameters

@@ -2326,7 +2369,7 @@ function in net/core/dev.c.

-

Returns

+

Returns

TRUE if interface name is valid, otherwise FALSE is returned.

@@ -2338,7 +2381,7 @@ nm_utils_is_uuid (const charChecks if str is a UUID

-

Parameters

+

Parameters

@@ -2353,7 +2396,7 @@ nm_utils_is_uuid (const char
-

Returns

+

Returns

TRUE if str is a UUID, FALSE if not

@@ -2367,7 +2410,7 @@ nm_utils_inet4_ntop (in_addr_tWrapper for inet_ntop.

[skip]

-

Parameters

+

Parameters

@@ -2398,7 +2441,7 @@ buffer to avoid these issues.

-

Returns

+

Returns

the input buffer dst , or a pointer to an internal, static buffer. This function cannot fail.

@@ -2413,7 +2456,7 @@ nm_utils_inet6_ntop (const struct

Wrapper for inet_ntop.

[skip]

-

Parameters

+

Parameters

@@ -2444,7 +2487,7 @@ buffer to avoid these issues.

-

Returns

+

Returns

the input buffer dst , or a pointer to an internal, static buffer. NULL is not allowed as in6addr @@ -2461,7 +2504,7 @@ nm_utils_ipaddr_valid (int

Checks if ip contains a valid IP address of the given family.

-

Parameters

+

Parameters

@@ -2484,7 +2527,7 @@ nm_utils_ipaddr_valid (int
-

Returns

+

Returns

TRUE or FALSE

@@ -2516,7 +2559,7 @@ compatible with virtual_type configuration of the two connections, or on the capabilities of an underlying device driver.

-

Parameters

+

Parameters

@@ -2539,12 +2582,72 @@ underlying device driver.

-

Returns

+

Returns

TRUE or FALSE


+

nm_utils_bond_mode_string_to_int ()

+
int
+nm_utils_bond_mode_string_to_int (const char *mode);
+

Convert bonding mode from string representation to numeric value. +See https://www.kernel.org/doc/Documentation/networking/bonding.txt for +available modes. +The mode + string can be either a descriptive name or a number (as string).

+
+

Parameters

+
+++++ + + + + + +

mode

bonding mode as string

 
+
+
+

Returns

+

numeric bond mode, or -1 on error

+
+

Since: 1.2

+
+
+
+

nm_utils_bond_mode_int_to_string ()

+
const char *
+nm_utils_bond_mode_int_to_string (int mode);
+

Convert bonding mode from integer value to descriptive name. +See https://www.kernel.org/doc/Documentation/networking/bonding.txt for +available modes.

+
+

Parameters

+
+++++ + + + + + +

mode

bonding mode as a numeric value

 
+
+
+

Returns

+

bonding mode string, or NULL on error

+
+

Since: 1.2

+
+
+

nm_utils_enum_to_str ()

char *
 nm_utils_enum_to_str (GType type,
@@ -2554,7 +2657,7 @@ nm_utils_enum_to_str (GTypeG_TYPE_ENUM and the given value is not valid the
 function returns NULL.

-

Parameters

+

Parameters

@@ -2576,10 +2679,10 @@ function returns NULL.

-

Returns

+

Returns

a newly allocated string or NULL

-

Since: 1.0.6

+

Since: 1.2


@@ -2596,7 +2699,7 @@ the function returns FALSE and stores a pointer to containing the unrecognized token in err_token .

-

Parameters

+

Parameters

@@ -2616,22 +2719,65 @@ containing the unrecognized token in err_token - - + + - - + +

out_value

(out) (allow-none) the output value

 

the output value.

[out][allow-none]

err_token

(out) (allow-none) location to store the first unrecognized token

 

location to store the first unrecognized token.

[out][allow-none]
-

Returns

+

Returns

TRUE if the conversion was successful, FALSE otherwise

-

Since: 1.0.6

+

Since: 1.2

+
+
+
+

nm_utils_enum_get_values ()

+
const char **
+nm_utils_enum_get_values (GType type,
+                          gint from,
+                          gint to);
+

Returns the list of possible values for a given enum.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

type

the GType of the enum

 

from

the first element to be returned

 

to

the last element to be returned

 
+
+
+

Returns

+

a NULL-terminated dynamically-allocated array of static strings +or NULL on error.

+

[transfer full]

+
+

Since: 1.2

@@ -2736,6 +2882,11 @@ generating the dynamic WEP keys automatically

argument for both nm_utils_inet4_ntop() and nm_utils_inet6_ntop().

+
+
+

struct stat

+
struct stat;
+
@@ -88,11 +94,11 @@ #define -NM_AVAILABLE_IN_1_0_4 +NM_DEPRECATED_IN_1_2 #define -NM_AVAILABLE_IN_1_0_6 +NM_AVAILABLE_IN_1_2
@@ -125,6 +131,12 @@
# define NM_DEPRECATED_IN_1_0_FOR(f)    G_DEPRECATED_FOR(f)
 
+
+
+

NM_DEPRECATED_IN_1_2_FOR()

+
# define NM_DEPRECATED_IN_1_2_FOR(f)    G_DEPRECATED_FOR(f)
+
+

Types and Values

@@ -153,14 +165,14 @@

-

NM_AVAILABLE_IN_1_0_4

-
# define NM_AVAILABLE_IN_1_0_4          G_UNAVAILABLE(1,0.4)
+

NM_DEPRECATED_IN_1_2

+
# define NM_DEPRECATED_IN_1_2           G_DEPRECATED
 

-

NM_AVAILABLE_IN_1_0_6

-
#define             NM_AVAILABLE_IN_1_0_6
+

NM_AVAILABLE_IN_1_2

+
#define             NM_AVAILABLE_IN_1_2
diff --git a/docs/libnm/html/libnm-nm-vpn-dbus-interface.html b/docs/libnm/html/libnm-nm-vpn-dbus-interface.html index 7f0d523b..b88d6dfc 100644 --- a/docs/libnm/html/libnm-nm-vpn-dbus-interface.html +++ b/docs/libnm/html/libnm-nm-vpn-dbus-interface.html @@ -7,7 +7,7 @@ - + @@ -21,7 +21,7 @@ Home Up Prev -Next +Next
@@ -293,7 +293,7 @@

Object Hierarchy

-
    GEnum
+
    GEnum
     ├── NMVpnConnectionState
     ├── NMVpnConnectionStateReason
     ├── NMVpnPluginFailure
diff --git a/docs/libnm/html/libnm.devhelp2 b/docs/libnm/html/libnm.devhelp2
index b4f89d29..f716e22b 100644
--- a/docs/libnm/html/libnm.devhelp2
+++ b/docs/libnm/html/libnm.devhelp2
@@ -25,17 +25,21 @@
       
       
       
-      
       
       
+      
+      
+      
       
       
       
       
       
       
+      
       
       
+      
       
       
       
@@ -50,10 +54,14 @@
       
       
       
+      
+      
       
       
       
+      
       
+      
       
       
       
@@ -70,7 +78,7 @@
     
     
       
-      
+      
     
     
     
@@ -107,6 +115,7 @@
     
     
     
+    
     
     
     
@@ -147,12 +156,15 @@
     
     
     
+    
     
     
     
     
     
     
+    
+    
     
     
     
@@ -162,6 +174,7 @@
     
     
     
+    
     
     
     
@@ -180,6 +193,8 @@
     
     
     
+    
+    
     
     
     
@@ -236,7 +251,7 @@
     
     
     
-    
+    
     
     
     
@@ -268,6 +283,7 @@
     
     
     
+    
     
     
     
@@ -289,10 +305,28 @@
     
     
     
-    
+    
     
     
     
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
     
     
     
@@ -304,6 +338,7 @@
     
     
     
+    
     
     
     
@@ -333,12 +368,15 @@
     
     
     
+    
     
     
+    
     
     
     
     
+    
     
     
     
@@ -346,6 +384,7 @@
     
     
     
+    
     
     
     
@@ -365,6 +404,7 @@
     
     
     
+    
     
     
     
@@ -375,6 +415,7 @@
     
     
     
+    
     
     
     
@@ -397,14 +438,15 @@
     
     
     
-    
+    
     
     
     
     
     
     
-    
+    
+    
     
     
     
@@ -425,7 +467,9 @@
     
     
     
+    
     
+    
     
     
     
@@ -433,6 +477,7 @@
     
     
     
+    
     
     
     
@@ -444,6 +489,7 @@
     
     
     
+    
     
     
     
@@ -652,6 +698,7 @@
     
     
     
+    
     
     
     
@@ -660,11 +707,13 @@
     
     
     
+    
     
     
     
     
     
+    
     
     
     
@@ -758,6 +807,9 @@
     
     
     
+    
+    
+    
     
     
     
@@ -770,7 +822,11 @@
     
     
     
+    
+    
+    
     
+    
     
     
     
@@ -778,6 +834,8 @@
     
     
     
+    
+    
     
     
     
@@ -797,6 +855,38 @@
     
     
     
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
     
     
     
@@ -848,6 +938,14 @@
     
     
     
+    
+    
+    
+    
+    
+    
+    
+    
     
     
     
@@ -871,6 +969,7 @@
     
     
     
+    
     
     
     
@@ -881,10 +980,25 @@
     
     
     
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
     
     
     
     
+    
     
     
     
@@ -894,28 +1008,59 @@
     
     
     
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
     
     
     
@@ -1025,6 +1170,28 @@
     
     
     
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
     
     
     
@@ -1065,20 +1232,73 @@
     
     
     
+    
     
     
     
     
     
     
+    
     
     
     
     
+    
     
-    
-    
-    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
     
     
     
@@ -1107,10 +1327,10 @@
     
     
     
-    
-    
+    
+    
     
-    
+    
     
     
     
@@ -1156,6 +1376,8 @@
     
     
     
+    
+    
     
     
     
@@ -1174,6 +1396,8 @@
     
     
     
+    
+    
     
     
     
@@ -1184,8 +1408,10 @@
     
     
     
+    
     
     
+    
     
     
     
@@ -1268,9 +1494,11 @@
     
     
     
+    
     
     
     
+    
     
     
     
@@ -1281,12 +1509,17 @@
     
     
     
+    
     
     
     
     
-    
+    
+    
     
+    
+    
+    
     
     
     
@@ -1297,6 +1530,13 @@
     
     
     
+    
+    
+    
+    
+    
+    
+    
     
     
     
@@ -1305,9 +1545,11 @@
     
     
     
+    
     
     
     
+    
     
     
     
@@ -1321,6 +1563,7 @@
     
     
     
+    
     
     
     
@@ -1336,11 +1579,14 @@
     
     
     
+    
     
     
     
+    
     
     
+    
     
     
     
@@ -1380,13 +1626,16 @@
     
     
     
+    
     
     
     
     
+    
     
     
     
+    
     
     
     
@@ -1399,6 +1648,54 @@
     
     
     
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
     
     
     
@@ -1423,6 +1720,27 @@
     
     
     
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
     
     
     
@@ -1435,6 +1753,60 @@
     
     
     
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
     
     
     
@@ -1444,9 +1816,9 @@
     
     
     
-    
+    
     
-    
+    
     
     
     
@@ -1464,15 +1836,15 @@
     
     
     
-    
-    
-    
-    
-    
-    
-    
-    
-    
+    
+    
+    
+    
+    
+    
+    
+    
+    
     
     
     
@@ -1572,7 +1944,7 @@
     
     
     
-    
+    
     
     
     
@@ -1672,13 +2044,14 @@
     
     
     
+    
     
     
     
     
     
-    
-    
+    
+    
     
     
     
@@ -1695,21 +2068,26 @@
     
     
     
-    
-    
+    
+    
+    
+    
+    
     
     
     
+    
     
     
     
     
+    
     
     
     
     
-    
-    
+    
+    
     
     
     
@@ -1772,25 +2150,24 @@
     
     
     
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
     
     
     
@@ -1903,6 +2280,10 @@
     
     
     
+    
+    
+    
+    
     
     
     
@@ -2039,6 +2420,16 @@
     
     
     
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
     
     
     
@@ -2055,6 +2446,9 @@
     
     
     
+    
+    
+    
     
     
     
@@ -2063,6 +2457,9 @@
     
     
     
+    
+    
+    
     
     
     
@@ -2078,14 +2475,28 @@
     
     
     
+    
+    
+    
+    
+    
+    
+    
+    
+    
+    
     
     
     
+    
+    
+    
     
     
     
     
     
+    
     
     
     
@@ -2145,9 +2556,9 @@
     
     
     
-    
-    
-    
-    
+    
+    
+    
+    
   
 
diff --git a/docs/libnm/html/object-tree.html b/docs/libnm/html/object-tree.html
index 555bc33f..b50431ac 100644
--- a/docs/libnm/html/object-tree.html
+++ b/docs/libnm/html/object-tree.html
@@ -6,7 +6,7 @@
 
 
 
-
+
 
 
 
@@ -16,7 +16,7 @@
 
 Home
 
-Prev
+Prev
 Next
 
 
@@ -37,17 +37,21 @@ ├── NMSettingGeneric ├── NMSettingGsm ├── NMSettingInfiniband + ├── NMSettingIPTunnel ├── NMSettingIPConfig ├── NMSettingIP4Config ╰── NMSettingIP6Config + ├── NMSettingMacvlan ├── NMSettingOlpcMesh ├── NMSettingPpp ├── NMSettingPppoe ├── NMSettingSerial ├── NMSettingTeamPort ├── NMSettingTeam + ├── NMSettingTun ├── NMSettingVlan ├── NMSettingVpn + ├── NMSettingVxlan ├── NMSettingWimax ├── NMSettingWired ├── NMSettingWirelessSecurity @@ -64,10 +68,14 @@ ├── NMDeviceEthernet ├── NMDeviceGeneric ├── NMDeviceInfiniband + ├── NMDeviceIPTunnel + ├── NMDeviceMacvlan ├── NMDeviceModem ├── NMDeviceOlpcMesh ├── NMDeviceTeam + ├── NMDeviceTun ├── NMDeviceVlan + ├── NMDeviceVxlan ├── NMDeviceWifi ╰── NMDeviceWimax ├── NMDhcpConfig @@ -77,10 +85,10 @@ ├── NMClient ├── NMSecretAgentOld ╰── NMSimpleConnection - GInterface - ├── NMVpnEditor - ╰── NMVpnEditorPlugin - GFlags + GInterface + ├── NMVpnEditor + ╰── NMVpnEditorPlugin + GFlags ├── NM80211ApFlags ├── NM80211ApSecurityFlags ├── NMBluetoothCapabilities @@ -94,8 +102,8 @@ ├── NMSettingSecretFlags ├── NMSettingWiredWakeOnLan ├── NMVlanFlags - ╰── NMVpnEditorPluginCapability - GEnum + ╰── NMVpnEditorPluginCapability + GEnum ├── NMAgentManagerError ├── NMConnectionError ├── NMDeviceError @@ -113,14 +121,20 @@ ├── NMDeviceState ├── NMDeviceStateReason ├── NMDeviceType + ├── NMIPTunnelMode ├── NMMetered ├── NMSetting8021xCKFormat ├── NMSetting8021xCKScheme ├── NMSettingCompareFlags ├── NMSettingConnectionAutoconnectSlaves + ├── NMSettingConnectionLldp ├── NMSettingDiffResult + ├── NMSettingIP6ConfigAddrGenMode ├── NMSettingIP6ConfigPrivacy + ├── NMSettingMacRandomization + ├── NMSettingMacvlanMode ├── NMSettingSerialParity + ├── NMSettingTunMode ├── NMState ├── NMUtilsSecurityType ├── NMVlanPriorityMap @@ -130,9 +144,10 @@ ├── NMVpnServiceState ├── NMWepKeyType ╰── NMWimaxNspNetworkType - GBoxed + GBoxed ├── NMIPAddress - ╰── NMIPRoute + ├── NMIPRoute + ╰── NMLldpNeighbor
+
+nm-setting-ip-tunnel +NMSettingIPTunnel +NM_SETTING_IP_TUNNEL_SETTING_NAME +NM_SETTING_IP_TUNNEL_PARENT +NM_SETTING_IP_TUNNEL_MODE +NM_SETTING_IP_TUNNEL_LOCAL +NM_SETTING_IP_TUNNEL_REMOTE +NM_SETTING_IP_TUNNEL_TTL +NM_SETTING_IP_TUNNEL_TOS +NM_SETTING_IP_TUNNEL_PATH_MTU_DISCOVERY +NM_SETTING_IP_TUNNEL_INPUT_KEY +NM_SETTING_IP_TUNNEL_OUTPUT_KEY +NM_SETTING_IP_TUNNEL_ENCAPSULATION_LIMIT +NM_SETTING_IP_TUNNEL_FLOW_LABEL +NM_SETTING_IP_TUNNEL_MTU +nm_setting_ip_tunnel_new +nm_setting_ip_tunnel_get_parent +nm_setting_ip_tunnel_get_mode +nm_setting_ip_tunnel_get_local +nm_setting_ip_tunnel_get_remote +nm_setting_ip_tunnel_get_ttl +nm_setting_ip_tunnel_get_tos +nm_setting_ip_tunnel_get_path_mtu_discovery +nm_setting_ip_tunnel_get_input_key +nm_setting_ip_tunnel_get_output_key +nm_setting_ip_tunnel_get_encapsulation_limit +nm_setting_ip_tunnel_get_flow_label +nm_setting_ip_tunnel_get_mtu + +NMSettingIPTunnel +NMSettingIPTunnelClass +NM_IS_SETTING_IP_TUNNEL +NM_IS_SETTING_IP_TUNNEL_CLASS +NM_SETTING_IP_TUNNEL +NM_SETTING_IP_TUNNEL_CLASS +NM_SETTING_IP_TUNNEL_GET_CLASS +NM_TYPE_SETTING_IP_TUNNEL +nm_setting_ip_tunnel_get_type +
+
nm-setting-ip4-config NMSettingIP4Config NM_SETTING_IP4_CONFIG_SETTING_NAME NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID +NM_SETTING_IP4_CONFIG_DHCP_TIMEOUT +NM_SETTING_IP4_CONFIG_DHCP_FQDN NM_SETTING_IP4_CONFIG_METHOD_AUTO NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL NM_SETTING_IP4_CONFIG_METHOD_MANUAL @@ -1625,6 +1908,8 @@ NM_SETTING_IP4_CONFIG_METHOD_SHARED NM_SETTING_IP4_CONFIG_METHOD_DISABLED nm_setting_ip4_config_new nm_setting_ip4_config_get_dhcp_client_id +nm_setting_ip4_config_get_dhcp_timeout +nm_setting_ip4_config_get_dhcp_fqdn NMSettingIP4Config NMSettingIP4ConfigClass @@ -1642,6 +1927,7 @@ nm_setting_ip4_config_get_type NMSettingIP6Config NM_SETTING_IP6_CONFIG_SETTING_NAME NM_SETTING_IP6_CONFIG_IP6_PRIVACY +NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE NM_SETTING_IP6_CONFIG_METHOD_IGNORE NM_SETTING_IP6_CONFIG_METHOD_AUTO NM_SETTING_IP6_CONFIG_METHOD_DHCP @@ -1649,8 +1935,10 @@ NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL NM_SETTING_IP6_CONFIG_METHOD_MANUAL NM_SETTING_IP6_CONFIG_METHOD_SHARED NMSettingIP6ConfigPrivacy +NMSettingIP6ConfigAddrGenMode nm_setting_ip6_config_new nm_setting_ip6_config_get_ip6_privacy +nm_setting_ip6_config_get_addr_gen_mode NMSettingIP6Config NMSettingIP6ConfigClass @@ -1663,6 +1951,32 @@ NM_TYPE_SETTING_IP6_CONFIG nm_setting_ip6_config_get_type
+
+nm-setting-macvlan +NMSettingMacvlan +NM_SETTING_MACVLAN_SETTING_NAME +NM_SETTING_MACVLAN_PARENT +NM_SETTING_MACVLAN_MODE +NM_SETTING_MACVLAN_PROMISCUOUS +NM_SETTING_MACVLAN_TAP +NMSettingMacvlanMode +nm_setting_macvlan_new +nm_setting_macvlan_get_parent +nm_setting_macvlan_get_mode +nm_setting_macvlan_get_promiscuous +nm_setting_macvlan_get_tap + +NMSettingMacvlan +NMSettingMacvlanClass +NM_IS_SETTING_MACVLAN +NM_IS_SETTING_MACVLAN_CLASS +NM_SETTING_MACVLAN +NM_SETTING_MACVLAN_CLASS +NM_SETTING_MACVLAN_GET_CLASS +NM_TYPE_SETTING_MACVLAN +nm_setting_macvlan_get_type +
+
nm-setting-olpc-mesh NMSettingOlpcMesh @@ -1830,6 +2144,36 @@ NM_TYPE_SETTING_TEAM_PORT nm_setting_team_port_get_type
+
+nm-setting-tun +NMSettingTun +NM_SETTING_TUN_SETTING_NAME +NM_SETTING_TUN_MODE +NM_SETTING_TUN_OWNER +NM_SETTING_TUN_GROUP +NM_SETTING_TUN_PI +NM_SETTING_TUN_VNET_HDR +NM_SETTING_TUN_MULTI_QUEUE +NMSettingTunMode +nm_setting_tun_new +nm_setting_tun_get_mode +nm_setting_tun_get_owner +nm_setting_tun_get_group +nm_setting_tun_get_pi +nm_setting_tun_get_vnet_hdr +nm_setting_tun_get_multi_queue + +NMSettingTun +NMSettingTunClass +NM_IS_SETTING_TUN +NM_IS_SETTING_TUN_CLASS +NM_SETTING_TUN +NM_SETTING_TUN_CLASS +NM_SETTING_TUN_GET_CLASS +NM_TYPE_SETTING_TUN +nm_setting_tun_get_type +
+
nm-setting-vlan NMSettingVlan @@ -1841,6 +2185,7 @@ NM_SETTING_VLAN_INGRESS_PRIORITY_MAP NM_SETTING_VLAN_EGRESS_PRIORITY_MAP NMVlanPriorityMap NMVlanFlags +NM_VLAN_FLAGS_ALL nm_setting_vlan_new nm_setting_vlan_get_parent nm_setting_vlan_get_id @@ -1874,6 +2219,7 @@ NM_SETTING_VPN_USER_NAME NM_SETTING_VPN_PERSISTENT NM_SETTING_VPN_DATA NM_SETTING_VPN_SECRETS +NM_SETTING_VPN_TIMEOUT NMVpnIterFunc nm_setting_vpn_new nm_setting_vpn_get_service_type @@ -1889,6 +2235,7 @@ nm_setting_vpn_add_secret nm_setting_vpn_get_secret nm_setting_vpn_remove_secret nm_setting_vpn_foreach_secret +nm_setting_vpn_get_timeout NMSettingVpn NMSettingVpnClass @@ -1901,6 +2248,55 @@ NM_TYPE_SETTING_VPN nm_setting_vpn_get_type
+
+nm-setting-vxlan +NMSettingVxlan +NM_SETTING_VXLAN_SETTING_NAME +NM_SETTING_VXLAN_PARENT +NM_SETTING_VXLAN_ID +NM_SETTING_VXLAN_LOCAL +NM_SETTING_VXLAN_REMOTE +NM_SETTING_VXLAN_SOURCE_PORT_MIN +NM_SETTING_VXLAN_SOURCE_PORT_MAX +NM_SETTING_VXLAN_DESTINATION_PORT +NM_SETTING_VXLAN_TOS +NM_SETTING_VXLAN_TTL +NM_SETTING_VXLAN_AGEING +NM_SETTING_VXLAN_LIMIT +NM_SETTING_VXLAN_PROXY +NM_SETTING_VXLAN_LEARNING +NM_SETTING_VXLAN_RSC +NM_SETTING_VXLAN_L2_MISS +NM_SETTING_VXLAN_L3_MISS +nm_setting_vxlan_new +nm_setting_vxlan_get_parent +nm_setting_vxlan_get_id +nm_setting_vxlan_get_local +nm_setting_vxlan_get_remote +nm_setting_vxlan_get_source_port_min +nm_setting_vxlan_get_source_port_max +nm_setting_vxlan_get_destination_port +nm_setting_vxlan_get_tos +nm_setting_vxlan_get_ttl +nm_setting_vxlan_get_ageing +nm_setting_vxlan_get_limit +nm_setting_vxlan_get_proxy +nm_setting_vxlan_get_learning +nm_setting_vxlan_get_rsc +nm_setting_vxlan_get_l2_miss +nm_setting_vxlan_get_l3_miss + +NMSettingVxlan +NMSettingVxlanClass +NM_IS_SETTING_VXLAN +NM_IS_SETTING_VXLAN_CLASS +NM_SETTING_VXLAN +NM_SETTING_VXLAN_CLASS +NM_SETTING_VXLAN_GET_CLASS +NM_TYPE_SETTING_VXLAN +nm_setting_vxlan_get_type +
+
nm-setting-wimax NMSettingWimax @@ -1994,6 +2390,8 @@ NM_SETTING_WIRELESS_MAC_ADDRESS_BLACKLIST NM_SETTING_WIRELESS_MTU NM_SETTING_WIRELESS_SEEN_BSSIDS NM_SETTING_WIRELESS_HIDDEN +NM_SETTING_WIRELESS_POWERSAVE +NM_SETTING_WIRELESS_MAC_ADDRESS_RANDOMIZATION NM_SETTING_WIRELESS_MODE_ADHOC NM_SETTING_WIRELESS_MODE_AP NM_SETTING_WIRELESS_MODE_INFRA @@ -2016,6 +2414,8 @@ nm_setting_wireless_remove_mac_blacklist_item_by_value nm_setting_wireless_clear_mac_blacklist_items nm_setting_wireless_get_mtu nm_setting_wireless_get_hidden +nm_setting_wireless_get_powersave +nm_setting_wireless_get_mac_address_randomization nm_setting_wireless_add_seen_bssid nm_setting_wireless_get_num_seen_bssids nm_setting_wireless_get_seen_bssid @@ -2150,6 +2550,7 @@ nm_utils_file_is_certificate nm_utils_file_is_private_key nm_utils_file_is_pkcs12 NMUtilsFileSearchInPathsPredicate +NMUtilsCheckFilePredicate nm_utils_file_search_in_paths nm_utils_wifi_freq_to_channel nm_utils_wifi_channel_to_freq @@ -2175,8 +2576,12 @@ nm_utils_inet4_ntop nm_utils_inet6_ntop nm_utils_ipaddr_valid nm_utils_check_virtual_device_compatibility +nm_utils_bond_mode_string_to_int +nm_utils_bond_mode_int_to_string nm_utils_enum_to_str nm_utils_enum_from_str +nm_utils_enum_get_values +stat
@@ -2189,8 +2594,9 @@ NM_AVAILABLE_IN_0_9_10 NM_DEPRECATED_IN_1_0 NM_DEPRECATED_IN_1_0_FOR NM_AVAILABLE_IN_1_0 -NM_AVAILABLE_IN_1_0_4 -NM_AVAILABLE_IN_1_0_6 +NM_DEPRECATED_IN_1_2 +NM_DEPRECATED_IN_1_2_FOR +NM_AVAILABLE_IN_1_2
@@ -2279,8 +2685,22 @@ NM_VPN_PLUGIN_IP6_CONFIG_NEVER_DEFAULT
-nm-vpn-editor-plugin +nm-vpn-editor NMVpnEditor +NMVpnEditorInterface +nm_vpn_editor_get_widget +nm_vpn_editor_update_connection + +NM_IS_VPN_EDITOR +NM_TYPE_VPN_EDITOR +NM_VPN_EDITOR +NM_VPN_EDITOR_GET_INTERFACE +nm_vpn_editor_get_type +
+ +
+nm-vpn-editor-plugin +NMVpnEditorPlugin NMVpnEditorPluginFactory nm_vpn_editor_plugin_factory NMVpnEditorPluginCapability @@ -2293,24 +2713,35 @@ nm_vpn_editor_plugin_get_capabilities nm_vpn_editor_plugin_import nm_vpn_editor_plugin_export nm_vpn_editor_plugin_get_suggested_filename -NMVpnEditorInterface -nm_vpn_editor_get_widget -nm_vpn_editor_update_connection - +nm_vpn_editor_plugin_load_from_file NMVpnEditor + NMVpnEditorPlugin -NM_IS_VPN_EDITOR NM_IS_VPN_EDITOR_PLUGIN -NM_TYPE_VPN_EDITOR NM_TYPE_VPN_EDITOR_PLUGIN -NM_VPN_EDITOR -NM_VPN_EDITOR_GET_INTERFACE NM_VPN_EDITOR_PLUGIN NM_VPN_EDITOR_PLUGIN_GET_INTERFACE -nm_vpn_editor_get_type nm_vpn_editor_plugin_get_type
+
+nm-vpn-plugin-info +NM_VPN_PLUGIN_INFO_NAME +NM_VPN_PLUGIN_INFO_FILENAME +NM_VPN_PLUGIN_INFO_KEYFILE +NM_VPN_PLUGIN_INFO_KF_GROUP_CONNECTION +NM_VPN_PLUGIN_INFO_KF_GROUP_LIBNM +NM_VPN_PLUGIN_INFO_KF_GROUP_GNOME + +NMVpnPluginInfo +NM_IS_VPN_PLUGIN_INFO +NM_IS_VPN_PLUGIN_INFO_CLASS +NM_TYPE_VPN_PLUGIN_INFO +NM_VPN_PLUGIN_INFO +NM_VPN_PLUGIN_INFO_CLASS +NM_VPN_PLUGIN_INFO_GET_CLASS +
+
nm-wimax-nsp NMWimaxNsp diff --git a/docs/libnm/libnm.types b/docs/libnm/libnm.types index c148200c..83e8325e 100644 --- a/docs/libnm/libnm.types +++ b/docs/libnm/libnm.types @@ -25,14 +25,18 @@ nm_device_ethernet_get_type nm_device_generic_get_type nm_device_get_type nm_device_infiniband_get_type +nm_device_ip_tunnel_get_type +nm_device_macvlan_get_type nm_device_modem_capabilities_get_type nm_device_modem_get_type nm_device_olpc_mesh_get_type nm_device_state_get_type nm_device_state_reason_get_type nm_device_team_get_type +nm_device_tun_get_type nm_device_type_get_type nm_device_vlan_get_type +nm_device_vxlan_get_type nm_device_wifi_capabilities_get_type nm_device_wifi_get_type nm_device_wimax_get_type @@ -40,6 +44,8 @@ nm_dhcp_config_get_type nm_ip_address_get_type nm_ip_config_get_type nm_ip_route_get_type +nm_ip_tunnel_mode_get_type +nm_lldp_neighbor_get_type nm_manager_error_get_type nm_metered_get_type nm_object_get_type @@ -60,6 +66,7 @@ nm_setting_cdma_get_type nm_setting_compare_flags_get_type nm_setting_connection_autoconnect_slaves_get_type nm_setting_connection_get_type +nm_setting_connection_lldp_get_type nm_setting_dcb_flags_get_type nm_setting_dcb_get_type nm_setting_diff_result_get_type @@ -68,9 +75,14 @@ nm_setting_get_type nm_setting_gsm_get_type nm_setting_infiniband_get_type nm_setting_ip4_config_get_type +nm_setting_ip6_config_addr_gen_mode_get_type nm_setting_ip6_config_get_type nm_setting_ip6_config_privacy_get_type nm_setting_ip_config_get_type +nm_setting_ip_tunnel_get_type +nm_setting_mac_randomization_get_type +nm_setting_macvlan_get_type +nm_setting_macvlan_mode_get_type nm_setting_olpc_mesh_get_type nm_setting_ppp_get_type nm_setting_pppoe_get_type @@ -79,8 +91,11 @@ nm_setting_serial_get_type nm_setting_serial_parity_get_type nm_setting_team_get_type nm_setting_team_port_get_type +nm_setting_tun_get_type +nm_setting_tun_mode_get_type nm_setting_vlan_get_type nm_setting_vpn_get_type +nm_setting_vxlan_get_type nm_setting_wimax_get_type nm_setting_wired_get_type nm_setting_wired_wake_on_lan_get_type diff --git a/docs/libnm/version.xml b/docs/libnm/version.xml index 7ee7020b..69658cdd 100644 --- a/docs/libnm/version.xml +++ b/docs/libnm/version.xml @@ -1 +1 @@ -1.0.10 +1.1.90 diff --git a/examples/C/Makefile.in b/examples/C/Makefile.in index 3b154702..77e47215 100644 --- a/examples/C/Makefile.in +++ b/examples/C/Makefile.in @@ -207,7 +207,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -219,8 +218,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -230,6 +227,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -284,16 +282,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -330,6 +325,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -358,7 +355,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -373,6 +369,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -433,6 +431,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -440,6 +439,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ diff --git a/examples/C/glib/Makefile.am b/examples/C/glib/Makefile.am index 4b03d87f..3e442c30 100644 --- a/examples/C/glib/Makefile.am +++ b/examples/C/glib/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = \ - -I${top_srcdir}/include \ - -I$(top_builddir)/include \ + -I${top_srcdir}/shared \ + -I$(top_builddir)/shared \ -I${top_srcdir}/libnm-core \ -I${top_builddir}/libnm-core \ -I${top_srcdir}/libnm \ diff --git a/examples/C/glib/Makefile.in b/examples/C/glib/Makefile.in index f4caa8a9..c755d178 100644 --- a/examples/C/glib/Makefile.in +++ b/examples/C/glib/Makefile.in @@ -245,7 +245,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -257,8 +256,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -268,6 +265,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -322,16 +320,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -368,6 +363,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -396,7 +393,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -411,6 +407,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -471,6 +469,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -478,6 +477,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -494,8 +494,8 @@ with_netconfig = @with_netconfig@ with_resolvconf = @with_resolvconf@ with_valgrind = @with_valgrind@ AM_CPPFLAGS = \ - -I${top_srcdir}/include \ - -I$(top_builddir)/include \ + -I${top_srcdir}/shared \ + -I$(top_builddir)/shared \ -I${top_srcdir}/libnm-core \ -I${top_builddir}/libnm-core \ -I${top_srcdir}/libnm \ diff --git a/examples/C/qt/Makefile.in b/examples/C/qt/Makefile.in index 997aca76..04634ccf 100644 --- a/examples/C/qt/Makefile.in +++ b/examples/C/qt/Makefile.in @@ -217,7 +217,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -229,8 +228,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -240,6 +237,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -294,16 +292,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -340,6 +335,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -368,7 +365,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -383,6 +379,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -443,6 +441,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -450,6 +449,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ diff --git a/examples/Makefile.am b/examples/Makefile.am index a227f0ea..3521b4ce 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -2,5 +2,6 @@ SUBDIRS= \ shell \ python \ ruby \ + lua \ C \ dispatcher diff --git a/examples/Makefile.in b/examples/Makefile.in index cc227072..352ddb15 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -206,7 +206,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -218,8 +217,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -229,6 +226,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -283,16 +281,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -329,6 +324,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -357,7 +354,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -372,6 +368,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -432,6 +430,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -439,6 +438,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -458,6 +458,7 @@ SUBDIRS = \ shell \ python \ ruby \ + lua \ C \ dispatcher diff --git a/examples/dispatcher/10-ifcfg-rh-routes.sh b/examples/dispatcher/10-ifcfg-rh-routes.sh index 75b8c5e5..59e44db5 100755 --- a/examples/dispatcher/10-ifcfg-rh-routes.sh +++ b/examples/dispatcher/10-ifcfg-rh-routes.sh @@ -8,6 +8,9 @@ # This should be installed in both dispatcher.d/ and # dispatcher.d/pre-up.d/ +# pre-up scripts delay activation of the device. To reduce the delay, +# it is adviced to install the script as symlink to no-wait.d directory. + if [ "$2" != "pre-up" -a "$2" != "down" ]; then exit 0 fi diff --git a/examples/dispatcher/Makefile.in b/examples/dispatcher/Makefile.in index b04b3e50..c28c3dd1 100644 --- a/examples/dispatcher/Makefile.in +++ b/examples/dispatcher/Makefile.in @@ -146,7 +146,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -158,8 +157,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -169,6 +166,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -223,16 +221,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -269,6 +264,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -297,7 +294,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -312,6 +308,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -372,6 +370,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -379,6 +378,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ diff --git a/examples/lua/Makefile.am b/examples/lua/Makefile.am new file mode 100644 index 00000000..bf14f682 --- /dev/null +++ b/examples/lua/Makefile.am @@ -0,0 +1,2 @@ +SUBDIRS= lgi + diff --git a/examples/lua/Makefile.in b/examples/lua/Makefile.in new file mode 100644 index 00000000..625155ed --- /dev/null +++ b/examples/lua/Makefile.in @@ -0,0 +1,772 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = examples/lua +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_readline.m4 \ + $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gnome-code-coverage.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + distdir +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AM_TESTS_FD_REDIRECT = @AM_TESTS_FD_REDIRECT@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BLUEZ5_CFLAGS = @BLUEZ5_CFLAGS@ +BLUEZ5_LIBS = @BLUEZ5_LIBS@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ +CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ +CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ +DLLTOOL = @DLLTOOL@ +DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GENHTML = @GENHTML@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MAKEFILE = @GLIB_MAKEFILE@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ +INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ +INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ +INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +IPTABLES_PATH = @IPTABLES_PATH@ +KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ +LCOV = @LCOV@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ +LIBDL = @LIBDL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBM = @LIBM@ +LIBNDP_CFLAGS = @LIBNDP_CFLAGS@ +LIBNDP_LIBS = @LIBNDP_LIBS@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSOUP_CFLAGS = @LIBSOUP_CFLAGS@ +LIBSOUP_LIBS = @LIBSOUP_LIBS@ +LIBTEAMDCTL_CFLAGS = @LIBTEAMDCTL_CFLAGS@ +LIBTEAMDCTL_LIBS = @LIBTEAMDCTL_LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOG_DRIVER = @LOG_DRIVER@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MM_GLIB_CFLAGS = @MM_GLIB_CFLAGS@ +MM_GLIB_LIBS = @MM_GLIB_LIBS@ +MOC = @MOC@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NEWT_CFLAGS = @NEWT_CFLAGS@ +NEWT_LIBS = @NEWT_LIBS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ +NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ +NM_MICRO_VERSION = @NM_MICRO_VERSION@ +NM_MINOR_VERSION = @NM_MINOR_VERSION@ +NM_MODIFY_SYSTEM_POLICY = @NM_MODIFY_SYSTEM_POLICY@ +NM_VERSION = @NM_VERSION@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PPPD_PATH = @PPPD_PATH@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +QT_CFLAGS = @QT_CFLAGS@ +QT_LIBS = @QT_LIBS@ +RANLIB = @RANLIB@ +READLINE_LIBS = @READLINE_LIBS@ +SED = @SED@ +SELINUX_CFLAGS = @SELINUX_CFLAGS@ +SELINUX_LIBS = @SELINUX_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ +SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ +SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ +SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ +SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ +SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_DIR = @UDEV_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VALGRIND_RULES = @VALGRIND_RULES@ +VAPIGEN = @VAPIGEN@ +VAPIGEN_MAKEFILE = @VAPIGEN_MAKEFILE@ +VAPIGEN_VAPIDIR = @VAPIGEN_VAPIDIR@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +intltool__v_merge_options_ = @intltool__v_merge_options_@ +intltool__v_merge_options_0 = @intltool__v_merge_options_0@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +nmbinary = @nmbinary@ +nmconfdir = @nmconfdir@ +nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ +nmrundir = @nmrundir@ +nmstatedir = @nmstatedir@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +systemdsystemunitdir = @systemdsystemunitdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +with_dhclient = @with_dhclient@ +with_dhcpcd = @with_dhcpcd@ +with_netconfig = @with_netconfig@ +with_resolvconf = @with_resolvconf@ +with_valgrind = @with_valgrind@ +SUBDIRS = lgi +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/lua/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu examples/lua/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-generic clean-libtool cscopelist-am ctags \ + ctags-am distclean distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# 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. +.NOEXPORT: diff --git a/examples/lua/lgi/Makefile.am b/examples/lua/lgi/Makefile.am new file mode 100644 index 00000000..ce5c8f5c --- /dev/null +++ b/examples/lua/lgi/Makefile.am @@ -0,0 +1,9 @@ +EXTRA_DIST = \ + add-connection.lua \ + list-connections.lua \ + list-devices.lua \ + show-wifi-networks.lua \ + get-basic-nm-info.lua \ + get-ips.lua \ + change-vpn-username.lua \ + deactivate-all.lua diff --git a/examples/lua/lgi/Makefile.in b/examples/lua/lgi/Makefile.in new file mode 100644 index 00000000..3025d55b --- /dev/null +++ b/examples/lua/lgi/Makefile.in @@ -0,0 +1,601 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = examples/lua/lgi +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_readline.m4 \ + $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gnome-code-coverage.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AM_TESTS_FD_REDIRECT = @AM_TESTS_FD_REDIRECT@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BLUEZ5_CFLAGS = @BLUEZ5_CFLAGS@ +BLUEZ5_LIBS = @BLUEZ5_LIBS@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ +CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ +CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ +DLLTOOL = @DLLTOOL@ +DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GENHTML = @GENHTML@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MAKEFILE = @GLIB_MAKEFILE@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ +INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ +INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ +INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +IPTABLES_PATH = @IPTABLES_PATH@ +KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ +LCOV = @LCOV@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ +LIBDL = @LIBDL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBM = @LIBM@ +LIBNDP_CFLAGS = @LIBNDP_CFLAGS@ +LIBNDP_LIBS = @LIBNDP_LIBS@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSOUP_CFLAGS = @LIBSOUP_CFLAGS@ +LIBSOUP_LIBS = @LIBSOUP_LIBS@ +LIBTEAMDCTL_CFLAGS = @LIBTEAMDCTL_CFLAGS@ +LIBTEAMDCTL_LIBS = @LIBTEAMDCTL_LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOG_DRIVER = @LOG_DRIVER@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MM_GLIB_CFLAGS = @MM_GLIB_CFLAGS@ +MM_GLIB_LIBS = @MM_GLIB_LIBS@ +MOC = @MOC@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NEWT_CFLAGS = @NEWT_CFLAGS@ +NEWT_LIBS = @NEWT_LIBS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ +NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ +NM_MICRO_VERSION = @NM_MICRO_VERSION@ +NM_MINOR_VERSION = @NM_MINOR_VERSION@ +NM_MODIFY_SYSTEM_POLICY = @NM_MODIFY_SYSTEM_POLICY@ +NM_VERSION = @NM_VERSION@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PPPD_PATH = @PPPD_PATH@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +QT_CFLAGS = @QT_CFLAGS@ +QT_LIBS = @QT_LIBS@ +RANLIB = @RANLIB@ +READLINE_LIBS = @READLINE_LIBS@ +SED = @SED@ +SELINUX_CFLAGS = @SELINUX_CFLAGS@ +SELINUX_LIBS = @SELINUX_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ +SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ +SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ +SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ +SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ +SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_DIR = @UDEV_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VALGRIND_RULES = @VALGRIND_RULES@ +VAPIGEN = @VAPIGEN@ +VAPIGEN_MAKEFILE = @VAPIGEN_MAKEFILE@ +VAPIGEN_VAPIDIR = @VAPIGEN_VAPIDIR@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +intltool__v_merge_options_ = @intltool__v_merge_options_@ +intltool__v_merge_options_0 = @intltool__v_merge_options_0@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +nmbinary = @nmbinary@ +nmconfdir = @nmconfdir@ +nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ +nmrundir = @nmrundir@ +nmstatedir = @nmstatedir@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +systemdsystemunitdir = @systemdsystemunitdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +with_dhclient = @with_dhclient@ +with_dhcpcd = @with_dhcpcd@ +with_netconfig = @with_netconfig@ +with_resolvconf = @with_resolvconf@ +with_valgrind = @with_valgrind@ +EXTRA_DIST = \ + add-connection.lua \ + list-connections.lua \ + list-devices.lua \ + show-wifi-networks.lua \ + get-basic-nm-info.lua \ + get-ips.lua \ + change-vpn-username.lua \ + deactivate-all.lua + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/lua/lgi/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu examples/lua/lgi/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + cscopelist-am ctags-am distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# 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. +.NOEXPORT: diff --git a/examples/lua/lgi/add-connection.lua b/examples/lua/lgi/add-connection.lua new file mode 100755 index 00000000..3daf5f32 --- /dev/null +++ b/examples/lua/lgi/add-connection.lua @@ -0,0 +1,98 @@ +#!/usr/bin/env lua +-- -*- Mode: Lua; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +-- vim: ft=lua ts=2 sts=2 sw=2 et ai +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License along +-- with this program; if not, write to the Free Software Foundation, Inc., +-- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +-- +-- Copyright 2015 Red Hat, Inc. +-- +-- +-- Adding an Ethernet connection to NetworkManager in Lua. +-- The example uses libnm library using GObject introspection via Lua lgi module. +-- Most distribution ship the module as lua-lgi package. +-- libnm guide: https://developer.gnome.org/libnm/1.0/ +-- Lua-lgi guide: https://github.com/pavouk/lgi/blob/master/docs/guide.md +-- + +local lgi = require 'lgi' +local GLib = lgi.GLib +local NM = lgi.NM + +function uuid() + math.randomseed(os.time()) + local template ='xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx' + local uuid = string.gsub(template, '[xy]', function (c) + local v = (c == 'x') and math.random(0, 0xf) or math.random(8, 0xb) + return string.format('%x', v) + end) + return uuid +end + +-- function creating NMConnection +function create_profile(name) + profile = NM.SimpleConnection.new() + + s_con = NM.SettingConnection.new() + s_wired = NM.SettingWired.new() + s_con[NM.SETTING_CONNECTION_ID] = name + s_con[NM.SETTING_CONNECTION_UUID] = uuid() + s_con[NM.SETTING_CONNECTION_TYPE] = "802-3-ethernet" + + profile:add_setting(s_con) + profile:add_setting(s_wired) + + -- show the connection + -- profile:dump() + return profile +end + +-- callback function for add_connection_async() +function added_cb(client, result, data) + local con,err,code = client:add_connection_finish(result) + if con then + print("The connection profile has been succesfully added to NetworkManager:") + print(con:get_id(), con:get_uuid()) + else + print(string.format("Error: (%d) %s", code, err)) + end + main_loop:quit() -- exit now +end + + +--------------------------- +-- Main code starts here -- +--------------------------- +-- parse command-line arguments +local name, persist = ... +if (not name or (persist and not string.find("persistent", persist, 1))) then + print(string.format("Usage: %s [persistent]", arg[0]:gsub(".*/",""))) + os.exit(1) +end + +-- create GLib main loop +main_loop = GLib.MainLoop(nil, false) + +-- create Client object +local client = NM.Client.new() + +-- create a connection profile +local con = create_profile(name) + +-- send the connection to NetworkManager +client:add_connection_async(con, persist, nil, added_cb, nil) + +-- run main loop so that the callback could be called +main_loop:run() + diff --git a/examples/lua/lgi/change-vpn-username.lua b/examples/lua/lgi/change-vpn-username.lua new file mode 100755 index 00000000..2e93f9dd --- /dev/null +++ b/examples/lua/lgi/change-vpn-username.lua @@ -0,0 +1,85 @@ +#!/usr/bin/env lua +-- -*- Mode: Lua; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +-- vim: ft=lua ts=2 sts=2 sw=2 et ai +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License along +-- with this program; if not, write to the Free Software Foundation, Inc., +-- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +-- +-- Copyright 2015 Red Hat, Inc. +-- +-- +-- This example changes username in a VPN profile. +-- The example uses libnm library using GObject introspection via Lua lgi module. +-- Most distribution ship the module as lua-lgi package. +-- libnm guide: https://developer.gnome.org/libnm/1.0/ +-- Lua-lgi guide: https://github.com/pavouk/lgi/blob/master/docs/guide.md +-- + +local lgi = require 'lgi' +local NM = lgi.NM + +-- mapping from VPN type to username data item +vpn2username = { + openvpn = "username", + vpnc = "Xauth username", + pptp = "user", + l2tp = "user", + openswan = "leftxauthusername", +} + +--------------------------- +-- Main code starts here -- +--------------------------- +-- parse command-line arguments +local profile, username, extra = ... +if (not profile or not username or extra) then + print(string.format("Usage: %s ", arg[0]:gsub(".*/",""))) + os.exit(1) +end + +-- get client object +client = NM.Client.new() + +-- find the connection profile +con = client:get_connection_by_id(profile) +if not con then con = client:get_connection_by_uuid(profile) end +if not con then con = client:get_connection_by_path(profile) end +if not con then io.stderr:write(string.format("Profile %s not found.\n", profile)) os.exit(1) end + +if not con:is_type(NM.SETTING_VPN_SETTING_NAME) then + io.stderr:write(string.format("Profile '%s' is not a VPN.\n", profile)) + os.exit(1) +end + +-- get VPN setting +vpn = con:get_setting_vpn() +service_name = vpn:get_service_type() +vpn_type = service_name:match(".*%.(.*)") + +if not vpn2username[vpn_type] then + io.stderr:write(string.format("Unknown VPN type '%s'.\n", vpn_type)) + os.exit(1) +end + +-- update the username +vpn:add_data_item(vpn2username[vpn_type], username) +-- save changes +ok, errmsg = con:commit_changes(true) +if not ok then + io.stderr:write(string.format("Error in updating connection: %s.\n", errmsg)) + os.exit(1) +end + +print(string.format("Username updated to '%s'.", username)) + diff --git a/examples/lua/lgi/deactivate-all.lua b/examples/lua/lgi/deactivate-all.lua new file mode 100755 index 00000000..fb8e0ed5 --- /dev/null +++ b/examples/lua/lgi/deactivate-all.lua @@ -0,0 +1,82 @@ +#!/usr/bin/env lua +-- -*- Mode: Lua; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +-- vim: ft=lua ts=2 sts=2 sw=2 et ai +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License along +-- with this program; if not, write to the Free Software Foundation, Inc., +-- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +-- +-- Copyright 2015 Red Hat, Inc. +-- +-- +-- Deactivate all active connections (of certain type). +-- The example uses libnm library using GObject introspection via Lua lgi module. +-- Most distribution ship the module as lua-lgi package. +-- libnm guide: https://developer.gnome.org/libnm/1.0/ +-- Lua-lgi guide: https://github.com/pavouk/lgi/blob/master/docs/guide.md +-- + +local lgi = require 'lgi' +local NM = lgi.NM + +-- suported connection types +connection_types = { + NM.SETTING_VPN_SETTING_NAME, + NM.SETTING_WIRELESS_SETTING_NAME, + NM.SETTING_WIRED_SETTING_NAME, + NM.SETTING_BOND_SETTING_NAME, + NM.SETTING_BRIDGE_SETTING_NAME, + NM.SETTING_TEAM_SETTING_NAME, + NM.SETTING_INFINIBAND_SETTING_NAME, + NM.SETTING_PPPOE_SETTING_NAME, + NM.SETTING_ADSL_SETTING_NAME, + NM.SETTING_BLUETOOTH_SETTING_NAME, + NM.SETTING_WIMAX_SETTING_NAME, + NM.SETTING_OLPC_MESH_SETTING_NAME, + NM.SETTING_GENERIC_SETTING_NAME, +} + +function known_ctype(ctype, types) + for _,v in ipairs(types) do + if v == ctype then return true end + end + return false +end + +--------------------------- +-- Main code starts here -- +--------------------------- +-- parse command-line arguments +local ctype = ... +if (ctype and not known_ctype(ctype, connection_types)) then + print(string.format("Usage: %s []", arg[0]:gsub(".*/",""))) + print("Allowed types:", table.concat(connection_types, ", ")) + os.exit(1) +end + +-- create Client object +local client = NM.Client.new() + +-- get active connections +connections = client:get_active_connections() + +-- deactivate the connections +for _, ac in pairs(connections) do + if not ctype or ctype == ac:get_connection_type() then + io.stdout:write(string.format("Deactivating %s (%s)", ac:get_id(), ac:get_uuid())) + ok,err = client:deactivate_connection(ac, nil, nil) + if ok then io.stdout:write("\27[32m -> succeeded\27[0m\n") + else io.stdout:write(string.format("\27[31m -> failed\27[0m (%s)\n", err)) end + end +end + diff --git a/examples/lua/lgi/get-basic-nm-info.lua b/examples/lua/lgi/get-basic-nm-info.lua new file mode 100755 index 00000000..fe3c3ea3 --- /dev/null +++ b/examples/lua/lgi/get-basic-nm-info.lua @@ -0,0 +1,51 @@ +#!/usr/bin/env lua +-- -*- Mode: Lua; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +-- vim: ft=lua ts=2 sts=2 sw=2 et ai +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License along +-- with this program; if not, write to the Free Software Foundation, Inc., +-- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +-- +-- Copyright 2015 Red Hat, Inc. +-- +-- +-- This example gets basic information about NetworkManager. +-- The example uses libnm library using GObject introspection via Lua lgi module. +-- Most distribution ship the module as lua-lgi package. +-- libnm guide: https://developer.gnome.org/libnm/1.0/ +-- Lua-lgi guide: https://github.com/pavouk/lgi/blob/master/docs/guide.md +-- + +local lgi = require 'lgi' +local NM = lgi.NM + +--------------------------- +-- Main code starts here -- +--------------------------- +-- get client object +client = NM.Client.new() + +print("Basic NM properties:") +print("====================") +print("NM version: ", client.version) +print("NM state: ", client.state) +print("NM startup: ", client.startup) +print("Networking enabled: ", client.networking_enabled) +print("Wireless enabled: ", client.wireless_enabled) +print("Wireless HW enabled: ", client.wireless_hardware_enabled) +print("WWAN enabled: ", client.wwan_enabled) +print("WWAN HW enabled: ", client.wwan_hardware_enabled) +print("# devices: ", #client.devices) +print("# connections: ", #client.connections) +print("# active connections:", #client.active_connections) + diff --git a/examples/lua/lgi/get-ips.lua b/examples/lua/lgi/get-ips.lua new file mode 100755 index 00000000..9a70de43 --- /dev/null +++ b/examples/lua/lgi/get-ips.lua @@ -0,0 +1,160 @@ +#!/usr/bin/env lua +-- -*- Mode: Lua; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +-- vim: ft=lua ts=2 sts=2 sw=2 et ai +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License along +-- with this program; if not, write to the Free Software Foundation, Inc., +-- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +-- +-- Copyright 2015 Red Hat, Inc. +-- +-- +-- This example shows how to get addresses, routes and DNS information from +-- NMIP4Config and NMIP6Config (got out of NMDevice) +-- The example uses libnm library using GObject introspection via Lua lgi module. +-- Most distribution ship the module as lua-lgi package. +-- libnm guide: https://developer.gnome.org/libnm/1.0/ +-- Lua-lgi guide: https://github.com/pavouk/lgi/blob/master/docs/guide.md +-- + +local lgi = require 'lgi' +local NM = lgi.NM + +AF_INET = 2 +AF_INET6 = 10 + +function to_str(table) + local val = "" + for i, str in ipairs(table) do + local delim = i == #table and "" or ", " + val = val .. str .. delim + end + return val +end + +function show_addresses(dev, family) + if (family == AF_INET) then ip_cfg = dev:get_ip4_config() + else ip_cfg = dev:get_ip6_config() end + + if not ip_cfg then print("None") return end + local nm_addresses = ip_cfg:get_addresses() + if #nm_addresses == 0 then print("None") return end + + for _, nm_address in ipairs(nm_addresses) do + addr = nm_address:get_address() + prefix = nm_address:get_prefix() + print(string.format("%s/%d", addr, prefix)) + end +end + +function show_gateway(dev, family) + if (family == AF_INET) then ip_cfg = dev:get_ip4_config() + else ip_cfg = dev:get_ip6_config() end + + if not ip_cfg then print("None") return end + gw = ip_cfg:get_gateway() + print(gw) +end + +function show_routes(dev, family) + if (family == AF_INET) then ip_cfg = dev:get_ip4_config() + else ip_cfg = dev:get_ip6_config() end + + if not ip_cfg then print("None") return end + local nm_routes = ip_cfg:get_routes() + if #nm_routes == 0 then print("None") return end + + for _, nm_route in ipairs(nm_routes) do + dest = nm_route:get_dest() + prefix = nm_route:get_prefix() + next_hop = nm_route:get_next_hop() + metric = nm_route:get_metric() + print(string.format("%s/%d %s %d", dest, prefix, next_hop, metric)) + end +end + +function show_dns(dev, family) + if (family == AF_INET) then ip_cfg = dev:get_ip4_config() + else ip_cfg = dev:get_ip6_config() end + + if not ip_cfg then print("None") return end + + print ("Nameservers:", to_str(ip_cfg:get_nameservers())) + print ("Domains: ", to_str(ip_cfg:get_domains())) + print ("Searches: ", to_str(ip_cfg:get_searches())) + if (family == AF_INET) then + print ("WINS: ", to_str(ip_cfg:get_wins_servers())) + end +end + + +--------------------------- +-- Main code starts here -- +--------------------------- +if not arg[1] or arg[2] then + io.stderr:write(string.format("Usage: %s \n", arg[0])) + os.exit(1) +end +local dev_iface = arg[1] + +local c = NM.Client.new() +local device = c:get_device_by_iface(dev_iface) +if not device then + io.stderr:write(string.format("Device '%s' not found\n", dev_iface)) + os.exit(1) +end + +local header = string.format("Device: %s - %s", dev_iface, device:get_device_type()) +print(header) +print(string.rep("=", #header)) + +print("IPv4 addresses:") +print("---------------") +show_addresses(device, AF_INET) +print("") + +print("IPv4 gateway:") +print("-------------") +show_gateway(device, AF_INET) +print("") + +print("IPv4 routes:") +print("------------") +show_routes(device, AF_INET) +print("") + +print "IPv6 addresses:" +print("---------------") +show_addresses(device, AF_INET6) +print("") + +print("IPv6 gateway:") +print("-------------") +show_gateway(device, AF_INET6) +print("") + +print "IPv6 routes:" +print("------------") +show_routes(device, AF_INET6) +print("") + +print "IPv4 DNS:" +print("---------") +show_dns(device, AF_INET) +print("") + +print "IPv6 DNS:" +print("---------") +show_dns(device, AF_INET6) +print("") + diff --git a/examples/lua/lgi/list-connections.lua b/examples/lua/lgi/list-connections.lua new file mode 100755 index 00000000..f2eda442 --- /dev/null +++ b/examples/lua/lgi/list-connections.lua @@ -0,0 +1,63 @@ +#!/usr/bin/env lua +-- -*- Mode: Lua; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +-- vim: ft=lua ts=2 sts=2 sw=2 et ai +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License along +-- with this program; if not, write to the Free Software Foundation, Inc., +-- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +-- +-- Copyright 2015 Red Hat, Inc. +-- +-- +-- Getting and printing all NetworkManager connection in Lua. +-- The example uses libnm library using GObject introspection via Lua lgi module. +-- Most distribution ship the module as lua-lgi package. +-- libnm guide: https://developer.gnome.org/libnm/1.0/ +-- Lua-lgi guide: https://github.com/pavouk/lgi/blob/master/docs/guide.md +-- + +local lgi = require 'lgi' +local GLib = lgi.GLib +local NM = lgi.NM + +function print_values(setting, key, value, flags, data) + print(string.format(" %s.%s: %s", setting:get_name(), key, value and tostring(value.value) or "nil")) +end + + +--------------------------- +-- Main code starts here -- +--------------------------- +-- parse command-line arguments +local details = ... +if (details and not string.find("details", details, 1)) then + print(string.format("Usage: %s [details]", arg[0]:gsub(".*/",""))) + os.exit(1) +end + +-- create Client object +local client = NM.Client.new() + +-- get connections +connections = client:get_connections() + +-- print the connections' details +print(string.format("There are %s connection profiles.", #connections)) +for i, c in pairs(connections) do + print(string.format("=== %s | %25s | %s ", c:get_uuid(), c:get_id(), c:get_path())) + if details then + c:for_each_setting_value(print_values, nil) + print("\n") + end +end + diff --git a/examples/lua/lgi/list-devices.lua b/examples/lua/lgi/list-devices.lua new file mode 100755 index 00000000..712d353e --- /dev/null +++ b/examples/lua/lgi/list-devices.lua @@ -0,0 +1,51 @@ +#!/usr/bin/env lua +-- -*- Mode: Lua; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +-- vim: ft=lua ts=2 sts=2 sw=2 et ai +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License along +-- with this program; if not, write to the Free Software Foundation, Inc., +-- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +-- +-- Copyright 2015 Red Hat, Inc. +-- +-- +-- Getting basic information about network interfaces known to NetworkManager. +-- The example uses libnm library using GObject introspection via Lua lgi module. +-- Most distribution ship the module as lua-lgi package. +-- libnm guide: https://developer.gnome.org/libnm/1.0/ +-- Lua-lgi guide: https://github.com/pavouk/lgi/blob/master/docs/guide.md +-- + +local lgi = require 'lgi' +local GLib = lgi.GLib +local NM = lgi.NM + +--------------------------- +-- Main code starts here -- +--------------------------- +-- create Client object +local client = NM.Client.new() + +-- get all devices +devices = client:get_devices() + +-- print device details +for i, d in ipairs(devices) do +print("============================") + print(string.format("Interface: %s", d[NM.DEVICE_INTERFACE])) + print(string.format("MAC: %s", d:get_hw_address())) + print(string.format("Type: %s", d:get_device_type())) + print(string.format("Driver: %s", d:get_driver())) + print(string.format("State: %s", d:get_state())) +end + diff --git a/examples/lua/lgi/show-wifi-networks.lua b/examples/lua/lgi/show-wifi-networks.lua new file mode 100755 index 00000000..954fee70 --- /dev/null +++ b/examples/lua/lgi/show-wifi-networks.lua @@ -0,0 +1,122 @@ +#!/usr/bin/env lua +-- -*- Mode: Lua; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- +-- vim: ft=lua ts=2 sts=2 sw=2 et ai +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License along +-- with this program; if not, write to the Free Software Foundation, Inc., +-- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +-- +-- Copyright 2015 Red Hat, Inc. +-- +-- +-- This example lists Wi-Fi access points NetworkManager scanned on Wi-Fi devices. +-- The example uses libnm library using GObject introspection via Lua lgi module. +-- Most distribution ship the module as lua-lgi package. +-- libnm guide: https://developer.gnome.org/libnm/1.0/ +-- Lua-lgi guide: https://github.com/pavouk/lgi/blob/master/docs/guide.md +-- + +local lgi = require 'lgi' +local NM = lgi.NM + +function is_empty(t) + local next = next + if next(t) then return false else return true end +end + +function ssid_to_utf8(ap) + local ssid = ap:get_ssid() + if not ssid then return "" end + return NM.utils_ssid_to_utf8(ssid:get_data()) +end + +function print_device_info(device) + local active_ap = device:get_active_access_point() + if active_ap then ssid = ssid_to_utf8(active_ap) end + local info = string.format("Device: %s | Driver: %s | Active AP: %s", + device:get_iface(), device:get_driver(), ssid) + print(info) + print(string.rep("=", info:len())) +end + +function flags_to_string(flags) + local str = "" + for flag, _ in pairs(flags) do + str = str .. " " .. flag + end + if str == "" then str = "NONE" end + return (str:gsub( "^%s", "")) +end + +function flags_to_security(flags, wpa_flags, rsn_flags) + local str = "" + if flags["PRIVACY"] and is_empty(wpa_flags) and is_empty(rsn_flags) then + str = str .. " WEP" + end + if not is_empty(wpa_flags) then + str = str .. " WPA1" + end + if not is_empty(rsn_flags) then + str = str .. " WPA2" + end + if wpa_flags["KEY_MGMT_802_1X"] or rsn_flags["KEY_MGMT_802_1X"] then + str = str .. " 802.1X" + end + return (str:gsub( "^%s", "")) +end + +function print_ap_info(ap) + local strength = ap:get_strength() + local frequency = ap:get_frequency() + local flags = ap:get_flags() + local wpa_flags = ap:get_wpa_flags() + local rsn_flags = ap:get_rsn_flags() + -- remove extra NONE from the flags tables + flags["NONE"] = nil + wpa_flags["NONE"] = nil + rsn_flags["NONE"] = nil + print("SSID: ", ssid_to_utf8(ap)) + print("BSSID: ", ap:get_bssid()) + print("Frequency: ", frequency) + print("Channel: ", NM.utils_wifi_freq_to_channel(frequency)) + print("Mode: ", ap:get_mode()) + print("Flags: ", flags_to_string(flags)) + print("WPA flags: ", flags_to_string(wpa_flags)) + print("RSN flags: ", flags_to_string(rsn_flags)) + print("Security: ", flags_to_security(flags, wpa_flags, rsn_flags)) + print(string.format("Strength: %s %s%%", NM.utils_wifi_strength_bars(strength), strength)) + print("") +end + + +--------------------------- +-- Main code starts here -- +--------------------------- +-- Call setlocale() else NM.utils_wifi_strength_bars() will think the locale +-- is ASCII-only, and return the fallback characters rather than the unicode bars +os.setlocale('') + +-- get all devices +client = NM.Client.new() +devs = client:get_devices() + +-- print APs for all Wi-Fi devices +for _, dev in ipairs(devs) do + if dev:get_device_type() == "WIFI" then + print_device_info(dev) + for _, ap in ipairs(dev:get_access_points()) do + print_ap_info(ap) + end + end +end + diff --git a/examples/python/Makefile.am b/examples/python/Makefile.am index 3b6a41f4..cd3ce3ed 100644 --- a/examples/python/Makefile.am +++ b/examples/python/Makefile.am @@ -1,2 +1,2 @@ -SUBDIRS= dbus gi +SUBDIRS= dbus gi python-networkmanager diff --git a/examples/python/Makefile.in b/examples/python/Makefile.in index c047d1a1..e5552ae8 100644 --- a/examples/python/Makefile.in +++ b/examples/python/Makefile.in @@ -206,7 +206,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -218,8 +217,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -229,6 +226,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -283,16 +281,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -329,6 +324,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -357,7 +354,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -372,6 +368,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -432,6 +430,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -439,6 +438,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -454,7 +454,7 @@ with_dhcpcd = @with_dhcpcd@ with_netconfig = @with_netconfig@ with_resolvconf = @with_resolvconf@ with_valgrind = @with_valgrind@ -SUBDIRS = dbus gi +SUBDIRS = dbus gi python-networkmanager all: all-recursive .SUFFIXES: diff --git a/examples/python/dbus/Makefile.am b/examples/python/dbus/Makefile.am index dd77f1e9..0a89dc56 100644 --- a/examples/python/dbus/Makefile.am +++ b/examples/python/dbus/Makefile.am @@ -2,7 +2,8 @@ EXTRA_DIST = \ nm-state.py \ add-connection.py \ add-connection-compat.py \ - add-system-wifi-connection.py \ + add-wifi-eap-connection.py \ + add-wifi-psk-connection.py \ vpn.py \ update-secrets.py \ list-connections.py \ @@ -11,4 +12,7 @@ EXTRA_DIST = \ get-active-connection-uuids.py \ list-devices.py \ update-ip4-method.py \ - is-wwan-default.py + is-wwan-default.py \ + wifi-hotspot.py \ + create-bond.py \ + wifi-active-ap.py diff --git a/examples/python/dbus/Makefile.in b/examples/python/dbus/Makefile.in index 023e52d8..1fcfd9cd 100644 --- a/examples/python/dbus/Makefile.in +++ b/examples/python/dbus/Makefile.in @@ -146,7 +146,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -158,8 +157,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -169,6 +166,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -223,16 +221,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -269,6 +264,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -297,7 +294,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -312,6 +308,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -372,6 +370,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -379,6 +378,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -398,7 +398,8 @@ EXTRA_DIST = \ nm-state.py \ add-connection.py \ add-connection-compat.py \ - add-system-wifi-connection.py \ + add-wifi-eap-connection.py \ + add-wifi-psk-connection.py \ vpn.py \ update-secrets.py \ list-connections.py \ @@ -407,7 +408,10 @@ EXTRA_DIST = \ get-active-connection-uuids.py \ list-devices.py \ update-ip4-method.py \ - is-wwan-default.py + is-wwan-default.py \ + wifi-hotspot.py \ + create-bond.py \ + wifi-active-ap.py all: all-am diff --git a/examples/python/dbus/add-system-wifi-connection.py b/examples/python/dbus/add-system-wifi-connection.py deleted file mode 100755 index ff390821..00000000 --- a/examples/python/dbus/add-system-wifi-connection.py +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env python -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright (C) 2011 Red Hat, Inc. -# - -import dbus - -def path_to_value(path): - return dbus.ByteArray("file://" + path + "\0") - -s_con = dbus.Dictionary({ - 'type': '802-11-wireless', - 'uuid': '7371bb78-c1f7-42a3-a9db-5b9566e8ca07', - 'id': 'My Wifi'}) - -s_wifi = dbus.Dictionary({ - 'ssid': dbus.ByteArray("homewifi"), - 'security': '802-11-wireless-security'}) - -s_wsec = dbus.Dictionary({'key-mgmt': 'wpa-eap'}) - -s_8021x = dbus.Dictionary({ - 'eap': ['tls'], - 'identity': 'Bill Smith', - 'client-cert': path_to_value("/some/place/client.pem"), - 'ca-cert': path_to_value("/some/place/ca-cert.pem"), - 'private-key': path_to_value("/some/place/privkey.pem"), - 'private-key-password': "12345testing"}) - -s_ip4 = dbus.Dictionary({'method': 'auto'}) -s_ip6 = dbus.Dictionary({'method': 'ignore'}) - -con = dbus.Dictionary({ - 'connection': s_con, - '802-11-wireless': s_wifi, - '802-11-wireless-security': s_wsec, - '802-1x': s_8021x, - 'ipv4': s_ip4, - 'ipv6': s_ip6 - }) - - -bus = dbus.SystemBus() - -proxy = bus.get_object("org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager/Settings") -settings = dbus.Interface(proxy, "org.freedesktop.NetworkManager.Settings") - -settings.AddConnection(con) - diff --git a/examples/python/dbus/add-wifi-eap-connection.py b/examples/python/dbus/add-wifi-eap-connection.py new file mode 100755 index 00000000..4085ac31 --- /dev/null +++ b/examples/python/dbus/add-wifi-eap-connection.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Copyright (C) 2011 Red Hat, Inc. +# + +import dbus, uuid + +def path_to_value(path): + return dbus.ByteArray("file://" + path + "\0") + +s_con = dbus.Dictionary({ + 'type': '802-11-wireless', + 'uuid': str(uuid.uuid4()), + 'id': 'My Wifi'}) + +s_wifi = dbus.Dictionary({ + 'ssid': dbus.ByteArray("homewifi"), + 'security': '802-11-wireless-security'}) + +s_wsec = dbus.Dictionary({'key-mgmt': 'wpa-eap'}) + +s_8021x = dbus.Dictionary({ + 'eap': ['tls'], + 'identity': 'Bill Smith', + 'client-cert': path_to_value("/some/place/client.pem"), + 'ca-cert': path_to_value("/some/place/ca-cert.pem"), + 'private-key': path_to_value("/some/place/privkey.pem"), + 'private-key-password': "12345testing"}) + +s_ip4 = dbus.Dictionary({'method': 'auto'}) +s_ip6 = dbus.Dictionary({'method': 'ignore'}) + +con = dbus.Dictionary({ + 'connection': s_con, + '802-11-wireless': s_wifi, + '802-11-wireless-security': s_wsec, + '802-1x': s_8021x, + 'ipv4': s_ip4, + 'ipv6': s_ip6 + }) + + +bus = dbus.SystemBus() + +proxy = bus.get_object("org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager/Settings") +settings = dbus.Interface(proxy, "org.freedesktop.NetworkManager.Settings") + +settings.AddConnection(con) + diff --git a/examples/python/dbus/add-wifi-psk-connection.py b/examples/python/dbus/add-wifi-psk-connection.py new file mode 100755 index 00000000..60cb2af9 --- /dev/null +++ b/examples/python/dbus/add-wifi-psk-connection.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Copyright (C) 2015 Red Hat, Inc. +# + +import dbus, uuid + +s_con = dbus.Dictionary({ + 'type': '802-11-wireless', + 'uuid': str(uuid.uuid4()), + 'id': 'My-WPA-PSK'}) + +s_wifi = dbus.Dictionary({ + 'ssid': dbus.ByteArray("best-wifi"), + 'mode': 'infrastructure', +}) + +s_wsec = dbus.Dictionary({ + 'key-mgmt': 'wpa-psk', + 'auth-alg': 'open', + 'psk': 'super-secret-password', +}) + +s_ip4 = dbus.Dictionary({'method': 'auto'}) +s_ip6 = dbus.Dictionary({'method': 'ignore'}) + +con = dbus.Dictionary({ + 'connection': s_con, + '802-11-wireless': s_wifi, + '802-11-wireless-security': s_wsec, + 'ipv4': s_ip4, + 'ipv6': s_ip6 + }) + + +bus = dbus.SystemBus() + +proxy = bus.get_object("org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager/Settings") +settings = dbus.Interface(proxy, "org.freedesktop.NetworkManager.Settings") + +settings.AddConnection(con) + diff --git a/examples/python/dbus/create-bond.py b/examples/python/dbus/create-bond.py new file mode 100755 index 00000000..41ffabe8 --- /dev/null +++ b/examples/python/dbus/create-bond.py @@ -0,0 +1,114 @@ +#!/usr/bin/env python +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Copyright (C) 2015 Red Hat, Inc. +# + +# +# This example configures a Bond from ethernet devices and activates it +# +# NetworkManager D-Bus API: +# https://developer.gnome.org/NetworkManager/1.0/spec.html +# + +import dbus, sys, uuid +from dbus.mainloop.glib import DBusGMainLoop +import gobject + +DBusGMainLoop(set_as_default=True) + +def add_connection(con): + bus = dbus.SystemBus() + proxy = bus.get_object("org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager/Settings") + settings = dbus.Interface(proxy, "org.freedesktop.NetworkManager.Settings") + return settings.AddConnection(con) + +def create_bond(bond_name): + bond_opts = dbus.Dictionary({'mode': '4'}) + s_bond = dbus.Dictionary({'options': bond_opts}) + s_con = dbus.Dictionary({ + 'type': 'bond', + 'uuid': str(uuid.uuid4()), + 'id': bond_name, + 'interface-name': bond_name, + 'autoconnect': False, + 'autoconnect-slaves': 1}) + s_ip4 = dbus.Dictionary({'method': 'auto'}) + s_ip6 = dbus.Dictionary({'method': 'ignore'}) + + con = dbus.Dictionary({ + 'bond': s_bond, + 'connection': s_con, + 'ipv4': s_ip4, + 'ipv6': s_ip6}) + print "Creating bond connection: %s" % bond_name + return add_connection(con) + +def create_slave(device, master): + slave_name = 'bond-' + master + '-slave-' + device + s_wired = dbus.Dictionary({'duplex': 'full'}) + s_con = dbus.Dictionary({ + 'type': '802-3-ethernet', + 'uuid': str(uuid.uuid4()), + 'id': slave_name, + 'interface-name': device, + 'autoconnect': False, + 'master': master, + 'slave-type': 'bond'}) + + con = dbus.Dictionary({ + '802-3-ethernet': s_wired, + 'connection': s_con}) + print "Creating slave connection: %s" % slave_name + add_connection(con) + +def usage(): + print "Usage: %s ..." % sys.argv[0] + sys.exit(0) + + +if len(sys.argv) < 3: + usage() + +# Create bond master and slave connections +bond_name = sys.argv[1] +bond_path = create_bond(bond_name) +for ifname in sys.argv[2:]: + create_slave(ifname, bond_name) + +# Activate the bond +bus = dbus.SystemBus() +proxy = bus.get_object("org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager") +manager = dbus.Interface(proxy, "org.freedesktop.NetworkManager") +ac = manager.ActivateConnection(bond_path, "/", "/") +print "Activating bond: %s (%s)" % (bond_name, ac) + +# Monitor the active bond connection +loop = gobject.MainLoop() +def properties_changed(props): + if 'State' in props: + if props['State'] == 2: + print "Succesfully connected" + loop.quit() + if props['State'] == 3 or props['State'] == 4: + print "Bond activation failed" + loop.quit() + +obj = bus.get_object("org.freedesktop.NetworkManager", ac) +iface = dbus.Interface(obj, "org.freedesktop.NetworkManager.Connection.Active") +iface.connect_to_signal("PropertiesChanged", properties_changed) + +loop.run() diff --git a/examples/python/dbus/nm-state.py b/examples/python/dbus/nm-state.py index 94fa6309..176090f7 100755 --- a/examples/python/dbus/nm-state.py +++ b/examples/python/dbus/nm-state.py @@ -34,11 +34,29 @@ device_states = { 0: "Unknown", 110: "Deactivating", 120: "Failed" } +connectivity_states = { 0: "Unknown", + 1: "Activating", + 2: "Activated", + 3: "Deactivating", + 4: "Deactivated" } + +nm_state = { 0: "Unknown", + 10: "Asleep", + 20: "Disconnected", + 30: "Disconnecting", + 40: "Connecting", + 50: "Connected-Local", + 60: "Connected-Site", + 70: "Connected-Global" } + bus = dbus.SystemBus() proxy = bus.get_object("org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager") manager = dbus.Interface(proxy, "org.freedesktop.NetworkManager") +# Get overall NM connection state +print("NetworkManager state is: '%s'" % nm_state[manager.state()]) + # Get device-specific state devices = manager.GetDevices() for d in devices: @@ -73,9 +91,4 @@ for a in active: con_details = con_iface.GetSettings() con_name = con_details['connection']['id'] - if state == 2: # activated - print "Connection '%s' is activated" % con_name - else: - print "Connection '%s' is activating" % con_name - - + print "Connection '%s' is %s" % (con_name, connectivity_states[state].lower()) diff --git a/examples/python/dbus/vpn.py b/examples/python/dbus/vpn.py index 59773a61..d60e470e 100755 --- a/examples/python/dbus/vpn.py +++ b/examples/python/dbus/vpn.py @@ -102,11 +102,11 @@ def get_wifi_device_path(): def activate_connection(connection_path, device_path): def reply_handler(opath): - print "Success: device activating" + print "Success: device activating" sys.exit(0) def error_handler(*args): - print "Error activating device: %s" % args + sys.stderr.write("Error activating device: %s\n" % args) sys.exit(1) bus = dbus.SystemBus() diff --git a/examples/python/dbus/wifi-active-ap.py b/examples/python/dbus/wifi-active-ap.py new file mode 100755 index 00000000..3b17c6f1 --- /dev/null +++ b/examples/python/dbus/wifi-active-ap.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Copyright (C) 2015 Red Hat, Inc. +# + +# +# This example starts or stops a wifi hotspot +# +# Configuration settings are described at +# https://developer.gnome.org/NetworkManager/1.0/ref-settings.html +# + +import dbus, sys, time + +bus = dbus.SystemBus() +service_name = "org.freedesktop.NetworkManager" +proxy = bus.get_object(service_name, "/org/freedesktop/NetworkManager/Settings") +settings = dbus.Interface(proxy, "org.freedesktop.NetworkManager.Settings") + +if len(sys.argv) != 2: + print "Usage: %s " % sys.argv[0] + sys.exit(0) + +# Get the device object path based on interface name +iface = sys.argv[1] +proxy = bus.get_object(service_name, "/org/freedesktop/NetworkManager") +nm = dbus.Interface(proxy, "org.freedesktop.NetworkManager") +devpath = nm.GetDeviceByIpIface(iface) + +# Get a proxy to the wifi device and get the active access point's object path +proxy = bus.get_object(service_name, devpath) +props = dbus.Interface(proxy, "org.freedesktop.DBus.Properties") +active_ap_path = props.Get("org.freedesktop.NetworkManager.Device.Wireless", "ActiveAccessPoint") +if active_ap_path == "/": + print "%s is not currently associated" % sys.argv[1] + sys.exit(0) + +# Get the active access point's SSID and BSSID +ap_proxy = bus.get_object(service_name, active_ap_path) +ap_props = dbus.Interface(ap_proxy, "org.freedesktop.DBus.Properties") +raw_ssid = ap_props.Get("org.freedesktop.NetworkManager.AccessPoint", "Ssid") +bssid = ap_props.Get("org.freedesktop.NetworkManager.AccessPoint", "HwAddress") + +# Convert the SSID from a byte array to a string, assuming ASCII encoding +ssid = "" +for c in raw_ssid: + ssid = ssid + chr(c) + +print "%s is associated to '%s' (%s)" % (sys.argv[1], ssid, bssid) + +sys.exit(0) + diff --git a/examples/python/dbus/wifi-hotspot.py b/examples/python/dbus/wifi-hotspot.py new file mode 100755 index 00000000..10958af8 --- /dev/null +++ b/examples/python/dbus/wifi-hotspot.py @@ -0,0 +1,112 @@ +#!/usr/bin/env python +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Copyright (C) 2010 - 2012 Red Hat, Inc. +# + +# +# This example starts or stops a wifi hotspot +# +# Configuration settings are described at +# https://developer.gnome.org/NetworkManager/1.0/ref-settings.html +# + +import dbus, sys, time + +our_uuid = '2b0d0f1d-b79d-43af-bde1-71744625642e' + +s_con = dbus.Dictionary({ + 'type': '802-11-wireless', + 'uuid': our_uuid, + 'id': 'Test Hotspot'}) + +s_wifi = dbus.Dictionary({ + 'ssid': dbus.ByteArray("My Hotspot"), + 'mode': "ap", + 'band': "bg", + 'channel': dbus.UInt32(1)}) + +s_wsec = dbus.Dictionary({ + 'key-mgmt': 'wpa-psk', + 'psk': 'great password'}) + +s_ip4 = dbus.Dictionary({'method': 'shared'}) +s_ip6 = dbus.Dictionary({'method': 'ignore'}) + +con = dbus.Dictionary({ + 'connection': s_con, + '802-11-wireless': s_wifi, + '802-11-wireless-security': s_wsec, + 'ipv4': s_ip4, + 'ipv6': s_ip6 + }) + +def usage(): + print "Usage: %s [up|down]" % sys.argv[0] + sys.exit(0) + +bus = dbus.SystemBus() +service_name = "org.freedesktop.NetworkManager" +proxy = bus.get_object(service_name, "/org/freedesktop/NetworkManager/Settings") +settings = dbus.Interface(proxy, "org.freedesktop.NetworkManager.Settings") + +if len(sys.argv) != 3: + usage() + +iface = sys.argv[1] +proxy = bus.get_object(service_name, "/org/freedesktop/NetworkManager") +nm = dbus.Interface(proxy, "org.freedesktop.NetworkManager") +devpath = nm.GetDeviceByIpIface(iface) + +# Find our existing hotspot connection +connection_path = None +for path in settings.ListConnections(): + proxy = bus.get_object(service_name, path) + settings_connection = dbus.Interface(proxy, "org.freedesktop.NetworkManager.Settings.Connection") + config = settings_connection.GetSettings() + if config['connection']['uuid'] == our_uuid: + connection_path = path + break + +# If the hotspot connection didn't already exist, add it +if not connection_path: + connection_path = settings.AddConnection(con) + +# Now start or stop the hotspot on the requested device +proxy = bus.get_object(service_name, devpath) +device = dbus.Interface(proxy, "org.freedesktop.NetworkManager.Device") +operation = sys.argv[2] +if operation == "up": + acpath = nm.ActivateConnection(connection_path, devpath, "/") + proxy = bus.get_object(service_name, acpath) + active_props = dbus.Interface(proxy, "org.freedesktop.DBus.Properties") + + # Wait for the hotspot to start up + start = time.time() + while time.time() < start + 10: + state = active_props.Get("org.freedesktop.NetworkManager.Connection.Active", "State") + if state == 2: # NM_ACTIVE_CONNECTION_STATE_ACTIVATED + print "Access point started" + sys.exit(0) + time.sleep(1) + print "Failed to start access point" +elif operation == "down": + device.Disconnect() +else: + usage() + +sys.exit(0) + diff --git a/examples/python/gi/Makefile.am b/examples/python/gi/Makefile.am index dcf2dff0..9c69407f 100644 --- a/examples/python/gi/Makefile.am +++ b/examples/python/gi/Makefile.am @@ -6,4 +6,6 @@ EXTRA_DIST = \ get_ips.py \ add_connection.py \ get-active-connections.py \ - update-ip4-method.py + update-ip4-method.py \ + deactivate-all.py \ + README diff --git a/examples/python/gi/Makefile.in b/examples/python/gi/Makefile.in index 21384364..972092ad 100644 --- a/examples/python/gi/Makefile.in +++ b/examples/python/gi/Makefile.in @@ -129,7 +129,7 @@ am__can_run_installinfo = \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -am__DIST_COMMON = $(srcdir)/Makefile.in +am__DIST_COMMON = $(srcdir)/Makefile.in README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ @@ -146,7 +146,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -158,8 +157,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -169,6 +166,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -223,16 +221,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -269,6 +264,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -297,7 +294,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -312,6 +308,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -372,6 +370,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -379,6 +378,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -402,7 +402,9 @@ EXTRA_DIST = \ get_ips.py \ add_connection.py \ get-active-connections.py \ - update-ip4-method.py + update-ip4-method.py \ + deactivate-all.py \ + README all: all-am diff --git a/examples/python/gi/README b/examples/python/gi/README new file mode 100644 index 00000000..d7773329 --- /dev/null +++ b/examples/python/gi/README @@ -0,0 +1,2 @@ +These examples show how to call libnm from Python using +GObject introspection. diff --git a/examples/python/gi/add_connection.py b/examples/python/gi/add_connection.py index 492d66d1..cfb40a9a 100755 --- a/examples/python/gi/add_connection.py +++ b/examples/python/gi/add_connection.py @@ -71,7 +71,7 @@ def added_cb(client, result, data): client.add_connection_finish(result) print("The connection profile has been succesfully added to NetworkManager.") except Exception, e: - print("Error: %s" % e) + sys.stderr.write("Error: %s\n" % e) main_loop.quit() if __name__ == "__main__": diff --git a/examples/python/gi/deactivate-all.py b/examples/python/gi/deactivate-all.py new file mode 100755 index 00000000..59842ac2 --- /dev/null +++ b/examples/python/gi/deactivate-all.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python +# -*- Mode: Python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +# vim: ft=python ts=4 sts=4 sw=4 et ai + +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Copyright 2015 Red Hat, Inc. +# + +# +# This example deactivates all active connections (of certain type). +# It makes use of libnm via GObject introspection. +# +# Links: +# https://developer.gnome.org/libnm/1.0/ +# https://wiki.gnome.org/GObjectIntrospection +# https://wiki.gnome.org/PyGObject +# + +import sys +import gi +gi.require_version('NM', '1.0') +from gi.repository import NM + +# suported connection types +connection_types = { + NM.SETTING_VPN_SETTING_NAME, + NM.SETTING_WIRELESS_SETTING_NAME, + NM.SETTING_WIRED_SETTING_NAME, + NM.SETTING_BOND_SETTING_NAME, + NM.SETTING_BRIDGE_SETTING_NAME, + NM.SETTING_TEAM_SETTING_NAME, + NM.SETTING_INFINIBAND_SETTING_NAME, + NM.SETTING_PPPOE_SETTING_NAME, + NM.SETTING_ADSL_SETTING_NAME, + NM.SETTING_BLUETOOTH_SETTING_NAME, + NM.SETTING_WIMAX_SETTING_NAME, + NM.SETTING_OLPC_MESH_SETTING_NAME, + NM.SETTING_GENERIC_SETTING_NAME, +} + + +if __name__ == "__main__": + if len(sys.argv) == 1: + ctype = None + else: + allowed_types = ", ".join(connection_types) + if len(sys.argv) == 2: + ctype = sys.argv[1] + if ctype not in connection_types: + sys.exit('Usage: %s []\nAllowed types: %s' % (sys.argv[0], allowed_types)) + else: + sys.exit('Usage: %s []\nAllowed types: %s' % (sys.argv[0], allowed_types)) + + # create Client object + client = NM.Client.new(None) + + # get all active connections + connections = client.get_active_connections() + + # deactivate the connections + for ac in connections: + if ctype == None or ctype == ac.get_connection_type(): + sys.stdout.write("Deactivating %s (%s)" % (ac.get_id(), ac.get_uuid())) + try: + client.deactivate_connection(ac, None) + sys.stdout.write("\033[32m -> succeeded\033[0m\n") + except Exception, e: + sys.stderr.write("\033[31m -> failed\033[0m (%s)\n" % e.message) + diff --git a/examples/python/gi/firewall-zone.py b/examples/python/gi/firewall-zone.py index a56760ae..979f2acf 100755 --- a/examples/python/gi/firewall-zone.py +++ b/examples/python/gi/firewall-zone.py @@ -77,5 +77,5 @@ if __name__ == "__main__": print("'%s' zone set to '%s'") % (c.get_id(), new_zone) break if not found: - print ("Error: connection '%s' not found.") % (con_name) + sys.stderr.write("Error: connection '%s' not found.\n") % (con_name) main_loop.quit() diff --git a/examples/python/gi/show-wifi-networks.py b/examples/python/gi/show-wifi-networks.py index a8bfbbfe..db49b555 100755 --- a/examples/python/gi/show-wifi-networks.py +++ b/examples/python/gi/show-wifi-networks.py @@ -52,13 +52,77 @@ def print_device_info(device): print info print '=' * len(info) +def mode_to_string(mode): + if mode == getattr(NM, '80211Mode').INFRA: + return "INFRA" + if mode == getattr(NM, '80211Mode').ADHOC: + return "ADHOC" + if mode == getattr(NM, '80211Mode').AP: + return "AP" + return "UNKNOWN" + +def flags_to_string(flags): + if flags & getattr(NM, '80211ApFlags').PRIVACY: + return "PRIVACY" + return "NONE" + +def security_flags_to_string(flags): + NM_AP_FLAGS = getattr(NM, '80211ApSecurityFlags') + str = "" + if flags & NM_AP_FLAGS.PAIR_WEP40: + str = str + " PAIR_WEP40" + if flags & NM_AP_FLAGS.PAIR_WEP104: + str = str + " PAIR_WEP104" + if flags & NM_AP_FLAGS.PAIR_TKIP: + str = str + " PAIR_TKIP" + if flags & NM_AP_FLAGS.PAIR_CCMP: + str = str + " PAIR_CCMP" + if flags & NM_AP_FLAGS.GROUP_WEP40: + str = str + " GROUP_WEP40" + if flags & NM_AP_FLAGS.GROUP_WEP104: + str = str + " GROUP_WEP104" + if flags & NM_AP_FLAGS.GROUP_TKIP: + str = str + " GROUP_TKIP" + if flags & NM_AP_FLAGS.GROUP_CCMP: + str = str + " GROUP_CCMP" + if flags & NM_AP_FLAGS.KEY_MGMT_PSK: + str = str + " KEY_MGMT_PSK" + if flags & NM_AP_FLAGS.KEY_MGMT_802_1X: + str = str + " KEY_MGMT_802_1X" + if str: + return str.lstrip() + else: + return "NONE" + +def flags_to_security(flags, wpa_flags, rsn_flags): + str = "" + if ((flags & getattr(NM, '80211ApFlags').PRIVACY) and + (wpa_flags == 0) and (rsn_flags == 0)): + str = str + " WEP" + if wpa_flags != 0: + str = str + " WPA1" + if rsn_flags != 0: + str = str + " WPA2" + if ((wpa_flags & getattr(NM, '80211ApSecurityFlags').KEY_MGMT_802_1X) or + (rsn_flags & getattr(NM, '80211ApSecurityFlags').KEY_MGMT_802_1X)): + str = str + " 802.1X" + return str.lstrip() + def print_ap_info(ap): strength = ap.get_strength() frequency = ap.get_frequency() + flags = ap.get_flags() + wpa_flags = ap.get_wpa_flags() + rsn_flags = ap.get_rsn_flags() print "SSID: %s" % (ssid_to_utf8(ap)) print "BSSID: %s" % (ap.get_bssid()) print "Frequency: %s" % (frequency) print "Channel: %s" % (NM.utils_wifi_freq_to_channel(frequency)) + print "Mode: %s" % (mode_to_string(ap.get_mode())) + print "Flags: %s" % (flags_to_string(flags)) + print "WPA flags: %s" % (security_flags_to_string(wpa_flags)) + print "RSN flags: %s" % (security_flags_to_string(rsn_flags)) + print "Security: %s" % (flags_to_security(flags, wpa_flags, rsn_flags)) print "Strength: %s %s%%" % (NM.utils_wifi_strength_bars(strength), strength) print diff --git a/examples/python/gi/update-ip4-method.py b/examples/python/gi/update-ip4-method.py index 5e058031..12124599 100755 --- a/examples/python/gi/update-ip4-method.py +++ b/examples/python/gi/update-ip4-method.py @@ -82,6 +82,6 @@ if __name__ == "__main__": c.commit_changes(True, None) print("The connection profile has been updated.") except Exception, e: - print("Error: %s" % e) + sys.stderr.write("Error: %s\n" % e) break diff --git a/examples/python/python-networkmanager/Makefile.am b/examples/python/python-networkmanager/Makefile.am new file mode 100644 index 00000000..45fe750c --- /dev/null +++ b/examples/python/python-networkmanager/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = \ + README diff --git a/examples/python/python-networkmanager/Makefile.in b/examples/python/python-networkmanager/Makefile.in new file mode 100644 index 00000000..43c752be --- /dev/null +++ b/examples/python/python-networkmanager/Makefile.in @@ -0,0 +1,594 @@ +# Makefile.in generated by automake 1.15 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2014 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = examples/python/python-networkmanager +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_readline.m4 \ + $(top_srcdir)/m4/compiler_warnings.m4 \ + $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gnome-code-coverage.m4 \ + $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intltool.m4 \ + $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ + $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in README +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALL_LINGUAS = @ALL_LINGUAS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AM_TESTS_FD_REDIRECT = @AM_TESTS_FD_REDIRECT@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BLUEZ5_CFLAGS = @BLUEZ5_CFLAGS@ +BLUEZ5_LIBS = @BLUEZ5_LIBS@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ +CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ +CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DBUS_CFLAGS = @DBUS_CFLAGS@ +DBUS_LIBS = @DBUS_LIBS@ +DBUS_SYS_DIR = @DBUS_SYS_DIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DHCLIENT_PATH = @DHCLIENT_PATH@ +DHCPCD_PATH = @DHCPCD_PATH@ +DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ +DLLTOOL = @DLLTOOL@ +DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GENHTML = @GENHTML@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MAKEFILE = @GLIB_MAKEFILE@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ +GNUTLS_LIBS = @GNUTLS_LIBS@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ +INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ +INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ +INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ +INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ +INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ +IPTABLES_PATH = @IPTABLES_PATH@ +KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ +LCOV = @LCOV@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ +LIBDL = @LIBDL@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBM = @LIBM@ +LIBNDP_CFLAGS = @LIBNDP_CFLAGS@ +LIBNDP_LIBS = @LIBNDP_LIBS@ +LIBNL_CFLAGS = @LIBNL_CFLAGS@ +LIBNL_LIBS = @LIBNL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBSOUP_CFLAGS = @LIBSOUP_CFLAGS@ +LIBSOUP_LIBS = @LIBSOUP_LIBS@ +LIBTEAMDCTL_CFLAGS = @LIBTEAMDCTL_CFLAGS@ +LIBTEAMDCTL_LIBS = @LIBTEAMDCTL_LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOG_DRIVER = @LOG_DRIVER@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +MM_GLIB_CFLAGS = @MM_GLIB_CFLAGS@ +MM_GLIB_LIBS = @MM_GLIB_LIBS@ +MOC = @MOC@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NEWT_CFLAGS = @NEWT_CFLAGS@ +NEWT_LIBS = @NEWT_LIBS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ +NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ +NM_MICRO_VERSION = @NM_MICRO_VERSION@ +NM_MINOR_VERSION = @NM_MINOR_VERSION@ +NM_MODIFY_SYSTEM_POLICY = @NM_MODIFY_SYSTEM_POLICY@ +NM_VERSION = @NM_VERSION@ +NSS_CFLAGS = @NSS_CFLAGS@ +NSS_LIBS = @NSS_LIBS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +POLKIT_CFLAGS = @POLKIT_CFLAGS@ +POLKIT_LIBS = @POLKIT_LIBS@ +POSUB = @POSUB@ +PPPD_PATH = @PPPD_PATH@ +PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ +QT_CFLAGS = @QT_CFLAGS@ +QT_LIBS = @QT_LIBS@ +RANLIB = @RANLIB@ +READLINE_LIBS = @READLINE_LIBS@ +SED = @SED@ +SELINUX_CFLAGS = @SELINUX_CFLAGS@ +SELINUX_LIBS = @SELINUX_LIBS@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ +SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ +SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ +SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ +SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ +SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ +SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ +UDEV_DIR = @UDEV_DIR@ +USE_NLS = @USE_NLS@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VALGRIND_RULES = @VALGRIND_RULES@ +VAPIGEN = @VAPIGEN@ +VAPIGEN_MAKEFILE = @VAPIGEN_MAKEFILE@ +VAPIGEN_VAPIDIR = @VAPIGEN_VAPIDIR@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +intltool__v_merge_options_ = @intltool__v_merge_options_@ +intltool__v_merge_options_0 = @intltool__v_merge_options_0@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +nmbinary = @nmbinary@ +nmconfdir = @nmconfdir@ +nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ +nmrundir = @nmrundir@ +nmstatedir = @nmstatedir@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +subdirs = @subdirs@ +sysconfdir = @sysconfdir@ +systemdsystemunitdir = @systemdsystemunitdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +with_dhclient = @with_dhclient@ +with_dhcpcd = @with_dhcpcd@ +with_netconfig = @with_netconfig@ +with_resolvconf = @with_resolvconf@ +with_valgrind = @with_valgrind@ +EXTRA_DIST = \ + README + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/python/python-networkmanager/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu examples/python/python-networkmanager/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + cscopelist-am ctags-am distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# 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. +.NOEXPORT: diff --git a/examples/python/python-networkmanager/README b/examples/python/python-networkmanager/README new file mode 100644 index 00000000..00805d82 --- /dev/null +++ b/examples/python/python-networkmanager/README @@ -0,0 +1,6 @@ +There is a client library in Python, named python-networkmanager. + +This library is developed outside of the core NetworkManager project. + +See https://github.com/seveas/python-networkmanager +and https://github.com/seveas/python-networkmanager/tree/master/examples diff --git a/examples/ruby/Makefile.in b/examples/ruby/Makefile.in index e314d036..aaa6818b 100644 --- a/examples/ruby/Makefile.in +++ b/examples/ruby/Makefile.in @@ -146,7 +146,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -158,8 +157,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -169,6 +166,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -223,16 +221,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -269,6 +264,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -297,7 +294,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -312,6 +308,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -372,6 +370,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -379,6 +378,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ diff --git a/examples/shell/Makefile.in b/examples/shell/Makefile.in index 223d68aa..dd9e966d 100644 --- a/examples/shell/Makefile.in +++ b/examples/shell/Makefile.in @@ -146,7 +146,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -158,8 +157,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -169,6 +166,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -223,16 +221,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -269,6 +264,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -297,7 +294,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -312,6 +308,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -372,6 +370,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -379,6 +378,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ diff --git a/include/Makefile.am b/include/Makefile.am deleted file mode 100644 index d8085056..00000000 --- a/include/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -EXTRA_DIST = \ - gsystem-local-alloc.h \ - nm-dbus-glib-types.h \ - nm-glib-compat.h \ - nm-gvaluearray-compat.h \ - nm-test-utils.h \ - nm-macros-internal.h \ - nm-version-macros.h.in - -CLEANFILES=nm-version.h diff --git a/include/Makefile.in b/include/Makefile.in deleted file mode 100644 index 6c5fff87..00000000 --- a/include/Makefile.in +++ /dev/null @@ -1,605 +0,0 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2014 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = include -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lib_readline.m4 \ - $(top_srcdir)/m4/compiler_warnings.m4 \ - $(top_srcdir)/m4/gettext.m4 \ - $(top_srcdir)/m4/gnome-code-coverage.m4 \ - $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intltool.m4 \ - $(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ - $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ - $(top_srcdir)/m4/vapigen.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = nm-version-macros.h -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -am__DIST_COMMON = $(srcdir)/Makefile.in \ - $(srcdir)/nm-version-macros.h.in -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -ALL_LINGUAS = @ALL_LINGUAS@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AM_TESTS_FD_REDIRECT = @AM_TESTS_FD_REDIRECT@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BLUEZ5_CFLAGS = @BLUEZ5_CFLAGS@ -BLUEZ5_LIBS = @BLUEZ5_LIBS@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ -CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ -CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ -CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ -DBUS_LIBS = @DBUS_LIBS@ -DBUS_SYS_DIR = @DBUS_SYS_DIR@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DHCLIENT_PATH = @DHCLIENT_PATH@ -DHCPCD_PATH = @DHCPCD_PATH@ -DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ -DLLTOOL = @DLLTOOL@ -DNSMASQ_PATH = @DNSMASQ_PATH@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GENHTML = @GENHTML@ -GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ -GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ -GLIB_CFLAGS = @GLIB_CFLAGS@ -GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ -GLIB_LIBS = @GLIB_LIBS@ -GLIB_MAKEFILE = @GLIB_MAKEFILE@ -GLIB_MKENUMS = @GLIB_MKENUMS@ -GMSGFMT = @GMSGFMT@ -GMSGFMT_015 = @GMSGFMT_015@ -GNUTLS_CFLAGS = @GNUTLS_CFLAGS@ -GNUTLS_LIBS = @GNUTLS_LIBS@ -GREP = @GREP@ -GTKDOC_CHECK = @GTKDOC_CHECK@ -GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ -GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ -GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ -GTKDOC_MKPDF = @GTKDOC_MKPDF@ -GTKDOC_REBASE = @GTKDOC_REBASE@ -GUDEV_CFLAGS = @GUDEV_CFLAGS@ -GUDEV_LIBS = @GUDEV_LIBS@ -HTML_DIR = @HTML_DIR@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -INTLLIBS = @INTLLIBS@ -INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -INTLTOOL_MERGE = @INTLTOOL_MERGE@ -INTLTOOL_PERL = @INTLTOOL_PERL@ -INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ -INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ -INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ -INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ -INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ -INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ -INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ -INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ -INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ -INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ -INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ -INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ -INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ -INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ -IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ -KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ -LCOV = @LCOV@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ -LIBICONV = @LIBICONV@ -LIBINTL = @LIBINTL@ -LIBM = @LIBM@ -LIBNDP_CFLAGS = @LIBNDP_CFLAGS@ -LIBNDP_LIBS = @LIBNDP_LIBS@ -LIBNL_CFLAGS = @LIBNL_CFLAGS@ -LIBNL_LIBS = @LIBNL_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBSOUP_CFLAGS = @LIBSOUP_CFLAGS@ -LIBSOUP_LIBS = @LIBSOUP_LIBS@ -LIBTEAMDCTL_CFLAGS = @LIBTEAMDCTL_CFLAGS@ -LIBTEAMDCTL_LIBS = @LIBTEAMDCTL_LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LOG_DRIVER = @LOG_DRIVER@ -LTLIBICONV = @LTLIBICONV@ -LTLIBINTL = @LTLIBINTL@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MM_GLIB_CFLAGS = @MM_GLIB_CFLAGS@ -MM_GLIB_LIBS = @MM_GLIB_LIBS@ -MOC = @MOC@ -MSGFMT = @MSGFMT@ -MSGFMT_015 = @MSGFMT_015@ -MSGMERGE = @MSGMERGE@ -NEWT_CFLAGS = @NEWT_CFLAGS@ -NEWT_LIBS = @NEWT_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ -NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ -NM_MICRO_VERSION = @NM_MICRO_VERSION@ -NM_MINOR_VERSION = @NM_MINOR_VERSION@ -NM_MODIFY_SYSTEM_POLICY = @NM_MODIFY_SYSTEM_POLICY@ -NM_VERSION = @NM_VERSION@ -NSS_CFLAGS = @NSS_CFLAGS@ -NSS_LIBS = @NSS_LIBS@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -POLKIT_CFLAGS = @POLKIT_CFLAGS@ -POLKIT_LIBS = @POLKIT_LIBS@ -POSUB = @POSUB@ -PPPD_PATH = @PPPD_PATH@ -PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ -QT_CFLAGS = @QT_CFLAGS@ -QT_LIBS = @QT_LIBS@ -RANLIB = @RANLIB@ -READLINE_LIBS = @READLINE_LIBS@ -SED = @SED@ -SELINUX_CFLAGS = @SELINUX_CFLAGS@ -SELINUX_LIBS = @SELINUX_LIBS@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ -SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ -SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ -SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ -SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ -SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ -SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ -UDEV_DIR = @UDEV_DIR@ -USE_NLS = @USE_NLS@ -UUID_CFLAGS = @UUID_CFLAGS@ -UUID_LIBS = @UUID_LIBS@ -VALGRIND_RULES = @VALGRIND_RULES@ -VAPIGEN = @VAPIGEN@ -VAPIGEN_MAKEFILE = @VAPIGEN_MAKEFILE@ -VAPIGEN_VAPIDIR = @VAPIGEN_VAPIDIR@ -VERSION = @VERSION@ -XGETTEXT = @XGETTEXT@ -XGETTEXT_015 = @XGETTEXT_015@ -XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -intltool__v_merge_options_ = @intltool__v_merge_options_@ -intltool__v_merge_options_0 = @intltool__v_merge_options_0@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -nmbinary = @nmbinary@ -nmconfdir = @nmconfdir@ -nmdatadir = @nmdatadir@ -nmrundir = @nmrundir@ -nmstatedir = @nmstatedir@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -subdirs = @subdirs@ -sysconfdir = @sysconfdir@ -systemdsystemunitdir = @systemdsystemunitdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -with_dhclient = @with_dhclient@ -with_dhcpcd = @with_dhcpcd@ -with_netconfig = @with_netconfig@ -with_resolvconf = @with_resolvconf@ -with_valgrind = @with_valgrind@ -EXTRA_DIST = \ - gsystem-local-alloc.h \ - nm-dbus-glib-types.h \ - nm-glib-compat.h \ - nm-gvaluearray-compat.h \ - nm-test-utils.h \ - nm-macros-internal.h \ - nm-version-macros.h.in - -CLEANFILES = nm-version.h -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu include/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -nm-version-macros.h: $(top_builddir)/config.status $(srcdir)/nm-version-macros.h.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -tags TAGS: - -ctags CTAGS: - -cscope cscopelist: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: - -.MAKE: install-am install-strip - -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - cscopelist-am ctags-am distclean distclean-generic \ - distclean-libtool distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags-am uninstall uninstall-am - -.PRECIOUS: Makefile - - -# 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. -.NOEXPORT: diff --git a/include/gsystem-local-alloc.h b/include/gsystem-local-alloc.h deleted file mode 100644 index 51b62519..00000000 --- a/include/gsystem-local-alloc.h +++ /dev/null @@ -1,208 +0,0 @@ -/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- - * - * Copyright (C) 2012 Colin Walters . - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __GSYSTEM_LOCAL_ALLOC_H__ -#define __GSYSTEM_LOCAL_ALLOC_H__ - -#include - -G_BEGIN_DECLS - -#define GS_DEFINE_CLEANUP_FUNCTION(Type, name, func) \ - static inline void name (void *v) \ - { \ - func (*(Type*)v); \ - } - -#define GS_DEFINE_CLEANUP_FUNCTION0(Type, name, func) \ - static inline void name (void *v) \ - { \ - if (*(Type*)v) \ - func (*(Type*)v); \ - } - -/* These functions shouldn't be invoked directly; - * they are stubs that: - * 1) Take a pointer to the location (typically itself a pointer). - * 2) Provide %NULL-safety where it doesn't exist already (e.g. g_object_unref) - */ - -/** - * gs_free: - * - * Call g_free() on a variable location when it goes out of scope. - */ -#define gs_free __attribute__ ((cleanup(gs_local_free))) -GS_DEFINE_CLEANUP_FUNCTION(void*, gs_local_free, g_free) - -/** - * gs_unref_object: - * - * Call g_object_unref() on a variable location when it goes out of - * scope. Note that unlike g_object_unref(), the variable may be - * %NULL. - */ -#define gs_unref_object __attribute__ ((cleanup(gs_local_obj_unref))) -GS_DEFINE_CLEANUP_FUNCTION0(GObject*, gs_local_obj_unref, g_object_unref) - -/** - * gs_unref_variant: - * - * Call g_variant_unref() on a variable location when it goes out of - * scope. Note that unlike g_variant_unref(), the variable may be - * %NULL. - */ -#define gs_unref_variant __attribute__ ((cleanup(gs_local_variant_unref))) -GS_DEFINE_CLEANUP_FUNCTION0(GVariant*, gs_local_variant_unref, g_variant_unref) - -/** - * gs_free_variant_iter: - * - * Call g_variant_iter_free() on a variable location when it goes out of - * scope. - */ -#define gs_free_variant_iter __attribute__ ((cleanup(gs_local_variant_iter_free))) -GS_DEFINE_CLEANUP_FUNCTION0(GVariantIter*, gs_local_variant_iter_free, g_variant_iter_free) - -/** - * gs_free_variant_builder: - * - * Call g_variant_builder_unref() on a variable location when it goes out of - * scope. - */ -#define gs_unref_variant_builder __attribute__ ((cleanup(gs_local_variant_builder_unref))) -GS_DEFINE_CLEANUP_FUNCTION0(GVariantBuilder*, gs_local_variant_builder_unref, g_variant_builder_unref) - -/** - * gs_unref_array: - * - * Call g_array_unref() on a variable location when it goes out of - * scope. Note that unlike g_array_unref(), the variable may be - * %NULL. - - */ -#define gs_unref_array __attribute__ ((cleanup(gs_local_array_unref))) -GS_DEFINE_CLEANUP_FUNCTION0(GArray*, gs_local_array_unref, g_array_unref) - -/** - * gs_unref_ptrarray: - * - * Call g_ptr_array_unref() on a variable location when it goes out of - * scope. Note that unlike g_ptr_array_unref(), the variable may be - * %NULL. - - */ -#define gs_unref_ptrarray __attribute__ ((cleanup(gs_local_ptrarray_unref))) -GS_DEFINE_CLEANUP_FUNCTION0(GPtrArray*, gs_local_ptrarray_unref, g_ptr_array_unref) - -/** - * gs_unref_hashtable: - * - * Call g_hash_table_unref() on a variable location when it goes out - * of scope. Note that unlike g_hash_table_unref(), the variable may - * be %NULL. - */ -#define gs_unref_hashtable __attribute__ ((cleanup(gs_local_hashtable_unref))) -GS_DEFINE_CLEANUP_FUNCTION0(GHashTable*, gs_local_hashtable_unref, g_hash_table_unref) - -/** - * gs_free_list: - * - * Call g_list_free() on a variable location when it goes out - * of scope. - */ -#define gs_free_list __attribute__ ((cleanup(gs_local_free_list))) -GS_DEFINE_CLEANUP_FUNCTION(GList*, gs_local_free_list, g_list_free) - -/** - * gs_free_slist: - * - * Call g_slist_free() on a variable location when it goes out - * of scope. - */ -#define gs_free_slist __attribute__ ((cleanup(gs_local_free_slist))) -GS_DEFINE_CLEANUP_FUNCTION(GSList*, gs_local_free_slist, g_slist_free) - -/** - * gs_free_checksum: - * - * Call g_checksum_free() on a variable location when it goes out - * of scope. Note that unlike g_checksum_free(), the variable may - * be %NULL. - */ -#define gs_free_checksum __attribute__ ((cleanup(gs_local_checksum_free))) -GS_DEFINE_CLEANUP_FUNCTION0(GChecksum*, gs_local_checksum_free, g_checksum_free) - -/** - * gs_unref_bytes: - * - * Call g_bytes_unref() on a variable location when it goes out - * of scope. Note that unlike g_bytes_unref(), the variable may - * be %NULL. - */ -#define gs_unref_bytes __attribute__ ((cleanup(gs_local_bytes_unref))) -GS_DEFINE_CLEANUP_FUNCTION0(GBytes*, gs_local_bytes_unref, g_bytes_unref) - -/** - * gs_strfreev: - * - * Call g_strfreev() on a variable location when it goes out of scope. - */ -#define gs_strfreev __attribute__ ((cleanup(gs_local_strfreev))) -GS_DEFINE_CLEANUP_FUNCTION(char**, gs_local_strfreev, g_strfreev) - -/** - * gs_free_error: - * - * Call g_error_free() on a variable location when it goes out of scope. - */ -#define gs_free_error __attribute__ ((cleanup(gs_local_free_error))) -GS_DEFINE_CLEANUP_FUNCTION0(GError*, gs_local_free_error, g_error_free) - -/** - * gs_unref_keyfile: - * - * Call g_key_file_unref() on a variable location when it goes out of scope. - */ -#define gs_unref_keyfile __attribute__ ((cleanup(gs_local_keyfile_unref))) -GS_DEFINE_CLEANUP_FUNCTION0(GKeyFile*, gs_local_keyfile_unref, g_key_file_unref) - -static inline void -gs_cleanup_close_fdp (int *fdp) -{ - int fd; - - g_assert (fdp); - - fd = *fdp; - if (fd != -1) - (void) close (fd); -} - -/** - * gs_fd_close: - * - * Call close() on a variable location when it goes out of scope. - */ -#define gs_fd_close __attribute__((cleanup(gs_cleanup_close_fdp))) - -G_END_DECLS - -#endif diff --git a/include/nm-dbus-glib-types.h b/include/nm-dbus-glib-types.h deleted file mode 100644 index ad11ab68..00000000 --- a/include/nm-dbus-glib-types.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Copyright 2008 Red Hat, Inc. - */ - -#ifndef __NM_DBUS_GLIB_TYPES_H__ -#define __NM_DBUS_GLIB_TYPES_H__ - -#include - -#define DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH)) -#define DBUS_TYPE_G_ARRAY_OF_STRING (dbus_g_type_get_collection ("GPtrArray", G_TYPE_STRING)) -#define DBUS_TYPE_G_ARRAY_OF_UINT (dbus_g_type_get_collection ("GArray", G_TYPE_UINT)) -#define DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UCHAR (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_UCHAR_ARRAY)) -#define DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_ARRAY_OF_UINT)) -#define DBUS_TYPE_G_MAP_OF_VARIANT (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE)) -#define DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, DBUS_TYPE_G_MAP_OF_VARIANT)) -#define DBUS_TYPE_G_MAP_OF_STRING (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING)) -#define DBUS_TYPE_G_LIST_OF_STRING (dbus_g_type_get_collection ("GSList", G_TYPE_STRING)) - -#define DBUS_TYPE_G_IP6_ADDRESS (dbus_g_type_get_struct ("GValueArray", DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_UINT, DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_INVALID)) -#define DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_IP6_ADDRESS)) -#define DBUS_TYPE_G_IP6_ROUTE (dbus_g_type_get_struct ("GValueArray", DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_UINT, DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_UINT, G_TYPE_INVALID)) -#define DBUS_TYPE_G_ARRAY_OF_IP6_ROUTE (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_IP6_ROUTE)) - -#define DBUS_TYPE_NM_IP_ADDRESS DBUS_TYPE_G_MAP_OF_VARIANT -#define DBUS_TYPE_NM_IP_ADDRESSES (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_NM_IP_ADDRESS)) -#define DBUS_TYPE_NM_IP_ROUTE DBUS_TYPE_G_MAP_OF_VARIANT -#define DBUS_TYPE_NM_IP_ROUTES (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_NM_IP_ROUTE)) - -#endif /* __NM_DBUS_GLIB_TYPES_H__ */ diff --git a/include/nm-glib-compat.h b/include/nm-glib-compat.h deleted file mode 100644 index 691f9935..00000000 --- a/include/nm-glib-compat.h +++ /dev/null @@ -1,264 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Copyright 2008 - 2011 Red Hat, Inc. - */ - -#ifndef __NM_GLIB_COMPAT_H__ -#define __NM_GLIB_COMPAT_H__ - - -#include -#include -#include - - -#ifdef __clang__ - -#undef G_GNUC_BEGIN_IGNORE_DEPRECATIONS -#undef G_GNUC_END_IGNORE_DEPRECATIONS - -#define G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ - _Pragma("clang diagnostic push") \ - _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") - -#define G_GNUC_END_IGNORE_DEPRECATIONS \ - _Pragma("clang diagnostic pop") - -#endif - - -#include "nm-gvaluearray-compat.h" - - -static inline void -__g_type_ensure (GType type) -{ -#if !GLIB_CHECK_VERSION(2,34,0) - if (G_UNLIKELY (type == (GType)-1)) - g_error ("can't happen"); -#else - G_GNUC_BEGIN_IGNORE_DEPRECATIONS; - g_type_ensure (type); - G_GNUC_END_IGNORE_DEPRECATIONS; -#endif -} -#define g_type_ensure __g_type_ensure - -#if !GLIB_CHECK_VERSION(2,34,0) - -#define g_clear_pointer(pp, destroy) \ - G_STMT_START { \ - G_STATIC_ASSERT (sizeof *(pp) == sizeof (gpointer)); \ - /* Only one access, please */ \ - gpointer *_pp = (gpointer *) (pp); \ - gpointer _p; \ - /* This assignment is needed to avoid a gcc warning */ \ - GDestroyNotify _destroy = (GDestroyNotify) (destroy); \ - \ - _p = *_pp; \ - if (_p) \ - { \ - *_pp = NULL; \ - _destroy (_p); \ - } \ - } G_STMT_END - -/* These are used to clean up the output of test programs; we can just let - * them no-op in older glib. - */ -#define g_test_expect_message(log_domain, log_level, pattern) -#define g_test_assert_expected_messages() - -#else - -/* We build with -DGLIB_MAX_ALLOWED_VERSION set to 2.32 to make sure we don't - * accidentally use new API that we shouldn't. But we don't want warnings for - * the APIs that we emulate above. - */ - -#define g_test_expect_message(domain, level, format...) \ - G_STMT_START { \ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ - g_test_expect_message (domain, level, format); \ - G_GNUC_END_IGNORE_DEPRECATIONS \ - } G_STMT_END - -#define g_test_assert_expected_messages_internal(domain, file, line, func) \ - G_STMT_START { \ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ - g_test_assert_expected_messages_internal (domain, file, line, func); \ - G_GNUC_END_IGNORE_DEPRECATIONS \ - } G_STMT_END - -#endif - -/* g_test_initialized() is only available since glib 2.36. */ -#if !GLIB_CHECK_VERSION (2, 36, 0) -#define g_test_initialized() (g_test_config_vars->test_initialized) -#endif - -/* Rumtime check for glib version. First do a compile time check which - * (if satisfied) shortcuts the runtime check. */ -#define nm_glib_check_version(major, minor, micro) \ - ( GLIB_CHECK_VERSION ((major), (minor), (micro)) \ - || ( ( glib_major_version > (major)) \ - || ( glib_major_version == (major) \ - && glib_minor_version > (minor)) \ - || ( glib_major_version == (major) \ - && glib_minor_version == (minor) \ - && glib_micro_version >= (micro)))) - -/* g_test_skip() is only available since glib 2.38. Add a compatibility wrapper. */ -inline static void -__nmtst_g_test_skip (const gchar *msg) -{ -#if GLIB_CHECK_VERSION (2, 38, 0) - G_GNUC_BEGIN_IGNORE_DEPRECATIONS - g_test_skip (msg); - G_GNUC_END_IGNORE_DEPRECATIONS -#else - g_debug ("%s", msg); -#endif -} -#define g_test_skip __nmtst_g_test_skip - - -/* g_test_add_data_func_full() is only available since glib 2.34. Add a compatibility wrapper. */ -inline static void -__g_test_add_data_func_full (const char *testpath, - gpointer test_data, - GTestDataFunc test_func, - GDestroyNotify data_free_func) -{ -#if GLIB_CHECK_VERSION (2, 34, 0) - G_GNUC_BEGIN_IGNORE_DEPRECATIONS - g_test_add_data_func_full (testpath, test_data, test_func, data_free_func); - G_GNUC_END_IGNORE_DEPRECATIONS -#else - g_return_if_fail (testpath != NULL); - g_return_if_fail (testpath[0] == '/'); - g_return_if_fail (test_func != NULL); - - g_test_add_vtable (testpath, 0, test_data, NULL, - (GTestFixtureFunc) test_func, - (GTestFixtureFunc) data_free_func); -#endif -} -#define g_test_add_data_func_full __g_test_add_data_func_full - - -#if !GLIB_CHECK_VERSION (2, 34, 0) -#define G_DEFINE_QUARK(QN, q_n) \ -GQuark \ -q_n##_quark (void) \ -{ \ - static GQuark q; \ - \ - if G_UNLIKELY (q == 0) \ - q = g_quark_from_static_string (#QN); \ - \ - return q; \ -} -#endif - - -static inline gboolean -nm_g_hash_table_replace (GHashTable *hash, gpointer key, gpointer value) -{ - /* glib 2.40 added a return value indicating whether the key already existed - * (910191597a6c2e5d5d460e9ce9efb4f47d9cc63c). */ -#if GLIB_CHECK_VERSION(2, 40, 0) - return g_hash_table_replace (hash, key, value); -#else - gboolean contained = g_hash_table_contains (hash, key); - - g_hash_table_replace (hash, key, value); - return !contained; -#endif -} - - -#if !GLIB_CHECK_VERSION(2, 40, 0) || defined (NM_GLIB_COMPAT_H_TEST) -static inline void -_nm_g_ptr_array_insert (GPtrArray *array, - gint index_, - gpointer data) -{ - g_return_if_fail (array); - g_return_if_fail (index_ >= -1); - g_return_if_fail (index_ <= (gint) array->len); - - g_ptr_array_add (array, data); - - if (index_ != -1 && index_ != (gint) (array->len - 1)) { - memmove (&(array->pdata[index_ + 1]), - &(array->pdata[index_]), - (array->len - index_ - 1) * sizeof (gpointer)); - array->pdata[index_] = data; - } -} -#endif -#if !GLIB_CHECK_VERSION(2, 40, 0) -#define g_ptr_array_insert(array, index, data) G_STMT_START { _nm_g_ptr_array_insert (array, index, data); } G_STMT_END -#else -#define g_ptr_array_insert(array, index, data) \ - G_STMT_START { \ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ - g_ptr_array_insert (array, index, data); \ - G_GNUC_END_IGNORE_DEPRECATIONS \ - } G_STMT_END -#endif - - -#if !GLIB_CHECK_VERSION (2, 40, 0) -inline static gboolean -_g_key_file_save_to_file (GKeyFile *key_file, - const gchar *filename, - GError **error) -{ - gchar *contents; - gboolean success; - gsize length; - - g_return_val_if_fail (key_file != NULL, FALSE); - g_return_val_if_fail (filename != NULL, FALSE); - g_return_val_if_fail (error == NULL || *error == NULL, FALSE); - - contents = g_key_file_to_data (key_file, &length, NULL); - g_assert (contents != NULL); - - success = g_file_set_contents (filename, contents, length, error); - g_free (contents); - - return success; -} -#define g_key_file_save_to_file(key_file, filename, error) \ - _g_key_file_save_to_file (key_file, filename, error) -#else -#define g_key_file_save_to_file(key_file, filename, error) \ - ({ \ - gboolean _success; \ - \ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ - _success = g_key_file_save_to_file (key_file, filename, error); \ - G_GNUC_END_IGNORE_DEPRECATIONS \ - _success; \ - }) -#endif - - -#endif /* __NM_GLIB_COMPAT_H__ */ diff --git a/include/nm-gvaluearray-compat.h b/include/nm-gvaluearray-compat.h deleted file mode 100644 index f0b4a6cd..00000000 --- a/include/nm-gvaluearray-compat.h +++ /dev/null @@ -1,108 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Copyright 2013 Red Hat, Inc. - */ - -#ifndef __NM_GVALUEARRAY_COMPAT_H__ -#define __NM_GVALUEARRAY_COMPAT_H__ - -#include - -#include "nm-glib-compat.h" - -#define g_value_array_get_type() \ - G_GNUC_EXTENSION ({ \ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ - g_value_array_get_type (); \ - G_GNUC_END_IGNORE_DEPRECATIONS \ - }) - -#define g_value_array_get_nth(value_array, index_) \ - G_GNUC_EXTENSION ({ \ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ - g_value_array_get_nth (value_array, index_); \ - G_GNUC_END_IGNORE_DEPRECATIONS \ - }) - -#define g_value_array_new(n_prealloced) \ - G_GNUC_EXTENSION ({ \ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ - g_value_array_new (n_prealloced); \ - G_GNUC_END_IGNORE_DEPRECATIONS \ - }) - -static inline void -__g_value_array_free (GValueArray *value_array) -{ - G_GNUC_EXTENSION ({ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS - g_value_array_free (value_array); - G_GNUC_END_IGNORE_DEPRECATIONS - }); -} -#define g_value_array_free __g_value_array_free - -#define g_value_array_copy(value_array) \ - G_GNUC_EXTENSION ({ \ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ - g_value_array_copy (value_array); \ - G_GNUC_END_IGNORE_DEPRECATIONS \ - }) - -#define g_value_array_prepend(value_array, value) \ - G_GNUC_EXTENSION ({ \ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ - g_value_array_prepend (value_array, value); \ - G_GNUC_END_IGNORE_DEPRECATIONS \ - }) - -#define g_value_array_append(value_array, value) \ - G_GNUC_EXTENSION ({ \ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ - g_value_array_append (value_array, value); \ - G_GNUC_END_IGNORE_DEPRECATIONS \ - }) - -#define g_value_array_insert(value_array, index_, value) \ - G_GNUC_EXTENSION ({ \ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ - g_value_array_insert (value_array, index_, value); \ - G_GNUC_END_IGNORE_DEPRECATIONS \ - }) - -#define g_value_array_remove(value_array, index_) \ - G_GNUC_EXTENSION ({ \ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ - g_value_array_remove (value_array, index_); \ - G_GNUC_END_IGNORE_DEPRECATIONS \ - }) - -#define g_value_array_sort(value_array, compare_func) \ - G_GNUC_EXTENSION ({ \ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ - g_value_array_sort (value_array, compare_func); \ - G_GNUC_END_IGNORE_DEPRECATIONS \ - }) - -#define g_value_array_sort_with_data(value_array, compare_func, user_data) \ - G_GNUC_EXTENSION ({ \ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ - g_value_array_sort_with_data (value_array, compare_func, user_data); \ - G_GNUC_END_IGNORE_DEPRECATIONS \ - }) - -#endif /* __NM_GVALUEARRAY_COMPAT_H__ */ diff --git a/include/nm-macros-internal.h b/include/nm-macros-internal.h deleted file mode 100644 index 123c49bb..00000000 --- a/include/nm-macros-internal.h +++ /dev/null @@ -1,346 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* NetworkManager -- Network link manager - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA. - * - * (C) Copyright 2014 Red Hat, Inc. - */ - -#ifndef __NM_MACROS_INTERNAL_H__ -#define __NM_MACROS_INTERNAL_H__ - - -#include -#include - -/********************************************************/ - -/* http://stackoverflow.com/a/11172679 */ -#define _NM_UTILS_MACRO_FIRST(...) __NM_UTILS_MACRO_FIRST_HELPER(__VA_ARGS__, throwaway) -#define __NM_UTILS_MACRO_FIRST_HELPER(first, ...) first - -#define _NM_UTILS_MACRO_REST(...) __NM_UTILS_MACRO_REST_HELPER(__NM_UTILS_MACRO_REST_NUM(__VA_ARGS__), __VA_ARGS__) -#define __NM_UTILS_MACRO_REST_HELPER(qty, ...) __NM_UTILS_MACRO_REST_HELPER2(qty, __VA_ARGS__) -#define __NM_UTILS_MACRO_REST_HELPER2(qty, ...) __NM_UTILS_MACRO_REST_HELPER_##qty(__VA_ARGS__) -#define __NM_UTILS_MACRO_REST_HELPER_ONE(first) -#define __NM_UTILS_MACRO_REST_HELPER_TWOORMORE(first, ...) , __VA_ARGS__ -#define __NM_UTILS_MACRO_REST_NUM(...) \ - __NM_UTILS_MACRO_REST_SELECT_20TH(__VA_ARGS__, \ - TWOORMORE, TWOORMORE, TWOORMORE, TWOORMORE, TWOORMORE,\ - TWOORMORE, TWOORMORE, TWOORMORE, TWOORMORE, TWOORMORE,\ - TWOORMORE, TWOORMORE, TWOORMORE, TWOORMORE, TWOORMORE,\ - TWOORMORE, TWOORMORE, TWOORMORE, ONE, throwaway) -#define __NM_UTILS_MACRO_REST_SELECT_20TH(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, ...) a20 - -/********************************************************/ - -/* http://stackoverflow.com/a/2124385/354393 */ - -#define NM_NARG(...) \ - _NM_NARG(__VA_ARGS__,_NM_NARG_RSEQ_N()) -#define _NM_NARG(...) \ - _NM_NARG_ARG_N(__VA_ARGS__) -#define _NM_NARG_ARG_N( \ - _1, _2, _3, _4, _5, _6, _7, _8, _9,_10, \ - _11,_12,_13,_14,_15,_16,_17,_18,_19,_20, \ - _21,_22,_23,_24,_25,_26,_27,_28,_29,_30, \ - _31,_32,_33,_34,_35,_36,_37,_38,_39,_40, \ - _41,_42,_43,_44,_45,_46,_47,_48,_49,_50, \ - _51,_52,_53,_54,_55,_56,_57,_58,_59,_60, \ - _61,_62,_63,N,...) N -#define _NM_NARG_RSEQ_N() \ - 63,62,61,60, \ - 59,58,57,56,55,54,53,52,51,50, \ - 49,48,47,46,45,44,43,42,41,40, \ - 39,38,37,36,35,34,33,32,31,30, \ - 29,28,27,26,25,24,23,22,21,20, \ - 19,18,17,16,15,14,13,12,11,10, \ - 9,8,7,6,5,4,3,2,1,0 - -/********************************************************/ - -#if defined (__GNUC__) -#define _NM_PRAGMA_WARNING_DO(warning) G_STRINGIFY(GCC diagnostic ignored warning) -#elif defined (__clang__) -#define _NM_PRAGMA_WARNING_DO(warning) G_STRINGIFY(clang diagnostic ignored warning) -#endif - -/* you can only suppress a specific warning that the compiler - * understands. Otherwise you will get another compiler warning - * about invalid pragma option. - * It's not that bad however, because gcc and clang often have the - * same name for the same warning. */ - -#if defined (__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) -#define NM_PRAGMA_WARNING_DISABLE(warning) \ - _Pragma("GCC diagnostic push"); \ - _Pragma(_NM_PRAGMA_WARNING_DO(warning)) -#elif defined (__clang__) -#define NM_PRAGMA_WARNING_DISABLE(warning) \ - _Pragma("clang diagnostic push"); \ - _Pragma(_NM_PRAGMA_WARNING_DO(warning)) -#else -#define NM_PRAGMA_WARNING_DISABLE(warning) -#endif - -#if defined (__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) -#define NM_PRAGMA_WARNING_REENABLE \ - _Pragma("GCC diagnostic pop") -#elif defined (__clang__) -#define NM_PRAGMA_WARNING_REENABLE \ - _Pragma("clang diagnostic pop") -#else -#define NM_PRAGMA_WARNING_REENABLE -#endif - -/********************************************************/ - -/* macro to return strlen() of a compile time string. */ -#define STRLEN(str) ( sizeof ("" str) - 1 ) - -/********************************************************/ - -#define _NM_IN_SET_EVAL_1(op, x, y1) \ - ({ \ - typeof(x) _x = (x); \ - ( (_x == (y1)) \ - ); \ - }) - -#define _NM_IN_SET_EVAL_2(op, x, y1, y2) \ - ({ \ - typeof(x) _x = (x); \ - ( (_x == (y1)) \ - op (_x == (y2)) \ - ); \ - }) - -#define _NM_IN_SET_EVAL_3(op, x, y1, y2, y3) \ - ({ \ - typeof(x) _x = (x); \ - ( (_x == (y1)) \ - op (_x == (y2)) \ - op (_x == (y3)) \ - ); \ - }) - -#define _NM_IN_SET_EVAL_4(op, x, y1, y2, y3, y4) \ - ({ \ - typeof(x) _x = (x); \ - ( (_x == (y1)) \ - op (_x == (y2)) \ - op (_x == (y3)) \ - op (_x == (y4)) \ - ); \ - }) - -#define _NM_IN_SET_EVAL_5(op, x, y1, y2, y3, y4, y5) \ - ({ \ - typeof(x) _x = (x); \ - ( (_x == (y1)) \ - op (_x == (y2)) \ - op (_x == (y3)) \ - op (_x == (y4)) \ - op (_x == (y5)) \ - ); \ - }) - -#define _NM_IN_SET_EVAL_N2(op, x, n, ...) _NM_IN_SET_EVAL_##n(op, x, __VA_ARGS__) -#define _NM_IN_SET_EVAL_N(op, x, n, ...) _NM_IN_SET_EVAL_N2(op, x, n, __VA_ARGS__) - -/* Beware that this does short-circuit evaluation (use "||" instead of "|") - * which has a possibly unexpected non-function-like behavior. - * Use NM_IN_SET_SE if you need all arguments to be evaluted. */ -#define NM_IN_SET(x, ...) _NM_IN_SET_EVAL_N(||, x, NM_NARG (__VA_ARGS__), __VA_ARGS__) - -/* "SE" stands for "side-effect". Contrary to NM_IN_SET(), this does not do - * short-circuit evaluation, which can make a difference if the arguments have - * side-effects. */ -#define NM_IN_SET_SE(x, ...) _NM_IN_SET_EVAL_N(|, x, NM_NARG (__VA_ARGS__), __VA_ARGS__) - -/*****************************************************************************/ - -#define NM_PRINT_FMT_QUOTED(cond, prefix, str, suffix, str_else) \ - (cond) ? (prefix) : "", \ - (cond) ? (str) : (str_else), \ - (cond) ? (suffix) : "" -#define NM_PRINT_FMT_QUOTE_STRING(arg) NM_PRINT_FMT_QUOTED((arg), "\"", (arg), "\"", "(null)") - -/*****************************************************************************/ - -#ifdef NM_MORE_ASSERTS -#define nm_assert(cond) G_STMT_START { g_assert (cond); } G_STMT_END -#else -#define nm_assert(cond) G_STMT_START { if (FALSE) { if (cond) { } } } G_STMT_END -#endif - -/*****************************************************************************/ - -#define NM_DEFINE_SINGLETON_INSTANCE(TYPE) \ -static TYPE *singleton_instance - -#define NM_DEFINE_SINGLETON_WEAK_REF(TYPE) \ -NM_DEFINE_SINGLETON_INSTANCE (TYPE); \ -static void \ -_singleton_instance_weak_ref_cb (gpointer data, \ - GObject *where_the_object_was) \ -{ \ - nm_log_dbg (LOGD_CORE, "disposing %s singleton (%p)", G_STRINGIFY (TYPE), singleton_instance); \ - singleton_instance = NULL; \ -} \ -static inline void \ -nm_singleton_instance_weak_ref_register (void) \ -{ \ - g_object_weak_ref (G_OBJECT (singleton_instance), _singleton_instance_weak_ref_cb, NULL); \ -} - -#define NM_DEFINE_SINGLETON_DESTRUCTOR(TYPE) \ -NM_DEFINE_SINGLETON_INSTANCE (TYPE); \ -static void __attribute__((destructor)) \ -_singleton_destructor (void) \ -{ \ - if (singleton_instance) { \ - if (G_OBJECT (singleton_instance)->ref_count > 1) \ - nm_log_dbg (LOGD_CORE, "disown %s singleton (%p)", G_STRINGIFY (TYPE), singleton_instance); \ - g_object_unref (singleton_instance); \ - } \ -} - -/* By default, the getter will assert that the singleton will be created only once. You can - * change this by redefining NM_DEFINE_SINGLETON_ALLOW_MULTIPLE. */ -#ifndef NM_DEFINE_SINGLETON_ALLOW_MULTIPLE -#define NM_DEFINE_SINGLETON_ALLOW_MULTIPLE FALSE -#endif - -#define NM_DEFINE_SINGLETON_GETTER(TYPE, GETTER, GTYPE, ...) \ -NM_DEFINE_SINGLETON_INSTANCE (TYPE); \ -NM_DEFINE_SINGLETON_WEAK_REF (TYPE); \ -TYPE * \ -GETTER (void) \ -{ \ - if (G_UNLIKELY (!singleton_instance)) { \ - static char _already_created = FALSE; \ -\ - g_assert (!_already_created || (NM_DEFINE_SINGLETON_ALLOW_MULTIPLE)); \ - _already_created = TRUE;\ - singleton_instance = (g_object_new (GTYPE, ##__VA_ARGS__, NULL)); \ - g_assert (singleton_instance); \ - nm_singleton_instance_weak_ref_register (); \ - nm_log_dbg (LOGD_CORE, "create %s singleton (%p)", G_STRINGIFY (TYPE), singleton_instance); \ - } \ - return singleton_instance; \ -} \ -NM_DEFINE_SINGLETON_DESTRUCTOR(TYPE) - -/*****************************************************************************/ - -static inline gboolean -nm_clear_g_source (guint *id) -{ - if (id && *id) { - g_source_remove (*id); - *id = 0; - return TRUE; - } - return FALSE; -} - -static inline gboolean -nm_clear_g_signal_handler (gpointer self, guint *id) -{ - if (id && *id) { - g_signal_handler_disconnect (self, *id); - *id = 0; - return TRUE; - } - return FALSE; -} - -/*****************************************************************************/ - -/* Determine whether @x is a power of two (@x being an integer type). - * For the special cases @x equals zero or one, it also returns true. - * For negative @x, always returns FALSE. That only applies, if the data - * type of @x is signed. */ -#define nm_utils_is_power_of_two(x) ({ \ - const typeof(x) __x = (x); \ - \ - /* Check if the value is negative. In that case, return FALSE. - * The first expression is a compile time constant, depending on whether - * the type is signed. The second expression is a clumsy way for (__x >= 0), - * which causes a compiler warning for unsigned types. */ \ - ( ( ((typeof(__x)) -1) > ((typeof(__x)) 0) ) || (__x > 0) || (__x == 0) ) \ - && ((__x & (__x - 1)) == 0); \ - }) - -/*****************************************************************************/ - -/* check if @flags has exactly one flag (@check) set. You should call this - * only with @check being a compile time constant and a power of two. */ -#define NM_FLAGS_HAS(flags, check) \ - ( (G_STATIC_ASSERT_EXPR ( ((check) != 0) && ((check) & ((check)-1)) == 0 )), (NM_FLAGS_ANY ((flags), (check))) ) - -#define NM_FLAGS_ANY(flags, check) ( ( ((flags) & (check)) != 0 ) ? TRUE : FALSE ) -#define NM_FLAGS_ALL(flags, check) ( ( ((flags) & (check)) == (check) ) ? TRUE : FALSE ) - -#define NM_FLAGS_SET(flags, val) ({ \ - const typeof(flags) _flags = (flags); \ - const typeof(flags) _val = (val); \ - \ - _flags | _val; \ - }) - -#define NM_FLAGS_UNSET(flags, val) ({ \ - const typeof(flags) _flags = (flags); \ - const typeof(flags) _val = (val); \ - \ - _flags & (~_val); \ - }) - -#define NM_FLAGS_ASSIGN(flags, val, assign) ({ \ - const typeof(flags) _flags = (flags); \ - const typeof(flags) _val = (val); \ - \ - (assign) \ - ? _flags | (_val) \ - : _flags & (~_val); \ - }) - -/*****************************************************************************/ - -static inline char * -nm_strstrip (char *str) -{ - /* g_strstrip doesn't like NULL. */ - return str ? g_strstrip (str) : NULL; -} - -/*****************************************************************************/ - -#define nm_sprintf_buf(buf, format, ...) ({ \ - char * _buf = (buf); \ - \ - /* some static assert trying to ensure that the buffer is statically allocated. - * It disallows a buffer size of sizeof(gpointer) to catch that. */ \ - G_STATIC_ASSERT (G_N_ELEMENTS (buf) == sizeof (buf) && sizeof (buf) != sizeof (char *)); \ - g_snprintf (_buf, sizeof (buf), \ - ""format"", __VA_ARGS__); \ - _buf; \ - }) - -/*****************************************************************************/ - -#endif /* __NM_MACROS_INTERNAL_H__ */ diff --git a/include/nm-test-utils.h b/include/nm-test-utils.h deleted file mode 100644 index d23672b8..00000000 --- a/include/nm-test-utils.h +++ /dev/null @@ -1,1507 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA. - * - * Copyright 2014 Red Hat, Inc. - */ - -#ifndef __NM_TEST_UTILS_H__ -#define __NM_TEST_UTILS_H__ - -/******************************************************************************* - * HOWTO run tests. - * - * Our tests (make check) include this header-only file nm-test-utils.h. - * - * Logging: - * In tests, nm-logging redirects to glib logging. By default, glib suppresses all debug - * messages unless you set G_MESSAGES_DEBUG. To enable debug logging, you can explicitly set - * G_MESSAGES_DEBUG. Otherwise, nm-test will set G_MESSAGES_DEBUG=all in debug mode (see below). - * For nm-logging, you can configure the log-level and domains via NMTST_DEBUG environment - * variable. - * - * Assert-logging: - * Some tests assert against logged messages (g_test_expect_message()). - * By specifying no-expect-message in NMTST_DEBUG, you can disable assert logging - * and g_test_assert_expected_messages() will not fail. - * - * NMTST_SEED_RAND environment variable: - * Tests that use random numbers from nmtst_get_rand() get seeded randomly at each start. - * You can specify the seed by setting NMTST_SEED_RAND. Also, tests will print the seed - * to stdout, so that you know the choosen seed. - * - * - * NMTST_DEBUG environment variable: - * - * "debug", "no-debug": when at test is run in debug mode, it might behave differently, - * depending on the test. See nmtst_is_debug(). - * Known differences: - * - a test might leave the logging level unspecified. In this case, running in - * debug mode, will turn on DEBUG logging, otherwise WARN logging only. - * - if G_MESSAGES_DEBUG is unset, nm-test will set G_MESSAGES_DEBUG=all - * for tests that don't do assert-logging. - * Debug mode is determined as follows (highest priority first): - * - command line option --debug/--no-debug - * - NMTST_DEBUG=debug/no-debug - * - setting NMTST_DEBUG implies debugging turned on - * - g_test_verbose() - * - * "no-expect-message": for tests that would assert against log messages, disable - * those asserts. - * - * "log-level=LEVEL", "log-domains=DOMAIN": reset the log level and domain for tests. - * It only has an effect for nm-logging messages. - * This has no effect if the test asserts against logging (unless no-expect-message), - * otherwise, changing the logging would break tests. - * If you set the level to DEBUG or TRACE, it also sets G_MESSAGES_DEBUG=all (unless - * in assert-logging mode and unless G_MESSAGES_DEBUG is already defined). - * - * "TRACE", this is shorthand for "log-level=TRACE". - * - * "sudo-cmd=PATH": when running root tests as normal user, the test will execute - * itself by invoking sudo at PATH. - * For example - * NMTST_DEBUG="sudo-cmd=$PWD/tools/test-sudo-wrapper.sh" make -C src/platform/tests/ check - * - * "slow|quick|thorough": enable/disable long-running tests. This sets nmtst_test_quick(). - * Whether long-running tests are enabled is determined as follows (highest priority first): - * - specifying the value in NMTST_DEBUG has highest priority - * - respect g_test_quick(), if the command line contains '-mslow', '-mquick', '-mthorough'. - * - use compile time default - * - * "p=PATH"|"s=PATH": passes the path to g_test_init() as "-p" and "-s", respectively. - * Unfortunately, these options conflict with "--tap" which our makefile passes to the - * tests, thus it's only useful outside of `make check`. - * - *******************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "nm-utils.h" -#include "nm-macros-internal.h" -#include "nm-glib-compat.h" -#include "gsystem-local-alloc.h" - -#ifdef __NETWORKMANAGER_LOGGING_H__ -/* We are running tests under src/ */ -#include "NetworkManagerUtils.h" -#endif - -/*******************************************************************************/ - -/* general purpose functions that have no dependency on other nmtst functions */ - -inline static void -nmtst_assert_error (GError *error, - GQuark expect_error_domain, - gint expect_error_code, - const char *expect_error_pattern) -{ - if (expect_error_domain) - g_assert_error (error, expect_error_domain, expect_error_code); - else - g_assert (error); - g_assert (error->message); - if ( expect_error_pattern - && !g_pattern_match_simple (expect_error_pattern, error->message)) { - g_error ("error message does not have expected pattern '%s'. Instead it is '%s' (%s, %d)", - expect_error_pattern, error->message, g_quark_to_string (error->domain), error->code); - } -} - -#define NMTST_WAIT(max_wait_ms, wait) \ - ({ \ - gboolean _not_expired = TRUE; \ - gint64 _nmtst_end, _nmtst_max_wait_us = (max_wait_ms) * 1000L; \ - \ - _nmtst_end = g_get_monotonic_time () + _nmtst_max_wait_us; \ - while (TRUE) { \ - { wait }; \ - if (g_get_monotonic_time () > _nmtst_end) { \ - _not_expired = FALSE; \ - break; \ - } \ - } \ - _not_expired; \ - }) - -#define NMTST_WAIT_ASSERT(max_wait_ms, wait) \ - G_STMT_START { \ - if (!(NMTST_WAIT (max_wait_ms, wait))) \ - g_assert_not_reached (); \ - } G_STMT_END - -inline static void -_nmtst_assert_success (gboolean success, GError *error, const char *file, int line) -{ - if (!success || error) - g_error ("(%s:%d) FAILURE success=%d, error=%s", file, line, success, error && error->message ? error->message : "(no error)"); -} -#define nmtst_assert_success(success, error) _nmtst_assert_success ((success), (error), __FILE__, __LINE__) - -/*******************************************************************************/ - -struct __nmtst_internal -{ - GRand *rand0; - guint32 rand_seed; - GRand *rand; - gboolean is_debug; - gboolean assert_logging; - gboolean no_expect_message; - gboolean test_quick; - gboolean test_tap_log; - char *sudo_cmd; - char **orig_argv; -}; - -extern struct __nmtst_internal __nmtst_internal; - -#define NMTST_DEFINE() \ -struct __nmtst_internal __nmtst_internal = { 0 }; \ -\ -__attribute__ ((destructor)) static void \ -_nmtst_exit (void) \ -{ \ - __nmtst_internal.assert_logging = FALSE; \ - g_test_assert_expected_messages (); \ - nmtst_free (); \ -} - - -inline static gboolean -nmtst_initialized (void) -{ - return !!__nmtst_internal.rand0; -} - -#define __NMTST_LOG(cmd, ...) \ - G_STMT_START { \ - g_assert (nmtst_initialized ()); \ - if (!__nmtst_internal.assert_logging || __nmtst_internal.no_expect_message) { \ - cmd (__VA_ARGS__); \ - } else { \ - printf (_NM_UTILS_MACRO_FIRST (__VA_ARGS__) "\n" _NM_UTILS_MACRO_REST (__VA_ARGS__)); \ - } \ - } G_STMT_END - -/* split the string inplace at specific delimiters, allowing escaping with '\\'. - * Returns a zero terminated array of pointers into @str. - * - * The caller must g_free() the returned argv array. - **/ -inline static char ** -nmtst_str_split (char *str, const char *delimiters) -{ - const char *d; - GArray *result = g_array_sized_new (TRUE, FALSE, sizeof (char *), 3); - - g_assert (str); - g_assert (delimiters && !strchr (delimiters, '\\')); - - while (*str) { - gsize i = 0, j = 0; - - while (TRUE) { - char c = str[i]; - - if (c == '\0') { - str[j++] = 0; - break; - } else if (c == '\\') { - str[j++] = str[++i]; - if (!str[i]) - break; - } else { - for (d = delimiters; *d; d++) { - if (c == *d) { - str[j++] = 0; - i++; - goto BREAK_INNER_LOOPS; - } - } - str[j++] = c; - } - i++; - } - -BREAK_INNER_LOOPS: - g_array_append_val (result, str); - str = &str[i]; - } - - return (char **) g_array_free (result, FALSE); -} - - -/* free instances allocated by nmtst (especially nmtst_init()) on shutdown - * to release memory. After nmtst_free(), the test is uninitialized again. */ -inline static void -nmtst_free (void) -{ - if (!nmtst_initialized ()) - return; - - g_rand_free (__nmtst_internal.rand0); - if (__nmtst_internal.rand) - g_rand_free (__nmtst_internal.rand); - g_free (__nmtst_internal.sudo_cmd); - g_strfreev (__nmtst_internal.orig_argv); - - memset (&__nmtst_internal, 0, sizeof (__nmtst_internal)); -} - -inline static void -__nmtst_init (int *argc, char ***argv, gboolean assert_logging, const char *log_level, const char *log_domains, gboolean *out_set_logging) -{ - const char *nmtst_debug; - gboolean is_debug = FALSE; - char *c_log_level = NULL, *c_log_domains = NULL; - char *sudo_cmd = NULL; - GArray *debug_messages = g_array_new (TRUE, FALSE, sizeof (char *)); - int i; - gboolean no_expect_message = FALSE; - gboolean _out_set_logging; - gboolean test_quick = FALSE; - gboolean test_quick_set = FALSE; - gboolean test_quick_argv = FALSE; - gs_unref_ptrarray GPtrArray *p_tests = NULL; - gs_unref_ptrarray GPtrArray *s_tests = NULL; - - if (!out_set_logging) - out_set_logging = &_out_set_logging; - *out_set_logging = FALSE; - - g_assert (!nmtst_initialized ()); - - g_assert (!((!!argc) ^ (!!argv))); - g_assert (!argc || (g_strv_length (*argv) == *argc)); - g_assert (!assert_logging || (!log_level && !log_domains)); - -#ifdef __NETWORKMANAGER_UTILS_H__ - if (!nm_utils_get_testing_initialized ()) - _nm_utils_set_testing (_NM_UTILS_TEST_GENERAL); -#endif - - if (argc) - __nmtst_internal.orig_argv = g_strdupv (*argv); - - __nmtst_internal.assert_logging = !!assert_logging; - -#if !GLIB_CHECK_VERSION (2, 35, 0) - g_type_init (); -#endif - - is_debug = g_test_verbose (); - - nmtst_debug = g_getenv ("NMTST_DEBUG"); - if (nmtst_debug) { - char **d_argv, **i_argv, *nmtst_debug_copy; - - /* By setting then NMTST_DEBUG variable, @is_debug is set automatically. - * This can be reverted with no-debug (on command line or environment variable). */ - is_debug = TRUE; - - nmtst_debug_copy = g_strdup (nmtst_debug); - d_argv = nmtst_str_split (nmtst_debug_copy, ",; \t\r\n"); - - for (i_argv = d_argv; *i_argv; i_argv++) { - const char *debug = *i_argv; - - if (!g_ascii_strcasecmp (debug, "debug")) - is_debug = TRUE; - else if (!g_ascii_strcasecmp (debug, "no-debug")) { - /* when specifying the NMTST_DEBUG variable, we set is_debug to true. Use this flag to disable this - * (e.g. for only setting the log-level, but not is_debug). */ - is_debug = FALSE; - } else if (!g_ascii_strncasecmp (debug, "log-level=", strlen ("log-level="))) { - g_free (c_log_level); - log_level = c_log_level = g_strdup (&debug[strlen ("log-level=")]); - } else if (!g_ascii_strcasecmp (debug, "TRACE")) { - g_free (c_log_level); - log_level = c_log_level = g_strdup (debug); - } else if (!g_ascii_strncasecmp (debug, "log-domains=", strlen ("log-domains="))) { - g_free (c_log_domains); - log_domains = c_log_domains = g_strdup (&debug[strlen ("log-domains=")]); - } else if (!g_ascii_strncasecmp (debug, "sudo-cmd=", strlen ("sudo-cmd="))) { - g_free (sudo_cmd); - sudo_cmd = g_strdup (&debug[strlen ("sudo-cmd=")]); - } else if (!g_ascii_strcasecmp (debug, "no-expect-message")) { - no_expect_message = TRUE; - } else if (!g_ascii_strncasecmp (debug, "p=", strlen ("p="))) { - if (!p_tests) - p_tests = g_ptr_array_new_with_free_func (g_free); - g_ptr_array_add (p_tests, g_strdup (&debug[strlen ("p=")])); - } else if (!g_ascii_strncasecmp (debug, "s=", strlen ("s="))) { - if (!s_tests) - s_tests = g_ptr_array_new_with_free_func (g_free); - g_ptr_array_add (s_tests, g_strdup (&debug[strlen ("s=")])); - } else if (!g_ascii_strcasecmp (debug, "slow") || !g_ascii_strcasecmp (debug, "thorough")) { - test_quick = FALSE; - test_quick_set = TRUE; - } else if (!g_ascii_strcasecmp (debug, "quick")) { - test_quick = TRUE; - test_quick_set = TRUE; - } else { - char *msg = g_strdup_printf (">>> nmtst: ignore unrecognized NMTST_DEBUG option \"%s\"", debug); - - g_array_append_val (debug_messages, msg); - } - } - - g_free (d_argv); - g_free (nmtst_debug_copy); - } - - if (__nmtst_internal.orig_argv) { - char **a = __nmtst_internal.orig_argv; - - for (; *a; a++) { - if (!g_ascii_strcasecmp (*a, "--debug")) - is_debug = TRUE; - else if (!g_ascii_strcasecmp (*a, "--no-debug")) - is_debug = FALSE; - else if ( !strcmp (*a, "-m=slow") - || !strcmp (*a, "-m=thorough") - || !strcmp (*a, "-m=quick") - || (!strcmp (*a, "-m") && *(a+1) - && ( !strcmp (*(a+1), "quick") - || !strcmp (*(a+1), "slow") - || !strcmp (*(a+1), "thorough")))) - test_quick_argv = TRUE; - else if (strcmp (*a, "--tap") == 0) - __nmtst_internal.test_tap_log = TRUE; - } - } - - if (!argc || g_test_initialized ()) { - if (p_tests || s_tests) { - char *msg = g_strdup_printf (">>> nmtst: ignore -p and -s options for test which calls g_test_init() itself"); - - g_array_append_val (debug_messages, msg); - } - } else { - /* g_test_init() is a variadic function, so we cannot pass it - * (variadic) arguments. If you need to pass additional parameters, - * call nmtst_init() with argc==NULL and call g_test_init() yourself. */ - - /* g_test_init() sets g_log_set_always_fatal() for G_LOG_LEVEL_WARNING - * and G_LOG_LEVEL_CRITICAL. So, beware that the test will fail if you - * have any WARN or ERR log messages -- unless you g_test_expect_message(). */ - GPtrArray *arg_array = g_ptr_array_new (); - gs_free char **arg_array_c = NULL; - int arg_array_n, j; - static char **s_tests_x, **p_tests_x; - - if (*argc) { - for (i = 0; i < *argc; i++) - g_ptr_array_add (arg_array, (*argv)[i]); - } else - g_ptr_array_add (arg_array, "./test"); - - if (test_quick_set && !test_quick_argv) - g_ptr_array_add (arg_array, "-m=quick"); - - if (!__nmtst_internal.test_tap_log) { - for (i = 0; p_tests && i < p_tests->len; i++) { - g_ptr_array_add (arg_array, "-p"); - g_ptr_array_add (arg_array, p_tests->pdata[i]); - } - for (i = 0; s_tests && i < s_tests->len; i++) { - g_ptr_array_add (arg_array, "-s"); - g_ptr_array_add (arg_array, s_tests->pdata[i]); - } - } else if (p_tests || s_tests) { - char *msg = g_strdup_printf (">>> nmtst: ignore -p and -s options for tap-tests"); - - g_array_append_val (debug_messages, msg); - } - - g_ptr_array_add (arg_array, NULL); - - arg_array_n = arg_array->len - 1; - arg_array_c = (char **) g_ptr_array_free (arg_array, FALSE); - - g_test_init (&arg_array_n, &arg_array_c, NULL); - - if (*argc > 1) { - /* collaps argc/argv by removing the arguments detected - * by g_test_init(). */ - for (i = 1, j = 1; i < *argc; i++) { - if ((*argv)[i] == arg_array_c[j]) - j++; - else - (*argv)[i] = NULL; - } - for (i = 1, j = 1; i < *argc; i++) { - if ((*argv)[i]) { - (*argv)[j++] = (*argv)[i]; - if (i >= j) - (*argv)[i] = NULL; - } - } - *argc = j; - } - - /* we must "leak" the test paths because they are not cloned by g_test_init(). */ - if (!__nmtst_internal.test_tap_log) { - if (p_tests) { - p_tests_x = (char **) g_ptr_array_free (p_tests, FALSE); - p_tests = NULL; - } - if (s_tests) { - s_tests_x = (char **) g_ptr_array_free (s_tests, FALSE); - s_tests = NULL; - } - } - } - - if (test_quick_set) - __nmtst_internal.test_quick = test_quick; - else if (test_quick_argv) - __nmtst_internal.test_quick = g_test_quick (); - else { -#ifdef NMTST_TEST_QUICK - __nmtst_internal.test_quick = NMTST_TEST_QUICK; -#else - __nmtst_internal.test_quick = FALSE; -#endif - } - - __nmtst_internal.is_debug = is_debug; - __nmtst_internal.rand0 = g_rand_new_with_seed (0); - __nmtst_internal.sudo_cmd = sudo_cmd; - __nmtst_internal.no_expect_message = no_expect_message; - - if (!log_level && log_domains) { - /* if the log level is not specified (but the domain is), we assume - * the caller wants to set it depending on is_debug */ - log_level = is_debug ? "DEBUG" : "WARN"; - } - - if (!__nmtst_internal.assert_logging) { - gboolean success = TRUE; -#ifdef __NETWORKMANAGER_LOGGING_H__ - success = nm_logging_setup (log_level, log_domains, NULL, NULL); - *out_set_logging = TRUE; -#endif - g_assert (success); - } else if (__nmtst_internal.no_expect_message) { - /* We have a test that would be assert_logging, but the user specified no_expect_message. - * This transforms g_test_expect_message() into a NOP, but we also have to relax - * g_log_set_always_fatal(), which was set by g_test_init(). */ - g_log_set_always_fatal (G_LOG_FATAL_MASK); -#ifdef __NETWORKMANAGER_LOGGING_H__ - if (c_log_domains || c_log_level) { - /* Normally, tests with assert_logging do not overwrite the logging level/domains because - * the logging statements are part of the assertions. But if the test is run with - * no-expect-message *and* the logging is set explicitly via environment variables, - * we still reset the logging. */ - gboolean success; - - success = nm_logging_setup (log_level, log_domains, NULL, NULL); - *out_set_logging = TRUE; - g_assert (success); - } -#endif - } else { -#if GLIB_CHECK_VERSION(2,34,0) - /* We were called not to set logging levels. This means, that the user - * expects to assert against (all) messages. Any uncought message is fatal. */ - g_log_set_always_fatal (G_LOG_LEVEL_MASK); -#else - /* g_test_expect_message() is a NOP, so allow any messages */ - g_log_set_always_fatal (G_LOG_FATAL_MASK); -#endif - } - - if ((!__nmtst_internal.assert_logging || (__nmtst_internal.assert_logging && __nmtst_internal.no_expect_message)) && - (is_debug || (c_log_level && (!g_ascii_strcasecmp (c_log_level, "DEBUG") || !g_ascii_strcasecmp (c_log_level, "TRACE")))) && - !g_getenv ("G_MESSAGES_DEBUG")) - { - /* if we are @is_debug or @log_level=="DEBUG" and - * G_MESSAGES_DEBUG is unset, we set G_MESSAGES_DEBUG=all. - * To disable this default behaviour, set G_MESSAGES_DEBUG='' */ - - /* Note that g_setenv is not thread safe, but you should anyway call - * nmtst_init() at the very start. */ - g_setenv ("G_MESSAGES_DEBUG", "all", TRUE); - } - - /* Delay messages until we setup logging. */ - for (i = 0; i < debug_messages->len; i++) - __NMTST_LOG (g_message, "%s", g_array_index (debug_messages, const char *, i)); - - g_strfreev ((char **) g_array_free (debug_messages, FALSE)); - g_free (c_log_level); - g_free (c_log_domains); - -#ifdef __NETWORKMANAGER_UTILS_H__ - /* ensure that monotonic timestamp is called (because it initially logs a line) */ - nm_utils_get_monotonic_timestamp_s (); -#endif -} - -#ifdef __NETWORKMANAGER_LOGGING_H__ -inline static void -nmtst_init_with_logging (int *argc, char ***argv, const char *log_level, const char *log_domains) -{ - __nmtst_init (argc, argv, FALSE, log_level, log_domains, NULL); -} -inline static void -nmtst_init_assert_logging (int *argc, char ***argv, const char *log_level, const char *log_domains) -{ - gboolean set_logging; - - __nmtst_init (argc, argv, TRUE, NULL, NULL, &set_logging); - - if (!set_logging) { - gboolean success; - - success = nm_logging_setup (log_level, log_domains, NULL, NULL); - g_assert (success); - } -} -#else -inline static void -nmtst_init (int *argc, char ***argv, gboolean assert_logging) -{ - __nmtst_init (argc, argv, assert_logging, NULL, NULL, NULL); -} -#endif - -inline static gboolean -nmtst_is_debug (void) -{ - g_assert (nmtst_initialized ()); - return __nmtst_internal.is_debug; -} - -inline static gboolean -nmtst_test_quick (void) -{ - g_assert (nmtst_initialized ()); - return __nmtst_internal.test_quick; -} - -#if GLIB_CHECK_VERSION(2,34,0) -#undef g_test_expect_message -#define g_test_expect_message(...) \ - G_STMT_START { \ - g_assert (nmtst_initialized ()); \ - if (__nmtst_internal.assert_logging && __nmtst_internal.no_expect_message) { \ - g_debug ("nmtst: assert-logging: g_test_expect_message %s", G_STRINGIFY ((__VA_ARGS__))); \ - } else { \ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ - g_test_expect_message (__VA_ARGS__); \ - G_GNUC_END_IGNORE_DEPRECATIONS \ - } \ - } G_STMT_END -#undef g_test_assert_expected_messages_internal -#define g_test_assert_expected_messages_internal(domain, file, line, func) \ - G_STMT_START { \ - const char *_domain = (domain); \ - const char *_file = (file); \ - const char *_func = (func); \ - int _line = (line); \ - \ - g_assert (nmtst_initialized ()); \ - if (__nmtst_internal.assert_logging && __nmtst_internal.no_expect_message) \ - g_debug ("nmtst: assert-logging: g_test_assert_expected_messages(%s, %s:%d, %s)", _domain?:"", _file?:"", _line, _func?:""); \ - \ - G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ - g_test_assert_expected_messages_internal (_domain, _file, _line, _func); \ - G_GNUC_END_IGNORE_DEPRECATIONS \ - } G_STMT_END -#endif - -inline static GRand * -nmtst_get_rand0 (void) -{ - g_assert (nmtst_initialized ()); - return __nmtst_internal.rand0; -} - -inline static GRand * -nmtst_get_rand (void) -{ - g_assert (nmtst_initialized ()); - - if (G_UNLIKELY (!__nmtst_internal.rand)) { - guint32 seed; - const char *str; - - if ((str = g_getenv ("NMTST_SEED_RAND"))) { - gchar *s; - gint64 i; - - i = g_ascii_strtoll (str, &s, 0); - g_assert (s[0] == '\0' && i >= 0 && i < G_MAXUINT32); - - seed = i; - __nmtst_internal.rand = g_rand_new_with_seed (seed); - } else { - __nmtst_internal.rand = g_rand_new (); - - seed = g_rand_int (__nmtst_internal.rand); - g_rand_set_seed (__nmtst_internal.rand, seed); - } - __nmtst_internal.rand_seed = seed; - - g_print ("\nnmtst: initialize nmtst_get_rand() with NMTST_SEED_RAND=%u\n", seed); - } - return __nmtst_internal.rand; -} - -inline static const char * -nmtst_get_sudo_cmd (void) -{ - g_assert (nmtst_initialized ()); - return __nmtst_internal.sudo_cmd; -} - -inline static void -nmtst_reexec_sudo (void) -{ - char *str; - char **argv; - int i; - int errsv; - - g_assert (nmtst_initialized ()); - g_assert (__nmtst_internal.orig_argv); - - if (!__nmtst_internal.sudo_cmd) - return; - - str = g_strjoinv (" ", __nmtst_internal.orig_argv); - __NMTST_LOG (g_message, ">> exec %s %s", __nmtst_internal.sudo_cmd, str); - - argv = g_new0 (char *, 1 + g_strv_length (__nmtst_internal.orig_argv) + 1); - argv[0] = __nmtst_internal.sudo_cmd; - for (i = 0; __nmtst_internal.orig_argv[i]; i++) - argv[i+1] = __nmtst_internal.orig_argv[i]; - - execvp (__nmtst_internal.sudo_cmd, argv); - - errsv = errno; - g_error (">> exec %s failed: %d - %s", __nmtst_internal.sudo_cmd, errsv, strerror (errsv)); -} - -#define __define_nmtst_static(NUM,SIZE) \ -inline static const char * \ -nmtst_static_##SIZE##_##NUM (const char *str) \ -{ \ - gsize l; \ - static char buf[SIZE]; \ -\ - if (!str) \ - return NULL; \ - l = g_strlcpy (buf, str, sizeof (buf)); \ - g_assert (l < sizeof (buf)); \ - return buf; \ -} -__define_nmtst_static(01, 1024) -__define_nmtst_static(02, 1024) -__define_nmtst_static(03, 1024) -#undef __define_nmtst_static - - -#define NMTST_SWAP(x,y) \ - G_STMT_START { \ - char __nmtst_swap_temp[sizeof(x) == sizeof(y) ? (signed) sizeof(x) : -1]; \ - memcpy(__nmtst_swap_temp, &y, sizeof(x)); \ - memcpy(&y, &x, sizeof(x)); \ - memcpy(&x, __nmtst_swap_temp, sizeof(x)); \ - } G_STMT_END - -inline static guint32 -nmtst_inet4_from_string (const char *str) -{ - guint32 addr; - int success; - - if (!str) - return 0; - - success = inet_pton (AF_INET, str, &addr); - - g_assert (success == 1); - - return addr; -} - -inline static const struct in6_addr * -nmtst_inet6_from_string (const char *str) -{ - static struct in6_addr addr; - int success; - - if (!str) - addr = in6addr_any; - else { - success = inet_pton (AF_INET6, str, &addr); - g_assert (success == 1); - } - - return &addr; -} - -inline static void -FAIL(const char *test_name, const char *fmt, ...) -{ - va_list args; - char buf[500]; - - g_snprintf (buf, 500, "FAIL: (%s) %s\n", test_name, fmt); - - va_start (args, fmt); - vfprintf (stderr, buf, args); - va_end (args); - _exit (1); -} - -#define ASSERT(x, test_name, fmt, ...) \ - if (!(x)) { \ - FAIL (test_name, fmt, ## __VA_ARGS__); \ - } - - -#define nmtst_spawn_sync(working_directory, standard_out, standard_err, assert_exit_status, ...) \ - __nmtst_spawn_sync (working_directory, standard_out, standard_err, assert_exit_status, ##__VA_ARGS__, NULL) -inline static gint -__nmtst_spawn_sync (const char *working_directory, char **standard_out, char **standard_err, int assert_exit_status, ...) G_GNUC_NULL_TERMINATED; -inline static gint -__nmtst_spawn_sync (const char *working_directory, char **standard_out, char **standard_err, int assert_exit_status, ...) -{ - gint exit_status = 0; - GError *error = NULL; - char *arg; - va_list va_args; - GPtrArray *argv = g_ptr_array_new (); - gboolean success; - - va_start (va_args, assert_exit_status); - while ((arg = va_arg (va_args, char *))) - g_ptr_array_add (argv, arg); - va_end (va_args); - - g_assert (argv->len >= 1); - g_ptr_array_add (argv, NULL); - - success = g_spawn_sync (working_directory, - (char**) argv->pdata, - NULL, - 0 /*G_SPAWN_DEFAULT*/, - NULL, - NULL, - standard_out, - standard_err, - &exit_status, - &error); - if (!success) - g_error ("nmtst_spawn_sync(%s): %s", ((char **) argv->pdata)[0], error->message); - g_assert (!error); - - g_assert (!standard_out || *standard_out); - g_assert (!standard_err || *standard_err); - - if (assert_exit_status != -1) { - /* exit status is a guint8 on success. Set @assert_exit_status to -1 - * not to check for the exit status. */ - g_assert (WIFEXITED (exit_status)); - g_assert_cmpint (WEXITSTATUS (exit_status), ==, assert_exit_status); - } - - g_ptr_array_free (argv, TRUE); - return exit_status; -} - -/*******************************************************************************/ - -inline static char * -nmtst_file_resolve_relative_path (const char *rel, const char *cwd) -{ - gs_free char *cwd_free = NULL; - - g_assert (rel && *rel); - - if (g_path_is_absolute (rel)) - return g_strdup (rel); - - if (!cwd) - cwd = cwd_free = g_get_current_dir (); - return g_build_filename (cwd, rel, NULL); -} - -inline static void -_nmtst_assert_resolve_relative_path_equals (const char *f1, const char *f2, const char *file, int line) -{ - gs_free char *p1 = NULL, *p2 = NULL; - - p1 = nmtst_file_resolve_relative_path (f1, NULL); - p2 = nmtst_file_resolve_relative_path (f2, NULL); - g_assert (p1 && *p1); - - /* Fixme: later we might need to coalesce repeated '/', "./", and "../". - * For now, it's good enough. */ - if (g_strcmp0 (p1, p2) != 0) - g_error ("%s:%d : filenames don't match \"%s\" vs. \"%s\" // \"%s\" - \"%s\"", file, line, f1, f2, p1, p2); -} -#define nmtst_assert_resolve_relative_path_equals(f1, f2) _nmtst_assert_resolve_relative_path_equals (f1, f2, __FILE__, __LINE__); - -/*******************************************************************************/ - -#ifdef __NETWORKMANAGER_PLATFORM_H__ - -inline static NMPlatformIP6Address * -nmtst_platform_ip6_address (const char *address, const char *peer_address, guint plen) -{ - static NMPlatformIP6Address addr; - - memset (&addr, 0, sizeof (addr)); - addr.address = *nmtst_inet6_from_string (address); - addr.peer_address = *nmtst_inet6_from_string (peer_address); - addr.plen = plen; - - return &addr; -} - -inline static NMPlatformIP6Address * -nmtst_platform_ip6_address_full (const char *address, const char *peer_address, guint plen, - int ifindex, NMIPConfigSource source, guint32 timestamp, - guint32 lifetime, guint32 preferred, guint flags) -{ - NMPlatformIP6Address *addr = nmtst_platform_ip6_address (address, peer_address, plen); - - addr->ifindex = ifindex; - addr->source = source; - addr->timestamp = timestamp; - addr->lifetime = lifetime; - addr->preferred = preferred; - addr->flags = flags; - - return addr; -} - -inline static NMPlatformIP4Route * -nmtst_platform_ip4_route (const char *network, guint plen, const char *gateway) -{ - static NMPlatformIP4Route route; - - memset (&route, 0, sizeof (route)); - route.network = nmtst_inet4_from_string (network); - route.plen = plen; - route.gateway = nmtst_inet4_from_string (gateway); - - return &route; -} - -inline static NMPlatformIP4Route * -nmtst_platform_ip4_route_full (const char *network, guint plen, const char *gateway, - int ifindex, NMIPConfigSource source, - guint metric, guint mss, - guint8 scope, - const char *pref_src) -{ - NMPlatformIP4Route *route = nmtst_platform_ip4_route (network, plen, gateway); - - route->ifindex = ifindex; - route->source = source; - route->metric = metric; - route->mss = mss; - route->scope_inv = nm_platform_route_scope_inv (scope); - route->pref_src = nmtst_inet4_from_string (pref_src); - - return route; -} - -inline static NMPlatformIP6Route * -nmtst_platform_ip6_route (const char *network, guint plen, const char *gateway) -{ - static NMPlatformIP6Route route; - - memset (&route, 0, sizeof (route)); - route.network = *nmtst_inet6_from_string (network); - route.plen = plen; - route.gateway = *nmtst_inet6_from_string (gateway); - - return &route; -} - -inline static NMPlatformIP6Route * -nmtst_platform_ip6_route_full (const char *network, guint plen, const char *gateway, - int ifindex, NMIPConfigSource source, - guint metric, guint mss) -{ - NMPlatformIP6Route *route = nmtst_platform_ip6_route (network, plen, gateway); - - route->ifindex = ifindex; - route->source = source; - route->metric = metric; - route->mss = mss; - - return route; -} - -inline static int -_nmtst_platform_ip4_routes_equal_sort (gconstpointer a, gconstpointer b, gpointer user_data) -{ - return nm_platform_ip4_route_cmp ((const NMPlatformIP4Route *) a, (const NMPlatformIP4Route *) b); -} - -inline static void -nmtst_platform_ip4_routes_equal (const NMPlatformIP4Route *a, const NMPlatformIP4Route *b, gsize len, gboolean ignore_order) -{ - gsize i; - gs_free const NMPlatformIP4Route *c_a = NULL, *c_b = NULL; - - g_assert (a); - g_assert (b); - - if (ignore_order) { - a = c_a = g_memdup (a, sizeof (NMPlatformIP4Route) * len); - b = c_b = g_memdup (b, sizeof (NMPlatformIP4Route) * len); - g_qsort_with_data (c_a, len, sizeof (NMPlatformIP4Route), _nmtst_platform_ip4_routes_equal_sort, NULL); - g_qsort_with_data (c_b, len, sizeof (NMPlatformIP4Route), _nmtst_platform_ip4_routes_equal_sort, NULL); - } - - for (i = 0; i < len; i++) { - if (nm_platform_ip4_route_cmp (&a[i], &b[i]) != 0) { - g_error ("Error comparing IPv4 route[%lu]: %s vs %s", (long unsigned) i, - nmtst_static_1024_01 (nm_platform_ip4_route_to_string (&a[i])), - nmtst_static_1024_02 (nm_platform_ip4_route_to_string (&b[i]))); - g_assert_not_reached (); - } - } -} - -inline static int -_nmtst_platform_ip6_routes_equal_sort (gconstpointer a, gconstpointer b, gpointer user_data) -{ - return nm_platform_ip6_route_cmp ((const NMPlatformIP6Route *) a, (const NMPlatformIP6Route *) b); -} - -inline static void -nmtst_platform_ip6_routes_equal (const NMPlatformIP6Route *a, const NMPlatformIP6Route *b, gsize len, gboolean ignore_order) -{ - gsize i; - gs_free const NMPlatformIP6Route *c_a = NULL, *c_b = NULL; - - g_assert (a); - g_assert (b); - - if (ignore_order) { - a = c_a = g_memdup (a, sizeof (NMPlatformIP6Route) * len); - b = c_b = g_memdup (b, sizeof (NMPlatformIP6Route) * len); - g_qsort_with_data (c_a, len, sizeof (NMPlatformIP6Route), _nmtst_platform_ip6_routes_equal_sort, NULL); - g_qsort_with_data (c_b, len, sizeof (NMPlatformIP6Route), _nmtst_platform_ip6_routes_equal_sort, NULL); - } - - for (i = 0; i < len; i++) { - if (nm_platform_ip6_route_cmp (&a[i], &b[i]) != 0) { - g_error ("Error comparing IPv6 route[%lu]: %s vs %s", (long unsigned) i, - nmtst_static_1024_01 (nm_platform_ip6_route_to_string (&a[i])), - nmtst_static_1024_02 (nm_platform_ip6_route_to_string (&b[i]))); - g_assert_not_reached (); - } - } -} - -#endif - - -#ifdef __NETWORKMANAGER_IP4_CONFIG_H__ - -inline static NMIP4Config * -nmtst_ip4_config_clone (NMIP4Config *config) -{ - NMIP4Config *copy = nm_ip4_config_new (); - - g_assert (copy); - g_assert (config); - nm_ip4_config_replace (copy, config, NULL); - return copy; -} - -#endif - - -#ifdef __NETWORKMANAGER_IP6_CONFIG_H__ - -inline static NMIP6Config * -nmtst_ip6_config_clone (NMIP6Config *config) -{ - NMIP6Config *copy = nm_ip6_config_new (); - - g_assert (copy); - g_assert (config); - nm_ip6_config_replace (copy, config, NULL); - return copy; -} - -#endif - -#ifdef __NM_SIMPLE_CONNECTION_H__ - -inline static NMConnection * -nmtst_create_minimal_connection (const char *id, const char *uuid, const char *type, NMSettingConnection **out_s_con) -{ - NMConnection *con; - NMSetting *s_base = NULL; - NMSettingConnection *s_con; - gs_free char *uuid_free = NULL; - - g_assert (id); - - if (uuid) - g_assert (nm_utils_is_uuid (uuid)); - else - uuid = uuid_free = nm_utils_uuid_generate (); - - if (type) { - GType type_g = nm_setting_lookup_type (type); - - g_assert (type_g != G_TYPE_INVALID); - - s_base = g_object_new (type_g, NULL); - g_assert (NM_IS_SETTING (s_base)); - } - - con = nm_simple_connection_new (); - s_con = NM_SETTING_CONNECTION (nm_setting_connection_new ()); - - g_object_set (s_con, - NM_SETTING_CONNECTION_ID, id, - NM_SETTING_CONNECTION_UUID, uuid, - NM_SETTING_CONNECTION_TYPE, type, - NULL); - nm_connection_add_setting (con, NM_SETTING (s_con)); - - if (s_base) - nm_connection_add_setting (con, s_base); - - if (out_s_con) - *out_s_con = s_con; - return con; -} - -inline static gboolean -_nmtst_connection_normalize_v (NMConnection *connection, va_list args) -{ - GError *error = NULL; - gboolean success; - gboolean was_modified = FALSE; - GHashTable *parameters = NULL; - const char *p_name; - - g_assert (NM_IS_CONNECTION (connection)); - - while ((p_name = va_arg (args, const char *))) { - if (!parameters) - parameters = g_hash_table_new (g_str_hash, g_str_equal); - g_hash_table_insert (parameters, (gpointer *) p_name, va_arg (args, gpointer)); - } - - success = nm_connection_normalize (connection, - parameters, - &was_modified, - &error); - g_assert_no_error (error); - g_assert (success); - - if (parameters) - g_hash_table_destroy (parameters); - - return was_modified; -} - -inline static gboolean -_nmtst_connection_normalize (NMConnection *connection, ...) -{ - gboolean was_modified; - va_list args; - - va_start (args, connection); - was_modified = _nmtst_connection_normalize_v (connection, args); - va_end (args); - - return was_modified; -} -#define nmtst_connection_normalize(connection, ...) \ - _nmtst_connection_normalize(connection, ##__VA_ARGS__, NULL) - -inline static NMConnection * -_nmtst_connection_duplicate_and_normalize (NMConnection *connection, ...) -{ - gboolean was_modified; - va_list args; - - g_assert (NM_IS_CONNECTION (connection)); - - connection = nm_simple_connection_new_clone (connection); - - va_start (args, connection); - was_modified = _nmtst_connection_normalize_v (connection, args); - va_end (args); - - return connection; -} -#define nmtst_connection_duplicate_and_normalize(connection, ...) \ - _nmtst_connection_duplicate_and_normalize(connection, ##__VA_ARGS__, NULL) - -inline static void -nmtst_assert_connection_equals (NMConnection *a, gboolean normalize_a, NMConnection *b, gboolean normalize_b) -{ - gboolean compare; - gs_unref_object NMConnection *a2 = NULL; - gs_unref_object NMConnection *b2 = NULL; - GHashTable *out_settings = NULL; - - g_assert (NM_IS_CONNECTION (a)); - g_assert (NM_IS_CONNECTION (b)); - - if (normalize_a) - a = a2 = nmtst_connection_duplicate_and_normalize (a); - if (normalize_b) - b = b2 = nmtst_connection_duplicate_and_normalize (b); - - compare = nm_connection_diff (a, b, NM_SETTING_COMPARE_FLAG_EXACT, &out_settings); - if (!compare || out_settings) { - const char *name, *pname; - GHashTable *setting; - GHashTableIter iter, iter2; - - __NMTST_LOG (g_message, ">>> ASSERTION nmtst_assert_connection_equals() fails"); - if (out_settings) { - g_hash_table_iter_init (&iter, out_settings); - while (g_hash_table_iter_next (&iter, (gpointer *) &name, (gpointer *) &setting)) { - __NMTST_LOG (g_message, ">>> differences in setting '%s':", name); - - g_hash_table_iter_init (&iter2, setting); - while (g_hash_table_iter_next (&iter2, (gpointer *) &pname, NULL)) - __NMTST_LOG (g_message, ">>> differences in setting '%s.%s'", name, pname); - } - } - } - g_assert (compare); - g_assert (!out_settings); - - compare = nm_connection_compare (a, b, NM_SETTING_COMPARE_FLAG_EXACT); - g_assert (compare); -} - -inline static void -nmtst_assert_connection_verifies_without_normalization (NMConnection *con) -{ - /* assert that the connection verifies and does not need any normalization */ - - GError *error = NULL; - gboolean success; - gboolean was_modified = FALSE; - gs_unref_object NMConnection *clone = NULL; - - g_assert (NM_IS_CONNECTION (con)); - - clone = nm_simple_connection_new_clone (con); - - success = nm_connection_verify (con, &error); - g_assert_no_error (error); - g_assert (success); - - success = nm_connection_normalize (con, NULL, &was_modified, &error); - g_assert_no_error (error); - g_assert (success); - nmtst_assert_connection_equals (con, FALSE, clone, FALSE); - g_assert (!was_modified); -} - -inline static void -nmtst_assert_connection_verifies_and_normalizable (NMConnection *con) -{ - /* assert that the connection does verify, but normalization still modifies it */ - GError *error = NULL; - gboolean success; - gboolean was_modified = FALSE; - - g_assert (NM_IS_CONNECTION (con)); - - success = nm_connection_verify (con, &error); - g_assert_no_error (error); - g_assert (success); - g_clear_error (&error); - - success = nm_connection_normalize (con, NULL, &was_modified, &error); - g_assert_no_error (error); - g_assert (success); - g_assert (was_modified); - - /* again! */ - nmtst_assert_connection_verifies_without_normalization (con); -} - -inline static void -nmtst_assert_connection_verifies_after_normalization (NMConnection *con, - GQuark expect_error_domain, - gint expect_error_code) -{ - /* assert that the connection does not verify, but normalization does fix it */ - GError *error = NULL; - gboolean success; - gboolean was_modified = FALSE; - - g_assert (NM_IS_CONNECTION (con)); - - success = nm_connection_verify (con, &error); - nmtst_assert_error (error, expect_error_domain, expect_error_code, NULL); - g_assert (!success); - g_clear_error (&error); - - success = nm_connection_normalize (con, NULL, &was_modified, &error); - g_assert_no_error (error); - g_assert (success); - g_assert (was_modified); - - /* again! */ - nmtst_assert_connection_verifies_without_normalization (con); -} - -inline static void -nmtst_assert_connection_unnormalizable (NMConnection *con, - GQuark expect_error_domain, - gint expect_error_code) -{ - /* assert that the connection does not verify, and it cannot be fixed by normalization */ - - GError *error = NULL; - gboolean success; - gboolean was_modified = FALSE; - - g_assert (NM_IS_CONNECTION (con)); - - success = nm_connection_verify (con, &error); - nmtst_assert_error (error, expect_error_domain, expect_error_code, NULL); - g_assert (!success); - g_clear_error (&error); - - success = nm_connection_normalize (con, NULL, &was_modified, &error); - nmtst_assert_error (error, expect_error_domain, expect_error_code, NULL); - g_assert (!success); - g_assert (!was_modified); - g_clear_error (&error); -} - -inline static void -nmtst_assert_setting_verifies (NMSetting *setting) -{ - /* assert that the setting verifies without an error */ - - GError *error = NULL; - gboolean success; - - g_assert (NM_IS_SETTING (setting)); - - success = nm_setting_verify (setting, NULL, &error); - g_assert_no_error (error); - g_assert (success); -} - -inline static void -nmtst_assert_setting_verify_fails (NMSetting *setting, - GQuark expect_error_domain, - gint expect_error_code) -{ - /* assert that the setting verification fails */ - - GError *error = NULL; - gboolean success; - - g_assert (NM_IS_SETTING (setting)); - - success = nm_setting_verify (setting, NULL, &error); - nmtst_assert_error (error, expect_error_domain, expect_error_code, NULL); - g_assert (!success); - g_clear_error (&error); -} - -#endif - -#ifdef __NM_UTILS_H__ -static inline void -nmtst_assert_hwaddr_equals (gconstpointer hwaddr1, gssize hwaddr1_len, const char *expected, const char *loc) -{ - guint8 buf2[NM_UTILS_HWADDR_LEN_MAX]; - gsize hwaddr2_len = 1; - const char *p; - gboolean success; - - g_assert (hwaddr1_len > 0 && hwaddr1_len <= NM_UTILS_HWADDR_LEN_MAX); - - g_assert (expected); - for (p = expected; *p; p++) { - if (*p == ':' || *p == '-') - hwaddr2_len++; - } - g_assert (hwaddr2_len <= NM_UTILS_HWADDR_LEN_MAX); - g_assert (nm_utils_hwaddr_aton (expected, buf2, hwaddr2_len)); - - /* Manually check the entire hardware address instead of using - * nm_utils_hwaddr_matches() because that function doesn't compare - * entire InfiniBand addresses for various (legitimate) reasons. - */ - success = (hwaddr1_len == hwaddr2_len); - if (success) - success = !memcmp (hwaddr1, buf2, hwaddr1_len); - if (!success) { - g_error ("assert: %s: hwaddr '%s' (%zd) expected, but got %s (%zd)", - loc, expected, hwaddr2_len, nm_utils_hwaddr_ntoa (hwaddr1, hwaddr1_len), hwaddr1_len); - } -} -#define nmtst_assert_hwaddr_equals(hwaddr1, hwaddr1_len, expected) \ - nmtst_assert_hwaddr_equals (hwaddr1, hwaddr1_len, expected, G_STRLOC) -#endif - -#if defined(__NM_SIMPLE_CONNECTION_H__) && defined(__NM_SETTING_CONNECTION_H__) && defined(__NM_KEYFILE_INTERNAL_H__) - -inline static NMConnection * -nmtst_create_connection_from_keyfile (const char *keyfile_str, const char *keyfile_name, const char *base_dir) -{ - GKeyFile *keyfile; - GError *error = NULL; - gboolean success; - NMConnection *con; - - g_assert (keyfile_str); - - keyfile = g_key_file_new (); - success = g_key_file_load_from_data (keyfile, keyfile_str, strlen (keyfile_str), G_KEY_FILE_NONE, &error); - g_assert_no_error (error); - g_assert (success); - - con = nm_keyfile_read (keyfile, keyfile_name, base_dir, NULL, NULL, &error); - g_assert_no_error (error); - g_assert (NM_IS_CONNECTION (con)); - - g_key_file_unref (keyfile); - - nmtst_connection_normalize (con); - - return con; -} - -#endif - -#ifdef __NM_CONNECTION_H__ - -typedef enum { - NMTST_VARIANT_EDITOR_CONNECTION, - NMTST_VARIANT_EDITOR_SETTING, - NMTST_VARIANT_EDITOR_PROPERTY -} NmtstVariantEditorPhase; - -#define NMTST_VARIANT_EDITOR(__connection_variant, __code) \ - G_STMT_START { \ - GVariantIter __connection_iter, *__setting_iter; \ - GVariantBuilder __connection_builder, __setting_builder; \ - const char *__cur_setting_name, *__cur_property_name; \ - GVariant *__property_val; \ - NmtstVariantEditorPhase __phase; \ - \ - g_variant_builder_init (&__connection_builder, NM_VARIANT_TYPE_CONNECTION); \ - g_variant_iter_init (&__connection_iter, __connection_variant); \ - \ - __phase = NMTST_VARIANT_EDITOR_CONNECTION; \ - __cur_setting_name = NULL; \ - __cur_property_name = NULL; \ - __code; \ - while (g_variant_iter_next (&__connection_iter, "{&sa{sv}}", &__cur_setting_name, &__setting_iter)) { \ - g_variant_builder_init (&__setting_builder, NM_VARIANT_TYPE_SETTING); \ - __phase = NMTST_VARIANT_EDITOR_SETTING; \ - __cur_property_name = NULL; \ - __code; \ - \ - while ( __cur_setting_name \ - && g_variant_iter_next (__setting_iter, "{&sv}", &__cur_property_name, &__property_val)) { \ - __phase = NMTST_VARIANT_EDITOR_PROPERTY; \ - __code; \ - \ - if (__cur_property_name) { \ - g_variant_builder_add (&__setting_builder, "{sv}", \ - __cur_property_name, \ - __property_val); \ - } \ - g_variant_unref (__property_val); \ - } \ - \ - if (__cur_setting_name) \ - g_variant_builder_add (&__connection_builder, "{sa{sv}}", __cur_setting_name, &__setting_builder); \ - g_variant_iter_free (__setting_iter); \ - } \ - \ - g_variant_unref (__connection_variant); \ - \ - __connection_variant = g_variant_builder_end (&__connection_builder); \ - } G_STMT_END; - -#define NMTST_VARIANT_ADD_SETTING(__setting_name, __setting_variant) \ - G_STMT_START { \ - if (__phase == NMTST_VARIANT_EDITOR_CONNECTION) \ - g_variant_builder_add (&__connection_builder, "{s@a{sv}}", __setting_name, __setting_variant); \ - } G_STMT_END - -#define NMTST_VARIANT_DROP_SETTING(__setting_name) \ - G_STMT_START { \ - if (__phase == NMTST_VARIANT_EDITOR_SETTING && __cur_setting_name) { \ - if (!strcmp (__cur_setting_name, __setting_name)) \ - __cur_setting_name = NULL; \ - } \ - } G_STMT_END - -#define NMTST_VARIANT_ADD_PROPERTY(__setting_name, __property_name, __format_string, __value) \ - G_STMT_START { \ - if (__phase == NMTST_VARIANT_EDITOR_SETTING) { \ - if (!strcmp (__cur_setting_name, __setting_name)) { \ - g_variant_builder_add (&__setting_builder, "{sv}", __property_name, \ - g_variant_new (__format_string, __value)); \ - } \ - } \ - } G_STMT_END - -#define NMTST_VARIANT_DROP_PROPERTY(__setting_name, __property_name) \ - G_STMT_START { \ - if (__phase == NMTST_VARIANT_EDITOR_PROPERTY && __cur_property_name) { \ - if ( !strcmp (__cur_setting_name, __setting_name) \ - && !strcmp (__cur_property_name, __property_name)) \ - __cur_property_name = NULL; \ - } \ - } G_STMT_END - -#define NMTST_VARIANT_CHANGE_PROPERTY(__setting_name, __property_name, __format_string, __value) \ - G_STMT_START { \ - NMTST_VARIANT_DROP_PROPERTY (__setting_name, __property_name); \ - NMTST_VARIANT_ADD_PROPERTY (__setting_name, __property_name, __format_string, __value); \ - } G_STMT_END - -#endif /* __NM_CONNECTION_H__ */ - -#endif /* __NM_TEST_UTILS_H__ */ diff --git a/include/nm-version-macros.h b/include/nm-version-macros.h deleted file mode 100644 index 2e15dcc1..00000000 --- a/include/nm-version-macros.h +++ /dev/null @@ -1,80 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA. - * - * Copyright 2011, 2015 Red Hat, Inc. - */ - -#ifndef __NM_VERSION_MACROS_H__ -#define __NM_VERSION_MACROS_H__ - -/* This header must not include glib or libnm. */ - -/** - * NM_MAJOR_VERSION: - * - * Evaluates to the major version number of NetworkManager which this source - * is compiled against. - */ -#define NM_MAJOR_VERSION (1) - -/** - * NM_MINOR_VERSION: - * - * Evaluates to the minor version number of NetworkManager which this source - * is compiled against. - */ -#define NM_MINOR_VERSION (0) - -/** - * NM_MICRO_VERSION: - * - * Evaluates to the micro version number of NetworkManager which this source - * compiled against. - */ -#define NM_MICRO_VERSION (10) - -/** - * NM_CHECK_VERSION: - * @major: major version (e.g. 1 for version 1.2.5) - * @minor: minor version (e.g. 2 for version 1.2.5) - * @micro: micro version (e.g. 5 for version 1.2.5) - * - * Returns: %TRUE if the version of the NetworkManager header files - * is the same as or newer than the passed-in version. - */ -#define NM_CHECK_VERSION(major,minor,micro) \ - (NM_MAJOR_VERSION > (major) || \ - (NM_MAJOR_VERSION == (major) && NM_MINOR_VERSION > (minor)) || \ - (NM_MAJOR_VERSION == (major) && NM_MINOR_VERSION == (minor) && NM_MICRO_VERSION >= (micro))) - - -#define NM_ENCODE_VERSION(major,minor,micro) ((major) << 16 | (minor) << 8 | (micro)) - -#define NM_VERSION_0_9_8 (NM_ENCODE_VERSION (0, 9, 8)) -#define NM_VERSION_0_9_10 (NM_ENCODE_VERSION (0, 9, 10)) -#define NM_VERSION_1_0 (NM_ENCODE_VERSION (1, 0, 0)) -#define NM_VERSION_1_0_2 (NM_ENCODE_VERSION (1, 0, 2)) -#define NM_VERSION_1_0_4 (NM_ENCODE_VERSION (1, 0, 4)) -#define NM_VERSION_1_0_6 (NM_ENCODE_VERSION (1, 0, 6)) -#define NM_VERSION_1_0_8 (NM_ENCODE_VERSION (1, 0, 8)) -#define NM_VERSION_1_0_10 (NM_ENCODE_VERSION (1, 0, 10)) -#define NM_VERSION_1_0_12 (NM_ENCODE_VERSION (1, 0, 12)) - -#define NM_VERSION_CUR_STABLE NM_VERSION_1_0_10 -#define NM_VERSION_NEXT_STABLE NM_VERSION_1_0_12 - -#endif /* __NM_VERSION_MACROS_H__ */ diff --git a/include/nm-version-macros.h.in b/include/nm-version-macros.h.in deleted file mode 100644 index 0051e005..00000000 --- a/include/nm-version-macros.h.in +++ /dev/null @@ -1,80 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA. - * - * Copyright 2011, 2015 Red Hat, Inc. - */ - -#ifndef __NM_VERSION_MACROS_H__ -#define __NM_VERSION_MACROS_H__ - -/* This header must not include glib or libnm. */ - -/** - * NM_MAJOR_VERSION: - * - * Evaluates to the major version number of NetworkManager which this source - * is compiled against. - */ -#define NM_MAJOR_VERSION (@NM_MAJOR_VERSION@) - -/** - * NM_MINOR_VERSION: - * - * Evaluates to the minor version number of NetworkManager which this source - * is compiled against. - */ -#define NM_MINOR_VERSION (@NM_MINOR_VERSION@) - -/** - * NM_MICRO_VERSION: - * - * Evaluates to the micro version number of NetworkManager which this source - * compiled against. - */ -#define NM_MICRO_VERSION (@NM_MICRO_VERSION@) - -/** - * NM_CHECK_VERSION: - * @major: major version (e.g. 1 for version 1.2.5) - * @minor: minor version (e.g. 2 for version 1.2.5) - * @micro: micro version (e.g. 5 for version 1.2.5) - * - * Returns: %TRUE if the version of the NetworkManager header files - * is the same as or newer than the passed-in version. - */ -#define NM_CHECK_VERSION(major,minor,micro) \ - (NM_MAJOR_VERSION > (major) || \ - (NM_MAJOR_VERSION == (major) && NM_MINOR_VERSION > (minor)) || \ - (NM_MAJOR_VERSION == (major) && NM_MINOR_VERSION == (minor) && NM_MICRO_VERSION >= (micro))) - - -#define NM_ENCODE_VERSION(major,minor,micro) ((major) << 16 | (minor) << 8 | (micro)) - -#define NM_VERSION_0_9_8 (NM_ENCODE_VERSION (0, 9, 8)) -#define NM_VERSION_0_9_10 (NM_ENCODE_VERSION (0, 9, 10)) -#define NM_VERSION_1_0 (NM_ENCODE_VERSION (1, 0, 0)) -#define NM_VERSION_1_0_2 (NM_ENCODE_VERSION (1, 0, 2)) -#define NM_VERSION_1_0_4 (NM_ENCODE_VERSION (1, 0, 4)) -#define NM_VERSION_1_0_6 (NM_ENCODE_VERSION (1, 0, 6)) -#define NM_VERSION_1_0_8 (NM_ENCODE_VERSION (1, 0, 8)) -#define NM_VERSION_1_0_10 (NM_ENCODE_VERSION (1, 0, 10)) -#define NM_VERSION_1_0_12 (NM_ENCODE_VERSION (1, 0, 12)) - -#define NM_VERSION_CUR_STABLE NM_VERSION_1_0_10 -#define NM_VERSION_NEXT_STABLE NM_VERSION_1_0_12 - -#endif /* __NM_VERSION_MACROS_H__ */ diff --git a/initscript/Arch/networkmanager.in b/initscript/Arch/networkmanager.in deleted file mode 100644 index 4846427a..00000000 --- a/initscript/Arch/networkmanager.in +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash - -prefix=@prefix@ -exec_prefix=@prefix@ -sbindir=@sbindir@ - -NETWORKMANAGER_BIN=${sbindir}/NetworkManager - -# general config -. /etc/rc.conf -. /etc/rc.d/functions - -# Sanity checks. -[ -x $NETWORKMANAGER_BIN ] || exit 0 - -PID=`pidof -o %PPID $NETWORKMANAGER_BIN` -case "$1" in - start) - stat_busy "Starting NetworkManager" - [ ! -d /var/run/NetworkManager ] && install -d /var/run/NetworkManager - if [ -z "$PID" ]; then - $NETWORKMANAGER_BIN - fi - if [ ! -z "$PID" -o $? -gt 0 ]; then - stat_fail - else - add_daemon networkmanager - stat_done - fi - ;; - stop) - stat_busy "Stopping NetworkManager" - [ ! -z "$PID" ] && kill $PID &> /dev/null - if [ $? -gt 0 ]; then - stat_fail - else - rm_daemon networkmanager - stat_done - fi - ;; - restart) - $0 stop - sleep 1 - $0 start - ;; - sleep) - /usr/bin/dbus-send --system \ - --dest=org.freedesktop.NetworkManager \ - --type=method_call \ - /org/freedesktop/NetworkManager \ - org.freedesktop.NetworkManager.sleep - ;; - wake) - /usr/bin/dbus-send --system \ - --dest=org.freedesktop.NetworkManager \ - --type=method_call \ - /org/freedesktop/NetworkManager \ - org.freedesktop.NetworkManager.wake - ;; - *) - echo "usage: $0 {start|stop|restart|sleep|wake}" - ;; -esac -exit 0 - - - diff --git a/initscript/Debian/NetworkManager.in b/initscript/Debian/NetworkManager.in deleted file mode 100755 index 9cc254ef..00000000 --- a/initscript/Debian/NetworkManager.in +++ /dev/null @@ -1,91 +0,0 @@ -#! /bin/sh -### BEGIN INIT INFO -# Provides: NetworkManager -# Required-Start: $remote_fs dbus hal -# Required-Stop: $remote_fs dbus hal -# Should-Start: $syslog -# Should-Stop: $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: network connection manager -# Description: Daemon for automatically switching network -# connections to the best available connection. -### END INIT INFO - -set -e - -prefix=@prefix@ -exec_prefix=@prefix@ -sbindir=@sbindir@ -localstatedir=@localstatedir@ - -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin -DESC="network connection manager" -NAME="NetworkManager" - -DAEMON=${sbindir}/$NAME - -PIDDIR=${localstatedir}/run/NetworkManager -PIDFILE=$PIDDIR/$NAME.pid - -USER=root - -# Gracefully exit if the package has been removed. -test -x $DAEMON || exit 0 - -. /lib/lsb/init-functions - -test -f /etc/default/NetworkManager && . /etc/default/NetworkManager - -# -# Function that starts the daemon/service. -# -d_start() { - if [ ! -d $PIDDIR ]; then - mkdir -p $PIDDIR - chown $USER:$USER $PIDDIR - fi - - start-stop-daemon --start --quiet --pidfile $PIDFILE \ - --oknodo --user $USER --exec $DAEMON -- $DAEMON_OPTS --pid-file $PIDFILE - -} - -# -# Function that stops the daemon/service. -# -d_stop() { - start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE \ - --oknodo --user $USER --exec $DAEMON - -} - - -case "$1" in - start) - log_daemon_msg "Starting $DESC" "$NAME" - d_start - log_end_msg $? - ;; - stop) - log_daemon_msg "Stopping $DESC" "$NAME" - d_stop - log_end_msg $? - ;; - restart|force-reload) - log_daemon_msg "Restarting $DESC" "$NAME" - d_stop - d_start - log_end_msg $? - ;; - status) - status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $? - ;; - *) - echo "Usage: $0 {start|stop|restart|force-reload|status}" >&2 - exit 1 - ;; -esac - -exit 0 - diff --git a/initscript/Mandriva/networkmanager.in b/initscript/Mandriva/networkmanager.in deleted file mode 100644 index b5374a04..00000000 --- a/initscript/Mandriva/networkmanager.in +++ /dev/null @@ -1,107 +0,0 @@ -#!/bin/sh -# -# NetworkManager: NetworkManager daemon -# -# chkconfig: - 98 02 -# description: This is a daemon for automatically switching network \ -# connections to the best available connection. -# -# processname: NetworkManager -# pidfile: /var/run/NetworkManager/NetworkManager.pid -# -### BEGIN INIT INFO -# Provides: networkmanager -# Required-Start: $network -# Required-Stop: $network -# Default-Start: 3 4 5 -# Default-Stop: 0 1 2 6 -# Short-Description: Daemon for automatically switching to best network connection. -# Description: This is a daemon for automatically switching network -# connections to the best available connection. -### END INIT INFO - -prefix=@prefix@ -exec_prefix=@prefix@ -sbindir=@sbindir@ - -NETWORKMANAGER_BIN=${sbindir}/NetworkManager - -# Sanity checks. -[ -x $NETWORKMANAGER_BIN ] || exit 1 - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source network configuration -. /etc/sysconfig/network - -# so we can rearrange this easily -processname=NetworkManager -servicename=NetworkManager -pidfile=/var/run/NetworkManager/NetworkManager.pid - -RETVAL=0 - -start() -{ - echo $"Setting network parameters... " - sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1 - - if [ ! -e /var/lock/subsys/named ]; then - service named start >/dev/null 2>&1 - fi - - echo -n $"Starting NetworkManager daemon: " - daemon --check $servicename $processname --pid-file=$pidfile - RETVAL=$? - echo - if [ -n "${NETWORKWAIT}" ]; then - [ -z "${LINKDELAY}" ] && LINKDELAY=10 - echo -n $"Waiting for network..." - nm-online -q --timeout=$LINKDELAY || nm-online -q -x --timeout=30 - [ "$?" = "0" ] && success "network startup" || failure "network startup" - echo - [ -n "${NETWORKDELAY}" ] && /bin/sleep ${NETWORKDELAY} - fi - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$servicename -} - -stop() -{ - echo -n $"Stopping NetworkManager daemon: " - killproc -p $pidfile $servicename - RETVAL=$? - echo - if [ $RETVAL -eq 0 ]; then - rm -f /var/lock/subsys/$servicename - rm -f $pidfile - fi -} - -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - status) - status -p $pidfile $processname - RETVAL=$? - ;; - restart) - stop - start - ;; - condrestart) - if [ -f /var/lock/subsys/$servicename ]; then - stop - start - fi - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart}" - ;; -esac -exit $RETVAL diff --git a/initscript/RedHat/NetworkManager.in b/initscript/RedHat/NetworkManager.in deleted file mode 100755 index e26e59ed..00000000 --- a/initscript/RedHat/NetworkManager.in +++ /dev/null @@ -1,104 +0,0 @@ -#!/bin/sh -# -# NetworkManager: NetworkManager daemon -# -# chkconfig: - 23 84 -# description: This is a daemon for automatically switching network \ -# connections to the best available connection. -# -# processname: NetworkManager -# pidfile: /var/run/NetworkManager/NetworkManager.pid -# -### BEGIN INIT INFO -# Provides: network_manager $network -# Required-Start: messagebus -# Required-Stop: messagebus -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: start and stop NetworkManager -# Description: NetworkManager is a tool for easily managing network connections -### END INIT INFO - -prefix=@prefix@ -exec_prefix=@prefix@ -sbindir=@sbindir@ - -NETWORKMANAGER_BIN=${sbindir}/NetworkManager - -# Sanity checks. -[ -x $NETWORKMANAGER_BIN ] || exit 1 - -# Source function library. -. /etc/rc.d/init.d/functions - -# Source network configuration -. /etc/sysconfig/network - -# so we can rearrange this easily -processname=NetworkManager -servicename=NetworkManager -pidfile=/var/run/NetworkManager/NetworkManager.pid - -RETVAL=0 - -start() -{ - echo -n $"Setting network parameters... " - sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1 - success - echo - - echo -n $"Starting NetworkManager daemon: " - daemon --pidfile $pidfile --check $servicename $processname --pid-file=$pidfile - RETVAL=$? - echo - if [ -n "${NETWORKWAIT}" ]; then - [ -z "${LINKDELAY}" ] && LINKDELAY=10 - echo -n $"Waiting for network..." - nm-online -q --timeout=$LINKDELAY || nm-online -q -x --timeout=30 - [ "$?" = "0" ] && success "network startup" || failure "network startup" - echo - [ -n "${NETWORKDELAY}" ] && /bin/sleep ${NETWORKDELAY} - fi - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$servicename -} - -stop() -{ - echo -n $"Stopping NetworkManager daemon: " - killproc -p $pidfile $servicename - RETVAL=$? - echo - if [ $RETVAL -eq 0 ]; then - rm -f /var/lock/subsys/$servicename - rm -f $pidfile - fi -} - -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - status) - status -p $pidfile $processname - RETVAL=$? - ;; - restart) - stop - start - ;; - condrestart) - if [ -f /var/lock/subsys/$servicename ]; then - stop - start - fi - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart}" - ;; -esac -exit $RETVAL diff --git a/initscript/SUSE/networkmanager.in b/initscript/SUSE/networkmanager.in deleted file mode 100644 index df2cd24a..00000000 --- a/initscript/SUSE/networkmanager.in +++ /dev/null @@ -1,51 +0,0 @@ -#! /bin/sh - -### BEGIN INIT INFO -# Provides: networkmanager -# Required-Start: dbus haldaemon -# Default-Start: 3 5 -# Default-Stop: -# Description: NetworkManager, a network and wireless connection manager -### END INIT INFO - -sbindir=@sbindir@ - -NETWORKMANAGER_BIN=${sbindir}/NetworkManager -test -x $NETWORKMANAGER_BIN || exit 5 - -. /etc/rc.status -rc_reset - -case "$1" in - start) - checkproc $NETWORKMANAGER_BIN - if [ $? = 0 ]; then - echo -n "NetworkManager already running" - rc_status -v - rc_exit - fi - echo -n "Starting the NetworkManager" - startproc $NETWORKMANAGER_BIN - rc_status -v - ;; - stop) - echo -n "Shutting down the NetworkManager" - killproc -TERM $NETWORKMANAGER_BIN - rc_status -v - ;; - restart) - $0 stop - $0 start - rc_status - ;; - status) - echo -n "Checking for the NetworkManager: " - checkproc $NETWORKMANAGER_BIN - rc_status -v - ;; - *) - echo "Usage: $0 {start|stop|status|restart}" - exit 1 - ;; -esac - diff --git a/initscript/Slackware/rc.networkmanager.in b/initscript/Slackware/rc.networkmanager.in deleted file mode 100644 index 6eed87e1..00000000 --- a/initscript/Slackware/rc.networkmanager.in +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/sh -# -# NetworkManager: NetworkManager daemon -# -# description: This is a daemon for automatically switching network \ -# connections to the best available connection. \ -# -# processname: NetworkManager -# pidfile: /var/run/NetworkManager.pid -# - -prefix=@prefix@ -exec_prefix=@prefix@ -sbindir=@sbindir@ - -NETWORKMANAGER_BIN=${sbindir}/NetworkManager - -# Sanity checks. -[ -x $NETWORKMANAGER_BIN ] || exit 0 - -PIDFILE=/var/run/NetworkManager.pid - -nm_start() -{ - if [ "`pgrep dbus-daemon`" = "" ]; then - echo "D-BUS must be running to start NetworkManager" - return - fi - - # Just in case the pidfile is still there, we may need to nuke it. - if [ -e "$PIDFILE" ]; then - rm -f $PIDFILE - fi - - echo "Starting NetworkManager daemon: $NETWORKMANAGER_BIN" - $NETWORKMANAGER_BIN -} - -nm_status() -{ - local pidlist=`cat $PIDFILE 2>/dev/null` - if [ -z "$pidlist" ]; then - return 1 - fi - local command=`ps -p $pidlist -o comm=` - if [ "$command" != 'NetworkManager' ]; then - return 1 - fi -} - -nm_stop() -{ - echo -en "Stopping NetworkManager: " - local pidlist=`cat $PIDFILE 2>/dev/null` - if [ ! -z "$pidlist" ]; then - kill $pidlist &>/dev/null - rm -f $PIDFILE &>/dev/null - fi - echo "stopped"; -} - -nm_restart() -{ - nm_stop - sleep 2 - nm_start -} - -case "$1" in -'start') - if ( ! nm_status ); then - nm_start - else - echo "NetworkManager is already running (will not start it twice)." - fi - ;; -'stop') - nm_stop - ;; -'restart') - nm_restart - ;; -'status') - if ( nm_status ); then - echo "NetworkManager is currently running" - else - echo "NetworkManager is not running." - fi - ;; -*) - echo "usage $0 start|stop|status|restart" -esac diff --git a/initscript/linexa/networkmanager.in b/initscript/linexa/networkmanager.in deleted file mode 100644 index 0d754c36..00000000 --- a/initscript/linexa/networkmanager.in +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash -# Start the networkmanager daemon -# -# Author: Elias -# [2010-08-20] - -# Information about the daemon -title="networkmanager" # No spaces allowed in here -start_after="dbus" # dependencies for start-up -stop_after="xinetd" # dependencies for stop -runlevel="2" # start/stop in this runlevel -sequence="25" # "checkinstall networkmanager enable" - # will create links to: - # /etc/rc.d/rc${runlevel}.d/S${sequence}${title} - # /etc/rc.d/rc${runlevel}.d/S$((100 - ${sequence}))${title} - -# check whether daemon is running -# returns 0 if running, >0 if not -check() { - [ -f /var/run/NetworkManager.pid ] -} - -# start procedure -start() { - if check ; then - warning "${title} is already running. Type 'service restart ${title}'" # Issue a warning - else - /usr/sbin/NetworkManager & - evaluate_retval "Starting ${title}. " # Print [ done ] or [ failed ] depending on outcome - fi -} - -# stop procedure -stop() { - if check ; then # daemon is running - kill $(cat /var/run/NetworkManager.pid) - evaluate_retval "Stopping ${title}." # Print [ done ] or [ failed ] depending on outcome - else # daemon not running - warning "${title} is not running." # Issue a warning - fi -} - -# restart procedure -restart() { - stop - sleep 1 - start -} - -# reload action -reload() { - if check ; then # daemon is running - kill -HUP $(cat /var/run/NetworkManager.pid) &>/dev/null - evaluate_retval "Reloading ${title}." # Print [ done ] or [ failed ] depending on outcome - else # daemon not running - warning "${title} is not running." # Issue a warning - fi -} - diff --git a/introspection/Makefile.am b/introspection/Makefile.am index 3cf08733..735921d3 100644 --- a/introspection/Makefile.am +++ b/introspection/Makefile.am @@ -17,6 +17,8 @@ nodist_libnmdbus_la_SOURCES = \ nmdbus-active-connection.h \ nmdbus-agent-manager.c \ nmdbus-agent-manager.h \ + nmdbus-device-adsl.c \ + nmdbus-device-adsl.h \ nmdbus-device-bond.c \ nmdbus-device-bond.h \ nmdbus-device-bridge.c \ @@ -29,12 +31,18 @@ nodist_libnmdbus_la_SOURCES = \ nmdbus-device.h \ nmdbus-device-generic.c \ nmdbus-device-generic.h \ - nmdbus-device-gre.c \ - nmdbus-device-gre.h \ nmdbus-device-infiniband.c \ nmdbus-device-infiniband.h \ + nmdbus-device-ip-tunnel.c \ + nmdbus-device-ip-tunnel.h \ nmdbus-device-macvlan.c \ nmdbus-device-macvlan.h \ + nmdbus-device-modem.c \ + nmdbus-device-modem.h \ + nmdbus-device-olpc-mesh.c \ + nmdbus-device-olpc-mesh.h \ + nmdbus-device-team.c \ + nmdbus-device-team.h \ nmdbus-device-tun.c \ nmdbus-device-tun.h \ nmdbus-device-veth.c \ @@ -100,8 +108,8 @@ EXTRA_DIST = \ nm-device-bt.xml \ nm-device-ethernet.xml \ nm-device-generic.xml \ - nm-device-gre.xml \ nm-device-infiniband.xml \ + nm-device-ip-tunnel.xml \ nm-device-macvlan.xml \ nm-device-modem.xml \ nm-device-olpc-mesh.xml \ diff --git a/introspection/Makefile.in b/introspection/Makefile.in index 53c6447c..ac18d9ae 100644 --- a/introspection/Makefile.in +++ b/introspection/Makefile.in @@ -114,18 +114,21 @@ LTLIBRARIES = $(noinst_LTLIBRARIES) libnmdbus_la_LIBADD = nodist_libnmdbus_la_OBJECTS = nmdbus-access-point.lo \ nmdbus-active-connection.lo nmdbus-agent-manager.lo \ - nmdbus-device-bond.lo nmdbus-device-bridge.lo \ - nmdbus-device-bt.lo nmdbus-device-ethernet.lo nmdbus-device.lo \ - nmdbus-device-generic.lo nmdbus-device-gre.lo \ - nmdbus-device-infiniband.lo nmdbus-device-macvlan.lo \ - nmdbus-device-tun.lo nmdbus-device-veth.lo \ - nmdbus-device-vlan.lo nmdbus-device-vxlan.lo \ - nmdbus-device-wifi.lo nmdbus-device-wimax.lo \ - nmdbus-dhcp4-config.lo nmdbus-dhcp6-config.lo \ - nmdbus-ip4-config.lo nmdbus-ip6-config.lo nmdbus-manager.lo \ - nmdbus-ppp-manager.lo nmdbus-secret-agent.lo \ - nmdbus-settings-connection.lo nmdbus-settings.lo \ - nmdbus-vpn-connection.lo nmdbus-vpn-plugin.lo + nmdbus-device-adsl.lo nmdbus-device-bond.lo \ + nmdbus-device-bridge.lo nmdbus-device-bt.lo \ + nmdbus-device-ethernet.lo nmdbus-device.lo \ + nmdbus-device-generic.lo nmdbus-device-infiniband.lo \ + nmdbus-device-ip-tunnel.lo nmdbus-device-macvlan.lo \ + nmdbus-device-modem.lo nmdbus-device-olpc-mesh.lo \ + nmdbus-device-team.lo nmdbus-device-tun.lo \ + nmdbus-device-veth.lo nmdbus-device-vlan.lo \ + nmdbus-device-vxlan.lo nmdbus-device-wifi.lo \ + nmdbus-device-wimax.lo nmdbus-dhcp4-config.lo \ + nmdbus-dhcp6-config.lo nmdbus-ip4-config.lo \ + nmdbus-ip6-config.lo nmdbus-manager.lo nmdbus-ppp-manager.lo \ + nmdbus-secret-agent.lo nmdbus-settings-connection.lo \ + nmdbus-settings.lo nmdbus-vpn-connection.lo \ + nmdbus-vpn-plugin.lo libnmdbus_la_OBJECTS = $(nodist_libnmdbus_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -209,7 +212,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -221,8 +223,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -232,6 +232,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -286,16 +287,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -332,6 +330,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -360,7 +360,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -375,6 +374,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -435,6 +436,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -442,6 +444,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -476,6 +479,8 @@ nodist_libnmdbus_la_SOURCES = \ nmdbus-active-connection.h \ nmdbus-agent-manager.c \ nmdbus-agent-manager.h \ + nmdbus-device-adsl.c \ + nmdbus-device-adsl.h \ nmdbus-device-bond.c \ nmdbus-device-bond.h \ nmdbus-device-bridge.c \ @@ -488,12 +493,18 @@ nodist_libnmdbus_la_SOURCES = \ nmdbus-device.h \ nmdbus-device-generic.c \ nmdbus-device-generic.h \ - nmdbus-device-gre.c \ - nmdbus-device-gre.h \ nmdbus-device-infiniband.c \ nmdbus-device-infiniband.h \ + nmdbus-device-ip-tunnel.c \ + nmdbus-device-ip-tunnel.h \ nmdbus-device-macvlan.c \ nmdbus-device-macvlan.h \ + nmdbus-device-modem.c \ + nmdbus-device-modem.h \ + nmdbus-device-olpc-mesh.c \ + nmdbus-device-olpc-mesh.h \ + nmdbus-device-team.c \ + nmdbus-device-team.h \ nmdbus-device-tun.c \ nmdbus-device-tun.h \ nmdbus-device-veth.c \ @@ -544,8 +555,8 @@ EXTRA_DIST = \ nm-device-bt.xml \ nm-device-ethernet.xml \ nm-device-generic.xml \ - nm-device-gre.xml \ nm-device-infiniband.xml \ + nm-device-ip-tunnel.xml \ nm-device-macvlan.xml \ nm-device-modem.xml \ nm-device-olpc-mesh.xml \ @@ -629,14 +640,18 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmdbus-access-point.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmdbus-active-connection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmdbus-agent-manager.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmdbus-device-adsl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmdbus-device-bond.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmdbus-device-bridge.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmdbus-device-bt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmdbus-device-ethernet.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmdbus-device-generic.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmdbus-device-gre.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmdbus-device-infiniband.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmdbus-device-ip-tunnel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmdbus-device-macvlan.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmdbus-device-modem.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmdbus-device-olpc-mesh.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmdbus-device-team.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmdbus-device-tun.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmdbus-device-veth.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmdbus-device-vlan.Plo@am__quote@ diff --git a/introspection/nm-access-point.xml b/introspection/nm-access-point.xml index ef5af6ab..16eae044 100644 --- a/introspection/nm-access-point.xml +++ b/introspection/nm-access-point.xml @@ -12,6 +12,10 @@ Flags describing the access point's capabilities according to the RSN (Robust Secure Network) protocol. + + The Service Set Identifier identifying the access point. diff --git a/introspection/nm-active-connection.xml b/introspection/nm-active-connection.xml index cbecdfce..4d5d15a1 100644 --- a/introspection/nm-active-connection.xml +++ b/introspection/nm-active-connection.xml @@ -2,6 +2,7 @@ + Objects that implement the Connection.Active interface represent an attempt to connect to a network using the details provided by a Connection object. diff --git a/introspection/nm-agent-manager.xml b/introspection/nm-agent-manager.xml index d1074428..4b53675c 100644 --- a/introspection/nm-agent-manager.xml +++ b/introspection/nm-agent-manager.xml @@ -8,8 +8,6 @@ Called by secret Agents to register their ability to provide and save network secrets. - - Identifies this agent; only one agent in each user session may use the @@ -27,8 +25,6 @@ Like Register() but indicates agent capabilities to NetworkManager. - - See the Register() method's identifier argument. @@ -47,8 +43,6 @@ longer handle requests for network secrets. Agents are automatically unregistered when they disconnect from D-Bus. - - diff --git a/introspection/nm-device-ethernet.xml b/introspection/nm-device-ethernet.xml index 2554bda1..86d68a35 100644 --- a/introspection/nm-device-ethernet.xml +++ b/introspection/nm-device-ethernet.xml @@ -22,6 +22,12 @@ + + + Array of S/390 subchannels for S/390 or z/Architecture devices. + + + Indicates whether the physical carrier is found (e.g. whether a cable is plugged in or not). diff --git a/introspection/nm-device-gre.xml b/introspection/nm-device-gre.xml deleted file mode 100644 index ae418aab..00000000 --- a/introspection/nm-device-gre.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - The object path of the parent device. - - - - - - The expected set of GRE flags for incoming packets. (The - values are specified by the GRE specification. On Linux, they - are defined in <linux/if_tunnel.h>. Eg, GRE_KEY for the - 'Key Present' bit.) - - - - - - The set of GRE flags to use for outgoing packets. (The - values are specified by the GRE specification. On Linux, they - are defined in <linux/if_tunnel.h>. Eg, GRE_KEY for the - 'Key Present' bit.) - - - - - - Expected input key (if the "Key Present" bit is set in the input flags). - - - - - - Output key (if the "Key Present" bit is set in the output flags). - - - - - - The local end of the tunnel. - - - - - - The remote end of the tunnel. - - - - - - The value to use in the IP TTL field for tunnel packets. - - - - - - The value to use in the IP ToS field for tunnel packets. - - - - - - Whether path MTU discovery is performed. - - - - - - - A dictionary mapping property names to variant boxed values - - - - - - diff --git a/introspection/nm-device-ip-tunnel.xml b/introspection/nm-device-ip-tunnel.xml new file mode 100644 index 00000000..fcb42ce2 --- /dev/null +++ b/introspection/nm-device-ip-tunnel.xml @@ -0,0 +1,86 @@ + + + + + + + + The tunneling mode. + + + + + + The object path of the parent device. + + + + + + The local endpoint of the tunnel. + + + + + + The remote endpoint of the tunnel. + + + + + + The TTL assigned to tunneled packets. 0 is a special value + meaning that packets inherit the TTL value + + + + + + The type of service (IPv4) or traffic class (IPv6) assigned to + tunneled packets. + + + + + + Whether path MTU discovery is enabled on this tunnel. + + + + + + The key used for incoming packets. + + + + + + The key used for outgoing packets. + + + + + + How many additional levels of encapsulation are permitted to + be prepended to packets. This property applies only to IPv6 + tunnels. + + + + + + The flow label to assign to tunnel packets. This property + applies only to IPv6 tunnels. + + + + + + + A dictionary mapping property names to variant boxed values + + + + + + diff --git a/introspection/nm-device-macvlan.xml b/introspection/nm-device-macvlan.xml index a387bf56..c4dcb4e6 100644 --- a/introspection/nm-device-macvlan.xml +++ b/introspection/nm-device-macvlan.xml @@ -21,6 +21,12 @@ + + + Whether the device is a macvtap. + + + diff --git a/introspection/nm-device-tun.xml b/introspection/nm-device-tun.xml index 8b0f81fb..2b3ae2f5 100644 --- a/introspection/nm-device-tun.xml +++ b/introspection/nm-device-tun.xml @@ -43,6 +43,12 @@ + + + Hardware address of the device. + + + diff --git a/introspection/nm-device-vxlan.xml b/introspection/nm-device-vxlan.xml index 053eea4d..4dd254a2 100644 --- a/introspection/nm-device-vxlan.xml +++ b/introspection/nm-device-vxlan.xml @@ -10,6 +10,12 @@ + + + Hardware address of the device. + + + The VXLAN Network Identifier (VNI). diff --git a/introspection/nm-device-wifi.xml b/introspection/nm-device-wifi.xml index b94aae84..27f3eb90 100644 --- a/introspection/nm-device-wifi.xml +++ b/introspection/nm-device-wifi.xml @@ -5,7 +5,6 @@ - List of access point object paths. @@ -20,7 +19,6 @@ - List of access point object paths. @@ -33,8 +31,6 @@ - - Options of scan. diff --git a/introspection/nm-device-wimax.xml b/introspection/nm-device-wimax.xml index b48ffe94..3bad6245 100644 --- a/introspection/nm-device-wimax.xml +++ b/introspection/nm-device-wimax.xml @@ -3,7 +3,6 @@ - List of NSP object paths diff --git a/introspection/nm-device.xml b/introspection/nm-device.xml index b2e3827e..2930cf06 100644 --- a/introspection/nm-device.xml +++ b/introspection/nm-device.xml @@ -96,9 +96,13 @@ NM_DEVICE_STATE_ACTIVATED state. - + - Whether or not this device is managed by NetworkManager. + Whether or not this device is managed by NetworkManager. Setting this + property has a similar effect to configuring the device as unmanaged + via the keyfile.unmanaged-devices setting in NetworkManager.conf. + Changes to this value are not persistent and lost after NetworkManager + restart. @@ -116,6 +120,12 @@ its operation. + + + If TRUE, indicates the NetworkManager plugin for the device is likely + missing or misconfigured. + + The general type of the network device; ie Ethernet, WiFi, etc. @@ -145,18 +155,48 @@ subject to limitations, for example set by service providers. + + + Array of LLDP neighbors; each element is a dictionary mapping + LLDP TLV names to variant boxed values. + + + + + True if the device exists, or False for placeholder devices that + do not yet exist but could be automatically created by NetworkManager + if one of their AvailableConnections was activated. + + + + + + + The effective connection settings and properties to use. If empty, the connection + settings from the connection that is active on the device will be used. + + + + + Flags which would modify the behavior of the Reapply call. + There are no flags defined currently and the users should use the value of 0. + + + + Attempts to update the configuration of a device without deactivating it. + You can either modify the configuration by passing the desired setup via "connection" + argument or just omit the argument to bring it in sync with the connection that + has been activated but could have been modified since. + + - - Disconnects a device and prevents the device from automatically activating further connections without user intervention. - - Deletes a software device from NetworkManager and removes the interface from the system. The method returns an error when called for a hardware device. diff --git a/introspection/nm-dhcp4-config.xml b/introspection/nm-dhcp4-config.xml index c0821ada..379c50f9 100644 --- a/introspection/nm-dhcp4-config.xml +++ b/introspection/nm-dhcp4-config.xml @@ -2,6 +2,7 @@ + Options and configuration returned by the IPv4 DHCP server. diff --git a/introspection/nm-dhcp6-config.xml b/introspection/nm-dhcp6-config.xml index 93b0f1c8..df75660a 100644 --- a/introspection/nm-dhcp6-config.xml +++ b/introspection/nm-dhcp6-config.xml @@ -2,6 +2,7 @@ + Options and configuration returned by the IPv6 DHCP server. diff --git a/introspection/nm-ip4-config.xml b/introspection/nm-ip4-config.xml index 98076534..5a9e8ea1 100644 --- a/introspection/nm-ip4-config.xml +++ b/introspection/nm-ip4-config.xml @@ -49,6 +49,13 @@ A list of dns searches. + + + A list of DNS options that modify the behavior of the DNS + resolver. See resolv.conf(5) manual page for the list of + supported options. + + The Windows Internet Name Service servers associated with the connection. Each address is in network byte order. diff --git a/introspection/nm-ip6-config.xml b/introspection/nm-ip6-config.xml index 985dd2e3..1a107bf2 100644 --- a/introspection/nm-ip6-config.xml +++ b/introspection/nm-ip6-config.xml @@ -35,6 +35,10 @@ + + The nameservers in use. @@ -43,6 +47,13 @@ A list of dns searches. + + + A list of DNS options that modify the behavior of the DNS + resolver. See resolv.conf(5) manual page for the list of + supported options. + + diff --git a/introspection/nm-manager.xml b/introspection/nm-manager.xml index db68214d..dd6fc4bd 100644 --- a/introspection/nm-manager.xml +++ b/introspection/nm-manager.xml @@ -6,12 +6,27 @@ - Get the list of network devices. + Get the list of realized network devices. - - List of object paths of network devices known to the system. + List of object paths of network devices known to the system. This + list does not include device placeholders (see GetAllDevices()). + + + + + + + Get the list of all network devices. + + + + + List of object paths of network devices and device placeholders + (eg, devices that do not yet exist but which can be automatically + created by NetworkManager if one of their AvailableConnections + was activated). @@ -22,7 +37,6 @@ interface name. Note that some devices (usually modems) only have an IP interface name when they are connected. - Interface name of the device to find. @@ -36,8 +50,6 @@ - - Activate a connection using the supplied device. @@ -76,8 +88,6 @@ - - Adds a new connection using the given details (if any) as a template (automatically filling in missing settings with the capabilities of the @@ -121,8 +131,6 @@ Deactivate an active connection. - - The currently active connection to deactivate. @@ -131,8 +139,6 @@ - - Control the NetworkManager daemon's sleep state. When asleep, all interfaces that it manages are deactivated. When awake, devices are @@ -147,8 +153,6 @@ - - Control whether overall networking is enabled or disabled. When disabled, all interfaces that NM manages are deactivated. When enabled, @@ -165,8 +169,6 @@ - - Returns the permissions a caller has for various authenticated operations that NetworkManager provides, like Enable/Disable networking, changing @@ -193,14 +195,18 @@ - - Set logging verbosity and which operations are logged. - One of [ERR, WARN, INFO, DEBUG, TRACE]. + One of [ERR, WARN, INFO, DEBUG, TRACE, OFF, KEEP]. + This level is applied to the domains as specified in the domains + argument. Except for the special level "KEEP", all unmentioned + domains are disabled entirely. "KEEP" is special and allows + not to change the current setting except for the specified + domains. E.g. level=KEEP and domains=PLATFORM:DEBUG will only + touch the platform domain. @@ -223,7 +229,6 @@ - Get current logging verbosity level and operations domains. @@ -240,8 +245,6 @@ - - Re-check the network connectivity state. @@ -257,13 +260,23 @@ The overall networking state as determined by the NetworkManager daemon, based on the state of network devices under it's management. - - The list of network devices/interfaces NetworkManager knows about. + The list of realized network devices. Realized devices are those which + have backing resources (eg from the kernel or a management daemon like + ModemManager, teamd, etc). + + + + + + The list of both realized and un-realized network devices. Un-realized + devices are software devices which do not yet have backing resources, + but for which backing resources can be created if the device is + activated. @@ -337,8 +350,8 @@ - Wheter the connectivity is metered. This is equivalent to the - metered property of the device associated with the primary + Indicates whether the connectivity is metered. This is equivalent + to the metered property of the device associated with the primary connection. @@ -388,6 +401,20 @@ + + + Dictionary of global DNS settings where the key is one of + "searches", "options" and "domains". The values for the + "searches" and "options" keys are string arrays describing the + list of search domains and resolver options, respectively. + The value of the "domains" key is a second-level dictionary, + where each key is a domain name, and each key's value is a + third-level dictionary with the keys "servers" and + "options". "servers" is a string array of DNS servers, + "options" is a string array of domain-specific options. + + + NetworkManager's properties changed. diff --git a/introspection/nm-ppp-manager.xml b/introspection/nm-ppp-manager.xml index 5ea1e8b1..e4c6a2c8 100644 --- a/introspection/nm-ppp-manager.xml +++ b/introspection/nm-ppp-manager.xml @@ -5,24 +5,19 @@ - - - - - diff --git a/introspection/nm-settings-connection.xml b/introspection/nm-settings-connection.xml index b02762d6..2d919619 100644 --- a/introspection/nm-settings-connection.xml +++ b/introspection/nm-settings-connection.xml @@ -15,8 +15,6 @@ stored in persistent storage or sent to a Secret Agent for storage, depending on the flags associated with each secret. - - New connection settings, properties, and (optionally) secrets. @@ -37,8 +35,6 @@ reloaded from disk (either automatically on file change or due to an explicit ReloadConnections call). - - New connection settings, properties, and (optionally) secrets. @@ -50,8 +46,6 @@ Delete the connection. - - @@ -61,8 +55,6 @@ to the network, as those are often protected. Secrets must be requested separately using the GetSecrets() call. - - The nested settings maps describing this object. @@ -77,8 +69,6 @@ the requestor's session will be returned. The user will never be prompted for secrets as a result of this request. - - Name of the setting to return secrets for. If empty, all @@ -97,8 +87,6 @@ Clear the secrets belonging to this network connection profile. - - @@ -106,8 +94,6 @@ Saves a "dirty" connection (that had previously been updated with UpdateUnsaved) to persistent storage. - - diff --git a/introspection/nm-settings.xml b/introspection/nm-settings.xml index 3a71959c..b6ab8260 100644 --- a/introspection/nm-settings.xml +++ b/introspection/nm-settings.xml @@ -10,7 +10,6 @@ List the saved network connections known to NetworkManager. - List of connections. @@ -22,8 +21,6 @@ Retrieve the object path of a connection, given that connection's UUID. - - The UUID to find the connection object path for. @@ -43,8 +40,6 @@ the network described by the new connection, and (2) the connection is allowed to be started automatically. - - Connection settings and properties. @@ -69,8 +64,6 @@ connection is reloaded from disk (either automatically on file change or due to an explicit ReloadConnections call). - - Connection settings and properties. @@ -93,8 +86,6 @@ harmless.) As with AddConnection(), this operation does not necessarily start the network connection. - - Array of paths to on-disk connection profiles in directories @@ -125,8 +116,6 @@ change, so you only need to use this command if you have set "monitor-connection-files=false" in NetworkManager.conf. - - Success or failure. @@ -138,8 +127,6 @@ Save the hostname to persistent configuration. - - The hostname to save to persistent configuration. If blank, the persistent hostname is cleared. diff --git a/libnm-core/Makefile.am b/libnm-core/Makefile.am index d76a48da..527a1c24 100644 --- a/libnm-core/Makefile.am +++ b/libnm-core/Makefile.am @@ -3,11 +3,13 @@ include $(GLIB_MAKEFILE) SUBDIRS = . tests AM_CPPFLAGS = \ - -I${top_srcdir}/include \ - -I${top_builddir}/include \ + -I${top_srcdir}/shared \ + -I${top_builddir}/shared \ -DG_LOG_DOMAIN=\""libnm"\" \ -DLOCALEDIR=\"$(datadir)/locale\" \ - -DNETWORKMANAGER_COMPILATION \ + -DNMCONFDIR=\"$(nmconfdir)\" \ + -DNMLIBDIR=\"$(nmlibdir)\" \ + -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB \ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ $(GLIB_CFLAGS) @@ -34,9 +36,9 @@ libnm_core_la_LIBADD = \ $(UUID_LIBS) if WITH_GNUTLS -AM_CPPFLAGS += $(LIBGCRYPT_CFLAGS) $(GNUTLS_CFLAGS) +AM_CPPFLAGS += $(GNUTLS_CFLAGS) libnm_core_la_SOURCES += crypto_gnutls.c -libnm_core_la_LIBADD += $(LIBGCRYPT_LIBS) $(GNUTLS_LIBS) +libnm_core_la_LIBADD += $(GNUTLS_LIBS) endif if WITH_NSS diff --git a/libnm-core/Makefile.in b/libnm-core/Makefile.in index f4b6bcd0..7ca647e2 100644 --- a/libnm-core/Makefile.in +++ b/libnm-core/Makefile.in @@ -93,9 +93,9 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@WITH_GNUTLS_TRUE@am__append_1 = $(LIBGCRYPT_CFLAGS) $(GNUTLS_CFLAGS) +@WITH_GNUTLS_TRUE@am__append_1 = $(GNUTLS_CFLAGS) @WITH_GNUTLS_TRUE@am__append_2 = crypto_gnutls.c -@WITH_GNUTLS_TRUE@am__append_3 = $(LIBGCRYPT_LIBS) $(GNUTLS_LIBS) +@WITH_GNUTLS_TRUE@am__append_3 = $(GNUTLS_LIBS) @WITH_NSS_TRUE@am__append_4 = $(NSS_CFLAGS) @WITH_NSS_TRUE@am__append_5 = crypto_nss.c @WITH_NSS_TRUE@am__append_6 = $(NSS_LIBS) @@ -124,14 +124,14 @@ CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = -@WITH_GNUTLS_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) \ -@WITH_GNUTLS_TRUE@ $(am__DEPENDENCIES_1) +@WITH_GNUTLS_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) @WITH_NSS_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) libnm_core_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ $(am__DEPENDENCIES_3) am__libnm_core_la_SOURCES_DIST = $(core_build)/nm-core-enum-types.c \ - $(core)/crypto.c $(core)/nm-connection.c $(core)/nm-errors.c \ + $(core)/crypto.c $(core)/nm-connection.c \ + $(core)/nm-dbus-utils.c $(core)/nm-errors.c \ $(core)/nm-keyfile-reader.c $(core)/nm-keyfile-utils.c \ $(core)/nm-keyfile-writer.c $(core)/nm-property-compare.c \ $(core)/nm-setting-8021x.c $(core)/nm-setting-adsl.c \ @@ -140,37 +140,42 @@ am__libnm_core_la_SOURCES_DIST = $(core_build)/nm-core-enum-types.c \ $(core)/nm-setting-cdma.c $(core)/nm-setting-connection.c \ $(core)/nm-setting-dcb.c $(core)/nm-setting-generic.c \ $(core)/nm-setting-gsm.c $(core)/nm-setting-infiniband.c \ - $(core)/nm-setting-ip-config.c $(core)/nm-setting-ip4-config.c \ - $(core)/nm-setting-ip6-config.c $(core)/nm-setting-olpc-mesh.c \ - $(core)/nm-setting-ppp.c $(core)/nm-setting-pppoe.c \ - $(core)/nm-setting-serial.c $(core)/nm-setting-team-port.c \ - $(core)/nm-setting-team.c $(core)/nm-setting-vlan.c \ - $(core)/nm-setting-vpn.c $(core)/nm-setting-wimax.c \ - $(core)/nm-setting-wired.c \ + $(core)/nm-setting-ip-config.c $(core)/nm-setting-ip-tunnel.c \ + $(core)/nm-setting-ip4-config.c \ + $(core)/nm-setting-ip6-config.c $(core)/nm-setting-macvlan.c \ + $(core)/nm-setting-olpc-mesh.c $(core)/nm-setting-ppp.c \ + $(core)/nm-setting-pppoe.c $(core)/nm-setting-serial.c \ + $(core)/nm-setting-team-port.c $(core)/nm-setting-team.c \ + $(core)/nm-setting-tun.c $(core)/nm-setting-vlan.c \ + $(core)/nm-setting-vpn.c $(core)/nm-setting-vxlan.c \ + $(core)/nm-setting-wimax.c $(core)/nm-setting-wired.c \ $(core)/nm-setting-wireless-security.c \ $(core)/nm-setting-wireless.c $(core)/nm-setting.c \ $(core)/nm-simple-connection.c $(core)/nm-utils.c \ + $(core)/nm-vpn-editor-plugin.c $(core)/nm-vpn-plugin-info.c \ $(core)/crypto.h $(core)/nm-connection-private.h \ - $(core)/nm-core-internal.h $(core)/nm-keyfile-internal.h \ - $(core)/nm-keyfile-utils.h $(core)/nm-property-compare.h \ - $(core)/nm-setting-private.h $(core)/nm-utils-private.h \ - crypto_gnutls.c crypto_nss.c + $(core)/nm-core-internal.h $(core)/nm-core-types-internal.h \ + $(core)/nm-keyfile-internal.h $(core)/nm-keyfile-utils.h \ + $(core)/nm-property-compare.h $(core)/nm-setting-private.h \ + $(core)/nm-utils-private.h crypto_gnutls.c crypto_nss.c am__objects_1 = nm-core-enum-types.lo crypto.lo nm-connection.lo \ - nm-errors.lo nm-keyfile-reader.lo nm-keyfile-utils.lo \ - nm-keyfile-writer.lo nm-property-compare.lo \ - nm-setting-8021x.lo nm-setting-adsl.lo nm-setting-bluetooth.lo \ - nm-setting-bond.lo nm-setting-bridge-port.lo \ - nm-setting-bridge.lo nm-setting-cdma.lo \ - nm-setting-connection.lo nm-setting-dcb.lo \ + nm-dbus-utils.lo nm-errors.lo nm-keyfile-reader.lo \ + nm-keyfile-utils.lo nm-keyfile-writer.lo \ + nm-property-compare.lo nm-setting-8021x.lo nm-setting-adsl.lo \ + nm-setting-bluetooth.lo nm-setting-bond.lo \ + nm-setting-bridge-port.lo nm-setting-bridge.lo \ + nm-setting-cdma.lo nm-setting-connection.lo nm-setting-dcb.lo \ nm-setting-generic.lo nm-setting-gsm.lo \ nm-setting-infiniband.lo nm-setting-ip-config.lo \ - nm-setting-ip4-config.lo nm-setting-ip6-config.lo \ + nm-setting-ip-tunnel.lo nm-setting-ip4-config.lo \ + nm-setting-ip6-config.lo nm-setting-macvlan.lo \ nm-setting-olpc-mesh.lo nm-setting-ppp.lo nm-setting-pppoe.lo \ nm-setting-serial.lo nm-setting-team-port.lo \ - nm-setting-team.lo nm-setting-vlan.lo nm-setting-vpn.lo \ - nm-setting-wimax.lo nm-setting-wired.lo \ - nm-setting-wireless-security.lo nm-setting-wireless.lo \ - nm-setting.lo nm-simple-connection.lo nm-utils.lo + nm-setting-team.lo nm-setting-tun.lo nm-setting-vlan.lo \ + nm-setting-vpn.lo nm-setting-vxlan.lo nm-setting-wimax.lo \ + nm-setting-wired.lo nm-setting-wireless-security.lo \ + nm-setting-wireless.lo nm-setting.lo nm-simple-connection.lo \ + nm-utils.lo nm-vpn-editor-plugin.lo nm-vpn-plugin-info.lo am__objects_2 = @WITH_GNUTLS_TRUE@am__objects_3 = crypto_gnutls.lo @WITH_NSS_TRUE@am__objects_4 = crypto_nss.lo @@ -330,7 +335,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -342,8 +346,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -353,6 +355,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -407,16 +410,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -453,6 +453,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -481,7 +483,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -496,6 +497,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -556,6 +559,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -563,6 +567,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -579,16 +584,17 @@ with_netconfig = @with_netconfig@ with_resolvconf = @with_resolvconf@ with_valgrind = @with_valgrind@ SUBDIRS = . tests -AM_CPPFLAGS = -I${top_srcdir}/include -I${top_builddir}/include \ +AM_CPPFLAGS = -I${top_srcdir}/shared -I${top_builddir}/shared \ -DG_LOG_DOMAIN=\""libnm"\" -DLOCALEDIR=\"$(datadir)/locale\" \ - -DNETWORKMANAGER_COMPILATION \ + -DNMCONFDIR=\"$(nmconfdir)\" -DNMLIBDIR=\"$(nmlibdir)\" \ + -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB \ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE $(GLIB_CFLAGS) \ $(am__append_1) $(am__append_4) noinst_LTLIBRARIES = libnm-core.la core = $(top_srcdir)/libnm-core core_build = $(top_builddir)/libnm-core libnm_core_headers = \ - $(top_builddir)/include/nm-version-macros.h \ + $(top_builddir)/shared/nm-version-macros.h \ $(core_build)/nm-core-enum-types.h \ $(core)/nm-connection.h \ $(core)/nm-core-types.h \ @@ -607,16 +613,20 @@ libnm_core_headers = \ $(core)/nm-setting-gsm.h \ $(core)/nm-setting-infiniband.h \ $(core)/nm-setting-ip-config.h \ + $(core)/nm-setting-ip-tunnel.h \ $(core)/nm-setting-ip4-config.h \ $(core)/nm-setting-ip6-config.h \ + $(core)/nm-setting-macvlan.h \ $(core)/nm-setting-olpc-mesh.h \ $(core)/nm-setting-ppp.h \ $(core)/nm-setting-pppoe.h \ $(core)/nm-setting-serial.h \ $(core)/nm-setting-team-port.h \ $(core)/nm-setting-team.h \ + $(core)/nm-setting-tun.h \ $(core)/nm-setting-vlan.h \ $(core)/nm-setting-vpn.h \ + $(core)/nm-setting-vxlan.h \ $(core)/nm-setting-wimax.h \ $(core)/nm-setting-wired.h \ $(core)/nm-setting-wireless-security.h \ @@ -625,12 +635,15 @@ libnm_core_headers = \ $(core)/nm-simple-connection.h \ $(core)/nm-utils.h \ $(core)/nm-version.h \ - $(core)/nm-vpn-dbus-interface.h + $(core)/nm-vpn-dbus-interface.h \ + $(core)/nm-vpn-editor-plugin.h \ + $(core)/nm-vpn-plugin-info.h libnm_core_private_headers = \ $(core)/crypto.h \ $(core)/nm-connection-private.h \ $(core)/nm-core-internal.h \ + $(core)/nm-core-types-internal.h \ $(core)/nm-keyfile-internal.h \ $(core)/nm-keyfile-utils.h \ $(core)/nm-property-compare.h \ @@ -641,6 +654,7 @@ libnm_core_sources = \ $(core_build)/nm-core-enum-types.c \ $(core)/crypto.c \ $(core)/nm-connection.c \ + $(core)/nm-dbus-utils.c \ $(core)/nm-errors.c \ $(core)/nm-keyfile-reader.c \ $(core)/nm-keyfile-utils.c \ @@ -659,23 +673,29 @@ libnm_core_sources = \ $(core)/nm-setting-gsm.c \ $(core)/nm-setting-infiniband.c \ $(core)/nm-setting-ip-config.c \ + $(core)/nm-setting-ip-tunnel.c \ $(core)/nm-setting-ip4-config.c \ $(core)/nm-setting-ip6-config.c \ + $(core)/nm-setting-macvlan.c \ $(core)/nm-setting-olpc-mesh.c \ $(core)/nm-setting-ppp.c \ $(core)/nm-setting-pppoe.c \ $(core)/nm-setting-serial.c \ $(core)/nm-setting-team-port.c \ $(core)/nm-setting-team.c \ + $(core)/nm-setting-tun.c \ $(core)/nm-setting-vlan.c \ $(core)/nm-setting-vpn.c \ + $(core)/nm-setting-vxlan.c \ $(core)/nm-setting-wimax.c \ $(core)/nm-setting-wired.c \ $(core)/nm-setting-wireless-security.c \ $(core)/nm-setting-wireless.c \ $(core)/nm-setting.c \ $(core)/nm-simple-connection.c \ - $(core)/nm-utils.c + $(core)/nm-utils.c \ + $(core)/nm-vpn-editor-plugin.c \ + $(core)/nm-vpn-plugin-info.c # header/source defines are in Makefile.libnm-core, so they can be shared @@ -753,6 +773,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crypto_nss.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-connection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-core-enum-types.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-dbus-utils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-errors.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-keyfile-reader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-keyfile-utils.Plo@am__quote@ @@ -771,16 +792,20 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-setting-gsm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-setting-infiniband.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-setting-ip-config.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-setting-ip-tunnel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-setting-ip4-config.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-setting-ip6-config.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-setting-macvlan.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-setting-olpc-mesh.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-setting-ppp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-setting-pppoe.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-setting-serial.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-setting-team-port.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-setting-team.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-setting-tun.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-setting-vlan.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-setting-vpn.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-setting-vxlan.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-setting-wimax.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-setting-wired.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-setting-wireless-security.Plo@am__quote@ @@ -788,6 +813,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-setting.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-simple-connection.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-utils.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-vpn-editor-plugin.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-vpn-plugin-info.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -831,6 +858,13 @@ nm-connection.lo: $(core)/nm-connection.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nm-connection.lo `test -f '$(core)/nm-connection.c' || echo '$(srcdir)/'`$(core)/nm-connection.c +nm-dbus-utils.lo: $(core)/nm-dbus-utils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nm-dbus-utils.lo -MD -MP -MF $(DEPDIR)/nm-dbus-utils.Tpo -c -o nm-dbus-utils.lo `test -f '$(core)/nm-dbus-utils.c' || echo '$(srcdir)/'`$(core)/nm-dbus-utils.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nm-dbus-utils.Tpo $(DEPDIR)/nm-dbus-utils.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(core)/nm-dbus-utils.c' object='nm-dbus-utils.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nm-dbus-utils.lo `test -f '$(core)/nm-dbus-utils.c' || echo '$(srcdir)/'`$(core)/nm-dbus-utils.c + nm-errors.lo: $(core)/nm-errors.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nm-errors.lo -MD -MP -MF $(DEPDIR)/nm-errors.Tpo -c -o nm-errors.lo `test -f '$(core)/nm-errors.c' || echo '$(srcdir)/'`$(core)/nm-errors.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nm-errors.Tpo $(DEPDIR)/nm-errors.Plo @@ -957,6 +991,13 @@ nm-setting-ip-config.lo: $(core)/nm-setting-ip-config.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nm-setting-ip-config.lo `test -f '$(core)/nm-setting-ip-config.c' || echo '$(srcdir)/'`$(core)/nm-setting-ip-config.c +nm-setting-ip-tunnel.lo: $(core)/nm-setting-ip-tunnel.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nm-setting-ip-tunnel.lo -MD -MP -MF $(DEPDIR)/nm-setting-ip-tunnel.Tpo -c -o nm-setting-ip-tunnel.lo `test -f '$(core)/nm-setting-ip-tunnel.c' || echo '$(srcdir)/'`$(core)/nm-setting-ip-tunnel.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nm-setting-ip-tunnel.Tpo $(DEPDIR)/nm-setting-ip-tunnel.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(core)/nm-setting-ip-tunnel.c' object='nm-setting-ip-tunnel.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nm-setting-ip-tunnel.lo `test -f '$(core)/nm-setting-ip-tunnel.c' || echo '$(srcdir)/'`$(core)/nm-setting-ip-tunnel.c + nm-setting-ip4-config.lo: $(core)/nm-setting-ip4-config.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nm-setting-ip4-config.lo -MD -MP -MF $(DEPDIR)/nm-setting-ip4-config.Tpo -c -o nm-setting-ip4-config.lo `test -f '$(core)/nm-setting-ip4-config.c' || echo '$(srcdir)/'`$(core)/nm-setting-ip4-config.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nm-setting-ip4-config.Tpo $(DEPDIR)/nm-setting-ip4-config.Plo @@ -971,6 +1012,13 @@ nm-setting-ip6-config.lo: $(core)/nm-setting-ip6-config.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nm-setting-ip6-config.lo `test -f '$(core)/nm-setting-ip6-config.c' || echo '$(srcdir)/'`$(core)/nm-setting-ip6-config.c +nm-setting-macvlan.lo: $(core)/nm-setting-macvlan.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nm-setting-macvlan.lo -MD -MP -MF $(DEPDIR)/nm-setting-macvlan.Tpo -c -o nm-setting-macvlan.lo `test -f '$(core)/nm-setting-macvlan.c' || echo '$(srcdir)/'`$(core)/nm-setting-macvlan.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nm-setting-macvlan.Tpo $(DEPDIR)/nm-setting-macvlan.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(core)/nm-setting-macvlan.c' object='nm-setting-macvlan.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nm-setting-macvlan.lo `test -f '$(core)/nm-setting-macvlan.c' || echo '$(srcdir)/'`$(core)/nm-setting-macvlan.c + nm-setting-olpc-mesh.lo: $(core)/nm-setting-olpc-mesh.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nm-setting-olpc-mesh.lo -MD -MP -MF $(DEPDIR)/nm-setting-olpc-mesh.Tpo -c -o nm-setting-olpc-mesh.lo `test -f '$(core)/nm-setting-olpc-mesh.c' || echo '$(srcdir)/'`$(core)/nm-setting-olpc-mesh.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nm-setting-olpc-mesh.Tpo $(DEPDIR)/nm-setting-olpc-mesh.Plo @@ -1013,6 +1061,13 @@ nm-setting-team.lo: $(core)/nm-setting-team.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nm-setting-team.lo `test -f '$(core)/nm-setting-team.c' || echo '$(srcdir)/'`$(core)/nm-setting-team.c +nm-setting-tun.lo: $(core)/nm-setting-tun.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nm-setting-tun.lo -MD -MP -MF $(DEPDIR)/nm-setting-tun.Tpo -c -o nm-setting-tun.lo `test -f '$(core)/nm-setting-tun.c' || echo '$(srcdir)/'`$(core)/nm-setting-tun.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nm-setting-tun.Tpo $(DEPDIR)/nm-setting-tun.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(core)/nm-setting-tun.c' object='nm-setting-tun.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nm-setting-tun.lo `test -f '$(core)/nm-setting-tun.c' || echo '$(srcdir)/'`$(core)/nm-setting-tun.c + nm-setting-vlan.lo: $(core)/nm-setting-vlan.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nm-setting-vlan.lo -MD -MP -MF $(DEPDIR)/nm-setting-vlan.Tpo -c -o nm-setting-vlan.lo `test -f '$(core)/nm-setting-vlan.c' || echo '$(srcdir)/'`$(core)/nm-setting-vlan.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nm-setting-vlan.Tpo $(DEPDIR)/nm-setting-vlan.Plo @@ -1027,6 +1082,13 @@ nm-setting-vpn.lo: $(core)/nm-setting-vpn.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nm-setting-vpn.lo `test -f '$(core)/nm-setting-vpn.c' || echo '$(srcdir)/'`$(core)/nm-setting-vpn.c +nm-setting-vxlan.lo: $(core)/nm-setting-vxlan.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nm-setting-vxlan.lo -MD -MP -MF $(DEPDIR)/nm-setting-vxlan.Tpo -c -o nm-setting-vxlan.lo `test -f '$(core)/nm-setting-vxlan.c' || echo '$(srcdir)/'`$(core)/nm-setting-vxlan.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nm-setting-vxlan.Tpo $(DEPDIR)/nm-setting-vxlan.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(core)/nm-setting-vxlan.c' object='nm-setting-vxlan.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nm-setting-vxlan.lo `test -f '$(core)/nm-setting-vxlan.c' || echo '$(srcdir)/'`$(core)/nm-setting-vxlan.c + nm-setting-wimax.lo: $(core)/nm-setting-wimax.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nm-setting-wimax.lo -MD -MP -MF $(DEPDIR)/nm-setting-wimax.Tpo -c -o nm-setting-wimax.lo `test -f '$(core)/nm-setting-wimax.c' || echo '$(srcdir)/'`$(core)/nm-setting-wimax.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nm-setting-wimax.Tpo $(DEPDIR)/nm-setting-wimax.Plo @@ -1076,6 +1138,20 @@ nm-utils.lo: $(core)/nm-utils.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nm-utils.lo `test -f '$(core)/nm-utils.c' || echo '$(srcdir)/'`$(core)/nm-utils.c +nm-vpn-editor-plugin.lo: $(core)/nm-vpn-editor-plugin.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nm-vpn-editor-plugin.lo -MD -MP -MF $(DEPDIR)/nm-vpn-editor-plugin.Tpo -c -o nm-vpn-editor-plugin.lo `test -f '$(core)/nm-vpn-editor-plugin.c' || echo '$(srcdir)/'`$(core)/nm-vpn-editor-plugin.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nm-vpn-editor-plugin.Tpo $(DEPDIR)/nm-vpn-editor-plugin.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(core)/nm-vpn-editor-plugin.c' object='nm-vpn-editor-plugin.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nm-vpn-editor-plugin.lo `test -f '$(core)/nm-vpn-editor-plugin.c' || echo '$(srcdir)/'`$(core)/nm-vpn-editor-plugin.c + +nm-vpn-plugin-info.lo: $(core)/nm-vpn-plugin-info.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nm-vpn-plugin-info.lo -MD -MP -MF $(DEPDIR)/nm-vpn-plugin-info.Tpo -c -o nm-vpn-plugin-info.lo `test -f '$(core)/nm-vpn-plugin-info.c' || echo '$(srcdir)/'`$(core)/nm-vpn-plugin-info.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nm-vpn-plugin-info.Tpo $(DEPDIR)/nm-vpn-plugin-info.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(core)/nm-vpn-plugin-info.c' object='nm-vpn-plugin-info.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nm-vpn-plugin-info.lo `test -f '$(core)/nm-vpn-plugin-info.c' || echo '$(srcdir)/'`$(core)/nm-vpn-plugin-info.c + mostlyclean-libtool: -rm -f *.lo diff --git a/libnm-core/Makefile.libnm-core b/libnm-core/Makefile.libnm-core index 0b606f32..fe8cc8a6 100644 --- a/libnm-core/Makefile.libnm-core +++ b/libnm-core/Makefile.libnm-core @@ -6,7 +6,7 @@ core = $(top_srcdir)/libnm-core core_build = $(top_builddir)/libnm-core libnm_core_headers = \ - $(top_builddir)/include/nm-version-macros.h \ + $(top_builddir)/shared/nm-version-macros.h \ $(core_build)/nm-core-enum-types.h \ $(core)/nm-connection.h \ $(core)/nm-core-types.h \ @@ -25,16 +25,20 @@ libnm_core_headers = \ $(core)/nm-setting-gsm.h \ $(core)/nm-setting-infiniband.h \ $(core)/nm-setting-ip-config.h \ + $(core)/nm-setting-ip-tunnel.h \ $(core)/nm-setting-ip4-config.h \ $(core)/nm-setting-ip6-config.h \ + $(core)/nm-setting-macvlan.h \ $(core)/nm-setting-olpc-mesh.h \ $(core)/nm-setting-ppp.h \ $(core)/nm-setting-pppoe.h \ $(core)/nm-setting-serial.h \ $(core)/nm-setting-team-port.h \ $(core)/nm-setting-team.h \ + $(core)/nm-setting-tun.h \ $(core)/nm-setting-vlan.h \ $(core)/nm-setting-vpn.h \ + $(core)/nm-setting-vxlan.h \ $(core)/nm-setting-wimax.h \ $(core)/nm-setting-wired.h \ $(core)/nm-setting-wireless-security.h \ @@ -43,12 +47,15 @@ libnm_core_headers = \ $(core)/nm-simple-connection.h \ $(core)/nm-utils.h \ $(core)/nm-version.h \ - $(core)/nm-vpn-dbus-interface.h + $(core)/nm-vpn-dbus-interface.h \ + $(core)/nm-vpn-editor-plugin.h \ + $(core)/nm-vpn-plugin-info.h libnm_core_private_headers = \ $(core)/crypto.h \ $(core)/nm-connection-private.h \ $(core)/nm-core-internal.h \ + $(core)/nm-core-types-internal.h \ $(core)/nm-keyfile-internal.h \ $(core)/nm-keyfile-utils.h \ $(core)/nm-property-compare.h \ @@ -59,6 +66,7 @@ libnm_core_sources = \ $(core_build)/nm-core-enum-types.c \ $(core)/crypto.c \ $(core)/nm-connection.c \ + $(core)/nm-dbus-utils.c \ $(core)/nm-errors.c \ $(core)/nm-keyfile-reader.c \ $(core)/nm-keyfile-utils.c \ @@ -77,21 +85,27 @@ libnm_core_sources = \ $(core)/nm-setting-gsm.c \ $(core)/nm-setting-infiniband.c \ $(core)/nm-setting-ip-config.c \ + $(core)/nm-setting-ip-tunnel.c \ $(core)/nm-setting-ip4-config.c \ $(core)/nm-setting-ip6-config.c \ + $(core)/nm-setting-macvlan.c \ $(core)/nm-setting-olpc-mesh.c \ $(core)/nm-setting-ppp.c \ $(core)/nm-setting-pppoe.c \ $(core)/nm-setting-serial.c \ $(core)/nm-setting-team-port.c \ $(core)/nm-setting-team.c \ + $(core)/nm-setting-tun.c \ $(core)/nm-setting-vlan.c \ $(core)/nm-setting-vpn.c \ + $(core)/nm-setting-vxlan.c \ $(core)/nm-setting-wimax.c \ $(core)/nm-setting-wired.c \ $(core)/nm-setting-wireless-security.c \ $(core)/nm-setting-wireless.c \ $(core)/nm-setting.c \ $(core)/nm-simple-connection.c \ - $(core)/nm-utils.c + $(core)/nm-utils.c \ + $(core)/nm-vpn-editor-plugin.c \ + $(core)/nm-vpn-plugin-info.c diff --git a/libnm-core/crypto.c b/libnm-core/crypto.c index 205d22c6..559ac52b 100644 --- a/libnm-core/crypto.c +++ b/libnm-core/crypto.c @@ -23,13 +23,12 @@ #include "config.h" -#include #include #include #include #include -#include +#include "nm-default.h" #include "crypto.h" #include "nm-errors.h" diff --git a/libnm-core/crypto.h b/libnm-core/crypto.h index 434f108d..c77ada5a 100644 --- a/libnm-core/crypto.h +++ b/libnm-core/crypto.h @@ -24,7 +24,7 @@ #ifndef __CRYPTO_H__ #define __CRYPTO_H__ -#include +#include "nm-default.h" #define MD5_HASH_LEN 20 #define CIPHER_DES_EDE3_CBC "DES-EDE3-CBC" diff --git a/libnm-core/crypto_gnutls.c b/libnm-core/crypto_gnutls.c index 96dddb90..3f90c77d 100644 --- a/libnm-core/crypto_gnutls.c +++ b/libnm-core/crypto_gnutls.c @@ -18,19 +18,17 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright 2007 - 2009 Red Hat, Inc. + * Copyright 2007 - 2015 Red Hat, Inc. */ #include "config.h" -#include -#include - -#include #include +#include #include #include +#include "nm-default.h" #include "crypto.h" #include "nm-errors.h" @@ -68,8 +66,9 @@ crypto_decrypt (const char *cipher, gsize *out_len, GError **error) { - gcry_cipher_hd_t ctx; - gcry_error_t err; + gnutls_cipher_hd_t ctx; + gnutls_datum_t key_dt, iv_dt; + int err; int cipher_mech, i; char *output = NULL; gboolean success = FALSE; @@ -79,13 +78,13 @@ crypto_decrypt (const char *cipher, return NULL; if (!strcmp (cipher, CIPHER_DES_EDE3_CBC)) { - cipher_mech = GCRY_CIPHER_3DES; + cipher_mech = GNUTLS_CIPHER_3DES_CBC; real_iv_len = SALT_LEN; } else if (!strcmp (cipher, CIPHER_DES_CBC)) { - cipher_mech = GCRY_CIPHER_DES; + cipher_mech = GNUTLS_CIPHER_DES_CBC; real_iv_len = SALT_LEN; } else if (!strcmp (cipher, CIPHER_AES_CBC)) { - cipher_mech = GCRY_CIPHER_AES; + cipher_mech = GNUTLS_CIPHER_AES_128_CBC; real_iv_len = 16; } else { g_set_error (error, NM_CRYPTO_ERROR, @@ -105,39 +104,26 @@ crypto_decrypt (const char *cipher, output = g_malloc0 (data_len); - err = gcry_cipher_open (&ctx, cipher_mech, GCRY_CIPHER_MODE_CBC, 0); - if (err) { - g_set_error (error, NM_CRYPTO_ERROR, - NM_CRYPTO_ERROR_DECRYPTION_FAILED, - _("Failed to initialize the decryption cipher context: %s / %s."), - gcry_strsource (err), gcry_strerror (err)); - goto out; - } + key_dt.data = (unsigned char *) key; + key_dt.size = key_len; + iv_dt.data = (unsigned char *) iv; + iv_dt.size = iv_len; - err = gcry_cipher_setkey (ctx, key, key_len); - if (err) { - g_set_error (error, NM_CRYPTO_ERROR, - NM_CRYPTO_ERROR_DECRYPTION_FAILED, - _("Failed to set symmetric key for decryption: %s / %s."), - gcry_strsource (err), gcry_strerror (err)); - goto out; - } - - err = gcry_cipher_setiv (ctx, iv, iv_len); - if (err) { + err = gnutls_cipher_init (&ctx, cipher_mech, &key_dt, &iv_dt); + if (err < 0) { g_set_error (error, NM_CRYPTO_ERROR, NM_CRYPTO_ERROR_DECRYPTION_FAILED, - _("Failed to set IV for decryption: %s / %s."), - gcry_strsource (err), gcry_strerror (err)); + _("Failed to initialize the decryption cipher context: %s (%s)"), + gnutls_strerror_name (err), gnutls_strerror (err)); goto out; } - err = gcry_cipher_decrypt (ctx, output, data_len, data, data_len); - if (err) { + err = gnutls_cipher_decrypt2 (ctx, data, data_len, output, data_len); + if (err < 0) { g_set_error (error, NM_CRYPTO_ERROR, NM_CRYPTO_ERROR_DECRYPTION_FAILED, - _("Failed to decrypt the private key: %s / %s."), - gcry_strsource (err), gcry_strerror (err)); + _("Failed to decrypt the private key: %s (%s)"), + gnutls_strerror_name (err), gnutls_strerror (err)); goto out; } pad_len = output[data_len - 1]; @@ -174,7 +160,7 @@ out: output = NULL; } } - gcry_cipher_close (ctx); + gnutls_cipher_deinit (ctx); return output; } @@ -189,26 +175,24 @@ crypto_encrypt (const char *cipher, gsize *out_len, GError **error) { - gcry_cipher_hd_t ctx; - gcry_error_t err; + gnutls_cipher_hd_t ctx; + gnutls_datum_t key_dt, iv_dt; + int err; int cipher_mech; char *output = NULL; gboolean success = FALSE; gsize padded_buf_len, pad_len, output_len; char *padded_buf = NULL; guint32 i; - gsize salt_len; if (!crypto_init (error)) return NULL; - if (!strcmp (cipher, CIPHER_DES_EDE3_CBC)) { - cipher_mech = GCRY_CIPHER_3DES; - salt_len = SALT_LEN; - } else if (!strcmp (cipher, CIPHER_AES_CBC)) { - cipher_mech = GCRY_CIPHER_AES; - salt_len = iv_len; - } else { + if (!strcmp (cipher, CIPHER_DES_EDE3_CBC)) + cipher_mech = GNUTLS_CIPHER_3DES_CBC; + else if (!strcmp (cipher, CIPHER_AES_CBC)) + cipher_mech = GNUTLS_CIPHER_AES_128_CBC; + else { g_set_error (error, NM_CRYPTO_ERROR, NM_CRYPTO_ERROR_UNKNOWN_CIPHER, _("Private key cipher '%s' was unknown."), @@ -229,40 +213,26 @@ crypto_encrypt (const char *cipher, output = g_malloc0 (output_len); - err = gcry_cipher_open (&ctx, cipher_mech, GCRY_CIPHER_MODE_CBC, 0); - if (err) { - g_set_error (error, NM_CRYPTO_ERROR, - NM_CRYPTO_ERROR_ENCRYPTION_FAILED, - _("Failed to initialize the encryption cipher context: %s / %s."), - gcry_strsource (err), gcry_strerror (err)); - goto out; - } - - err = gcry_cipher_setkey (ctx, key, key_len); - if (err) { - g_set_error (error, NM_CRYPTO_ERROR, - NM_CRYPTO_ERROR_ENCRYPTION_FAILED, - _("Failed to set symmetric key for encryption: %s / %s."), - gcry_strsource (err), gcry_strerror (err)); - goto out; - } + key_dt.data = (unsigned char *) key; + key_dt.size = key_len; + iv_dt.data = (unsigned char *) iv; + iv_dt.size = iv_len; - /* gcrypt only wants 8 bytes of the IV (same as the DES block length) */ - err = gcry_cipher_setiv (ctx, iv, salt_len); - if (err) { + err = gnutls_cipher_init (&ctx, cipher_mech, &key_dt, &iv_dt); + if (err < 0) { g_set_error (error, NM_CRYPTO_ERROR, NM_CRYPTO_ERROR_ENCRYPTION_FAILED, - _("Failed to set IV for encryption: %s / %s."), - gcry_strsource (err), gcry_strerror (err)); + _("Failed to initialize the encryption cipher context: %s (%s)"), + gnutls_strerror_name (err), gnutls_strerror (err)); goto out; } - err = gcry_cipher_encrypt (ctx, output, output_len, padded_buf, padded_buf_len); - if (err) { + err = gnutls_cipher_encrypt2 (ctx, padded_buf, padded_buf_len, output, output_len); + if (err < 0) { g_set_error (error, NM_CRYPTO_ERROR, NM_CRYPTO_ERROR_ENCRYPTION_FAILED, - _("Failed to encrypt the data: %s / %s."), - gcry_strsource (err), gcry_strerror (err)); + _("Failed to encrypt the data: %s (%s)"), + gnutls_strerror_name (err), gnutls_strerror (err)); goto out; } @@ -284,7 +254,7 @@ out: output = NULL; } } - gcry_cipher_close (ctx); + gnutls_cipher_deinit (ctx); return output; } @@ -449,6 +419,6 @@ crypto_randomize (void *buffer, gsize buffer_len, GError **error) if (!crypto_init (error)) return FALSE; - gcry_randomize (buffer, buffer_len, GCRY_STRONG_RANDOM); + gnutls_rnd (GNUTLS_RND_RANDOM, buffer, buffer_len); return TRUE; } diff --git a/libnm-core/crypto_nss.c b/libnm-core/crypto_nss.c index d0c3506b..7f61ad7c 100644 --- a/libnm-core/crypto_nss.c +++ b/libnm-core/crypto_nss.c @@ -23,9 +23,6 @@ #include "config.h" -#include -#include - #include #include #include @@ -36,6 +33,7 @@ #include #include +#include "nm-default.h" #include "crypto.h" #include "nm-errors.h" diff --git a/libnm-core/nm-connection.c b/libnm-core/nm-connection.c index 8f226582..5a491b40 100644 --- a/libnm-core/nm-connection.c +++ b/libnm-core/nm-connection.c @@ -22,15 +22,13 @@ #include "config.h" -#include -#include #include +#include "nm-default.h" #include "nm-connection.h" #include "nm-connection-private.h" #include "nm-utils.h" #include "nm-setting-private.h" #include "nm-core-internal.h" -#include "gsystem-local-alloc.h" /** * SECTION:nm-connection @@ -898,6 +896,34 @@ EXIT: return success; } +/** + * nm_connection_verify_secrets: + * @connection: the #NMConnection to verify in + * @error: location to store error, or %NULL + * + * Verifies the secrets in the connection. + * + * Returns: %TRUE if the secrets are valid, %FALSE if they are not + * + * Since: 1.2 + **/ +gboolean +nm_connection_verify_secrets (NMConnection *connection, GError **error) +{ + GHashTableIter iter; + NMSetting *setting; + + g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE); + g_return_val_if_fail (!error || !*error, FALSE); + + g_hash_table_iter_init (&iter, NM_CONNECTION_GET_PRIVATE (connection)->settings); + while (g_hash_table_iter_next (&iter, NULL, (gpointer) &setting)) { + if (!nm_setting_verify_secrets (setting, connection, error)) + return FALSE; + } + return TRUE; +} + /** * nm_connection_normalize: * @connection: the #NMConnection to normalize @@ -1520,7 +1546,8 @@ nm_connection_get_id (NMConnection *connection) g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); s_con = nm_connection_get_setting_connection (connection); - g_return_val_if_fail (s_con != NULL, NULL); + if (!s_con) + return NULL; return nm_setting_connection_get_id (s_con); } @@ -1541,7 +1568,8 @@ nm_connection_get_connection_type (NMConnection *connection) g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); s_con = nm_connection_get_setting_connection (connection); - g_return_val_if_fail (s_con != NULL, NULL); + if (!s_con) + return NULL; return nm_setting_connection_get_connection_type (s_con); } @@ -1566,7 +1594,11 @@ nm_connection_is_virtual (NMConnection *connection) if ( !strcmp (type, NM_SETTING_BOND_SETTING_NAME) || !strcmp (type, NM_SETTING_TEAM_SETTING_NAME) || !strcmp (type, NM_SETTING_BRIDGE_SETTING_NAME) - || !strcmp (type, NM_SETTING_VLAN_SETTING_NAME)) + || !strcmp (type, NM_SETTING_VLAN_SETTING_NAME) + || !strcmp (type, NM_SETTING_TUN_SETTING_NAME) + || !strcmp (type, NM_SETTING_IP_TUNNEL_SETTING_NAME) + || !strcmp (type, NM_SETTING_MACVLAN_SETTING_NAME) + || !strcmp (type, NM_SETTING_VXLAN_SETTING_NAME)) return TRUE; if (!strcmp (type, NM_SETTING_INFINIBAND_SETTING_NAME)) { @@ -1836,6 +1868,24 @@ nm_connection_get_setting_ip4_config (NMConnection *connection) return (NMSettingIPConfig *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP4_CONFIG); } +/** + * nm_connection_get_setting_ip_tunnel: + * @connection: the #NMConnection + * + * A shortcut to return any #NMSettingIPTunnel the connection might contain. + * + * Returns: (transfer none): an #NMSettingIPTunnel if the connection contains one, otherwise %NULL + * + * Since: 1.2 + **/ +NMSettingIPTunnel * +nm_connection_get_setting_ip_tunnel (NMConnection *connection) +{ + g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); + + return (NMSettingIPTunnel *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP_TUNNEL); +} + /** * nm_connection_get_setting_ip6_config: * @connection: the #NMConnection @@ -1857,6 +1907,24 @@ nm_connection_get_setting_ip6_config (NMConnection *connection) return (NMSettingIPConfig *) nm_connection_get_setting (connection, NM_TYPE_SETTING_IP6_CONFIG); } +/** + * nm_connection_get_setting_macvlan: + * @connection: the #NMConnection + * + * A shortcut to return any #NMSettingMacvlan the connection might contain. + * + * Returns: (transfer none): an #NMSettingMacvlan if the connection contains one, otherwise %NULL + * + * Since: 1.2 + **/ +NMSettingMacvlan * +nm_connection_get_setting_macvlan (NMConnection *connection) +{ + g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); + + return (NMSettingMacvlan *) nm_connection_get_setting (connection, NM_TYPE_SETTING_MACVLAN); +} + /** * nm_connection_get_setting_olpc_mesh: * @connection: the #NMConnection @@ -1921,6 +1989,24 @@ nm_connection_get_setting_serial (NMConnection *connection) return (NMSettingSerial *) nm_connection_get_setting (connection, NM_TYPE_SETTING_SERIAL); } +/** + * nm_connection_get_setting_tun: + * @connection: the #NMConnection + * + * A shortcut to return any #NMSettingTun the connection might contain. + * + * Returns: (transfer none): an #NMSettingTun if the connection contains one, otherwise %NULL + * + * Since: 1.2 + **/ +NMSettingTun * +nm_connection_get_setting_tun (NMConnection *connection) +{ + g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); + + return (NMSettingTun *) nm_connection_get_setting (connection, NM_TYPE_SETTING_TUN); +} + /** * nm_connection_get_setting_vpn: * @connection: the #NMConnection @@ -1937,6 +2023,24 @@ nm_connection_get_setting_vpn (NMConnection *connection) return (NMSettingVpn *) nm_connection_get_setting (connection, NM_TYPE_SETTING_VPN); } +/** + * nm_connection_get_setting_vxlan: + * @connection: the #NMConnection + * + * A shortcut to return any #NMSettingVxlan the connection might contain. + * + * Returns: (transfer none): an #NMSettingVxlan if the connection contains one, otherwise %NULL + * + * Since: 1.2 + **/ +NMSettingVxlan * +nm_connection_get_setting_vxlan (NMConnection *connection) +{ + g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL); + + return (NMSettingVxlan *) nm_connection_get_setting (connection, NM_TYPE_SETTING_VXLAN); +} + /** * nm_connection_get_setting_wimax: * @connection: the #NMConnection diff --git a/libnm-core/nm-connection.h b/libnm-core/nm-connection.h index c76ad607..21e30422 100644 --- a/libnm-core/nm-connection.h +++ b/libnm-core/nm-connection.h @@ -145,6 +145,8 @@ gboolean nm_connection_diff (NMConnection *a, GHashTable **out_settings); gboolean nm_connection_verify (NMConnection *connection, GError **error); +NM_AVAILABLE_IN_1_2 +gboolean nm_connection_verify_secrets (NMConnection *connection, GError **error); gboolean nm_connection_normalize (NMConnection *connection, GHashTable *parameters, gboolean *modified, @@ -200,12 +202,17 @@ NMSettingDcb * nm_connection_get_setting_dcb (NMConnec NMSettingGeneric * nm_connection_get_setting_generic (NMConnection *connection); NMSettingGsm * nm_connection_get_setting_gsm (NMConnection *connection); NMSettingInfiniband * nm_connection_get_setting_infiniband (NMConnection *connection); +NM_AVAILABLE_IN_1_2 +NMSettingIPTunnel * nm_connection_get_setting_ip_tunnel (NMConnection *connection); NMSettingIPConfig * nm_connection_get_setting_ip4_config (NMConnection *connection); NMSettingIPConfig * nm_connection_get_setting_ip6_config (NMConnection *connection); +NM_AVAILABLE_IN_1_2 +NMSettingMacvlan * nm_connection_get_setting_macvlan (NMConnection *connection); NMSettingOlpcMesh * nm_connection_get_setting_olpc_mesh (NMConnection *connection); NMSettingPpp * nm_connection_get_setting_ppp (NMConnection *connection); NMSettingPppoe * nm_connection_get_setting_pppoe (NMConnection *connection); NMSettingSerial * nm_connection_get_setting_serial (NMConnection *connection); +NMSettingTun * nm_connection_get_setting_tun (NMConnection *connection); NMSettingVpn * nm_connection_get_setting_vpn (NMConnection *connection); NMSettingWimax * nm_connection_get_setting_wimax (NMConnection *connection); NMSettingAdsl * nm_connection_get_setting_adsl (NMConnection *connection); @@ -213,6 +220,8 @@ NMSettingWired * nm_connection_get_setting_wired (NMConnec NMSettingWireless * nm_connection_get_setting_wireless (NMConnection *connection); NMSettingWirelessSecurity *nm_connection_get_setting_wireless_security (NMConnection *connection); NMSettingVlan * nm_connection_get_setting_vlan (NMConnection *connection); +NM_AVAILABLE_IN_1_2 +NMSettingVxlan * nm_connection_get_setting_vxlan (NMConnection *connection); G_END_DECLS diff --git a/libnm-core/nm-core-enum-types.c b/libnm-core/nm-core-enum-types.c index d2281653..4c580984 100644 --- a/libnm-core/nm-core-enum-types.c +++ b/libnm-core/nm-core-enum-types.c @@ -3,6 +3,8 @@ /* Generated by glib-mkenums. Do not edit */ +#include "config.h" + #include "nm-core-enum-types.h" #include "nm-version-macros.h" @@ -23,16 +25,20 @@ #include "nm-setting-gsm.h" #include "nm-setting-infiniband.h" #include "nm-setting-ip-config.h" +#include "nm-setting-ip-tunnel.h" #include "nm-setting-ip4-config.h" #include "nm-setting-ip6-config.h" +#include "nm-setting-macvlan.h" #include "nm-setting-olpc-mesh.h" #include "nm-setting-ppp.h" #include "nm-setting-pppoe.h" #include "nm-setting-serial.h" #include "nm-setting-team-port.h" #include "nm-setting-team.h" +#include "nm-setting-tun.h" #include "nm-setting-vlan.h" #include "nm-setting-vpn.h" +#include "nm-setting-vxlan.h" #include "nm-setting-wimax.h" #include "nm-setting-wired.h" #include "nm-setting-wireless-security.h" @@ -41,7 +47,9 @@ #include "nm-simple-connection.h" #include "nm-utils.h" #include "nm-version.h" -#include "nm-vpn-dbus-interface.h" +#include "nm-vpn-dbus-interface.h" +#include "nm-vpn-editor-plugin.h" +#include "nm-vpn-plugin-info.h" GType nm_connection_serialization_flags_get_type (void) @@ -134,6 +142,10 @@ nm_device_type_get_type (void) { NM_DEVICE_TYPE_BRIDGE, "NM_DEVICE_TYPE_BRIDGE", "bridge" }, { NM_DEVICE_TYPE_GENERIC, "NM_DEVICE_TYPE_GENERIC", "generic" }, { NM_DEVICE_TYPE_TEAM, "NM_DEVICE_TYPE_TEAM", "team" }, + { NM_DEVICE_TYPE_TUN, "NM_DEVICE_TYPE_TUN", "tun" }, + { NM_DEVICE_TYPE_IP_TUNNEL, "NM_DEVICE_TYPE_IP_TUNNEL", "ip-tunnel" }, + { NM_DEVICE_TYPE_MACVLAN, "NM_DEVICE_TYPE_MACVLAN", "macvlan" }, + { NM_DEVICE_TYPE_VXLAN, "NM_DEVICE_TYPE_VXLAN", "vxlan" }, { 0, NULL, NULL } }; GType g_define_type_id = @@ -501,6 +513,33 @@ nm_secret_agent_capabilities_get_type (void) return g_define_type_id__volatile; } GType +nm_ip_tunnel_mode_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { NM_IP_TUNNEL_MODE_UKNOWN, "NM_IP_TUNNEL_MODE_UKNOWN", "uknown" }, + { NM_IP_TUNNEL_MODE_IPIP, "NM_IP_TUNNEL_MODE_IPIP", "ipip" }, + { NM_IP_TUNNEL_MODE_GRE, "NM_IP_TUNNEL_MODE_GRE", "gre" }, + { NM_IP_TUNNEL_MODE_SIT, "NM_IP_TUNNEL_MODE_SIT", "sit" }, + { NM_IP_TUNNEL_MODE_ISATAP, "NM_IP_TUNNEL_MODE_ISATAP", "isatap" }, + { NM_IP_TUNNEL_MODE_VTI, "NM_IP_TUNNEL_MODE_VTI", "vti" }, + { NM_IP_TUNNEL_MODE_IP6IP6, "NM_IP_TUNNEL_MODE_IP6IP6", "ip6ip6" }, + { NM_IP_TUNNEL_MODE_IPIP6, "NM_IP_TUNNEL_MODE_IPIP6", "ipip6" }, + { NM_IP_TUNNEL_MODE_IP6GRE, "NM_IP_TUNNEL_MODE_IP6GRE", "ip6gre" }, + { NM_IP_TUNNEL_MODE_VTI6, "NM_IP_TUNNEL_MODE_VTI6", "vti6" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("NMIPTunnelMode"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} +GType nm_agent_manager_error_get_type (void) { static volatile gsize g_define_type_id__volatile = 0; @@ -761,6 +800,26 @@ nm_setting_connection_autoconnect_slaves_get_type (void) return g_define_type_id__volatile; } GType +nm_setting_connection_lldp_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { NM_SETTING_CONNECTION_LLDP_DEFAULT, "NM_SETTING_CONNECTION_LLDP_DEFAULT", "default" }, + { NM_SETTING_CONNECTION_LLDP_DISABLE, "NM_SETTING_CONNECTION_LLDP_DISABLE", "disable" }, + { NM_SETTING_CONNECTION_LLDP_ENABLE_RX, "NM_SETTING_CONNECTION_LLDP_ENABLE_RX", "enable-rx" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("NMSettingConnectionLldp"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} +GType nm_setting_dcb_flags_get_type (void) { static volatile gsize g_define_type_id__volatile = 0; @@ -803,6 +862,48 @@ nm_setting_ip6_config_privacy_get_type (void) return g_define_type_id__volatile; } GType +nm_setting_ip6_config_addr_gen_mode_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_EUI64, "NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_EUI64", "eui64" }, + { NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_STABLE_PRIVACY, "NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_STABLE_PRIVACY", "stable-privacy" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("NMSettingIP6ConfigAddrGenMode"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} +GType +nm_setting_macvlan_mode_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { NM_SETTING_MACVLAN_MODE_UNKNOWN, "NM_SETTING_MACVLAN_MODE_UNKNOWN", "unknown" }, + { NM_SETTING_MACVLAN_MODE_VEPA, "NM_SETTING_MACVLAN_MODE_VEPA", "vepa" }, + { NM_SETTING_MACVLAN_MODE_BRIDGE, "NM_SETTING_MACVLAN_MODE_BRIDGE", "bridge" }, + { NM_SETTING_MACVLAN_MODE_PRIVATE, "NM_SETTING_MACVLAN_MODE_PRIVATE", "private" }, + { NM_SETTING_MACVLAN_MODE_PASSTHRU, "NM_SETTING_MACVLAN_MODE_PASSTHRU", "passthru" }, + { NM_SETTING_MACVLAN_MODE_SOURCE, "NM_SETTING_MACVLAN_MODE_SOURCE", "source" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("NMSettingMacvlanMode"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} +GType nm_setting_serial_parity_get_type (void) { static volatile gsize g_define_type_id__volatile = 0; @@ -823,6 +924,26 @@ nm_setting_serial_parity_get_type (void) return g_define_type_id__volatile; } GType +nm_setting_tun_mode_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { NM_SETTING_TUN_MODE_UNKNOWN, "NM_SETTING_TUN_MODE_UNKNOWN", "unknown" }, + { NM_SETTING_TUN_MODE_TUN, "NM_SETTING_TUN_MODE_TUN", "tun" }, + { NM_SETTING_TUN_MODE_TAP, "NM_SETTING_TUN_MODE_TAP", "tap" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("NMSettingTunMode"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} +GType nm_vlan_priority_map_get_type (void) { static volatile gsize g_define_type_id__volatile = 0; @@ -852,6 +973,7 @@ nm_vlan_flags_get_type (void) { NM_VLAN_FLAG_REORDER_HEADERS, "NM_VLAN_FLAG_REORDER_HEADERS", "reorder-headers" }, { NM_VLAN_FLAG_GVRP, "NM_VLAN_FLAG_GVRP", "gvrp" }, { NM_VLAN_FLAG_LOOSE_BINDING, "NM_VLAN_FLAG_LOOSE_BINDING", "loose-binding" }, + { NM_VLAN_FLAG_MVRP, "NM_VLAN_FLAG_MVRP", "mvrp" }, { 0, NULL, NULL } }; GType g_define_type_id = @@ -955,6 +1077,26 @@ nm_setting_compare_flags_get_type (void) return g_define_type_id__volatile; } GType +nm_setting_mac_randomization_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GEnumValue values[] = { + { NM_SETTING_MAC_RANDOMIZATION_DEFAULT, "NM_SETTING_MAC_RANDOMIZATION_DEFAULT", "default" }, + { NM_SETTING_MAC_RANDOMIZATION_NEVER, "NM_SETTING_MAC_RANDOMIZATION_NEVER", "never" }, + { NM_SETTING_MAC_RANDOMIZATION_ALWAYS, "NM_SETTING_MAC_RANDOMIZATION_ALWAYS", "always" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_enum_register_static (g_intern_static_string ("NMSettingMacRandomization"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} +GType nm_setting_diff_result_get_type (void) { static volatile gsize g_define_type_id__volatile = 0; @@ -1100,6 +1242,27 @@ nm_vpn_plugin_failure_get_type (void) return g_define_type_id__volatile; } +GType +nm_vpn_editor_plugin_capability_get_type (void) +{ + static volatile gsize g_define_type_id__volatile = 0; + + if (g_once_init_enter (&g_define_type_id__volatile)) + { + static const GFlagsValue values[] = { + { NM_VPN_EDITOR_PLUGIN_CAPABILITY_NONE, "NM_VPN_EDITOR_PLUGIN_CAPABILITY_NONE", "none" }, + { NM_VPN_EDITOR_PLUGIN_CAPABILITY_IMPORT, "NM_VPN_EDITOR_PLUGIN_CAPABILITY_IMPORT", "import" }, + { NM_VPN_EDITOR_PLUGIN_CAPABILITY_EXPORT, "NM_VPN_EDITOR_PLUGIN_CAPABILITY_EXPORT", "export" }, + { NM_VPN_EDITOR_PLUGIN_CAPABILITY_IPV6, "NM_VPN_EDITOR_PLUGIN_CAPABILITY_IPV6", "ipv6" }, + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_flags_register_static (g_intern_static_string ("NMVpnEditorPluginCapability"), values); + g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); + } + + return g_define_type_id__volatile; +} diff --git a/libnm-core/nm-core-enum-types.h b/libnm-core/nm-core-enum-types.h index 7e5c6df0..1c16cb21 100644 --- a/libnm-core/nm-core-enum-types.h +++ b/libnm-core/nm-core-enum-types.h @@ -43,6 +43,8 @@ GType nm_secret_agent_get_secrets_flags_get_type (void) G_GNUC_CONST; #define NM_TYPE_SECRET_AGENT_GET_SECRETS_FLAGS (nm_secret_agent_get_secrets_flags_get_type ()) GType nm_secret_agent_capabilities_get_type (void) G_GNUC_CONST; #define NM_TYPE_SECRET_AGENT_CAPABILITIES (nm_secret_agent_capabilities_get_type ()) +GType nm_ip_tunnel_mode_get_type (void) G_GNUC_CONST; +#define NM_TYPE_IP_TUNNEL_MODE (nm_ip_tunnel_mode_get_type ()) GType nm_agent_manager_error_get_type (void) G_GNUC_CONST; #define NM_TYPE_AGENT_MANAGER_ERROR (nm_agent_manager_error_get_type ()) GType nm_connection_error_get_type (void) G_GNUC_CONST; @@ -65,12 +67,20 @@ GType nm_setting_802_1x_ck_scheme_get_type (void) G_GNUC_CONST; #define NM_TYPE_SETTING_802_1X_CK_SCHEME (nm_setting_802_1x_ck_scheme_get_type ()) GType nm_setting_connection_autoconnect_slaves_get_type (void) G_GNUC_CONST; #define NM_TYPE_SETTING_CONNECTION_AUTOCONNECT_SLAVES (nm_setting_connection_autoconnect_slaves_get_type ()) +GType nm_setting_connection_lldp_get_type (void) G_GNUC_CONST; +#define NM_TYPE_SETTING_CONNECTION_LLDP (nm_setting_connection_lldp_get_type ()) GType nm_setting_dcb_flags_get_type (void) G_GNUC_CONST; #define NM_TYPE_SETTING_DCB_FLAGS (nm_setting_dcb_flags_get_type ()) GType nm_setting_ip6_config_privacy_get_type (void) G_GNUC_CONST; #define NM_TYPE_SETTING_IP6_CONFIG_PRIVACY (nm_setting_ip6_config_privacy_get_type ()) +GType nm_setting_ip6_config_addr_gen_mode_get_type (void) G_GNUC_CONST; +#define NM_TYPE_SETTING_IP6_CONFIG_ADDR_GEN_MODE (nm_setting_ip6_config_addr_gen_mode_get_type ()) +GType nm_setting_macvlan_mode_get_type (void) G_GNUC_CONST; +#define NM_TYPE_SETTING_MACVLAN_MODE (nm_setting_macvlan_mode_get_type ()) GType nm_setting_serial_parity_get_type (void) G_GNUC_CONST; #define NM_TYPE_SETTING_SERIAL_PARITY (nm_setting_serial_parity_get_type ()) +GType nm_setting_tun_mode_get_type (void) G_GNUC_CONST; +#define NM_TYPE_SETTING_TUN_MODE (nm_setting_tun_mode_get_type ()) GType nm_vlan_priority_map_get_type (void) G_GNUC_CONST; #define NM_TYPE_VLAN_PRIORITY_MAP (nm_vlan_priority_map_get_type ()) GType nm_vlan_flags_get_type (void) G_GNUC_CONST; @@ -83,6 +93,8 @@ GType nm_setting_secret_flags_get_type (void) G_GNUC_CONST; #define NM_TYPE_SETTING_SECRET_FLAGS (nm_setting_secret_flags_get_type ()) GType nm_setting_compare_flags_get_type (void) G_GNUC_CONST; #define NM_TYPE_SETTING_COMPARE_FLAGS (nm_setting_compare_flags_get_type ()) +GType nm_setting_mac_randomization_get_type (void) G_GNUC_CONST; +#define NM_TYPE_SETTING_MAC_RANDOMIZATION (nm_setting_mac_randomization_get_type ()) GType nm_setting_diff_result_get_type (void) G_GNUC_CONST; #define NM_TYPE_SETTING_DIFF_RESULT (nm_setting_diff_result_get_type ()) GType nm_utils_security_type_get_type (void) G_GNUC_CONST; @@ -95,6 +107,8 @@ GType nm_vpn_connection_state_reason_get_type (void) G_GNUC_CONST; #define NM_TYPE_VPN_CONNECTION_STATE_REASON (nm_vpn_connection_state_reason_get_type ()) GType nm_vpn_plugin_failure_get_type (void) G_GNUC_CONST; #define NM_TYPE_VPN_PLUGIN_FAILURE (nm_vpn_plugin_failure_get_type ()) +GType nm_vpn_editor_plugin_capability_get_type (void) G_GNUC_CONST; +#define NM_TYPE_VPN_EDITOR_PLUGIN_CAPABILITY (nm_vpn_editor_plugin_capability_get_type ()) G_END_DECLS #endif /* __NM_CORE_ENUM_TYPES_H__ */ diff --git a/libnm-core/nm-core-internal.h b/libnm-core/nm-core-internal.h index 56cb7806..3e1236b9 100644 --- a/libnm-core/nm-core-internal.h +++ b/libnm-core/nm-core-internal.h @@ -33,6 +33,8 @@ * and some test programs. **/ + +#include "nm-default.h" #include "nm-connection.h" #include "nm-core-enum-types.h" #include "nm-setting-8021x.h" @@ -47,16 +49,20 @@ #include "nm-setting-generic.h" #include "nm-setting-gsm.h" #include "nm-setting-infiniband.h" +#include "nm-setting-ip-tunnel.h" #include "nm-setting-ip4-config.h" #include "nm-setting-ip6-config.h" +#include "nm-setting-macvlan.h" #include "nm-setting-olpc-mesh.h" #include "nm-setting-ppp.h" #include "nm-setting-pppoe.h" #include "nm-setting-serial.h" #include "nm-setting-team-port.h" #include "nm-setting-team.h" +#include "nm-setting-tun.h" #include "nm-setting-vlan.h" #include "nm-setting-vpn.h" +#include "nm-setting-vxlan.h" #include "nm-setting-wimax.h" #include "nm-setting-wired.h" #include "nm-setting-wireless-security.h" @@ -64,22 +70,28 @@ #include "nm-setting.h" #include "nm-simple-connection.h" #include "nm-utils.h" -#include "nm-version.h" #include "nm-vpn-dbus-interface.h" - -#define NM_UTILS_CLEAR_CANCELLABLE(c) \ - if (c) { \ - g_cancellable_cancel (c); \ - g_clear_object (&c); \ - } +#include "nm-core-types-internal.h" /* NM_SETTING_COMPARE_FLAG_INFERRABLE: check whether a device-generated * connection can be replaced by a already-defined connection. This flag only * takes into account properties marked with the %NM_SETTING_PARAM_INFERRABLE * flag. */ -#define NM_SETTING_COMPARE_FLAG_INFERRABLE 0x80000000 +#define NM_SETTING_COMPARE_FLAG_INFERRABLE ((NMSettingCompareFlags) 0x80000000) + +/* NM_SETTING_COMPARE_FLAG_IGNORE_REAPPLY_IMMEDIATELY: this flag is used for properties + * that automatically get re-applied on an active connection when the settings + * connection is modified. For most properties, the applied-connection is distinct + * from the setting-connection and changes don't propagate. Exceptions are the + * firewall-zone and the metered property. + */ +#define NM_SETTING_COMPARE_FLAG_IGNORE_REAPPLY_IMMEDIATELY ((NMSettingCompareFlags) 0x40000000) +/* NM_SETTING_COMPARE_FLAG_NONE: for convenience, define a special flag NONE -- which + * equals to numeric zero (NM_SETTING_COMPARE_FLAG_EXACT). + */ +#define NM_SETTING_COMPARE_FLAG_NONE ((NMSettingCompareFlags) 0) #define NM_SETTING_SECRET_FLAGS_ALL \ @@ -132,12 +144,27 @@ char ** _nm_utils_slist_to_strv (GSList *slist, gboolean deep_copy); GPtrArray * _nm_utils_strv_to_ptrarray (char **strv); char ** _nm_utils_ptrarray_to_strv (GPtrArray *ptrarray); +gboolean _nm_utils_strv_equal (char **strv1, char **strv2); + +gboolean _nm_utils_check_file (const char *filename, + gint64 check_owner, + NMUtilsCheckFilePredicate check_file, + gpointer user_data, + struct stat *out_st, + GError **error); + +gboolean _nm_utils_check_module_file (const char *name, + int check_owner, + NMUtilsCheckFilePredicate check_file, + gpointer user_data, + GError **error); #define NM_UTILS_UUID_TYPE_LEGACY 0 #define NM_UTILS_UUID_TYPE_VARIANT3 1 char *nm_utils_uuid_generate_from_string (const char *s, gssize slen, int uuid_type, gpointer type_args); +/* arbitrarily choosen namespace UUID for _nm_utils_uuid_generate_from_strings() */ #define NM_UTILS_UUID_NS "b425e9fb-7598-44b4-9e3b-5a2e3aaa4905" char *_nm_utils_uuid_generate_from_strings (const char *string1, ...) G_GNUC_NULL_TERMINATED; @@ -152,12 +179,91 @@ GByteArray *nm_utils_rsa_key_encrypt (const guint8 *data, char **out_password, GError **error); -/* These are public API in NM 1.2, but private on nm-1-0. */ -int nm_utils_bond_mode_string_to_int (const char *mode); -const char *nm_utils_bond_mode_int_to_string (int mode); - gint64 _nm_utils_ascii_str_to_int64 (const char *str, guint base, gint64 min, gint64 max, gint64 fallback); +gulong _nm_dbus_signal_connect_data (GDBusProxy *proxy, + const char *signal_name, + const GVariantType *signature, + GCallback c_handler, + gpointer data, + GClosureNotify destroy_data, + GConnectFlags connect_flags); +#define _nm_dbus_signal_connect(proxy, name, signature, handler, data) \ + _nm_dbus_signal_connect_data (proxy, name, signature, handler, data, NULL, (GConnectFlags) 0) + +GVariant *_nm_dbus_proxy_call_finish (GDBusProxy *proxy, + GAsyncResult *res, + const GVariantType *reply_type, + GError **error); + +GVariant *_nm_dbus_proxy_call_sync (GDBusProxy *proxy, + const gchar *method_name, + GVariant *parameters, + const GVariantType *reply_type, + GDBusCallFlags flags, + gint timeout_msec, + GCancellable *cancellable, + GError **error); + gboolean _nm_dbus_error_has_name (GError *error, const char *dbus_error_name); + +/***********************************************************/ + +gboolean _nm_vpn_plugin_info_check_file (const char *filename, + gboolean check_absolute, + gboolean do_validate_filename, + gint64 check_owner, + NMUtilsCheckFilePredicate check_file, + gpointer user_data, + GError **error); + +const char *_nm_vpn_plugin_info_get_default_dir_etc (void); +const char *_nm_vpn_plugin_info_get_default_dir_lib (void); +const char *_nm_vpn_plugin_info_get_default_dir_user (void); + +GSList *_nm_vpn_plugin_info_list_load_dir (const char *dirname, + gboolean do_validate_filename, + gint64 check_owner, + NMUtilsCheckFilePredicate check_file, + gpointer user_data); + +/***********************************************************/ + +typedef struct { + const char *name; + gboolean numeric; + gboolean ipv6_only; +} NMUtilsDNSOptionDesc; + +extern const NMUtilsDNSOptionDesc _nm_utils_dns_option_descs[]; + +gboolean _nm_utils_dns_option_validate (const char *option, char **out_name, + long *out_value, gboolean ipv6, + const NMUtilsDNSOptionDesc *option_descs); +int _nm_utils_dns_option_find_idx (GPtrArray *array, const char *option); + +/***********************************************************/ + +typedef struct _NMUtilsStrStrDictKey NMUtilsStrStrDictKey; +guint _nm_utils_strstrdictkey_hash (gconstpointer a); +gboolean _nm_utils_strstrdictkey_equal (gconstpointer a, gconstpointer b); +NMUtilsStrStrDictKey *_nm_utils_strstrdictkey_create (const char *v1, const char *v2); + +#define _nm_utils_strstrdictkey_static(v1, v2) \ + ( (NMUtilsStrStrDictKey *) ("\03" v1 "\0" v2 "") ) + +/***********************************************************/ + +gboolean _nm_setting_vlan_set_priorities (NMSettingVlan *setting, + NMVlanPriorityMap map, + const NMVlanQosMapping *qos_map, + guint n_qos_map); +void _nm_setting_vlan_get_priorities (NMSettingVlan *setting, + NMVlanPriorityMap map, + NMVlanQosMapping **out_qos_map, + guint *out_n_qos_map); + +/***********************************************************/ + #endif diff --git a/libnm-core/nm-core-types-internal.h b/libnm-core/nm-core-types-internal.h new file mode 100644 index 00000000..442a10a3 --- /dev/null +++ b/libnm-core/nm-core-types-internal.h @@ -0,0 +1,30 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2015 Red Hat, Inc. + */ + +#ifndef NM_CORE_TYPES_INTERNAL_H +#define NM_CORE_TYPES_INTERNAL_H + +typedef struct { + guint32 from; + guint32 to; +} NMVlanQosMapping; + +#endif /* NM_CORE_TYPES_INTERNAL_H */ diff --git a/libnm-core/nm-core-types.h b/libnm-core/nm-core-types.h index 19388c5b..cd19923b 100644 --- a/libnm-core/nm-core-types.h +++ b/libnm-core/nm-core-types.h @@ -42,16 +42,20 @@ typedef struct _NMSettingGeneric NMSettingGeneric; typedef struct _NMSettingGsm NMSettingGsm; typedef struct _NMSettingInfiniband NMSettingInfiniband; typedef struct _NMSettingIPConfig NMSettingIPConfig; +typedef struct _NMSettingIPTunnel NMSettingIPTunnel; typedef struct _NMSettingIP4Config NMSettingIP4Config; typedef struct _NMSettingIP6Config NMSettingIP6Config; +typedef struct _NMSettingMacvlan NMSettingMacvlan; typedef struct _NMSettingOlpcMesh NMSettingOlpcMesh; typedef struct _NMSettingPpp NMSettingPpp; typedef struct _NMSettingPppoe NMSettingPppoe; typedef struct _NMSettingSerial NMSettingSerial; typedef struct _NMSettingTeam NMSettingTeam; typedef struct _NMSettingTeamPort NMSettingTeamPort; +typedef struct _NMSettingTun NMSettingTun; typedef struct _NMSettingVlan NMSettingVlan; typedef struct _NMSettingVpn NMSettingVpn; +typedef struct _NMSettingVxlan NMSettingVxlan; typedef struct _NMSettingWimax NMSettingWimax; typedef struct _NMSettingWired NMSettingWired; typedef struct _NMSettingWireless NMSettingWireless; diff --git a/libnm-core/nm-dbus-interface.h b/libnm-core/nm-dbus-interface.h index ac20fa2e..b32aabc2 100644 --- a/libnm-core/nm-dbus-interface.h +++ b/libnm-core/nm-dbus-interface.h @@ -29,7 +29,7 @@ /* This header must not include glib or libnm. */ #ifndef NM_VERSION_H -#define NM_AVAILABLE_IN_1_0_6 +#define NM_AVAILABLE_IN_1_2 #endif /* @@ -67,7 +67,7 @@ #define NM_DBUS_INTERFACE_DEVICE_MACVLAN NM_DBUS_INTERFACE_DEVICE ".Macvlan" #define NM_DBUS_INTERFACE_DEVICE_VXLAN NM_DBUS_INTERFACE_DEVICE ".Vxlan" #define NM_DBUS_INTERFACE_DEVICE_GRE NM_DBUS_INTERFACE_DEVICE ".Gre" - +#define NM_DBUS_INTERFACE_DEVICE_IP_TUNNEL NM_DBUS_INTERFACE_DEVICE ".IPTunnel" #define NM_DBUS_INTERFACE_SETTINGS "org.freedesktop.NetworkManager.Settings" #define NM_DBUS_PATH_SETTINGS "/org/freedesktop/NetworkManager/Settings" @@ -148,6 +148,10 @@ typedef enum { * @NM_DEVICE_TYPE_ADSL: ADSL modem * @NM_DEVICE_TYPE_BRIDGE: a bridge master interface * @NM_DEVICE_TYPE_TEAM: a team master interface + * @NM_DEVICE_TYPE_TUN: a TUN or TAP interface + * @NM_DEVICE_TYPE_IP_TUNNEL: a IP tunnel interface + * @NM_DEVICE_TYPE_MACVLAN: a MACVLAN interface + * @NM_DEVICE_TYPE_VXLAN: a VXLAN interface * * #NMDeviceType values indicate the type of hardware represented by * an #NMDevice. @@ -171,6 +175,10 @@ typedef enum { NM_DEVICE_TYPE_BRIDGE = 13, NM_DEVICE_TYPE_GENERIC = 14, NM_DEVICE_TYPE_TEAM = 15, + NM_DEVICE_TYPE_TUN = 16, + NM_DEVICE_TYPE_IP_TUNNEL = 17, + NM_DEVICE_TYPE_MACVLAN = 18, + NM_DEVICE_TYPE_VXLAN = 19, } NMDeviceType; /** @@ -553,9 +561,9 @@ typedef enum { * * (Corresponds to the NM_METERED type in nm-device.xml.) * - * Since: 1.0.6 + * Since: 1.2 **/ -NM_AVAILABLE_IN_1_0_6 +NM_AVAILABLE_IN_1_2 typedef enum { NM_METERED_UNKNOWN = 0, NM_METERED_YES = 1, @@ -644,7 +652,56 @@ typedef enum /*< flags >*/ { } NMSecretAgentCapabilities; #ifndef NM_VERSION_H -#undef NM_AVAILABLE_IN_1_0_6 +#undef NM_AVAILABLE_IN_1_2 #endif +#define NM_LLDP_ATTR_DESTINATION "destination" +#define NM_LLDP_ATTR_CHASSIS_ID_TYPE "chassis-id-type" +#define NM_LLDP_ATTR_CHASSIS_ID "chassis-id" +#define NM_LLDP_ATTR_PORT_ID_TYPE "port-id-type" +#define NM_LLDP_ATTR_PORT_ID "port-id" +#define NM_LLDP_ATTR_PORT_DESCRIPTION "port-description" +#define NM_LLDP_ATTR_SYSTEM_NAME "system-name" +#define NM_LLDP_ATTR_SYSTEM_DESCRIPTION "system-description" +#define NM_LLDP_ATTR_SYSTEM_CAPABILITIES "system-capabilities" +#define NM_LLDP_ATTR_IEEE_802_1_PVID "ieee-802-1-pvid" +#define NM_LLDP_ATTR_IEEE_802_1_PPVID "ieee-802-1-ppvid" +#define NM_LLDP_ATTR_IEEE_802_1_PPVID_FLAGS "ieee-802-1-ppvid-flags" +#define NM_LLDP_ATTR_IEEE_802_1_VID "ieee-802-1-pvid" +#define NM_LLDP_ATTR_IEEE_802_1_VLAN_NAME "ieee-802-1-vlan-name" + +#define NM_LLDP_DEST_NEAREST_BRIDGE "nearest-bridge" +#define NM_LLDP_DEST_NEAREST_NON_TPMR_BRIDGE "nearest-non-tpmr-bridge" +#define NM_LLDP_DEST_NEAREST_CUSTOMER_BRIDGE "nearest-customer-bridge" + +/** + * NMIPTunnelMode: + * @NM_IP_TUNNEL_MODE_UNKNOWN: Unknown/unset tunnel mode + * @NM_IP_TUNNEL_MODE_IPIP: IP in IP tunnel + * @NM_IP_TUNNEL_MODE_GRE: GRE tunnel + * @NM_IP_TUNNEL_MODE_SIT: SIT tunnel + * @NM_IP_TUNNEL_MODE_ISATAP: ISATAP tunnel + * @NM_IP_TUNNEL_MODE_VTI: VTI tunnel + * @NM_IP_TUNNEL_MODE_IP6IP6: IPv6 in IPv6 tunnel + * @NM_IP_TUNNEL_MODE_IPIP6: IPv4 in IPv6 tunnel + * @NM_IP_TUNNEL_MODE_IP6GRE: IPv6 GRE tunnel + * @NM_IP_TUNNEL_MODE_VTI6: IPv6 VTI tunnel + * + * The tunneling mode. + * + * Since: 1.2 + */ +typedef enum { + NM_IP_TUNNEL_MODE_UKNOWN = 0, + NM_IP_TUNNEL_MODE_IPIP = 1, + NM_IP_TUNNEL_MODE_GRE = 2, + NM_IP_TUNNEL_MODE_SIT = 3, + NM_IP_TUNNEL_MODE_ISATAP = 4, + NM_IP_TUNNEL_MODE_VTI = 5, + NM_IP_TUNNEL_MODE_IP6IP6 = 6, + NM_IP_TUNNEL_MODE_IPIP6 = 7, + NM_IP_TUNNEL_MODE_IP6GRE = 8, + NM_IP_TUNNEL_MODE_VTI6 = 9, +} NMIPTunnelMode; + #endif /* __NM_DBUS_INTERFACE_H__ */ diff --git a/libnm-core/nm-dbus-utils.c b/libnm-core/nm-dbus-utils.c new file mode 100644 index 00000000..86272786 --- /dev/null +++ b/libnm-core/nm-dbus-utils.c @@ -0,0 +1,294 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2015 Red Hat, Inc. + */ + +#include "config.h" + +#include + +#include "nm-default.h" +#include "nm-core-internal.h" + +typedef struct { + char *signal_name; + const GVariantType *signature; +} NMDBusSignalData; + +static void +dbus_signal_data_free (gpointer data, GClosure *closure) +{ + NMDBusSignalData *sd = data; + + g_free (sd->signal_name); + g_slice_free (NMDBusSignalData, sd); +} + +static void +dbus_signal_meta_marshal (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data) +{ + NMDBusSignalData *sd = marshal_data; + const char *signal_name; + GVariant *parameters, *param; + GValue *closure_params; + gsize n_params, i; + + g_return_if_fail (n_param_values == 4); + + signal_name = g_value_get_string (¶m_values[2]); + parameters = g_value_get_variant (¶m_values[3]); + + if (strcmp (signal_name, sd->signal_name) != 0) + return; + + if (sd->signature) { + if (!g_variant_is_of_type (parameters, sd->signature)) { + g_warning ("%p: got signal '%s' but parameters were of type '%s', not '%s'", + g_value_get_object (¶m_values[0]), + signal_name, g_variant_get_type_string (parameters), + g_variant_type_peek_string (sd->signature)); + return; + } + + n_params = g_variant_n_children (parameters) + 1; + } else + n_params = 1; + + closure_params = g_new0 (GValue, n_params); + g_value_init (&closure_params[0], G_TYPE_OBJECT); + g_value_copy (¶m_values[0], &closure_params[0]); + + for (i = 1; i < n_params; i++) { + param = g_variant_get_child_value (parameters, i - 1); + if ( g_variant_is_of_type (param, G_VARIANT_TYPE ("ay")) + || g_variant_is_of_type (param, G_VARIANT_TYPE ("aay"))) { + /* g_dbus_gvariant_to_gvalue() thinks 'ay' means "non-UTF-8 NUL-terminated string" */ + g_value_init (&closure_params[i], G_TYPE_VARIANT); + g_value_set_variant (&closure_params[i], param); + } else + g_dbus_gvariant_to_gvalue (param, &closure_params[i]); + g_variant_unref (param); + } + + g_cclosure_marshal_generic (closure, + NULL, + n_params, + closure_params, + invocation_hint, + NULL); + + for (i = 0; i < n_params; i++) + g_value_unset (&closure_params[i]); + g_free (closure_params); +} + +/** + * _nm_dbus_signal_connect_data: + * @proxy: a #GDBusProxy + * @signal_name: the D-Bus signal to connect to + * @signature: (allow-none): the signal's type signature (must be a tuple) + * @c_handler: the signal handler function + * @data: (allow-none): data to pass to @c_handler + * @destroy_data: (allow-none): closure destroy notify for @data + * @connect_flags: connection flags + * + * Connects to the D-Bus signal @signal_name on @proxy. @c_handler must be a + * void function whose first argument is a #GDBusProxy, followed by arguments + * for each element of @signature, ending with a #gpointer argument for @data. + * + * The argument types in @c_handler correspond to the types output by + * g_dbus_gvariant_to_gvalue(), except for 'ay' and 'aay'. In particular: + * - both 16-bit and 32-bit integers are passed as #gint/#guint + * - 'as' values are passed as #GStrv (char **) + * - all other array, tuple, and dict types are passed as #GVariant + * + * If @signature is %NULL, then the signal's parameters will be ignored, and + * @c_handler should take only the #GDBusProxy and #gpointer arguments. + * + * Returns: the signal handler ID, which can be used with + * g_signal_handler_remove(). Beware that because of the way the signal is + * connected, you will not be able to remove it with + * g_signal_handlers_disconnect_by_func(), although + * g_signal_handlers_disconnect_by_data() will work correctly. + */ +gulong +_nm_dbus_signal_connect_data (GDBusProxy *proxy, + const char *signal_name, + const GVariantType *signature, + GCallback c_handler, + gpointer data, + GClosureNotify destroy_data, + GConnectFlags connect_flags) +{ + NMDBusSignalData *sd; + GClosure *closure; + gboolean swapped = !!(connect_flags & G_CONNECT_SWAPPED); + gboolean after = !!(connect_flags & G_CONNECT_AFTER); + + g_return_val_if_fail (G_IS_DBUS_PROXY (proxy), 0); + g_return_val_if_fail (signal_name != NULL, 0); + g_return_val_if_fail (signature == NULL || g_variant_type_is_tuple (signature), 0); + g_return_val_if_fail (c_handler != NULL, 0); + + sd = g_slice_new (NMDBusSignalData); + sd->signal_name = g_strdup (signal_name); + sd->signature = signature; + + closure = (swapped ? g_cclosure_new_swap : g_cclosure_new) (c_handler, data, destroy_data); + g_closure_set_marshal (closure, g_cclosure_marshal_generic); + g_closure_set_meta_marshal (closure, sd, dbus_signal_meta_marshal); + g_closure_add_finalize_notifier (closure, sd, dbus_signal_data_free); + + return g_signal_connect_closure (proxy, "g-signal", closure, after); +} + +/** + * _nm_dbus_signal_connect: + * @proxy: a #GDBusProxy + * @signal_name: the D-Bus signal to connect to + * @signature: the signal's type signature (must be a tuple) + * @c_handler: the signal handler function + * @data: (allow-none): data to pass to @c_handler + * + * Simplified version of _nm_dbus_signal_connect_data() with fewer arguments. + * + * Returns: the signal handler ID, as with _nm_signal_connect_data(). + */ + + +static void +typecheck_response (GVariant **response, + const GVariantType *reply_type, + GError **error) +{ + if (*response && reply_type && !g_variant_is_of_type (*response, reply_type)) { + /* This is the same error code that g_dbus_connection_call() returns if + * @reply_type doesn't match. + */ + g_set_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, + _("Method returned type '%s', but expected '%s'"), + g_variant_get_type_string (*response), + g_variant_type_peek_string (reply_type)); + g_clear_pointer (response, g_variant_unref); + } +} + +/** + * _nm_dbus_proxy_call_finish: + * @proxy: A #GDBusProxy. + * @res: A #GAsyncResult obtained from the #GAsyncReadyCallback passed to + * g_dbus_proxy_call(). + * @reply_type: (allow-none): the expected type of the reply, or %NULL + * @error: Return location for error or %NULL. + * + * Finishes an operation started with g_dbus_proxy_call(), as with + * g_dbus_proxy_call_finish(), except thatif @reply_type is non-%NULL, then it + * will also check that the response matches that type signature, and return + * an error if not. + * + * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with + * return values. Free with g_variant_unref(). + */ +GVariant * +_nm_dbus_proxy_call_finish (GDBusProxy *proxy, + GAsyncResult *res, + const GVariantType *reply_type, + GError **error) +{ + GVariant *ret; + + ret = g_dbus_proxy_call_finish (proxy, res, error); + typecheck_response (&ret, reply_type, error); + return ret; +} + +/** + * _nm_dbus_proxy_call_sync: + * @proxy: A #GDBusProxy. + * @method_name: Name of method to invoke. + * @parameters: (allow-none): A #GVariant tuple with parameters for the signal + * or %NULL if not passing parameters. + * @reply_type: (allow-none): the expected type of the reply, or %NULL + * @flags: Flags from the #GDBusCallFlags enumeration. + * @timeout_msec: The timeout in milliseconds (with %G_MAXINT meaning + * "infinite") or -1 to use the proxy default timeout. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the @method_name method on @proxy, as with + * g_dbus_proxy_call_sync(), except that if @reply_type is non-%NULL, then the + * reply to the call will be checked against it, and an error returned if it + * does not match. + * + * Returns: %NULL if @error is set. Otherwise a #GVariant tuple with + * return values. Free with g_variant_unref(). + */ +GVariant * +_nm_dbus_proxy_call_sync (GDBusProxy *proxy, + const gchar *method_name, + GVariant *parameters, + const GVariantType *reply_type, + GDBusCallFlags flags, + gint timeout_msec, + GCancellable *cancellable, + GError **error) +{ + GVariant *ret; + + ret = g_dbus_proxy_call_sync (proxy, method_name, parameters, + flags, timeout_msec, + cancellable, error); + typecheck_response (&ret, reply_type, error); + return ret; +} + +/** + * _nm_dbus_error_has_name: + * @error: (allow-none): a #GError, or %NULL + * @dbus_error_name: a D-Bus error name + * + * Checks if @error is set and corresponds to the D-Bus error @dbus_error_name. + * + * This should only be used for "foreign" D-Bus errors (eg, errors + * from BlueZ or wpa_supplicant). All NetworkManager D-Bus errors + * should be properly mapped by gdbus to one of the domains/codes in + * nm-errors.h. + * + * Returns: %TRUE or %FALSE + */ +gboolean +_nm_dbus_error_has_name (GError *error, + const char *dbus_error_name) +{ + gboolean has_name = FALSE; + + if (error && g_dbus_error_is_remote_error (error)) { + char *error_name; + + error_name = g_dbus_error_get_remote_error (error); + has_name = !g_strcmp0 (error_name, dbus_error_name); + g_free (error_name); + } + + return has_name; +} diff --git a/libnm-core/nm-errors.c b/libnm-core/nm-errors.c index 222f2de6..4c950f69 100644 --- a/libnm-core/nm-errors.c +++ b/libnm-core/nm-errors.c @@ -21,10 +21,9 @@ #include "config.h" #include -#include +#include "nm-default.h" #include "nm-errors.h" -#include "nm-glib-compat.h" #include "nm-vpn-dbus-interface.h" #include "nm-core-internal.h" diff --git a/libnm-core/nm-keyfile-internal.h b/libnm-core/nm-keyfile-internal.h index f4bb0796..7873aa7c 100644 --- a/libnm-core/nm-keyfile-internal.h +++ b/libnm-core/nm-keyfile-internal.h @@ -22,13 +22,12 @@ #ifndef __NM_KEYFILE_INTERNAL_H__ #define __NM_KEYFILE_INTERNAL_H__ -#include #include +#include "nm-default.h" #include "nm-connection.h" #include "nm-setting-8021x.h" - /*********************************************************/ #define NM_KEYFILE_CERT_SCHEME_PREFIX_BLOB "data:;base64," diff --git a/libnm-core/nm-keyfile-reader.c b/libnm-core/nm-keyfile-reader.c index 9d8c8734..6a0584a5 100644 --- a/libnm-core/nm-keyfile-reader.c +++ b/libnm-core/nm-keyfile-reader.c @@ -28,16 +28,12 @@ #include #include #include -#include +#include "nm-default.h" #include "nm-core-internal.h" #include "nm-macros-internal.h" -#include "gsystem-local-alloc.h" -#include "nm-glib-compat.h" #include "nm-keyfile-internal.h" #include "nm-keyfile-utils.h" -#include "nm-setting-private.h" - typedef struct { NMConnection *connection; @@ -563,6 +559,28 @@ ip6_dns_parser (KeyfileReaderInfo *info, NMSetting *setting, const char *key) g_strfreev (list); } +static void +ip6_addr_gen_mode_parser (KeyfileReaderInfo *info, NMSetting *setting, const char *key) +{ + NMSettingIP6ConfigAddrGenMode addr_gen_mode; + const char *setting_name = nm_setting_get_name (setting); + gs_free char *s = NULL; + + s = nm_keyfile_plugin_kf_get_string (info->keyfile, setting_name, key, NULL); + if (s) { + if (!nm_utils_enum_from_str (nm_setting_ip6_config_addr_gen_mode_get_type (), s, + (int *) &addr_gen_mode, NULL)) { + handle_warn (info, key, NM_KEYFILE_WARN_SEVERITY_WARN, + _("invalid option '%s', use one of [%s]"), + s, "eui64,stable-privacy"); + return; + } + } else + addr_gen_mode = NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_EUI64; + + g_object_set (G_OBJECT (setting), key, (gint) addr_gen_mode, NULL); +} + static void mac_address_parser (KeyfileReaderInfo *info, NMSetting *setting, const char *key, gsize enforce_length) { @@ -1181,6 +1199,10 @@ static KeyParser key_parsers[] = { NM_SETTING_IP_CONFIG_DNS, FALSE, ip6_dns_parser }, + { NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE, + FALSE, + ip6_addr_gen_mode_parser }, { NM_SETTING_WIRED_SETTING_NAME, NM_SETTING_WIRED_MAC_ADDRESS, TRUE, @@ -1257,8 +1279,13 @@ set_default_for_missing_key (NMSetting *setting, const char *property) { /* Set a value different from the default value of the property's spec */ - if (NM_IS_SETTING_VLAN (setting) && !strcmp (property, NM_SETTING_VLAN_FLAGS)) - g_object_set (setting, property, 0, NULL); + if (NM_IS_SETTING_VLAN (setting)) { + if (!strcmp (property, NM_SETTING_VLAN_FLAGS)) + g_object_set (setting, property, (NMVlanFlags) 0, NULL); + } else if (NM_IS_SETTING_WIRELESS (setting)) { + if (!strcmp (property, NM_SETTING_WIRELESS_MAC_ADDRESS_RANDOMIZATION)) + g_object_set (setting, property, (NMSettingMacRandomization) NM_SETTING_MAC_RANDOMIZATION_NEVER, NULL); + } } static void diff --git a/libnm-core/nm-keyfile-utils.c b/libnm-core/nm-keyfile-utils.c index d04a3d1b..15b14a3e 100644 --- a/libnm-core/nm-keyfile-utils.c +++ b/libnm-core/nm-keyfile-utils.c @@ -20,18 +20,16 @@ #include "config.h" -#include #include #include -#include "gsystem-local-alloc.h" +#include "nm-default.h" #include "nm-keyfile-utils.h" #include "nm-keyfile-internal.h" #include "nm-setting-wired.h" #include "nm-setting-wireless.h" #include "nm-setting-wireless-security.h" - typedef struct { const char *setting; const char *alias; diff --git a/libnm-core/nm-keyfile-writer.c b/libnm-core/nm-keyfile-writer.c index 1dac5c32..ba1736b9 100644 --- a/libnm-core/nm-keyfile-writer.c +++ b/libnm-core/nm-keyfile-writer.c @@ -28,11 +28,8 @@ #include #include #include -#include #include "nm-core-internal.h" -#include "gsystem-local-alloc.h" -#include "nm-glib-compat.h" #include "nm-keyfile-internal.h" #include "nm-keyfile-utils.h" @@ -105,6 +102,24 @@ dns_writer (KeyfileWriterInfo *info, } } +static void +ip6_addr_gen_mode_writer (KeyfileWriterInfo *info, + NMSetting *setting, + const char *key, + const GValue *value) +{ + NMSettingIP6ConfigAddrGenMode addr_gen_mode; + gs_free char *str = NULL; + + addr_gen_mode = (NMSettingIP6ConfigAddrGenMode) g_value_get_int (value); + str = nm_utils_enum_to_str (nm_setting_ip6_config_addr_gen_mode_get_type (), + addr_gen_mode); + nm_keyfile_plugin_kf_set_string (info->keyfile, + nm_setting_get_name (setting), + key, + str); +} + static void write_ip_values (GKeyFile *file, const char *setting_name, @@ -560,6 +575,9 @@ static KeyWriter key_writers[] = { { NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_DNS, dns_writer }, + { NM_SETTING_IP6_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE, + ip6_addr_gen_mode_writer }, { NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_SSID, ssid_writer }, @@ -590,8 +608,16 @@ static KeyWriter key_writers[] = { static gboolean can_omit_default_value (NMSetting *setting, const char *property) { - if (NM_IS_SETTING_VLAN (setting) && !strcmp (property, NM_SETTING_VLAN_FLAGS)) - return FALSE; + if (NM_IS_SETTING_VLAN (setting)) { + if (!strcmp (property, NM_SETTING_VLAN_FLAGS)) + return FALSE; + } else if (NM_IS_SETTING_IP6_CONFIG (setting)) { + if (!strcmp (property, NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE)) + return FALSE; + } else if (NM_IS_SETTING_WIRELESS (setting)) { + if (!strcmp (property, NM_SETTING_WIRELESS_MAC_ADDRESS_RANDOMIZATION)) + return FALSE; + } return TRUE; } diff --git a/libnm-core/nm-property-compare.c b/libnm-core/nm-property-compare.c index 5d270706..d244f745 100644 --- a/libnm-core/nm-property-compare.c +++ b/libnm-core/nm-property-compare.c @@ -22,13 +22,12 @@ #include "config.h" -#include "nm-property-compare.h" -#include "nm-glib-compat.h" - #include #include #include -#include + +#include "nm-property-compare.h" +#include "nm-default.h" static gint _nm_property_compare_collection (GVariant *value1, GVariant *value2) diff --git a/libnm-core/nm-property-compare.h b/libnm-core/nm-property-compare.h index 33016787..3f105818 100644 --- a/libnm-core/nm-property-compare.h +++ b/libnm-core/nm-property-compare.h @@ -23,7 +23,7 @@ #ifndef __NM_PROPERTY_COMPARE_H__ #define __NM_PROPERTY_COMPARE_H__ -#include +#include "nm-default.h" int nm_property_compare (GVariant *value1, GVariant *value2); diff --git a/libnm-core/nm-setting-8021x.c b/libnm-core/nm-setting-8021x.c index d53ae43b..cd0d4e66 100644 --- a/libnm-core/nm-setting-8021x.c +++ b/libnm-core/nm-setting-8021x.c @@ -23,8 +23,8 @@ #include "config.h" #include -#include +#include "nm-default.h" #include "nm-setting-8021x.h" #include "nm-utils.h" #include "crypto.h" @@ -32,7 +32,6 @@ #include "nm-setting-private.h" #include "nm-core-enum-types.h" #include "nm-macros-internal.h" -#include "gsystem-local-alloc.h" /** * SECTION:nm-setting-8021x @@ -429,6 +428,8 @@ get_cert_scheme (GBytes *bytes, GError **error) * * Returns: the scheme of the blob or %NM_SETTING_802_1X_CK_SCHEME_UNKNOWN. * For NULL it also returns NM_SETTING_802_1X_CK_SCHEME_UNKNOWN. + * + * Since: 1.2 **/ NMSetting8021xCKScheme nm_setting_802_1x_check_cert_scheme (gconstpointer pdata, gsize length, GError **error) diff --git a/libnm-core/nm-setting-8021x.h b/libnm-core/nm-setting-8021x.h index 3099fbd1..da86071a 100644 --- a/libnm-core/nm-setting-8021x.h +++ b/libnm-core/nm-setting-8021x.h @@ -149,6 +149,9 @@ GType nm_setting_802_1x_get_type (void); NMSetting *nm_setting_802_1x_new (void); +NM_AVAILABLE_IN_1_2 +NMSetting8021xCKScheme nm_setting_802_1x_check_cert_scheme (gconstpointer pdata, gsize length, GError **error); + guint32 nm_setting_802_1x_get_num_eap_methods (NMSetting8021x *setting); const char * nm_setting_802_1x_get_eap_method (NMSetting8021x *setting, guint32 i); gboolean nm_setting_802_1x_add_eap_method (NMSetting8021x *setting, const char *eap); diff --git a/libnm-core/nm-setting-adsl.c b/libnm-core/nm-setting-adsl.c index 7d78f060..0cf386d8 100644 --- a/libnm-core/nm-setting-adsl.c +++ b/libnm-core/nm-setting-adsl.c @@ -22,7 +22,6 @@ #include "config.h" #include -#include #include "nm-setting-adsl.h" #include "nm-setting-ppp.h" @@ -227,6 +226,15 @@ verify (NMSetting *setting, NMConnection *connection, GError **error) return TRUE; } +static gboolean +verify_secrets (NMSetting *setting, NMConnection *connection, GError **error) +{ + return _nm_setting_verify_secret_string (NM_SETTING_ADSL_GET_PRIVATE (setting)->password, + NM_SETTING_ADSL_SETTING_NAME, + NM_SETTING_ADSL_PASSWORD, + error); +} + static GPtrArray * need_secrets (NMSetting *setting) { @@ -350,6 +358,7 @@ nm_setting_adsl_class_init (NMSettingAdslClass *setting_class) object_class->get_property = get_property; object_class->finalize = finalize; parent_class->verify = verify; + parent_class->verify_secrets = verify_secrets; parent_class->need_secrets = need_secrets; /* Properties */ diff --git a/libnm-core/nm-setting-bluetooth.c b/libnm-core/nm-setting-bluetooth.c index 41a0b4c2..864a91cc 100644 --- a/libnm-core/nm-setting-bluetooth.c +++ b/libnm-core/nm-setting-bluetooth.c @@ -24,7 +24,6 @@ #include #include -#include #include "nm-setting-bluetooth.h" #include "nm-setting-cdma.h" diff --git a/libnm-core/nm-setting-bond.c b/libnm-core/nm-setting-bond.c index 5441a090..1c377584 100644 --- a/libnm-core/nm-setting-bond.c +++ b/libnm-core/nm-setting-bond.c @@ -26,7 +26,6 @@ #include #include #include -#include #include "nm-setting-bond.h" #include "nm-utils.h" diff --git a/libnm-core/nm-setting-bridge-port.c b/libnm-core/nm-setting-bridge-port.c index 763af37b..a02b8de1 100644 --- a/libnm-core/nm-setting-bridge-port.c +++ b/libnm-core/nm-setting-bridge-port.c @@ -24,7 +24,6 @@ #include #include #include -#include #include "nm-setting-bridge-port.h" #include "nm-utils.h" diff --git a/libnm-core/nm-setting-bridge.c b/libnm-core/nm-setting-bridge.c index d00271b7..7915e730 100644 --- a/libnm-core/nm-setting-bridge.c +++ b/libnm-core/nm-setting-bridge.c @@ -24,7 +24,6 @@ #include #include #include -#include #include "nm-setting-bridge.h" #include "nm-connection-private.h" @@ -53,6 +52,7 @@ typedef struct { guint16 hello_time; guint16 max_age; guint32 ageing_time; + gboolean multicast_snooping; } NMSettingBridgePrivate; enum { @@ -64,6 +64,7 @@ enum { PROP_HELLO_TIME, PROP_MAX_AGE, PROP_AGEING_TIME, + PROP_MULTICAST_SNOOPING, LAST_PROP }; @@ -178,6 +179,22 @@ nm_setting_bridge_get_ageing_time (NMSettingBridge *setting) return NM_SETTING_BRIDGE_GET_PRIVATE (setting)->ageing_time; } +/** + * nm_setting_bridge_get_multicast_snooping: + * @setting: the #NMSettingBridge + * + * Returns: the #NMSettingBridge:multicast-snooping property of the setting + * + * Since: 1.2 + **/ +gboolean +nm_setting_bridge_get_multicast_snooping (NMSettingBridge *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_BRIDGE (setting), FALSE); + + return NM_SETTING_BRIDGE_GET_PRIVATE (setting)->multicast_snooping; +} + /* IEEE 802.1D-1998 timer values */ #define BR_MIN_HELLO_TIME 1 #define BR_MAX_HELLO_TIME 10 @@ -309,6 +326,9 @@ set_property (GObject *object, guint prop_id, case PROP_AGEING_TIME: priv->ageing_time = g_value_get_uint (value); break; + case PROP_MULTICAST_SNOOPING: + priv->multicast_snooping = g_value_get_boolean (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -344,6 +364,9 @@ get_property (GObject *object, guint prop_id, case PROP_AGEING_TIME: g_value_set_uint (value, priv->ageing_time); break; + case PROP_MULTICAST_SNOOPING: + g_value_set_boolean (value, priv->multicast_snooping); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -533,6 +556,33 @@ nm_setting_bridge_class_init (NMSettingBridgeClass *setting_class) NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS)); + /** + * NMSettingBridge:multicast-snooping: + * + * Controls whether IGMP snooping is enabled for this bridge. + * Note that if snooping was automatically disabled due to hash collisions, + * the system may refuse to enable the feature until the collisions are + * resolved. + * + * Since: 1.2 + **/ + /* ---ifcfg-rh--- + * property: multicast-snooping + * variable: BRIDGING_OPTS: multicast_snooping= + * values: 0 or 1 + * default: 1 + * description: IGMP snooping support. + * ---end--- + */ + g_object_class_install_property + (object_class, PROP_MULTICAST_SNOOPING, + g_param_spec_boolean (NM_SETTING_BRIDGE_MULTICAST_SNOOPING, "", "", + TRUE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + /* ---dbus--- * property: interface-name * format: string diff --git a/libnm-core/nm-setting-bridge.h b/libnm-core/nm-setting-bridge.h index b4fe7477..020d6db6 100644 --- a/libnm-core/nm-setting-bridge.h +++ b/libnm-core/nm-setting-bridge.h @@ -16,7 +16,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright 2011 - 2012 Red Hat, Inc. + * Copyright 2011 - 2015 Red Hat, Inc. */ #ifndef __NM_SETTING_BRIDGE_H__ @@ -46,6 +46,7 @@ G_BEGIN_DECLS #define NM_SETTING_BRIDGE_HELLO_TIME "hello-time" #define NM_SETTING_BRIDGE_MAX_AGE "max-age" #define NM_SETTING_BRIDGE_AGEING_TIME "ageing-time" +#define NM_SETTING_BRIDGE_MULTICAST_SNOOPING "multicast-snooping" struct _NMSettingBridge { NMSetting parent; @@ -76,6 +77,8 @@ guint16 nm_setting_bridge_get_max_age (NMSettingBridge *setting); guint32 nm_setting_bridge_get_ageing_time (NMSettingBridge *setting); +gboolean nm_setting_bridge_get_multicast_snooping (NMSettingBridge *setting); + G_END_DECLS #endif /* __NM_SETTING_BRIDGE_H__ */ diff --git a/libnm-core/nm-setting-cdma.c b/libnm-core/nm-setting-cdma.c index 6fd2ad8b..3c01b43f 100644 --- a/libnm-core/nm-setting-cdma.c +++ b/libnm-core/nm-setting-cdma.c @@ -22,7 +22,6 @@ #include "config.h" #include -#include #include "nm-setting-cdma.h" #include "nm-utils.h" @@ -163,6 +162,15 @@ verify (NMSetting *setting, NMConnection *connection, GError **error) return TRUE; } +static gboolean +verify_secrets (NMSetting *setting, NMConnection *connection, GError **error) +{ + return _nm_setting_verify_secret_string (NM_SETTING_CDMA_GET_PRIVATE (setting)->password, + NM_SETTING_CDMA_SETTING_NAME, + NM_SETTING_CDMA_PASSWORD, + error); +} + static GPtrArray * need_secrets (NMSetting *setting) { @@ -265,6 +273,7 @@ nm_setting_cdma_class_init (NMSettingCdmaClass *setting_class) object_class->get_property = get_property; object_class->finalize = finalize; parent_class->verify = verify; + parent_class->verify_secrets = verify_secrets; parent_class->need_secrets = need_secrets; /* Properties */ diff --git a/libnm-core/nm-setting-connection.c b/libnm-core/nm-setting-connection.c index 28e590df..f341a398 100644 --- a/libnm-core/nm-setting-connection.c +++ b/libnm-core/nm-setting-connection.c @@ -23,7 +23,6 @@ #include "config.h" #include -#include #include "nm-utils.h" #include "nm-utils-private.h" @@ -34,6 +33,7 @@ #include "nm-setting-bridge.h" #include "nm-setting-team.h" #include "nm-setting-vlan.h" +#include "nm-macros-internal.h" /** * SECTION:nm-setting-connection @@ -77,6 +77,7 @@ typedef struct { GSList *secondaries; /* secondary connections to activate with the base connection */ guint gateway_ping_timeout; NMMetered metered; + NMSettingConnectionLldp lldp; } NMSettingConnectionPrivate; enum { @@ -97,6 +98,7 @@ enum { PROP_SECONDARIES, PROP_GATEWAY_PING_TIMEOUT, PROP_METERED, + PROP_LLDP, LAST_PROP }; @@ -616,7 +618,7 @@ nm_setting_connection_is_slave_type (NMSettingConnection *setting, * Returns: whether slaves of the connection should be activated together * with the connection. * - * Since: 1.0.4 + * Since: 1.2 **/ NMSettingConnectionAutoconnectSlaves nm_setting_connection_get_autoconnect_slaves (NMSettingConnection *setting) @@ -625,6 +627,9 @@ nm_setting_connection_get_autoconnect_slaves (NMSettingConnection *setting) return NM_SETTING_CONNECTION_GET_PRIVATE (setting)->autoconnect_slaves; } +NM_BACKPORT_SYMBOL (libnm_1_0_4, NMSettingConnectionAutoconnectSlaves, nm_setting_connection_get_autoconnect_slaves, (NMSettingConnection *setting), (setting)); + +NM_BACKPORT_SYMBOL (libnm_1_0_4, GType, nm_setting_connection_autoconnect_slaves_get_type, (void), ()); /** * nm_setting_connection_get_num_secondaries: @@ -768,7 +773,7 @@ nm_setting_connection_get_gateway_ping_timeout (NMSettingConnection *setting) * * Returns: the #NMSettingConnection:metered property of the setting. * - * Since: 1.0.6 + * Since: 1.2 **/ NMMetered nm_setting_connection_get_metered (NMSettingConnection *setting) @@ -779,6 +784,29 @@ nm_setting_connection_get_metered (NMSettingConnection *setting) return NM_SETTING_CONNECTION_GET_PRIVATE (setting)->metered; } +NM_BACKPORT_SYMBOL (libnm_1_0_6, NMMetered, nm_setting_connection_get_metered, (NMSettingConnection *setting), (setting)); + +NM_BACKPORT_SYMBOL (libnm_1_0_6, GType, nm_metered_get_type, (void), ()); + +/** + * nm_setting_connection_get_lldp: + * @setting: the #NMSettingConnection + * + * Returns the #NMSettingConnection:lldp property of the connection. + * + * Returns: a %NMSettingConnectionLldp which indicates whether LLDP must be + * enabled for the connection. + * + * Since: 1.2 + **/ +NMSettingConnectionLldp +nm_setting_connection_get_lldp (NMSettingConnection *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_CONNECTION (setting), NM_SETTING_CONNECTION_LLDP_DEFAULT); + + return NM_SETTING_CONNECTION_GET_PRIVATE (setting)->lldp; +} + static void _set_error_missing_base_setting (GError **error, const char *type) { @@ -1188,6 +1216,9 @@ set_property (GObject *object, guint prop_id, case PROP_METERED: priv->metered = g_value_get_enum (value); break; + case PROP_LLDP: + priv->lldp = g_value_get_int (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -1264,6 +1295,9 @@ get_property (GObject *object, guint prop_id, case PROP_METERED: g_value_set_enum (value, priv->metered); break; + case PROP_LLDP: + g_value_set_int (value, priv->lldp); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -1525,6 +1559,9 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class) * (for example "Home", "Work", "Public"). %NULL or unspecified zone means * the connection will be placed in the default zone as defined by the * firewall. + * + * When updating this property on a currently activated connection, + * the change takes effect immediately. **/ /* ---ifcfg-rh--- * property: zone @@ -1541,6 +1578,7 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class) G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_FUZZY_IGNORE | + NM_SETTING_PARAM_REAPPLY_IMMEDIATELY | G_PARAM_STATIC_STRINGS)); /** @@ -1599,7 +1637,7 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class) * If -1 (default) is set, global connection.autoconnect-slaves is read to * determine the real value. If it is default as well, this fallbacks to 0. * - * Since: 1.0.4 + * Since: 1.2 **/ /* ---ifcfg-rh--- * property: autoconnect-slaves @@ -1669,7 +1707,10 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class) * * Whether the connection is metered. * - * Since: 1.0.6 + * When updating this property on a currently activated connection, + * the change takes effect immediately. + * + * Since: 1.2 **/ /* ---ifcfg-rh--- * property: metered @@ -1685,5 +1726,31 @@ nm_setting_connection_class_init (NMSettingConnectionClass *setting_class) NM_TYPE_METERED, NM_METERED_UNKNOWN, G_PARAM_READWRITE | + NM_SETTING_PARAM_REAPPLY_IMMEDIATELY | G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingConnection:lldp: + * + * Whether LLDP is enabled for the connection. + * + * Since: 1.2 + **/ + /* ---ifcfg-rh--- + * property: lldp + * variable: LLDP + * values: boolean value or 'rx' + * default: missing variable means global default + * description: whether LLDP is enabled for the connection + * example: LLDP=no + * ---end--- + */ + g_object_class_install_property + (object_class, PROP_LLDP, + g_param_spec_int (NM_SETTING_CONNECTION_LLDP, "", "", + G_MININT32, G_MAXINT32, NM_SETTING_CONNECTION_LLDP_DEFAULT, + NM_SETTING_PARAM_FUZZY_IGNORE | + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS)); } diff --git a/libnm-core/nm-setting-connection.h b/libnm-core/nm-setting-connection.h index 24b5f6ac..0d4966f0 100644 --- a/libnm-core/nm-setting-connection.h +++ b/libnm-core/nm-setting-connection.h @@ -60,6 +60,7 @@ G_BEGIN_DECLS #define NM_SETTING_CONNECTION_SECONDARIES "secondaries" #define NM_SETTING_CONNECTION_GATEWAY_PING_TIMEOUT "gateway-ping-timeout" #define NM_SETTING_CONNECTION_METERED "metered" +#define NM_SETTING_CONNECTION_LLDP "lldp" /* Types for property values */ /** @@ -73,13 +74,25 @@ G_BEGIN_DECLS * #NMSettingConnectionAutoconnectSlaves values indicate whether slave connections * should be activated when master is activated. */ -NM_AVAILABLE_IN_1_0_4 typedef enum { NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_DEFAULT = -1, NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_NO = 0, NM_SETTING_CONNECTION_AUTOCONNECT_SLAVES_YES = 1, } NMSettingConnectionAutoconnectSlaves; +/** + * NMSettingConnectionLldp: + * @NM_SETTING_CONNECTION_LLDP_DEFAULT: default value + * @NM_SETTING_CONNECTION_LLDP_DISABLE: disable LLDP + * @NM_SETTING_CONNECTION_LLDP_ENABLE_RX: enable reception of LLDP frames + * + * #NMSettingConnectionLldp values indicate whether LLDP should be enabled. + */ +typedef enum { + NM_SETTING_CONNECTION_LLDP_DEFAULT = -1, + NM_SETTING_CONNECTION_LLDP_DISABLE = 0, + NM_SETTING_CONNECTION_LLDP_ENABLE_RX = 1, +} NMSettingConnectionLldp; /** * NMSettingConnection: @@ -133,7 +146,7 @@ const char *nm_setting_connection_get_master (NMSettingConnection *set gboolean nm_setting_connection_is_slave_type (NMSettingConnection *setting, const char *type); const char *nm_setting_connection_get_slave_type (NMSettingConnection *setting); -NM_AVAILABLE_IN_1_0_4 +NM_AVAILABLE_IN_1_2 NMSettingConnectionAutoconnectSlaves nm_setting_connection_get_autoconnect_slaves (NMSettingConnection *setting); guint32 nm_setting_connection_get_num_secondaries (NMSettingConnection *setting); @@ -143,8 +156,10 @@ void nm_setting_connection_remove_secondary (NMSettingConnection *set gboolean nm_setting_connection_remove_secondary_by_value (NMSettingConnection *setting, const char *sec_uuid); guint32 nm_setting_connection_get_gateway_ping_timeout (NMSettingConnection *setting); -NM_AVAILABLE_IN_1_0_6 +NM_AVAILABLE_IN_1_2 NMMetered nm_setting_connection_get_metered (NMSettingConnection *setting); +NM_AVAILABLE_IN_1_2 +NMSettingConnectionLldp nm_setting_connection_get_lldp (NMSettingConnection *setting); G_END_DECLS diff --git a/libnm-core/nm-setting-dcb.c b/libnm-core/nm-setting-dcb.c index 915cc41f..89675810 100644 --- a/libnm-core/nm-setting-dcb.c +++ b/libnm-core/nm-setting-dcb.c @@ -22,7 +22,6 @@ #include "config.h" #include -#include #include "nm-setting-dcb.h" #include "nm-utils.h" diff --git a/libnm-core/nm-setting-gsm.c b/libnm-core/nm-setting-gsm.c index 36557a25..4bb5ba9f 100644 --- a/libnm-core/nm-setting-gsm.c +++ b/libnm-core/nm-setting-gsm.c @@ -23,7 +23,6 @@ #include "config.h" #include -#include #include "nm-setting-gsm.h" #include "nm-utils.h" @@ -51,6 +50,11 @@ typedef struct { char *password; NMSettingSecretFlags password_flags; + /* Restrict connection to certain devices or SIMs */ + char *device_id; + char *sim_id; + char *sim_operator_id; + char *apn; /* NULL for dynamic */ char *network_id; /* for manual registration or NULL for automatic */ @@ -71,6 +75,9 @@ enum { PROP_PIN, PROP_PIN_FLAGS, PROP_HOME_ONLY, + PROP_DEVICE_ID, + PROP_SIM_ID, + PROP_SIM_OPERATOR_ID, LAST_PROP }; @@ -214,6 +221,54 @@ nm_setting_gsm_get_home_only (NMSettingGsm *setting) return NM_SETTING_GSM_GET_PRIVATE (setting)->home_only; } +/** + * nm_setting_gsm_get_device_id: + * @setting: the #NMSettingGsm + * + * Returns: the #NMSettingGsm:device-id property of the setting + * + * Since: 1.2 + **/ +const char * +nm_setting_gsm_get_device_id (NMSettingGsm *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_GSM (setting), NULL); + + return NM_SETTING_GSM_GET_PRIVATE (setting)->device_id; +} + +/** + * nm_setting_gsm_get_sim_id: + * @setting: the #NMSettingGsm + * + * Returns: the #NMSettingGsm:sim-id property of the setting + * + * Since: 1.2 + **/ +const char * +nm_setting_gsm_get_sim_id (NMSettingGsm *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_GSM (setting), NULL); + + return NM_SETTING_GSM_GET_PRIVATE (setting)->sim_id; +} + +/** + * nm_setting_gsm_get_sim_operator_id: + * @setting: the #NMSettingGsm + * + * Returns: the #NMSettingGsm:sim-operator-id property of the setting + * + * Since: 1.2 + **/ +const char * +nm_setting_gsm_get_sim_operator_id (NMSettingGsm *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_GSM (setting), NULL); + + return NM_SETTING_GSM_GET_PRIVATE (setting)->sim_operator_id; +} + static gboolean verify (NMSetting *setting, NMConnection *connection, GError **error) { @@ -313,9 +368,61 @@ verify (NMSetting *setting, NMConnection *connection, GError **error) } } + if (priv->device_id && !priv->device_id[0]) { + g_set_error_literal (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("property is empty")); + g_prefix_error (error, "%s.%s: ", NM_SETTING_GSM_SETTING_NAME, NM_SETTING_GSM_DEVICE_ID); + return FALSE; + } + + if (priv->sim_id && !priv->sim_id[0]) { + g_set_error_literal (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("property is empty")); + g_prefix_error (error, "%s.%s: ", NM_SETTING_GSM_SETTING_NAME, NM_SETTING_GSM_SIM_ID); + return FALSE; + } + + if (priv->sim_operator_id) { + size_t len = strlen (priv->sim_operator_id); + const char *p = priv->sim_operator_id; + + if (len == 0 || (len != 5 && len != 6)) { + g_set_error_literal (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("property is empty or wrong size")); + g_prefix_error (error, "%s.%s: ", NM_SETTING_GSM_SETTING_NAME, NM_SETTING_GSM_SIM_OPERATOR_ID); + return FALSE; + } + + while (p && *p) { + if (!g_ascii_isdigit (*p++)) { + g_set_error_literal (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("property must contain only digits")); + g_prefix_error (error, "%s.%s: ", NM_SETTING_GSM_SETTING_NAME, NM_SETTING_GSM_SIM_OPERATOR_ID); + return FALSE; + } + } + } + return TRUE; } +static gboolean +verify_secrets (NMSetting *setting, NMConnection *connection, GError **error) +{ + return _nm_setting_verify_secret_string (NM_SETTING_GSM_GET_PRIVATE (setting)->password, + NM_SETTING_GSM_SETTING_NAME, + NM_SETTING_GSM_PASSWORD, + error); +} + static GPtrArray * need_secrets (NMSetting *setting) { @@ -351,6 +458,9 @@ finalize (GObject *object) g_free (priv->apn); g_free (priv->network_id); g_free (priv->pin); + g_free (priv->device_id); + g_free (priv->sim_id); + g_free (priv->sim_operator_id); G_OBJECT_CLASS (nm_setting_gsm_parent_class)->finalize (object); } @@ -402,6 +512,18 @@ set_property (GObject *object, guint prop_id, case PROP_HOME_ONLY: priv->home_only = g_value_get_boolean (value); break; + case PROP_DEVICE_ID: + g_free (priv->device_id); + priv->device_id = g_value_dup_string (value); + break; + case PROP_SIM_ID: + g_free (priv->sim_id); + priv->sim_id = g_value_dup_string (value); + break; + case PROP_SIM_OPERATOR_ID: + g_free (priv->sim_operator_id); + priv->sim_operator_id = g_value_dup_string (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -442,6 +564,15 @@ get_property (GObject *object, guint prop_id, case PROP_HOME_ONLY: g_value_set_boolean (value, nm_setting_gsm_get_home_only (setting)); break; + case PROP_DEVICE_ID: + g_value_set_string (value, nm_setting_gsm_get_device_id (setting)); + break; + case PROP_SIM_ID: + g_value_set_string (value, nm_setting_gsm_get_sim_id (setting)); + break; + case PROP_SIM_OPERATOR_ID: + g_value_set_string (value, nm_setting_gsm_get_sim_operator_id (setting)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -461,6 +592,7 @@ nm_setting_gsm_class_init (NMSettingGsmClass *setting_class) object_class->get_property = get_property; object_class->finalize = finalize; parent_class->verify = verify; + parent_class->verify_secrets = verify_secrets; parent_class->need_secrets = need_secrets; /* Properties */ @@ -597,6 +729,57 @@ nm_setting_gsm_class_init (NMSettingGsmClass *setting_class) G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + /** + * NMSettingGsm:device-id: + * + * The device unique identifier (as given by the WWAN management service) + * which this connection applies to. If given, the connection will only + * apply to the specified device. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_DEVICE_ID, + g_param_spec_string (NM_SETTING_GSM_DEVICE_ID, "", "", + NULL, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingGsm:sim-id: + * + * The SIM card unique identifier (as given by the WWAN management service) + * which this connection applies to. If given, the connection will apply + * to any device also allowed by #NMSettingGsm:device-id which contains a + * SIM card matching the given identifier. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_SIM_ID, + g_param_spec_string (NM_SETTING_GSM_SIM_ID, "", "", + NULL, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingGsm:sim-operator-id: + * + * A MCC/MNC string like "310260" or "21601" identifying the specific + * mobile network operator which this connection applies to. If given, + * the connection will apply to any device also allowed by + * #NMSettingGsm:device-id and #NMSettingGsm:sim-id which contains a SIM + * card provisioined by the given operator. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_SIM_OPERATOR_ID, + g_param_spec_string (NM_SETTING_GSM_SIM_OPERATOR_ID, "", "", + NULL, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + /* Ignore incoming deprecated properties */ _nm_setting_class_add_dbus_only_property (parent_class, "allowed-bands", G_VARIANT_TYPE_UINT32, diff --git a/libnm-core/nm-setting-gsm.h b/libnm-core/nm-setting-gsm.h index 90756738..2dfe73fa 100644 --- a/libnm-core/nm-setting-gsm.h +++ b/libnm-core/nm-setting-gsm.h @@ -40,15 +40,18 @@ G_BEGIN_DECLS #define NM_SETTING_GSM_SETTING_NAME "gsm" -#define NM_SETTING_GSM_NUMBER "number" -#define NM_SETTING_GSM_USERNAME "username" -#define NM_SETTING_GSM_PASSWORD "password" -#define NM_SETTING_GSM_PASSWORD_FLAGS "password-flags" -#define NM_SETTING_GSM_APN "apn" -#define NM_SETTING_GSM_NETWORK_ID "network-id" -#define NM_SETTING_GSM_PIN "pin" -#define NM_SETTING_GSM_PIN_FLAGS "pin-flags" -#define NM_SETTING_GSM_HOME_ONLY "home-only" +#define NM_SETTING_GSM_NUMBER "number" +#define NM_SETTING_GSM_USERNAME "username" +#define NM_SETTING_GSM_PASSWORD "password" +#define NM_SETTING_GSM_PASSWORD_FLAGS "password-flags" +#define NM_SETTING_GSM_APN "apn" +#define NM_SETTING_GSM_NETWORK_ID "network-id" +#define NM_SETTING_GSM_PIN "pin" +#define NM_SETTING_GSM_PIN_FLAGS "pin-flags" +#define NM_SETTING_GSM_HOME_ONLY "home-only" +#define NM_SETTING_GSM_DEVICE_ID "device-id" +#define NM_SETTING_GSM_SIM_ID "sim-id" +#define NM_SETTING_GSM_SIM_OPERATOR_ID "sim-operator-id" struct _NMSettingGsm { NMSetting parent; @@ -63,14 +66,21 @@ typedef struct { GType nm_setting_gsm_get_type (void); -NMSetting *nm_setting_gsm_new (void); -const char *nm_setting_gsm_get_number (NMSettingGsm *setting); -const char *nm_setting_gsm_get_username (NMSettingGsm *setting); -const char *nm_setting_gsm_get_password (NMSettingGsm *setting); -const char *nm_setting_gsm_get_apn (NMSettingGsm *setting); -const char *nm_setting_gsm_get_network_id (NMSettingGsm *setting); -const char *nm_setting_gsm_get_pin (NMSettingGsm *setting); -gboolean nm_setting_gsm_get_home_only (NMSettingGsm *setting); +NMSetting *nm_setting_gsm_new (void); +const char *nm_setting_gsm_get_number (NMSettingGsm *setting); +const char *nm_setting_gsm_get_username (NMSettingGsm *setting); +const char *nm_setting_gsm_get_password (NMSettingGsm *setting); +const char *nm_setting_gsm_get_apn (NMSettingGsm *setting); +const char *nm_setting_gsm_get_network_id (NMSettingGsm *setting); +const char *nm_setting_gsm_get_pin (NMSettingGsm *setting); +gboolean nm_setting_gsm_get_home_only (NMSettingGsm *setting); + +NM_AVAILABLE_IN_1_2 +const char *nm_setting_gsm_get_device_id (NMSettingGsm *setting); +NM_AVAILABLE_IN_1_2 +const char *nm_setting_gsm_get_sim_id (NMSettingGsm *setting); +NM_AVAILABLE_IN_1_2 +const char *nm_setting_gsm_get_sim_operator_id (NMSettingGsm *setting); NMSettingSecretFlags nm_setting_gsm_get_pin_flags (NMSettingGsm *setting); NMSettingSecretFlags nm_setting_gsm_get_password_flags (NMSettingGsm *setting); diff --git a/libnm-core/nm-setting-infiniband.c b/libnm-core/nm-setting-infiniband.c index b0afe04f..1cffdd79 100644 --- a/libnm-core/nm-setting-infiniband.c +++ b/libnm-core/nm-setting-infiniband.c @@ -22,7 +22,6 @@ #include "config.h" #include -#include #include "nm-setting-infiniband.h" #include "nm-utils.h" diff --git a/libnm-core/nm-setting-ip-config.c b/libnm-core/nm-setting-ip-config.c index 3a67ca32..7e719aae 100644 --- a/libnm-core/nm-setting-ip-config.c +++ b/libnm-core/nm-setting-ip-config.c @@ -24,13 +24,12 @@ #include #include -#include +#include "nm-default.h" #include "nm-setting-ip-config.h" #include "nm-setting-ip4-config.h" #include "nm-setting-ip6-config.h" #include "nm-utils.h" -#include "nm-glib-compat.h" #include "nm-setting-private.h" #include "nm-utils-private.h" @@ -46,6 +45,24 @@ * related to IP addressing, routing, and Domain Name Service. **/ +const NMUtilsDNSOptionDesc _nm_utils_dns_option_descs[] = { + { NM_SETTING_DNS_OPTION_DEBUG, FALSE, FALSE }, + { NM_SETTING_DNS_OPTION_NDOTS, TRUE, FALSE }, + { NM_SETTING_DNS_OPTION_TIMEOUT, TRUE, FALSE }, + { NM_SETTING_DNS_OPTION_ATTEMPTS, TRUE, FALSE }, + { NM_SETTING_DNS_OPTION_ROTATE, FALSE, FALSE }, + { NM_SETTING_DNS_OPTION_NO_CHECK_NAMES, FALSE, FALSE }, + { NM_SETTING_DNS_OPTION_INET6, FALSE, TRUE }, + { NM_SETTING_DNS_OPTION_IP6_BYTESTRING, FALSE, TRUE }, + { NM_SETTING_DNS_OPTION_IP6_DOTINT, FALSE, TRUE }, + { NM_SETTING_DNS_OPTION_NO_IP6_DOTINT, FALSE, TRUE }, + { NM_SETTING_DNS_OPTION_EDNS0, FALSE, FALSE }, + { NM_SETTING_DNS_OPTION_SINGLE_REQUEST, FALSE, FALSE }, + { NM_SETTING_DNS_OPTION_SINGLE_REQUEST_REOPEN, FALSE, FALSE }, + { NM_SETTING_DNS_OPTION_NO_TLD_QUERY, FALSE, FALSE }, + { NULL, FALSE, FALSE } +}; + static char * canonicalize_ip (int family, const char *ip, gboolean null_any) { @@ -79,7 +96,7 @@ valid_ip (int family, const char *ip, GError **error) } if (!nm_utils_ipaddr_valid (family, ip)) { g_set_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_FAILED, - family == AF_INET ? _("Invalid IPv4 address '%s'") : _("Invalid IPv6 address '%s"), + family == AF_INET ? _("Invalid IPv4 address '%s'") : _("Invalid IPv6 address '%s'"), ip); return FALSE; } else @@ -93,7 +110,7 @@ valid_prefix (int family, guint prefix, GError **error, gboolean allow_zero_pref || (family == AF_INET6 && prefix > 128) || (!allow_zero_prefix && prefix == 0)) { g_set_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_FAILED, - family == AF_INET ? _("Invalid IPv4 address prefix '%u'") : _("Invalid IPv6 address prefix '%u"), + family == AF_INET ? _("Invalid IPv4 address prefix '%u'") : _("Invalid IPv6 address prefix '%u'"), prefix); return FALSE; } @@ -1065,6 +1082,7 @@ typedef struct { char *method; GPtrArray *dns; /* array of IP address strings */ GPtrArray *dns_search; /* array of domain name strings */ + GPtrArray *dns_options;/* array of DNS options */ GPtrArray *addresses; /* array of NMIPAddress */ GPtrArray *routes; /* array of NMIPRoute */ gint64 route_metric; @@ -1082,6 +1100,7 @@ enum { PROP_METHOD, PROP_DNS, PROP_DNS_SEARCH, + PROP_DNS_OPTIONS, PROP_ADDRESSES, PROP_GATEWAY, PROP_ROUTES, @@ -1131,21 +1150,21 @@ nm_setting_ip_config_get_num_dns (NMSettingIPConfig *setting) /** * nm_setting_ip_config_get_dns: * @setting: the #NMSettingIPConfig - * @i: index number of the DNS server to return + * @idx: index number of the DNS server to return * - * Returns: the IP address of the DNS server at index @i + * Returns: the IP address of the DNS server at index @idx **/ const char * -nm_setting_ip_config_get_dns (NMSettingIPConfig *setting, int i) +nm_setting_ip_config_get_dns (NMSettingIPConfig *setting, int idx) { NMSettingIPConfigPrivate *priv; g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), NULL); priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting); - g_return_val_if_fail (i < priv->dns->len, NULL); + g_return_val_if_fail (idx < priv->dns->len, NULL); - return priv->dns->pdata[i]; + return priv->dns->pdata[idx]; } /** @@ -1187,21 +1206,21 @@ nm_setting_ip_config_add_dns (NMSettingIPConfig *setting, const char *dns) /** * nm_setting_ip_config_remove_dns: * @setting: the #NMSettingIPConfig - * @i: index number of the DNS server to remove + * @idx: index number of the DNS server to remove * - * Removes the DNS server at index @i. + * Removes the DNS server at index @idx. **/ void -nm_setting_ip_config_remove_dns (NMSettingIPConfig *setting, int i) +nm_setting_ip_config_remove_dns (NMSettingIPConfig *setting, int idx) { NMSettingIPConfigPrivate *priv; g_return_if_fail (NM_IS_SETTING_IP_CONFIG (setting)); priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting); - g_return_if_fail (i < priv->dns->len); + g_return_if_fail (idx < priv->dns->len); - g_ptr_array_remove_index (priv->dns, i); + g_ptr_array_remove_index (priv->dns, idx); g_object_notify (G_OBJECT (setting), NM_SETTING_IP_CONFIG_DNS); } @@ -1275,21 +1294,21 @@ nm_setting_ip_config_get_num_dns_searches (NMSettingIPConfig *setting) /** * nm_setting_ip_config_get_dns_search: * @setting: the #NMSettingIPConfig - * @i: index number of the DNS search domain to return + * @idx: index number of the DNS search domain to return * - * Returns: the DNS search domain at index @i + * Returns: the DNS search domain at index @idx **/ const char * -nm_setting_ip_config_get_dns_search (NMSettingIPConfig *setting, int i) +nm_setting_ip_config_get_dns_search (NMSettingIPConfig *setting, int idx) { NMSettingIPConfigPrivate *priv; g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), NULL); priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting); - g_return_val_if_fail (i < priv->dns_search->len, NULL); + g_return_val_if_fail (idx < priv->dns_search->len, NULL); - return priv->dns_search->pdata[i]; + return priv->dns_search->pdata[idx]; } /** @@ -1327,21 +1346,21 @@ nm_setting_ip_config_add_dns_search (NMSettingIPConfig *setting, /** * nm_setting_ip_config_remove_dns_search: * @setting: the #NMSettingIPConfig - * @i: index number of the DNS search domain + * @idx: index number of the DNS search domain * - * Removes the DNS search domain at index @i. + * Removes the DNS search domain at index @idx. **/ void -nm_setting_ip_config_remove_dns_search (NMSettingIPConfig *setting, int i) +nm_setting_ip_config_remove_dns_search (NMSettingIPConfig *setting, int idx) { NMSettingIPConfigPrivate *priv; g_return_if_fail (NM_IS_SETTING_IP_CONFIG (setting)); priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting); - g_return_if_fail (i < priv->dns_search->len); + g_return_if_fail (idx < priv->dns_search->len); - g_ptr_array_remove_index (priv->dns_search, i); + g_ptr_array_remove_index (priv->dns_search, idx); g_object_notify (G_OBJECT (setting), NM_SETTING_IP_CONFIG_DNS_SEARCH); } @@ -1396,6 +1415,233 @@ nm_setting_ip_config_clear_dns_searches (NMSettingIPConfig *setting) g_object_notify (G_OBJECT (setting), NM_SETTING_IP_CONFIG_DNS_SEARCH); } +/** + * nm_setting_ip_config_get_num_dns_options: + * @setting: the #NMSettingIPConfig + * + * Returns: the number of configured DNS options + * + * Since: 1.2 + **/ +guint +nm_setting_ip_config_get_num_dns_options (NMSettingIPConfig *setting) +{ + NMSettingIPConfigPrivate *priv; + + g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), 0); + + priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting); + + return priv->dns_options ? priv->dns_options->len : 0; +} + +/** + * nm_setting_ip_config_has_dns_options: + * @setting: the #NMSettingIPConfig + * + * NMSettingIPConfig can have a list of dns-options. If the list + * is empty, there are two similar (but differentiated) states. + * Either the options are explicitly set to have no values, + * or the options are left undefined. The latter means to use + * a default configuration, while the former explicitly means "no-options". + * + * Returns: whether DNS options are initalized or left unset (the default). + **/ +gboolean +nm_setting_ip_config_has_dns_options (NMSettingIPConfig *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), 0); + + return !!NM_SETTING_IP_CONFIG_GET_PRIVATE (setting)->dns_options; +} + +/** + * nm_setting_ip_config_get_dns_option: + * @setting: the #NMSettingIPConfig + * @idx: index number of the DNS option + * + * Returns: the DNS option at index @idx + * + * Since: 1.2 + **/ +const char * +nm_setting_ip_config_get_dns_option (NMSettingIPConfig *setting, guint idx) +{ + NMSettingIPConfigPrivate *priv; + + g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), NULL); + + priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting); + g_return_val_if_fail (priv->dns_options, NULL); + g_return_val_if_fail (idx < priv->dns_options->len, NULL); + + return priv->dns_options->pdata[idx]; +} + +/** + * nm_setting_ip_config_next_valid_dns_option: + * @setting: the #NMSettingIPConfig + * @idx: index to start the search from + * + * Returns: the index, greater or equal than @idx, of the first valid + * DNS option, or -1 if no valid option is found + * + * Since: 1.2 + **/ +gint +nm_setting_ip_config_next_valid_dns_option (NMSettingIPConfig *setting, guint idx) +{ + NMSettingIPConfigPrivate *priv; + + g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), -1); + + priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting); + + if (!priv->dns_options) + return -1; + + for (; idx < priv->dns_options->len; idx++) { + if (_nm_utils_dns_option_validate (priv->dns_options->pdata[idx], NULL, NULL, + NM_IS_SETTING_IP6_CONFIG (setting), + _nm_utils_dns_option_descs)) + return idx; + } + + return -1; +} + +/** + * nm_setting_ip_config_add_dns_option: + * @setting: the #NMSettingIPConfig + * @dns_option: the DNS option to add + * + * Adds a new DNS option to the setting. + * + * Returns: %TRUE if the DNS option was added; %FALSE otherwise + * + * Since: 1.2 + **/ +gboolean +nm_setting_ip_config_add_dns_option (NMSettingIPConfig *setting, + const char *dns_option) +{ + NMSettingIPConfigPrivate *priv; + + g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), FALSE); + g_return_val_if_fail (dns_option != NULL, FALSE); + g_return_val_if_fail (dns_option[0] != '\0', FALSE); + + if (!_nm_utils_dns_option_validate (dns_option, NULL, NULL, FALSE, NULL)) + return FALSE; + + priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting); + if (!priv->dns_options) + priv->dns_options = g_ptr_array_new_with_free_func (g_free); + else { + if (_nm_utils_dns_option_find_idx (priv->dns_options, dns_option) >= 0) + return FALSE; + } + + g_ptr_array_add (priv->dns_options, g_strdup (dns_option)); + g_object_notify (G_OBJECT (setting), NM_SETTING_IP_CONFIG_DNS_OPTIONS); + return TRUE; +} + +/** + * nm_setting_ip_config_remove_dns_option: + * @setting: the #NMSettingIPConfig + * @idx: index number of the DNS option + * + * Removes the DNS option at index @idx. + * + * Since: 1.2 + **/ +void +nm_setting_ip_config_remove_dns_option (NMSettingIPConfig *setting, int idx) +{ + NMSettingIPConfigPrivate *priv; + + g_return_if_fail (NM_IS_SETTING_IP_CONFIG (setting)); + + priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting); + g_return_if_fail (priv->dns_options); + g_return_if_fail (idx < priv->dns_options->len); + + g_ptr_array_remove_index (priv->dns_options, idx); + g_object_notify (G_OBJECT (setting), NM_SETTING_IP_CONFIG_DNS_OPTIONS); +} + +/** + * nm_setting_ip_config_remove_dns_option_by_value: + * @setting: the #NMSettingIPConfig + * @dns_option: the DNS option to remove + * + * Removes the DNS option @dns_option. + * + * Returns: %TRUE if the DNS option was found and removed; %FALSE if it was not. + * + * Since: 1.2 + **/ +gboolean +nm_setting_ip_config_remove_dns_option_by_value (NMSettingIPConfig *setting, + const char *dns_option) +{ + NMSettingIPConfigPrivate *priv; + int i; + + g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), FALSE); + g_return_val_if_fail (dns_option != NULL, FALSE); + g_return_val_if_fail (dns_option[0] != '\0', FALSE); + + priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting); + if (!priv->dns_options) + return FALSE; + + i = _nm_utils_dns_option_find_idx (priv->dns_options, dns_option); + if (i >= 0) { + g_ptr_array_remove_index (priv->dns_options, i); + g_object_notify (G_OBJECT (setting), NM_SETTING_IP_CONFIG_DNS_OPTIONS); + return TRUE; + } + + return FALSE; +} + +/** + * nm_setting_ip_config_clear_dns_options: + * @setting: the #NMSettingIPConfig + * @is_set: the dns-options can be either empty or unset (default). + * Specify how to clear the options. + * + * Removes all configured DNS options. + * + * Since: 1.2 + **/ +void +nm_setting_ip_config_clear_dns_options (NMSettingIPConfig *setting, gboolean is_set) +{ + NMSettingIPConfigPrivate *priv; + + g_return_if_fail (NM_IS_SETTING_IP_CONFIG (setting)); + + priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting); + if (!priv->dns_options) { + if (!is_set) + return; + priv->dns_options = g_ptr_array_new_with_free_func (g_free); + } else { + if (!is_set) { + g_ptr_array_unref (priv->dns_options); + priv->dns_options = NULL; + } else { + if (priv->dns_options->len == 0) + return; + g_ptr_array_set_size (priv->dns_options, 0); + } + } + g_object_notify (G_OBJECT (setting), NM_SETTING_IP_CONFIG_DNS_OPTIONS); +} + /** * nm_setting_ip_config_get_num_addresses: * @setting: the #NMSettingIPConfig @@ -1413,21 +1659,21 @@ nm_setting_ip_config_get_num_addresses (NMSettingIPConfig *setting) /** * nm_setting_ip_config_get_address: * @setting: the #NMSettingIPConfig - * @i: index number of the address to return + * @idx: index number of the address to return * - * Returns: (transfer none): the address at index @i + * Returns: (transfer none): the address at index @idx **/ NMIPAddress * -nm_setting_ip_config_get_address (NMSettingIPConfig *setting, int i) +nm_setting_ip_config_get_address (NMSettingIPConfig *setting, int idx) { NMSettingIPConfigPrivate *priv; g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), NULL); priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting); - g_return_val_if_fail (i < priv->addresses->len, NULL); + g_return_val_if_fail (idx < priv->addresses->len, NULL); - return priv->addresses->pdata[i]; + return priv->addresses->pdata[idx]; } /** @@ -1467,21 +1713,21 @@ nm_setting_ip_config_add_address (NMSettingIPConfig *setting, /** * nm_setting_ip_config_remove_address: * @setting: the #NMSettingIPConfig - * @i: index number of the address to remove + * @idx: index number of the address to remove * - * Removes the address at index @i. + * Removes the address at index @idx. **/ void -nm_setting_ip_config_remove_address (NMSettingIPConfig *setting, int i) +nm_setting_ip_config_remove_address (NMSettingIPConfig *setting, int idx) { NMSettingIPConfigPrivate *priv; g_return_if_fail (NM_IS_SETTING_IP_CONFIG (setting)); priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting); - g_return_if_fail (i < priv->addresses->len); + g_return_if_fail (idx < priv->addresses->len); - g_ptr_array_remove_index (priv->addresses, i); + g_ptr_array_remove_index (priv->addresses, idx); g_object_notify (G_OBJECT (setting), NM_SETTING_IP_CONFIG_ADDRESSES); } @@ -1565,21 +1811,21 @@ nm_setting_ip_config_get_num_routes (NMSettingIPConfig *setting) /** * nm_setting_ip_config_get_route: * @setting: the #NMSettingIPConfig - * @i: index number of the route to return + * @idx: index number of the route to return * - * Returns: (transfer none): the route at index @i + * Returns: (transfer none): the route at index @idx **/ NMIPRoute * -nm_setting_ip_config_get_route (NMSettingIPConfig *setting, int i) +nm_setting_ip_config_get_route (NMSettingIPConfig *setting, int idx) { NMSettingIPConfigPrivate *priv; g_return_val_if_fail (NM_IS_SETTING_IP_CONFIG (setting), NULL); priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting); - g_return_val_if_fail (i < priv->routes->len, NULL); + g_return_val_if_fail (idx < priv->routes->len, NULL); - return priv->routes->pdata[i]; + return priv->routes->pdata[idx]; } /** @@ -1617,21 +1863,21 @@ nm_setting_ip_config_add_route (NMSettingIPConfig *setting, /** * nm_setting_ip_config_remove_route: * @setting: the #NMSettingIPConfig - * @i: index number of the route + * @idx: index number of the route * - * Removes the route at index @i. + * Removes the route at index @idx. **/ void -nm_setting_ip_config_remove_route (NMSettingIPConfig *setting, int i) +nm_setting_ip_config_remove_route (NMSettingIPConfig *setting, int idx) { NMSettingIPConfigPrivate *priv; g_return_if_fail (NM_IS_SETTING_IP_CONFIG (setting)); priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting); - g_return_if_fail (i < priv->routes->len); + g_return_if_fail (idx < priv->routes->len); - g_ptr_array_remove_index (priv->routes, i); + g_ptr_array_remove_index (priv->routes, idx); g_object_notify (G_OBJECT (setting), NM_SETTING_IP_CONFIG_ROUTES); } @@ -1962,6 +2208,7 @@ nm_setting_ip_config_init (NMSettingIPConfig *setting) priv->dns = g_ptr_array_new_with_free_func (g_free); priv->dns_search = g_ptr_array_new_with_free_func (g_free); + priv->dns_options = NULL; priv->addresses = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_ip_address_unref); priv->routes = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_ip_route_unref); } @@ -1978,6 +2225,8 @@ finalize (GObject *object) g_ptr_array_unref (priv->dns); g_ptr_array_unref (priv->dns_search); + if (priv->dns_options) + g_ptr_array_unref (priv->dns_options); g_ptr_array_unref (priv->addresses); g_ptr_array_unref (priv->routes); @@ -1991,6 +2240,8 @@ set_property (GObject *object, guint prop_id, NMSettingIPConfig *setting = NM_SETTING_IP_CONFIG (object); NMSettingIPConfigPrivate *priv = NM_SETTING_IP_CONFIG_GET_PRIVATE (setting); const char *gateway; + char **strv; + int i; switch (prop_id) { case PROP_METHOD: @@ -2005,6 +2256,25 @@ set_property (GObject *object, guint prop_id, g_ptr_array_unref (priv->dns_search); priv->dns_search = _nm_utils_strv_to_ptrarray (g_value_get_boxed (value)); break; + case PROP_DNS_OPTIONS: + strv = g_value_get_boxed (value); + if (!strv) { + if (priv->dns_options) { + g_ptr_array_unref (priv->dns_options); + priv->dns_options = NULL; + } + } else { + if (priv->dns_options) + g_ptr_array_set_size (priv->dns_options, 0); + else + priv->dns_options = g_ptr_array_new_with_free_func (g_free); + for (i = 0; strv[i]; i++) { + if ( _nm_utils_dns_option_validate (strv[i], NULL, NULL, FALSE, NULL) + && _nm_utils_dns_option_find_idx (priv->dns_options, strv[i]) < 0) + g_ptr_array_add (priv->dns_options, g_strdup (strv[i])); + } + } + break; case PROP_ADDRESSES: g_ptr_array_unref (priv->addresses); priv->addresses = _nm_utils_copy_array (g_value_get_boxed (value), @@ -2068,6 +2338,9 @@ get_property (GObject *object, guint prop_id, case PROP_DNS_SEARCH: g_value_take_boxed (value, _nm_utils_ptrarray_to_strv (priv->dns_search)); break; + case PROP_DNS_OPTIONS: + g_value_take_boxed (value, priv->dns_options ? _nm_utils_ptrarray_to_strv (priv->dns_options) : NULL); + break; case PROP_ADDRESSES: g_value_take_boxed (value, _nm_utils_copy_array (priv->addresses, (NMUtilsCopyFunc) nm_ip_address_dup, @@ -2187,6 +2460,24 @@ nm_setting_ip_config_class_init (NMSettingIPConfigClass *setting_class) G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + /** + * NMSettingIPConfig:dns-options: + * + * Array of DNS options. + * + * %NULL means that the options are unset and left at the default. + * In this case NetworkManager will use default options. This is + * distinct from an empty list of properties. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_DNS_OPTIONS, + g_param_spec_boxed (NM_SETTING_IP_CONFIG_DNS_OPTIONS, "", "", + G_TYPE_STRV, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + /** * NMSettingIPConfig:addresses: * @@ -2304,6 +2595,8 @@ nm_setting_ip_config_class_init (NMSettingIPConfigClass *setting_class) * * If the #NMSettingIPConfig:dhcp-send-hostname property is %TRUE, then the * specified name will be sent to the DHCP server when acquiring a lease. + * This property and #NMSettingIP4Config:dhcp-fqdn are mutually exclusive and + * cannot be set at the same time. **/ g_object_class_install_property (object_class, PROP_DHCP_HOSTNAME, diff --git a/libnm-core/nm-setting-ip-config.h b/libnm-core/nm-setting-ip-config.h index 12763fa8..6e8c0202 100644 --- a/libnm-core/nm-setting-ip-config.h +++ b/libnm-core/nm-setting-ip-config.h @@ -133,6 +133,7 @@ void nm_ip_route_set_attribute (NMIPRoute *route, #define NM_SETTING_IP_CONFIG_METHOD "method" #define NM_SETTING_IP_CONFIG_DNS "dns" #define NM_SETTING_IP_CONFIG_DNS_SEARCH "dns-search" +#define NM_SETTING_IP_CONFIG_DNS_OPTIONS "dns-options" #define NM_SETTING_IP_CONFIG_ADDRESSES "addresses" #define NM_SETTING_IP_CONFIG_GATEWAY "gateway" #define NM_SETTING_IP_CONFIG_ROUTES "routes" @@ -144,6 +145,21 @@ void nm_ip_route_set_attribute (NMIPRoute *route, #define NM_SETTING_IP_CONFIG_NEVER_DEFAULT "never-default" #define NM_SETTING_IP_CONFIG_MAY_FAIL "may-fail" +#define NM_SETTING_DNS_OPTION_DEBUG "debug" +#define NM_SETTING_DNS_OPTION_NDOTS "ndots" +#define NM_SETTING_DNS_OPTION_TIMEOUT "timeout" +#define NM_SETTING_DNS_OPTION_ATTEMPTS "attempts" +#define NM_SETTING_DNS_OPTION_ROTATE "rotate" +#define NM_SETTING_DNS_OPTION_NO_CHECK_NAMES "no-check-names" +#define NM_SETTING_DNS_OPTION_INET6 "inet6" +#define NM_SETTING_DNS_OPTION_IP6_BYTESTRING "ip6-bytestring" +#define NM_SETTING_DNS_OPTION_IP6_DOTINT "ip6-dotint" +#define NM_SETTING_DNS_OPTION_NO_IP6_DOTINT "no-ip6-dotint" +#define NM_SETTING_DNS_OPTION_EDNS0 "edns0" +#define NM_SETTING_DNS_OPTION_SINGLE_REQUEST "single-request" +#define NM_SETTING_DNS_OPTION_SINGLE_REQUEST_REOPEN "single-request-reopen" +#define NM_SETTING_DNS_OPTION_NO_TLD_QUERY "no-tld-query" + struct _NMSettingIPConfig { NMSetting parent; }; @@ -161,33 +177,47 @@ const char *nm_setting_ip_config_get_method (NMSettingIPConfig guint nm_setting_ip_config_get_num_dns (NMSettingIPConfig *setting); const char *nm_setting_ip_config_get_dns (NMSettingIPConfig *setting, - int i); + int idx); gboolean nm_setting_ip_config_add_dns (NMSettingIPConfig *setting, const char *dns); void nm_setting_ip_config_remove_dns (NMSettingIPConfig *setting, - int i); + int idx); gboolean nm_setting_ip_config_remove_dns_by_value (NMSettingIPConfig *setting, const char *dns); void nm_setting_ip_config_clear_dns (NMSettingIPConfig *setting); guint nm_setting_ip_config_get_num_dns_searches (NMSettingIPConfig *setting); const char *nm_setting_ip_config_get_dns_search (NMSettingIPConfig *setting, - int i); + int idx); gboolean nm_setting_ip_config_add_dns_search (NMSettingIPConfig *setting, const char *dns_search); void nm_setting_ip_config_remove_dns_search (NMSettingIPConfig *setting, - int i); + int idx); gboolean nm_setting_ip_config_remove_dns_search_by_value (NMSettingIPConfig *setting, const char *dns_search); void nm_setting_ip_config_clear_dns_searches (NMSettingIPConfig *setting); +guint nm_setting_ip_config_get_num_dns_options (NMSettingIPConfig *setting); +gboolean nm_setting_ip_config_has_dns_options (NMSettingIPConfig *setting); +const char *nm_setting_ip_config_get_dns_option (NMSettingIPConfig *setting, + guint idx); +gint nm_setting_ip_config_next_valid_dns_option (NMSettingIPConfig *setting, + guint idx); +gboolean nm_setting_ip_config_add_dns_option (NMSettingIPConfig *setting, + const char *dns_option); +void nm_setting_ip_config_remove_dns_option (NMSettingIPConfig *setting, + int idx); +gboolean nm_setting_ip_config_remove_dns_option_by_value (NMSettingIPConfig *setting, + const char *dns_option); +void nm_setting_ip_config_clear_dns_options (NMSettingIPConfig *setting, gboolean is_set); + guint nm_setting_ip_config_get_num_addresses (NMSettingIPConfig *setting); NMIPAddress *nm_setting_ip_config_get_address (NMSettingIPConfig *setting, - int i); + int idx); gboolean nm_setting_ip_config_add_address (NMSettingIPConfig *setting, NMIPAddress *address); void nm_setting_ip_config_remove_address (NMSettingIPConfig *setting, - int i); + int idx); gboolean nm_setting_ip_config_remove_address_by_value (NMSettingIPConfig *setting, NMIPAddress *address); void nm_setting_ip_config_clear_addresses (NMSettingIPConfig *setting); @@ -196,11 +226,11 @@ const char *nm_setting_ip_config_get_gateway (NMSettingIPConfig guint nm_setting_ip_config_get_num_routes (NMSettingIPConfig *setting); NMIPRoute *nm_setting_ip_config_get_route (NMSettingIPConfig *setting, - int i); + int idx); gboolean nm_setting_ip_config_add_route (NMSettingIPConfig *setting, NMIPRoute *route); void nm_setting_ip_config_remove_route (NMSettingIPConfig *setting, - int i); + int idx); gboolean nm_setting_ip_config_remove_route_by_value (NMSettingIPConfig *setting, NMIPRoute *route); void nm_setting_ip_config_clear_routes (NMSettingIPConfig *setting); diff --git a/libnm-core/nm-setting-ip-tunnel.c b/libnm-core/nm-setting-ip-tunnel.c new file mode 100644 index 00000000..cd63aa11 --- /dev/null +++ b/libnm-core/nm-setting-ip-tunnel.c @@ -0,0 +1,767 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2015 Red Hat, Inc. + */ + +#include "nm-setting-ip-tunnel.h" + +#include "config.h" + +#include "nm-setting-private.h" +#include "nm-macros-internal.h" +#include "nm-utils.h" + +/** + * SECTION:nm-setting-ip-tunnel + * @short_description: Describes connection properties for IP tunnel devices + **/ + +G_DEFINE_TYPE_WITH_CODE (NMSettingIPTunnel, nm_setting_ip_tunnel, NM_TYPE_SETTING, + _nm_register_setting (IP_TUNNEL, 1)) +NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_IP_TUNNEL) + +#define NM_SETTING_IP_TUNNEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_IP_TUNNEL, NMSettingIPTunnelPrivate)) + +typedef struct { + char *parent; + NMIPTunnelMode mode; + char *local; + char *remote; + guint ttl; + guint tos; + gboolean path_mtu_discovery; + char *input_key; + char *output_key; + guint encapsulation_limit; + guint flow_label; + guint mtu; +} NMSettingIPTunnelPrivate; + +enum { + PROP_0, + PROP_PARENT, + PROP_MODE, + PROP_LOCAL, + PROP_REMOTE, + PROP_TTL, + PROP_TOS, + PROP_PATH_MTU_DISCOVERY, + PROP_INPUT_KEY, + PROP_OUTPUT_KEY, + PROP_ENCAPSULATION_LIMIT, + PROP_FLOW_LABEL, + PROP_MTU, + + LAST_PROP +}; + +/** + * nm_setting_ip_tunnel_get_parent: + * @setting: the #NMSettingIPTunnel + * + * Returns the #NMSettingIPTunnel:parent property of the setting + * + * Returns: the parent device + * + * Since: 1.2 + **/ +const char * +nm_setting_ip_tunnel_get_parent (NMSettingIPTunnel *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_IP_TUNNEL (setting), NULL); + return NM_SETTING_IP_TUNNEL_GET_PRIVATE (setting)->parent; +} + +/** + * nm_setting_ip_tunnel_get_mode: + * @setting: the #NMSettingIPTunnel + * + * Returns the #NMSettingIPTunnel:mode property of the setting. + * + * Returns: the tunnel mode + * + * Since: 1.2 + **/ +NMIPTunnelMode +nm_setting_ip_tunnel_get_mode (NMSettingIPTunnel *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_IP_TUNNEL (setting), 0); + + return NM_SETTING_IP_TUNNEL_GET_PRIVATE (setting)->mode; +} + +/** + * nm_setting_ip_tunnel_get_local: + * @setting: the #NMSettingIPTunnel + * + * Returns the #NMSettingIPTunnel:local property of the setting. + * + * Returns: the local endpoint + * + * Since: 1.2 + **/ +const char * +nm_setting_ip_tunnel_get_local (NMSettingIPTunnel *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_IP_TUNNEL (setting), NULL); + + return NM_SETTING_IP_TUNNEL_GET_PRIVATE (setting)->local; +} + +/** + * nm_setting_ip_tunnel_get_remote: + * @setting: the #NMSettingIPTunnel + * + * Returns the #NMSettingIPTunnel:remote property of the setting. + * + * Returns: the remote endpoint + * + * Since: 1.2 + **/ +const char * +nm_setting_ip_tunnel_get_remote (NMSettingIPTunnel *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_IP_TUNNEL (setting), NULL); + + return NM_SETTING_IP_TUNNEL_GET_PRIVATE (setting)->remote; +} + +/** + * nm_setting_ip_tunnel_get_ttl: + * @setting: the #NMSettingIPTunnel + * + * Returns the #NMSettingIPTunnel:ttl property of the setting. + * + * Returns: the Time-to-live value + * + * Since: 1.2 + **/ + +guint +nm_setting_ip_tunnel_get_ttl (NMSettingIPTunnel *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_IP_TUNNEL (setting), 0); + + return NM_SETTING_IP_TUNNEL_GET_PRIVATE (setting)->ttl; +} + +/** + * nm_setting_ip_tunnel_get_tos: + * @setting: the #NMSettingIPTunnel + * + * Returns the #NMSettingIPTunnel:tos property of the setting. + * + * Returns: the TOS value + * + * Since: 1.2 + **/ +guint +nm_setting_ip_tunnel_get_tos (NMSettingIPTunnel *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_IP_TUNNEL (setting), 0); + + return NM_SETTING_IP_TUNNEL_GET_PRIVATE (setting)->tos; +} + +/** + * nm_setting_ip_tunnel_get_path_mtu_discovery: + * @setting: the #NMSettingIPTunnel + * + * Returns the #NMSettingIPTunnel:path-mtu-discovery property of the setting. + * + * Returns: whether path MTU discovery is enabled + * + * Since: 1.2 + **/ +gboolean +nm_setting_ip_tunnel_get_path_mtu_discovery (NMSettingIPTunnel *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_IP_TUNNEL (setting), TRUE); + + return NM_SETTING_IP_TUNNEL_GET_PRIVATE (setting)->path_mtu_discovery; +} + +/** + * nm_setting_ip_tunnel_get_input_key: + * @setting: the #NMSettingIPTunnel + * + * Returns the #NMSettingIPTunnel:input-key property of the setting. + * + * Returns: the input key + * + * Since: 1.2 + **/ +const char * +nm_setting_ip_tunnel_get_input_key (NMSettingIPTunnel *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_IP_TUNNEL (setting), NULL); + + return NM_SETTING_IP_TUNNEL_GET_PRIVATE (setting)->input_key; +} + +/** + * nm_setting_ip_tunnel_get_output_key: + * @setting: the #NMSettingIPTunnel + * + * Returns the #NMSettingIPTunnel:output-key property of the setting. + * + * Returns: the output key + * + * Since: 1.2 + **/ +const char * +nm_setting_ip_tunnel_get_output_key (NMSettingIPTunnel *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_IP_TUNNEL (setting), NULL); + + return NM_SETTING_IP_TUNNEL_GET_PRIVATE (setting)->output_key; +} + +/** + * nm_setting_ip_tunnel_get_encapsulation_limit: + * @setting: the #NMSettingIPTunnel + * + * Returns the #NMSettingIPTunnel:encapsulation-limit property of the setting. + * + * Returns: the encapsulation limit value + * + * Since: 1.2 + **/ +guint +nm_setting_ip_tunnel_get_encapsulation_limit (NMSettingIPTunnel *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_IP_TUNNEL (setting), 0); + + return NM_SETTING_IP_TUNNEL_GET_PRIVATE (setting)->encapsulation_limit; +} + +/** + * nm_setting_ip_tunnel_get_flow_label: + * @setting: the #NMSettingIPTunnel + * + * Returns the #NMSettingIPTunnel:flow-label property of the setting. + * + * Returns: the flow label value + * + * Since: 1.2 + **/ +guint +nm_setting_ip_tunnel_get_flow_label (NMSettingIPTunnel *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_IP_TUNNEL (setting), 0); + + return NM_SETTING_IP_TUNNEL_GET_PRIVATE (setting)->flow_label; +} + +/** + * nm_setting_ip_tunnel_get_mtu: + * @setting: the #NMSettingIPTunnel + * + * Returns the #NMSettingIPTunnel:mtu property of the setting. + * + * Returns: the MTU + * + * Since: 1.2 + **/ +guint +nm_setting_ip_tunnel_get_mtu (NMSettingIPTunnel *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_IP_TUNNEL (setting), 0); + + return NM_SETTING_IP_TUNNEL_GET_PRIVATE (setting)->mtu; +} + +/*********************************************************************/ + +static gboolean +verify (NMSetting *setting, NMConnection *connection, GError **error) +{ + NMSettingIPTunnelPrivate *priv = NM_SETTING_IP_TUNNEL_GET_PRIVATE (setting); + int family; + + switch (priv->mode) { + case NM_IP_TUNNEL_MODE_IPIP: + case NM_IP_TUNNEL_MODE_SIT: + case NM_IP_TUNNEL_MODE_ISATAP: + case NM_IP_TUNNEL_MODE_GRE: + case NM_IP_TUNNEL_MODE_VTI: + family = AF_INET; + break; + case NM_IP_TUNNEL_MODE_IP6IP6: + case NM_IP_TUNNEL_MODE_IPIP6: + case NM_IP_TUNNEL_MODE_IP6GRE: + case NM_IP_TUNNEL_MODE_VTI6: + family = AF_INET6; + break; + default: + family = AF_UNSPEC; + } + + if (family == AF_UNSPEC) { + g_set_error (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("'%d' is not a valid tunnel mode"), + (int) priv->mode); + g_prefix_error (error, "%s.%s: ", NM_SETTING_IP_TUNNEL_SETTING_NAME, NM_SETTING_IP_TUNNEL_MODE); + return FALSE; + } + + if ( priv->parent + && !nm_utils_iface_valid_name (priv->parent) + && !nm_utils_is_uuid (priv->parent)) { + g_set_error (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("'%s' is neither an UUID nor an interface name"), + priv->parent); + g_prefix_error (error, "%s.%s: ", NM_SETTING_IP_TUNNEL_SETTING_NAME, + NM_SETTING_IP_TUNNEL_PARENT); + return FALSE; + } + + if (priv->local && !nm_utils_ipaddr_valid (family, priv->local)) { + g_set_error (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("'%s' is not a valid IPv%c address"), + priv->local, + family == AF_INET ? '4' : '6'); + g_prefix_error (error, "%s.%s: ", NM_SETTING_IP_TUNNEL_SETTING_NAME, NM_SETTING_IP_TUNNEL_LOCAL); + return FALSE; + } + + if (priv->remote && !nm_utils_ipaddr_valid (family, priv->remote)) { + g_set_error (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("'%s' is not a valid IPv%c address"), + priv->remote, + family == AF_INET ? '4' : '6'); + g_prefix_error (error, "%s.%s: ", NM_SETTING_IP_TUNNEL_SETTING_NAME, NM_SETTING_IP_TUNNEL_REMOTE); + return FALSE; + } + + if ( (priv->input_key && priv->input_key[0]) + || (priv->output_key && priv->output_key[0])) { + if ( priv->mode != NM_IP_TUNNEL_MODE_GRE + && priv->mode != NM_IP_TUNNEL_MODE_IP6GRE) { + g_set_error_literal (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("tunnel keys can only be specified for GRE tunnels")); + return FALSE; + } + } + + if (priv->input_key && priv->input_key[0]) { + gint64 val; + + val = _nm_utils_ascii_str_to_int64 (priv->input_key, 10, 0, G_MAXUINT32, -1); + if (val == -1) { + g_set_error (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("'%s' is not a valid tunnel key"), + priv->input_key); + g_prefix_error (error, "%s.%s: ", NM_SETTING_IP_TUNNEL_SETTING_NAME, + NM_SETTING_IP_TUNNEL_INPUT_KEY); + return FALSE; + } + } + + if (priv->output_key && priv->output_key[0]) { + gint64 val; + + val = _nm_utils_ascii_str_to_int64 (priv->output_key, 10, 0, G_MAXUINT32, -1); + if (val == -1) { + g_set_error (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("'%s' is not a valid tunnel key"), + priv->output_key); + g_prefix_error (error, "%s.%s: ", NM_SETTING_IP_TUNNEL_SETTING_NAME, + NM_SETTING_IP_TUNNEL_OUTPUT_KEY); + return FALSE; + } + } + + if (!priv->path_mtu_discovery && priv->ttl != 0) { + g_set_error_literal (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("a fixed TTL is allowed only when path MTU discovery is enabled")); + g_prefix_error (error, "%s.%s: ", NM_SETTING_IP_TUNNEL_SETTING_NAME, + NM_SETTING_IP_TUNNEL_TTL); + return FALSE; + } + + return TRUE; +} + +/** + * nm_setting_ip_tunnel_new: + * + * Creates a new #NMSettingIPTunnel object with default values. + * + * Returns: (transfer full): the new empty #NMSettingIPTunnel object + * + * Since: 1.2 + **/ +NMSetting * +nm_setting_ip_tunnel_new (void) +{ + return (NMSetting *) g_object_new (NM_TYPE_SETTING_IP_TUNNEL, NULL); +} + +static void +nm_setting_ip_tunnel_init (NMSettingIPTunnel *setting) +{ +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMSettingIPTunnel *setting = NM_SETTING_IP_TUNNEL (object); + NMSettingIPTunnelPrivate *priv = NM_SETTING_IP_TUNNEL_GET_PRIVATE (setting); + + switch (prop_id) { + case PROP_PARENT: + g_free (priv->parent); + priv->parent = g_value_dup_string (value); + break; + case PROP_MODE: + priv->mode = g_value_get_uint (value); + break; + case PROP_LOCAL: + g_free (priv->local); + priv->local = g_value_dup_string (value); + break; + case PROP_REMOTE: + g_free (priv->remote); + priv->remote = g_value_dup_string (value); + break; + case PROP_TTL: + priv->ttl = g_value_get_uint (value); + break; + case PROP_TOS: + priv->tos = g_value_get_uint (value); + break; + case PROP_PATH_MTU_DISCOVERY: + priv->path_mtu_discovery = g_value_get_boolean (value); + break; + case PROP_INPUT_KEY: + g_free (priv->input_key); + priv->input_key = g_value_dup_string (value); + break; + case PROP_OUTPUT_KEY: + g_free (priv->output_key); + priv->output_key = g_value_dup_string (value); + break; + case PROP_ENCAPSULATION_LIMIT: + priv->encapsulation_limit = g_value_get_uint (value); + break; + case PROP_FLOW_LABEL: + priv->flow_label = g_value_get_uint (value); + break; + case PROP_MTU: + priv->mtu = g_value_get_uint (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMSettingIPTunnel *setting = NM_SETTING_IP_TUNNEL (object); + NMSettingIPTunnelPrivate *priv = NM_SETTING_IP_TUNNEL_GET_PRIVATE (setting); + + switch (prop_id) { + case PROP_PARENT: + g_value_set_string (value, priv->parent); + break; + case PROP_MODE: + g_value_set_uint (value, priv->mode); + break; + case PROP_LOCAL: + g_value_set_string (value, priv->local); + break; + case PROP_REMOTE: + g_value_set_string (value, priv->remote); + break; + case PROP_TTL: + g_value_set_uint (value, priv->ttl); + break; + case PROP_TOS: + g_value_set_uint (value, priv->tos); + break; + case PROP_PATH_MTU_DISCOVERY: + g_value_set_boolean (value, priv->path_mtu_discovery); + break; + case PROP_INPUT_KEY: + g_value_set_string (value, priv->input_key); + break; + case PROP_OUTPUT_KEY: + g_value_set_string (value, priv->output_key); + break; + case PROP_ENCAPSULATION_LIMIT: + g_value_set_uint (value, priv->encapsulation_limit); + break; + case PROP_FLOW_LABEL: + g_value_set_uint (value, priv->flow_label); + break; + case PROP_MTU: + g_value_set_uint (value, priv->mtu); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +finalize (GObject *object) +{ + NMSettingIPTunnel *setting = NM_SETTING_IP_TUNNEL (object); + NMSettingIPTunnelPrivate *priv = NM_SETTING_IP_TUNNEL_GET_PRIVATE (setting); + + g_free (priv->local); + g_free (priv->remote); + g_free (priv->input_key); + g_free (priv->output_key); + + G_OBJECT_CLASS (nm_setting_ip_tunnel_parent_class)->finalize (object); +} + +static void +nm_setting_ip_tunnel_class_init (NMSettingIPTunnelClass *setting_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (setting_class); + NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class); + + g_type_class_add_private (setting_class, sizeof (NMSettingIPTunnelPrivate)); + + /* virtual methods */ + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->finalize = finalize; + parent_class->verify = verify; + + /** + * NMSettingIPTunnel:parent: + * + * If given, specifies the parent interface name or parent connection UUID + * the new device will be bound to so that tunneled packets will only be + * routed via that interface. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_PARENT, + g_param_spec_string (NM_SETTING_IP_TUNNEL_PARENT, "", "", + NULL, + G_PARAM_READWRITE | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingIPTunnel:mode: + * + * The tunneling mode, for example %NM_IP_TUNNEL_MODE_IPIP or + * %NM_IP_TUNNEL_MODE_GRE. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_MODE, + g_param_spec_uint (NM_SETTING_IP_TUNNEL_MODE, "", "", + 0, G_MAXUINT, 0, + G_PARAM_READWRITE | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingIPTunnel:local: + * + * The local endpoint of the tunnel; the value can be empty, otherwise it + * must contain an IPv4 or IPv6 address. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_LOCAL, + g_param_spec_string (NM_SETTING_IP_TUNNEL_LOCAL, "", "", + NULL, + G_PARAM_READWRITE | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingIPTunnel:remote: + * + * The remote endpoint of the tunnel; the value must contain an IPv4 or IPv6 + * address. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_REMOTE, + g_param_spec_string (NM_SETTING_IP_TUNNEL_REMOTE, "", "", + NULL, + G_PARAM_READWRITE | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingIPTunnel:ttl + * + * The TTL to assign to tunneled packets. 0 is a special value meaning that + * packets inherit the TTL value. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_TTL, + g_param_spec_uint (NM_SETTING_IP_TUNNEL_TTL, "", "", + 0, 255, 0, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingIPTunnel:tos + * + * The type of service (IPv4) or traffic class (IPv6) field to be set on + * tunneled packets. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_TOS, + g_param_spec_uint (NM_SETTING_IP_TUNNEL_TOS, "", "", + 0, 255, 0, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingIPTunnel:path-mtu-discovery + * + * Whether to enable Path MTU Discovery on this tunnel. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_PATH_MTU_DISCOVERY, + g_param_spec_boolean (NM_SETTING_IP_TUNNEL_PATH_MTU_DISCOVERY, "", "", + TRUE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingIPTunnel:input-key: + * + * The key used for tunnel input packets; the property is valid only for + * certain tunnel modes (GRE, IP6GRE). If empty, no key is used. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_INPUT_KEY, + g_param_spec_string (NM_SETTING_IP_TUNNEL_INPUT_KEY, "", "", + NULL, + G_PARAM_READWRITE | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingIPTunnel:output-key: + * + * The key used for tunnel output packets; the property is valid only for + * certain tunnel modes (GRE, IP6GRE). If empty, no key is used. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_OUTPUT_KEY, + g_param_spec_string (NM_SETTING_IP_TUNNEL_OUTPUT_KEY, "", "", + NULL, + G_PARAM_READWRITE | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingIPTunnel:encapsulation-limit: + * + * How many additional levels of encapsulation are permitted to be prepended + * to packets. This property applies only to IPv6 tunnels. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_ENCAPSULATION_LIMIT, + g_param_spec_uint (NM_SETTING_IP_TUNNEL_ENCAPSULATION_LIMIT, "", "", + 0, 255, 0, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingIPTunnel:flow-label: + * + * The flow label to assign to tunnel packets. This property applies only to + * IPv6 tunnels. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_FLOW_LABEL, + g_param_spec_uint (NM_SETTING_IP_TUNNEL_FLOW_LABEL, "", "", + 0, (1 << 20) - 1, 0, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingIPTunel:mtu: + * + * If non-zero, only transmit packets of the specified size or smaller, + * breaking larger packets up into multiple fragments. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_MTU, + g_param_spec_uint (NM_SETTING_IP_TUNNEL_MTU, "", "", + 0, G_MAXUINT, 0, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + NM_SETTING_PARAM_FUZZY_IGNORE | + G_PARAM_STATIC_STRINGS)); +} diff --git a/libnm-core/nm-setting-ip-tunnel.h b/libnm-core/nm-setting-ip-tunnel.h new file mode 100644 index 00000000..09814f35 --- /dev/null +++ b/libnm-core/nm-setting-ip-tunnel.h @@ -0,0 +1,98 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2015 Red Hat, Inc. + */ + +#ifndef __NM_SETTING_IP_TUNNEL_H__ +#define __NM_SETTING_IP_TUNNEL_H__ + +#if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION) +#error "Only can be included directly." +#endif + +#include + +G_BEGIN_DECLS + +#define NM_TYPE_SETTING_IP_TUNNEL (nm_setting_ip_tunnel_get_type ()) +#define NM_SETTING_IP_TUNNEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_IP_TUNNEL, NMSettingIPTunnel)) +#define NM_SETTING_IP_TUNNEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_IP_TUNNEL, NMSettingIPTunnelClass)) +#define NM_IS_SETTING_IP_TUNNEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_IP_TUNNEL)) +#define NM_IS_SETTING_IP_TUNNEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SETTING_IP_TUNNEL)) +#define NM_SETTING_IP_TUNNEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_IP_TUNNEL, NMSettingIPTunnelClass)) + +#define NM_SETTING_IP_TUNNEL_SETTING_NAME "ip-tunnel" + +#define NM_SETTING_IP_TUNNEL_PARENT "parent" +#define NM_SETTING_IP_TUNNEL_MODE "mode" +#define NM_SETTING_IP_TUNNEL_LOCAL "local" +#define NM_SETTING_IP_TUNNEL_REMOTE "remote" +#define NM_SETTING_IP_TUNNEL_TTL "ttl" +#define NM_SETTING_IP_TUNNEL_TOS "tos" +#define NM_SETTING_IP_TUNNEL_PATH_MTU_DISCOVERY "path-mtu-discovery" +#define NM_SETTING_IP_TUNNEL_INPUT_KEY "input-key" +#define NM_SETTING_IP_TUNNEL_OUTPUT_KEY "output-key" +#define NM_SETTING_IP_TUNNEL_ENCAPSULATION_LIMIT "encapsulation-limit" +#define NM_SETTING_IP_TUNNEL_FLOW_LABEL "flow-label" +#define NM_SETTING_IP_TUNNEL_MTU "mtu" + +struct _NMSettingIPTunnel { + NMSetting parent; +}; + +typedef struct { + NMSettingClass parent; + + /*< private >*/ + gpointer padding[4]; +} NMSettingIPTunnelClass; + +NM_AVAILABLE_IN_1_2 +GType nm_setting_ip_tunnel_get_type (void); + +NM_AVAILABLE_IN_1_2 +NMSetting * nm_setting_ip_tunnel_new (void); + +NM_AVAILABLE_IN_1_2 +const char *nm_setting_ip_tunnel_get_parent (NMSettingIPTunnel *setting); +NM_AVAILABLE_IN_1_2 +NMIPTunnelMode nm_setting_ip_tunnel_get_mode (NMSettingIPTunnel *setting); +NM_AVAILABLE_IN_1_2 +const char *nm_setting_ip_tunnel_get_local (NMSettingIPTunnel *setting); +NM_AVAILABLE_IN_1_2 +const char *nm_setting_ip_tunnel_get_remote (NMSettingIPTunnel *setting); +NM_AVAILABLE_IN_1_2 +guint nm_setting_ip_tunnel_get_ttl (NMSettingIPTunnel *setting); +NM_AVAILABLE_IN_1_2 +guint nm_setting_ip_tunnel_get_tos (NMSettingIPTunnel *setting); +NM_AVAILABLE_IN_1_2 +gboolean nm_setting_ip_tunnel_get_path_mtu_discovery (NMSettingIPTunnel *setting); +NM_AVAILABLE_IN_1_2 +const char *nm_setting_ip_tunnel_get_input_key (NMSettingIPTunnel *setting); +NM_AVAILABLE_IN_1_2 +const char *nm_setting_ip_tunnel_get_output_key (NMSettingIPTunnel *setting); +NM_AVAILABLE_IN_1_2 +guint nm_setting_ip_tunnel_get_encapsulation_limit (NMSettingIPTunnel *setting); +NM_AVAILABLE_IN_1_2 +guint nm_setting_ip_tunnel_get_flow_label (NMSettingIPTunnel *setting); +NM_AVAILABLE_IN_1_2 +guint nm_setting_ip_tunnel_get_mtu (NMSettingIPTunnel *setting); + +G_END_DECLS + +#endif /* __NM_SETTING_IP_TUNNEL_H__ */ diff --git a/libnm-core/nm-setting-ip4-config.c b/libnm-core/nm-setting-ip4-config.c index 81cc1f88..7708b6c5 100644 --- a/libnm-core/nm-setting-ip4-config.c +++ b/libnm-core/nm-setting-ip4-config.c @@ -22,7 +22,6 @@ #include "config.h" #include -#include #include "nm-setting-ip4-config.h" #include "nm-setting-private.h" @@ -59,11 +58,15 @@ NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_IP4_CONFIG) typedef struct { char *dhcp_client_id; + int dhcp_timeout; + char *dhcp_fqdn; } NMSettingIP4ConfigPrivate; enum { PROP_0, PROP_DHCP_CLIENT_ID, + PROP_DHCP_TIMEOUT, + PROP_DHCP_FQDN, LAST_PROP }; @@ -99,6 +102,45 @@ nm_setting_ip4_config_get_dhcp_client_id (NMSettingIP4Config *setting) return NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting)->dhcp_client_id; } +/** + * nm_setting_ip4_config_get_dhcp_timeout: + * @setting: the #NMSettingIP4Config + * + * Returns the value contained in the #NMSettingIP4Config:dhcp-timeout + * property. + * + * Returns: the configured DHCP timeout in seconds. 0 = default for + * the particular kind of device. + * + * Since: 1.2 + **/ +int +nm_setting_ip4_config_get_dhcp_timeout (NMSettingIP4Config *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), 0); + + return NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting)->dhcp_timeout; +} + +/** + * nm_setting_ip4_config_get_dhcp_fqdn: + * @setting: the #NMSettingIP4Config + * + * Returns the value contained in the #NMSettingIP4Config:dhcp-fqdn + * property. + * + * Returns: the configured FQDN to send to the DHCP server + * + * Since: 1.2 + **/ +const char * +nm_setting_ip4_config_get_dhcp_fqdn (NMSettingIP4Config *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), NULL); + + return NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting)->dhcp_fqdn; +} + static gboolean verify (NMSetting *setting, NMConnection *connection, GError **error) { @@ -180,6 +222,31 @@ verify (NMSetting *setting, NMConnection *connection, GError **error) return FALSE; } + if (priv->dhcp_fqdn && !*priv->dhcp_fqdn) { + g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("property is empty")); + g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_DHCP_FQDN); + return FALSE; + } + + if (priv->dhcp_fqdn && !strchr (priv->dhcp_fqdn, '.')) { + g_set_error (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("'%s' is not a valid FQDN"), priv->dhcp_fqdn); + g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_DHCP_FQDN); + return FALSE; + } + + if (priv->dhcp_fqdn && nm_setting_ip_config_get_dhcp_hostname (s_ip)) { + g_set_error_literal (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("property cannot be set when dhcp-hostname is also set")); + g_prefix_error (error, "%s.%s: ", NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_DHCP_FQDN); + return FALSE; + } + return TRUE; } @@ -194,6 +261,7 @@ finalize (GObject *object) NMSettingIP4ConfigPrivate *priv = NM_SETTING_IP4_CONFIG_GET_PRIVATE (object); g_free (priv->dhcp_client_id); + g_free (priv->dhcp_fqdn); G_OBJECT_CLASS (nm_setting_ip4_config_parent_class)->finalize (object); } @@ -209,6 +277,13 @@ set_property (GObject *object, guint prop_id, g_free (priv->dhcp_client_id); priv->dhcp_client_id = g_value_dup_string (value); break; + case PROP_DHCP_TIMEOUT: + priv->dhcp_timeout = g_value_get_uint (value); + break; + case PROP_DHCP_FQDN: + g_free (priv->dhcp_fqdn); + priv->dhcp_fqdn = g_value_dup_string (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -225,6 +300,12 @@ get_property (GObject *object, guint prop_id, case PROP_DHCP_CLIENT_ID: g_value_set_string (value, nm_setting_ip4_config_get_dhcp_client_id (s_ip4)); break; + case PROP_DHCP_TIMEOUT: + g_value_set_uint (value, nm_setting_ip4_config_get_dhcp_timeout (s_ip4)); + break; + case PROP_DHCP_FQDN: + g_value_set_string (value, nm_setting_ip4_config_get_dhcp_fqdn (s_ip4)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -549,7 +630,8 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *ip4_class) /* ---ifcfg-rh--- * property: dhcp-hostname * variable: DHCP_HOSTNAME - * description: Hostname to send to the DHCP server. + * description: Hostname to send to the DHCP server. When both DHCP_HOSTNAME and + * DHCP_FQDN are specified only the latter is used. * ---end--- */ @@ -600,6 +682,51 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *ip4_class) G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + /** + * NMSettingIP4Config:dhcp-timeout: + * + * A timeout for a DHCP transaction in seconds. + **/ + /* ---ifcfg-rh--- + * property: dhcp-timeout + * variable: DHCP_TIMEOUT(+) + * description: A timeout after which the DHCP transaction fails in case of no response. + * example: DHCP_TIMEOUT=10 + * ---end--- + */ + g_object_class_install_property + (object_class, PROP_DHCP_TIMEOUT, + g_param_spec_uint (NM_SETTING_IP4_CONFIG_DHCP_TIMEOUT, "", "", + 0, G_MAXUINT32, 0, + G_PARAM_READWRITE | + NM_SETTING_PARAM_FUZZY_IGNORE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingIP4Config:dhcp-fqdn: + * + * If the #NMSettingIPConfig:dhcp-send-hostname property is %TRUE, then the + * specified FQDN will be sent to the DHCP server when acquiring a lease. This + * property and #NMSettingIPConfig:dhcp-hostname are mutually exclusive and + * cannot be set at the same time. + * + * Since: 1.2 + */ + /* ---ifcfg-rh--- + * property: dhcp-fqdn + * variable: DHCP_FQDN + * description: FQDN to send to the DHCP server. When both DHCP_HOSTNAME and + * DHCP_FQDN are specified only the latter is used. + * example: DHCP_FQDN=foo.bar.com + * ---end--- + */ + g_object_class_install_property + (object_class, PROP_DHCP_FQDN, + g_param_spec_string (NM_SETTING_IP4_CONFIG_DHCP_FQDN, "", "", + NULL, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + /* IP4-specific property overrides */ /* ---dbus--- diff --git a/libnm-core/nm-setting-ip4-config.h b/libnm-core/nm-setting-ip4-config.h index e944dfe3..a78df703 100644 --- a/libnm-core/nm-setting-ip4-config.h +++ b/libnm-core/nm-setting-ip4-config.h @@ -41,6 +41,8 @@ G_BEGIN_DECLS #define NM_SETTING_IP4_CONFIG_SETTING_NAME "ipv4" #define NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID "dhcp-client-id" +#define NM_SETTING_IP4_CONFIG_DHCP_TIMEOUT "dhcp-timeout" +#define NM_SETTING_IP4_CONFIG_DHCP_FQDN "dhcp-fqdn" /** * NM_SETTING_IP4_CONFIG_METHOD_AUTO: @@ -102,6 +104,10 @@ GType nm_setting_ip4_config_get_type (void); NMSetting *nm_setting_ip4_config_new (void); const char *nm_setting_ip4_config_get_dhcp_client_id (NMSettingIP4Config *setting); +NM_AVAILABLE_IN_1_2 +int nm_setting_ip4_config_get_dhcp_timeout (NMSettingIP4Config *setting); +NM_AVAILABLE_IN_1_2 +const char *nm_setting_ip4_config_get_dhcp_fqdn (NMSettingIP4Config *setting); G_END_DECLS diff --git a/libnm-core/nm-setting-ip6-config.c b/libnm-core/nm-setting-ip6-config.c index 619e002c..bc516d6e 100644 --- a/libnm-core/nm-setting-ip6-config.c +++ b/libnm-core/nm-setting-ip6-config.c @@ -22,11 +22,11 @@ #include "config.h" #include -#include #include "nm-setting-ip6-config.h" #include "nm-setting-private.h" #include "nm-core-enum-types.h" +#include "nm-macros-internal.h" /** * SECTION:nm-setting-ip6-config @@ -58,12 +58,14 @@ NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_IP6_CONFIG) typedef struct { NMSettingIP6ConfigPrivacy ip6_privacy; + NMSettingIP6ConfigAddrGenMode addr_gen_mode; } NMSettingIP6ConfigPrivate; enum { PROP_0, PROP_IP6_PRIVACY, + PROP_ADDR_GEN_MODE, LAST_PROP }; @@ -98,9 +100,30 @@ nm_setting_ip6_config_get_ip6_privacy (NMSettingIP6Config *setting) return NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->ip6_privacy; } +/** + * nm_setting_ip6_config_get_addr_gen_mode: + * @setting: the #NMSettingIP6Config + * + * Returns the value contained in the #NMSettingIP6Config:addr-gen-mode + * property. + * + * Returns: IPv6 Address Generation Mode. + * + * Since: 1.2 + **/ +NMSettingIP6ConfigAddrGenMode +nm_setting_ip6_config_get_addr_gen_mode (NMSettingIP6Config *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_IP6_CONFIG (setting), + NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_STABLE_PRIVACY); + + return NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting)->addr_gen_mode; +} + static gboolean verify (NMSetting *setting, NMConnection *connection, GError **error) { + NMSettingIP6ConfigPrivate *priv = NM_SETTING_IP6_CONFIG_GET_PRIVATE (setting); NMSettingIPConfig *s_ip = NM_SETTING_IP_CONFIG (setting); NMSettingVerifyResult ret; const char *method; @@ -167,6 +190,17 @@ verify (NMSetting *setting, NMConnection *connection, GError **error) return FALSE; } + if (!NM_IN_SET (priv->addr_gen_mode, + NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_EUI64, + NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_STABLE_PRIVACY)) { + g_set_error_literal (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("property is invalid")); + g_prefix_error (error, "%s.%s: ", NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP_CONFIG_METHOD); + return FALSE; + } + return TRUE; } @@ -331,6 +365,9 @@ set_property (GObject *object, guint prop_id, case PROP_IP6_PRIVACY: priv->ip6_privacy = g_value_get_enum (value); break; + case PROP_ADDR_GEN_MODE: + priv->addr_gen_mode = g_value_get_int (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -347,6 +384,9 @@ get_property (GObject *object, guint prop_id, case PROP_IP6_PRIVACY: g_value_set_enum (value, priv->ip6_privacy); break; + case PROP_ADDR_GEN_MODE: + g_value_set_int (value, priv->addr_gen_mode); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -512,6 +552,10 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *ip6_class) * * If also global configuration is unspecified or set to "-1", fallback to read * "/proc/sys/net/ipv6/conf/default/use_tempaddr". + * + * Note that this setting is distinct from the Stable Privacy addresses + * that can be enabled with the "addr-gen-mode" property's "stable-privacy" + * setting as another way of avoiding host tracking with IPv6 addresses. **/ /* ---ifcfg-rh--- * property: ip6-privacy @@ -532,6 +576,53 @@ nm_setting_ip6_config_class_init (NMSettingIP6ConfigClass *ip6_class) G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); + /** + * NMSettingIP6Config:addr-gen-mode: + * + * Configure method for creating the address for use with RFC4862 IPv6 + * Stateless Address Autoconfiguration. The permitted values are: "eui64", + * "stable-privacy" or unset. + * + * If the property is set to "eui64", the addresses will be generated + * using the interface tokens derived from hardware address. This makes + * the host part of the address to stay constant, making it possible + * to track host's presence when it changes networks. The address changes + * when the interface hardware is replaced. + * + * The value of "stable-privacy" enables use of cryptographically + * secure hash of a secret host-specific key along with the connection + * identification and the network address as specified by RFC7217. + * This makes it impossible to use the address track host's presence, + * and makes the address stable when the network interface hardware is + * replaced. + * + * Leaving this unset causes a default that could be subject to change + * in future versions to be used. + * + * Note that this setting is distinct from the Privacy Extensions as + * configured by "ip6-privacy" property and it does not affect the + * temporary addresses configured with this option. + * + * Since: 1.2 + **/ + /* ---ifcfg-rh--- + * property: addr-gen-mode + * variable: IPV6_ADDR_GEN_MODE + * values: IPV6_ADDR_GEN_MODE: eui64, stable-privacy + * default: eui64 + * description: Configure IPv6 Stable Privacy addressing for SLAAC (RFC7217). + * example: IPV6_ADDR_GEN_MODE=stable-privacy + * ---end--- + */ + g_object_class_install_property + (object_class, PROP_ADDR_GEN_MODE, + g_param_spec_int (NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE, "", "", + G_MININT, G_MAXINT, + NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_STABLE_PRIVACY, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS)); + /* IP6-specific property overrides */ /* ---dbus--- diff --git a/libnm-core/nm-setting-ip6-config.h b/libnm-core/nm-setting-ip6-config.h index b791e937..f8923d19 100644 --- a/libnm-core/nm-setting-ip6-config.h +++ b/libnm-core/nm-setting-ip6-config.h @@ -41,6 +41,8 @@ G_BEGIN_DECLS #define NM_SETTING_IP6_CONFIG_IP6_PRIVACY "ip6-privacy" +#define NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE "addr-gen-mode" + /** * NM_SETTING_IP6_CONFIG_METHOD_IGNORE: * @@ -114,6 +116,25 @@ typedef enum { NM_SETTING_IP6_CONFIG_PRIVACY_PREFER_TEMP_ADDR = 2 } NMSettingIP6ConfigPrivacy; +/** + * NMSettingIP6ConfigAddrGenMode: + * @NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_EUI64: The Interface Identifier is derived + * from the interface hardware address. + * @NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_STABLE_PRIVACY: The Interface Identifier + * is created by using a cryptographically secure hash of a secret host-specific + * key along with the connection identification and the network address as + * specified by RFC7217. + * + * #NMSettingIP6ConfigAddrGenMode controls how the the Interface Identifier for + * RFC4862 Stateless Address Autoconfiguration is created. + * + * Since: 1.2 + */ +typedef enum { + NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_EUI64 = 0, + NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_STABLE_PRIVACY = 1, +} NMSettingIP6ConfigAddrGenMode; + struct _NMSettingIP6Config { NMSettingIPConfig parent; }; @@ -130,6 +151,8 @@ GType nm_setting_ip6_config_get_type (void); NMSetting *nm_setting_ip6_config_new (void); NMSettingIP6ConfigPrivacy nm_setting_ip6_config_get_ip6_privacy (NMSettingIP6Config *setting); +NM_AVAILABLE_IN_1_2 +NMSettingIP6ConfigAddrGenMode nm_setting_ip6_config_get_addr_gen_mode (NMSettingIP6Config *setting); G_END_DECLS diff --git a/libnm-core/nm-setting-macvlan.c b/libnm-core/nm-setting-macvlan.c new file mode 100644 index 00000000..7bedf514 --- /dev/null +++ b/libnm-core/nm-setting-macvlan.c @@ -0,0 +1,350 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2015 Red Hat, Inc. + */ + +#include "config.h" + +#include +#include + +#include "nm-setting-macvlan.h" +#include "nm-utils.h" +#include "nm-setting-connection.h" +#include "nm-setting-private.h" +#include "nm-setting-wired.h" +#include "nm-connection-private.h" + +/** + * SECTION:nm-setting-macvlan + * @short_description: Describes connection properties for macvlan interfaces + * + * The #NMSettingMacvlan object is a #NMSetting subclass that describes properties + * necessary for connection to macvlan interfaces. + **/ + +G_DEFINE_TYPE_WITH_CODE (NMSettingMacvlan, nm_setting_macvlan, NM_TYPE_SETTING, + _nm_register_setting (MACVLAN, 1)) +NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_MACVLAN) + +#define NM_SETTING_MACVLAN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_MACVLAN, NMSettingMacvlanPrivate)) + +typedef struct { + char *parent; + NMSettingMacvlanMode mode; + gboolean promiscuous; + gboolean tap; +} NMSettingMacvlanPrivate; + +enum { + PROP_0, + PROP_PARENT, + PROP_MODE, + PROP_PROMISCUOUS, + PROP_TAP, + LAST_PROP +}; + +/** + * nm_setting_macvlan_new: + * + * Creates a new #NMSettingMacvlan object with default values. + * + * Returns: (transfer full): the new empty #NMSettingMacvlan object + * + * Since: 1.2 + **/ +NMSetting * +nm_setting_macvlan_new (void) +{ + return (NMSetting *) g_object_new (NM_TYPE_SETTING_MACVLAN, NULL); +} + +/** + * nm_setting_macvlan_get_parent: + * @setting: the #NMSettingMacvlan + * + * Returns: the #NMSettingMacvlan:parent property of the setting + * + * Since: 1.2 + **/ +const char * +nm_setting_macvlan_get_parent (NMSettingMacvlan *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_MACVLAN (setting), NULL); + return NM_SETTING_MACVLAN_GET_PRIVATE (setting)->parent; +} + +/** + * nm_setting_macvlan_get_mode: + * @setting: the #NMSettingMacvlan + * + * Returns: the #NMSettingMacvlan:mode property of the setting + * + * Since: 1.2 + **/ +NMSettingMacvlanMode +nm_setting_macvlan_get_mode (NMSettingMacvlan *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_MACVLAN (setting), NM_SETTING_MACVLAN_MODE_UNKNOWN); + return NM_SETTING_MACVLAN_GET_PRIVATE (setting)->mode; +} + +/** + * nm_setting_macvlan_get_promiscuous: + * @setting: the #NMSettingMacvlan + * + * Returns: the #NMSettingMacvlan:promiscuous property of the setting + * + * Since: 1.2 + **/ +gboolean +nm_setting_macvlan_get_promiscuous (NMSettingMacvlan *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_MACVLAN (setting), FALSE); + return NM_SETTING_MACVLAN_GET_PRIVATE (setting)->promiscuous; +} + +/** + * nm_setting_macvlan_get_tap: + * @setting: the #NMSettingMacvlan + * + * Returns: the #NMSettingMacvlan:tap property of the setting + * + * Since: 1.2 + **/ +gboolean +nm_setting_macvlan_get_tap (NMSettingMacvlan *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_MACVLAN (setting), FALSE); + return NM_SETTING_MACVLAN_GET_PRIVATE (setting)->tap; +} + +/*********************************************************************/ + +static void +nm_setting_macvlan_init (NMSettingMacvlan *setting) +{ +} + +static gboolean +verify (NMSetting *setting, NMConnection *connection, GError **error) +{ + NMSettingMacvlanPrivate *priv = NM_SETTING_MACVLAN_GET_PRIVATE (setting); + NMSettingConnection *s_con; + NMSettingWired *s_wired; + + if (connection) { + s_con = nm_connection_get_setting_connection (connection); + s_wired = nm_connection_get_setting_wired (connection); + } else { + s_con = NULL; + s_wired = NULL; + } + + if (priv->parent) { + if ( !nm_utils_is_uuid (priv->parent) + && !nm_utils_iface_valid_name (priv->parent)) { + g_set_error (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("'%s' is neither an UUID nor an interface name"), + priv->parent); + g_prefix_error (error, "%s.%s: ", NM_SETTING_MACVLAN_SETTING_NAME, NM_SETTING_MACVLAN_PARENT); + return FALSE; + } + } else { + /* If parent is NULL, the parent must be specified via + * NMSettingWired:mac-address. + */ + if ( connection + && (!s_wired || !nm_setting_wired_get_mac_address (s_wired))) { + g_set_error (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_MISSING_PROPERTY, + _("property is not specified and neither is '%s:%s'"), + NM_SETTING_WIRED_SETTING_NAME, NM_SETTING_WIRED_MAC_ADDRESS); + g_prefix_error (error, "%s.%s: ", NM_SETTING_MACVLAN_SETTING_NAME, NM_SETTING_MACVLAN_PARENT); + return FALSE; + } + } + + if (!priv->promiscuous && priv->mode != NM_SETTING_MACVLAN_MODE_PASSTHRU) { + g_set_error_literal (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("non promiscuous operation is allowed only in passthru mode'")); + g_prefix_error (error, "%s.%s: ", + NM_SETTING_MACVLAN_SETTING_NAME, + NM_SETTING_MACVLAN_PROMISCUOUS); + return FALSE; + + } + + return TRUE; +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMSettingMacvlan *setting = NM_SETTING_MACVLAN (object); + NMSettingMacvlanPrivate *priv = NM_SETTING_MACVLAN_GET_PRIVATE (setting); + + switch (prop_id) { + case PROP_PARENT: + g_free (priv->parent); + priv->parent = g_value_dup_string (value); + break; + case PROP_MODE: + priv->mode = g_value_get_uint (value); + break; + case PROP_PROMISCUOUS: + priv->promiscuous = g_value_get_boolean (value); + break; + case PROP_TAP: + priv->tap = g_value_get_boolean (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMSettingMacvlan *setting = NM_SETTING_MACVLAN (object); + NMSettingMacvlanPrivate *priv = NM_SETTING_MACVLAN_GET_PRIVATE (setting); + + switch (prop_id) { + case PROP_PARENT: + g_value_set_string (value, priv->parent); + break; + case PROP_MODE: + g_value_set_uint (value, priv->mode); + break; + case PROP_PROMISCUOUS: + g_value_set_boolean (value, priv->promiscuous); + break; + case PROP_TAP: + g_value_set_boolean (value, priv->tap); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +finalize (GObject *object) +{ + NMSettingMacvlan *setting = NM_SETTING_MACVLAN (object); + NMSettingMacvlanPrivate *priv = NM_SETTING_MACVLAN_GET_PRIVATE (setting); + + g_free (priv->parent); + + G_OBJECT_CLASS (nm_setting_macvlan_parent_class)->finalize (object); +} + +static void +nm_setting_macvlan_class_init (NMSettingMacvlanClass *setting_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (setting_class); + NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class); + + g_type_class_add_private (setting_class, sizeof (NMSettingMacvlanPrivate)); + + /* virtual methods */ + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->finalize = finalize; + parent_class->verify = verify; + + /* Properties */ + + /** + * NMSettingMacvlan:parent: + * + * If given, specifies the parent interface name or parent connection UUID + * from which this MAC-VLAN interface should be created. If this property is + * not specified, the connection must contain an #NMSettingWired setting + * with a #NMSettingWired:mac-address property. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_PARENT, + g_param_spec_string (NM_SETTING_MACVLAN_PARENT, "", "", + NULL, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingMacvlan:mode: + * + * The macvlan mode, which specifies the communication mechanism between multiple + * macvlans on the same lower device. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_MODE, + g_param_spec_uint (NM_SETTING_MACVLAN_MODE, "", "", + 0, G_MAXUINT, 0, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingMacvlan:promiscuous: + * + * Whether the interface should be put in promiscuous mode. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_PROMISCUOUS, + g_param_spec_boolean (NM_SETTING_MACVLAN_PROMISCUOUS, "", "", + TRUE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingMacvlan:tap: + * + * Whether the interface should be a MACVTAP. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_TAP, + g_param_spec_boolean (NM_SETTING_MACVLAN_TAP, "", "", + FALSE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); +} diff --git a/libnm-core/nm-setting-macvlan.h b/libnm-core/nm-setting-macvlan.h new file mode 100644 index 00000000..3922cd93 --- /dev/null +++ b/libnm-core/nm-setting-macvlan.h @@ -0,0 +1,94 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2015 Red Hat, Inc. + */ + +#ifndef __NM_SETTING_MACVLAN_H__ +#define __NM_SETTING_MACVLAN_H__ + +#if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION) +#error "Only can be included directly." +#endif + +#include "nm-setting.h" + +G_BEGIN_DECLS + +#define NM_TYPE_SETTING_MACVLAN (nm_setting_macvlan_get_type ()) +#define NM_SETTING_MACVLAN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_MACVLAN, NMSettingMacvlan)) +#define NM_SETTING_MACVLAN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_MACVLANCONFIG, NMSettingMacvlanClass)) +#define NM_IS_SETTING_MACVLAN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_MACVLAN)) +#define NM_IS_SETTING_MACVLAN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SETTING_MACVLAN)) +#define NM_SETTING_MACVLAN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_MACVLAN, NMSettingMacvlanClass)) + +#define NM_SETTING_MACVLAN_SETTING_NAME "macvlan" + +#define NM_SETTING_MACVLAN_PARENT "parent" +#define NM_SETTING_MACVLAN_MODE "mode" +#define NM_SETTING_MACVLAN_PROMISCUOUS "promiscuous" +#define NM_SETTING_MACVLAN_TAP "tap" + +struct _NMSettingMacvlan { + NMSetting parent; +}; + +typedef struct { + NMSettingClass parent; + + /*< private >*/ + gpointer padding[4]; +} NMSettingMacvlanClass; + +/** + * NMSettingMacvlanMode: + * @NM_SETTING_MACVLAN_MODE_UNKNOWN: unknown/unset mode + * @NM_SETTING_MACVLAN_MODE_VEPA: Virtual Ethernet Port Aggregator mode + * @NM_SETTING_MACVLAN_MODE_BRIDGE: bridge mode + * @NM_SETTING_MACVLAN_MODE_PRIVATE: private mode + * @NM_SETTING_MACVLAN_MODE_PASSTHRU: passthru mode + * @NM_SETTING_MACVLAN_MODE_SOURCE: source mode + **/ +typedef enum { + NM_SETTING_MACVLAN_MODE_UNKNOWN = 0, + NM_SETTING_MACVLAN_MODE_VEPA = 1, + NM_SETTING_MACVLAN_MODE_BRIDGE = 2, + NM_SETTING_MACVLAN_MODE_PRIVATE = 3, + NM_SETTING_MACVLAN_MODE_PASSTHRU = 4, + NM_SETTING_MACVLAN_MODE_SOURCE = 5, + _NM_SETTING_MACVLAN_MODE_NUM, /*< skip >*/ + NM_SETTING_MACVLAN_MODE_LAST = _NM_SETTING_MACVLAN_MODE_NUM - 1, /*< skip >*/ +} NMSettingMacvlanMode; + +NM_AVAILABLE_IN_1_2 +GType nm_setting_macvlan_get_type (void); +NM_AVAILABLE_IN_1_2 +NMSetting *nm_setting_macvlan_new (void); + +NM_AVAILABLE_IN_1_2 +const char *nm_setting_macvlan_get_parent (NMSettingMacvlan *setting); +NM_AVAILABLE_IN_1_2 +NMSettingMacvlanMode nm_setting_macvlan_get_mode (NMSettingMacvlan *setting); +NM_AVAILABLE_IN_1_2 +gboolean nm_setting_macvlan_get_promiscuous (NMSettingMacvlan *setting); +NM_AVAILABLE_IN_1_2 +gboolean nm_setting_macvlan_get_tap (NMSettingMacvlan *setting); + +G_END_DECLS + +#endif /* __NM_SETTING_MACVLAN_H__ */ diff --git a/libnm-core/nm-setting-olpc-mesh.c b/libnm-core/nm-setting-olpc-mesh.c index a3a5d881..4b42c365 100644 --- a/libnm-core/nm-setting-olpc-mesh.c +++ b/libnm-core/nm-setting-olpc-mesh.c @@ -23,13 +23,20 @@ #include "config.h" #include -#include #include "nm-setting-olpc-mesh.h" #include "nm-utils.h" #include "nm-utils-private.h" #include "nm-setting-private.h" +/** + * SECTION:nm-setting-olpc-mesh + * @short_description: Describes connection properties for OLPC-Mesh devices + * + * The #NMSettingOlpcMesh object is a #NMSetting subclass that describes properties + * necessary for connection to OLPC-Mesh devices. + **/ + static void nm_setting_olpc_mesh_init (NMSettingOlpcMesh *setting); G_DEFINE_TYPE_WITH_CODE (NMSettingOlpcMesh, nm_setting_olpc_mesh, NM_TYPE_SETTING, diff --git a/libnm-core/nm-setting-ppp.c b/libnm-core/nm-setting-ppp.c index 01f798ea..2cc5a209 100644 --- a/libnm-core/nm-setting-ppp.c +++ b/libnm-core/nm-setting-ppp.c @@ -22,8 +22,6 @@ #include "config.h" -#include - #include "nm-setting-ppp.h" #include "nm-setting-private.h" diff --git a/libnm-core/nm-setting-pppoe.c b/libnm-core/nm-setting-pppoe.c index ac6764d0..e2466eb3 100644 --- a/libnm-core/nm-setting-pppoe.c +++ b/libnm-core/nm-setting-pppoe.c @@ -23,7 +23,6 @@ #include "config.h" #include -#include #include "nm-setting-pppoe.h" #include "nm-setting-ppp.h" diff --git a/libnm-core/nm-setting-private.h b/libnm-core/nm-setting-private.h index 955608fa..cb7ca52e 100644 --- a/libnm-core/nm-setting-private.h +++ b/libnm-core/nm-setting-private.h @@ -21,10 +21,10 @@ #ifndef __NM_SETTING_PRIVATE_H__ #define __NM_SETTING_PRIVATE_H__ +#include "nm-default.h" #include "nm-setting.h" #include "nm-connection.h" #include "nm-core-enum-types.h" -#include "nm-glib-compat.h" #include "nm-core-internal.h" @@ -89,10 +89,20 @@ gboolean _nm_setting_clear_secrets_with_flags (NMSetting *setting, /* This is a legacy property, which clients should not send to the daemon. */ #define NM_SETTING_PARAM_LEGACY (1 << (5 + G_PARAM_USER_SHIFT)) +/* When a connection is active and gets modified, usually the change + * to the settings-connection does not propagate automatically to the + * applied-connection of the device. For certain properties like the + * firewall zone and the metered property, this is different. + * + * Such fields can be ignored during nm_connection_compare() with the + * NMSettingCompareFlag NM_SETTING_COMPARE_FLAG_IGNORE_REAPPLY_IMMEDIATELY. + */ +#define NM_SETTING_PARAM_REAPPLY_IMMEDIATELY (1 << (6 + G_PARAM_USER_SHIFT)) + /* Ensure the setting's GType is registered at library load time */ #define NM_SETTING_REGISTER_TYPE(x) \ static void __attribute__((constructor)) register_setting (void) \ -{ g_type_init (); g_type_ensure (x); } +{ nm_g_type_init (); g_type_ensure (x); } GVariant *_nm_setting_get_deprecated_virtual_interface_name (NMSetting *setting, NMConnection *connection, @@ -102,6 +112,11 @@ NMSettingVerifyResult _nm_setting_verify (NMSetting *setting, NMConnection *connection, GError **error); +gboolean _nm_setting_verify_secret_string (const char *str, + const char *setting_name, + const char *property, + GError **error); + gboolean _nm_setting_slave_type_is_valid (const char *slave_type, const char **out_port_type); GVariant *_nm_setting_to_dbus (NMSetting *setting, @@ -155,6 +170,4 @@ gboolean _nm_setting_use_legacy_property (NMSetting *setting, GPtrArray *_nm_setting_need_secrets (NMSetting *setting); -NMSetting8021xCKScheme nm_setting_802_1x_check_cert_scheme (gconstpointer pdata, gsize length, GError **error); - #endif /* NM_SETTING_PRIVATE_H */ diff --git a/libnm-core/nm-setting-serial.c b/libnm-core/nm-setting-serial.c index 3fd780c8..b8589cd2 100644 --- a/libnm-core/nm-setting-serial.c +++ b/libnm-core/nm-setting-serial.c @@ -24,8 +24,8 @@ #include +#include "nm-default.h" #include "nm-setting-serial.h" -#include "nm-glib-compat.h" #include "nm-setting-private.h" /** diff --git a/libnm-core/nm-setting-team-port.c b/libnm-core/nm-setting-team-port.c index 7fbf8620..78cb3cb7 100644 --- a/libnm-core/nm-setting-team-port.c +++ b/libnm-core/nm-setting-team-port.c @@ -23,7 +23,6 @@ #include #include #include -#include #include "nm-setting-team-port.h" #include "nm-utils.h" diff --git a/libnm-core/nm-setting-team.c b/libnm-core/nm-setting-team.c index 04b98243..2dfffaac 100644 --- a/libnm-core/nm-setting-team.c +++ b/libnm-core/nm-setting-team.c @@ -22,7 +22,6 @@ #include #include -#include #include "nm-setting-team.h" #include "nm-utils.h" diff --git a/libnm-core/nm-setting-tun.c b/libnm-core/nm-setting-tun.c new file mode 100644 index 00000000..b3c11860 --- /dev/null +++ b/libnm-core/nm-setting-tun.c @@ -0,0 +1,409 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2015 Red Hat, Inc. + */ + +#include "config.h" + +#include +#include + +#include "nm-setting-tun.h" +#include "nm-utils.h" +#include "nm-setting-connection.h" +#include "nm-setting-private.h" +#include "nm-connection-private.h" + +/** + * SECTION:nm-setting-tun + * @short_description: Describes connection properties for TUN/TAP interfaces + * + * The #NMSettingTun object is a #NMSetting subclass that describes properties + * necessary for connection to TUN/TAP interfaces. + **/ + +G_DEFINE_TYPE_WITH_CODE (NMSettingTun, nm_setting_tun, NM_TYPE_SETTING, + _nm_register_setting (TUN, 1)) +NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_TUN) + +#define NM_SETTING_TUN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_TUN, NMSettingTunPrivate)) + +typedef struct { + NMSettingTunMode mode; + char *owner; + char *group; + gboolean pi; + gboolean vnet_hdr; + gboolean multi_queue; +} NMSettingTunPrivate; + +enum { + PROP_0, + PROP_MODE, + PROP_OWNER, + PROP_GROUP, + PROP_PI, + PROP_VNET_HDR, + PROP_MULTI_QUEUE, + LAST_PROP +}; + +/** + * nm_setting_tun_new: + * + * Creates a new #NMSettingTun object with default values. + * + * Returns: (transfer full): the new empty #NMSettingTun object + * + * Since: 1.2 + **/ +NMSetting * +nm_setting_tun_new (void) +{ + return (NMSetting *) g_object_new (NM_TYPE_SETTING_TUN, NULL); +} + +/** + * nm_setting_tun_get_mode: + * @setting: the #NMSettingTun + * + * Returns: the #NMSettingTun:mode property of the setting + * + * Since: 1.2 + **/ +NMSettingTunMode +nm_setting_tun_get_mode (NMSettingTun *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_TUN (setting), NM_SETTING_TUN_MODE_TUN); + return NM_SETTING_TUN_GET_PRIVATE (setting)->mode; +} + +/** + * nm_setting_tun_get_owner: + * @setting: the #NMSettingTun + * + * Returns: the #NMSettingTun:owner property of the setting + * + * Since: 1.2 + **/ +const char * +nm_setting_tun_get_owner (NMSettingTun *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_TUN (setting), NULL); + return NM_SETTING_TUN_GET_PRIVATE (setting)->owner; +} + +/** + * nm_setting_tun_get_group: + * @setting: the #NMSettingTun + * + * Returns: the #NMSettingTun:group property of the setting + * + * Since: 1.2 + **/ +const char * +nm_setting_tun_get_group (NMSettingTun *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_TUN (setting), NULL); + return NM_SETTING_TUN_GET_PRIVATE (setting)->group; +} + +/** + * nm_setting_tun_get_pi: + * @setting: the #NMSettingTun + * + * Returns: the #NMSettingTun:pi property of the setting + * + * Since: 1.2 + **/ +gboolean +nm_setting_tun_get_pi (NMSettingTun *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_TUN (setting), FALSE); + return NM_SETTING_TUN_GET_PRIVATE (setting)->pi; +} + +/** + * nm_setting_tun_get_vnet_hdr: + * @setting: the #NMSettingTun + * + * Returns: the #NMSettingTun:vnet_hdr property of the setting + * + * Since: 1.2 + **/ +gboolean +nm_setting_tun_get_vnet_hdr (NMSettingTun *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_TUN (setting), FALSE); + return NM_SETTING_TUN_GET_PRIVATE (setting)->vnet_hdr; +} + +/** + * nm_setting_tun_get_multi_queue: + * @setting: the #NMSettingTun + * + * Returns: the #NMSettingTun:multi-queue property of the setting + * + * Since: 1.2 + **/ +gboolean +nm_setting_tun_get_multi_queue (NMSettingTun *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_TUN (setting), FALSE); + return NM_SETTING_TUN_GET_PRIVATE (setting)->multi_queue; +} + +static void +nm_setting_tun_init (NMSettingTun *setting) +{ +} + +static gboolean +verify (NMSetting *setting, NMConnection *connection, GError **error) +{ + NMSettingTunPrivate *priv = NM_SETTING_TUN_GET_PRIVATE (setting); + + if ( priv->mode != NM_SETTING_TUN_MODE_TUN + && priv->mode != NM_SETTING_TUN_MODE_TAP) { + g_set_error (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("'%u': invalid mode"), (unsigned int) priv->mode); + g_prefix_error (error, "%s.%s: ", NM_SETTING_TUN_SETTING_NAME, NM_SETTING_TUN_MODE); + return FALSE; + } + + if (priv->owner) { + if (_nm_utils_ascii_str_to_int64 (priv->owner, 10, 0, G_MAXINT32, -1) == -1) { + g_set_error (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("'%s': invalid user ID"), priv->owner); + g_prefix_error (error, "%s.%s: ", NM_SETTING_TUN_SETTING_NAME, NM_SETTING_TUN_OWNER); + return FALSE; + } + } + + if (priv->group) { + if (_nm_utils_ascii_str_to_int64 (priv->group, 10, 0, G_MAXINT32, -1) == -1) { + g_set_error (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("'%s': invalid group ID"), priv->group); + g_prefix_error (error, "%s.%s: ", NM_SETTING_TUN_SETTING_NAME, NM_SETTING_TUN_GROUP); + return FALSE; + } + } + + return TRUE; +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMSettingTun *setting = NM_SETTING_TUN (object); + NMSettingTunPrivate *priv = NM_SETTING_TUN_GET_PRIVATE (setting); + + switch (prop_id) { + case PROP_MODE: + priv->mode = g_value_get_uint (value); + break; + case PROP_OWNER: + g_free (priv->owner); + priv->owner = g_value_dup_string (value); + break; + case PROP_GROUP: + g_free (priv->group); + priv->group = g_value_dup_string (value); + break; + case PROP_PI: + priv->pi = g_value_get_boolean (value); + break; + case PROP_VNET_HDR: + priv->vnet_hdr = g_value_get_boolean (value); + break; + case PROP_MULTI_QUEUE: + priv->multi_queue = g_value_get_boolean (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMSettingTun *setting = NM_SETTING_TUN (object); + NMSettingTunPrivate *priv = NM_SETTING_TUN_GET_PRIVATE (setting); + + switch (prop_id) { + case PROP_MODE: + g_value_set_uint (value, priv->mode); + break; + case PROP_OWNER: + g_value_set_string (value, priv->owner); + break; + case PROP_GROUP: + g_value_set_string (value, priv->group); + break; + case PROP_PI: + g_value_set_boolean (value, priv->pi); + break; + case PROP_VNET_HDR: + g_value_set_boolean (value, priv->vnet_hdr); + break; + case PROP_MULTI_QUEUE: + g_value_set_boolean (value, priv->multi_queue); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +finalize (GObject *object) +{ + NMSettingTun *setting = NM_SETTING_TUN (object); + NMSettingTunPrivate *priv = NM_SETTING_TUN_GET_PRIVATE (setting); + + g_free (priv->owner); + g_free (priv->group); + + G_OBJECT_CLASS (nm_setting_tun_parent_class)->finalize (object); +} + +static void +nm_setting_tun_class_init (NMSettingTunClass *setting_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (setting_class); + NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class); + + g_type_class_add_private (setting_class, sizeof (NMSettingTunPrivate)); + + /* virtual methods */ + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->finalize = finalize; + parent_class->verify = verify; + + /* Properties */ + /** + * NMSettingTun:mode: + * + * The operating mode of the virtual device. Allowed values are + * %NM_SETTING_TUN_MODE_TUN to create a layer 3 device and + * %NM_SETTING_TUN_MODE_TAP to create an Ethernet-like layer 2 + * one. + * + * Since: 1.2 + */ + g_object_class_install_property + (object_class, PROP_MODE, + g_param_spec_uint (NM_SETTING_TUN_MODE, "", "", + 0, G_MAXUINT, NM_SETTING_TUN_MODE_TUN, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingTun:owner: + * + * The user ID which will own the device. If set to %NULL everyone + * will be able to use the device. + * + * Since: 1.2 + */ + g_object_class_install_property + (object_class, PROP_OWNER, + g_param_spec_string (NM_SETTING_TUN_OWNER, "", "", + NULL, + G_PARAM_READWRITE | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingTun:group: + * + * The group ID which will own the device. If set to %NULL everyone + * will be able to use the device. + * + * Since: 1.2 + */ + g_object_class_install_property + (object_class, PROP_GROUP, + g_param_spec_string (NM_SETTING_TUN_GROUP, "", "", + NULL, + G_PARAM_READWRITE | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingTun:pi: + * + * If %TRUE the interface will prepend a 4 byte header describing the + * physical interface to the packets. + * + * Since: 1.2 + */ + g_object_class_install_property + (object_class, PROP_PI, + g_param_spec_boolean (NM_SETTING_TUN_PI, "", "", + FALSE, + G_PARAM_READWRITE | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingTun:vnet-hdr: + * + * If %TRUE the IFF_VNET_HDR the tunnel packets will include a virtio + * network header. + * + * Since: 1.2 + */ + g_object_class_install_property + (object_class, PROP_VNET_HDR, + g_param_spec_boolean (NM_SETTING_TUN_VNET_HDR, "", "", + FALSE, + G_PARAM_READWRITE | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingTun:multi-queue: + * + * If the property is set to %TRUE, the interface will support + * multiple file descriptors (queues) to parallelize packet + * sending or receiving. Otherwise, the interface will only + * support a single queue. + * + * Since: 1.2 + */ + g_object_class_install_property + (object_class, PROP_MULTI_QUEUE, + g_param_spec_boolean (NM_SETTING_TUN_MULTI_QUEUE, "", "", + FALSE, + G_PARAM_READWRITE | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); +} diff --git a/libnm-core/nm-setting-tun.h b/libnm-core/nm-setting-tun.h new file mode 100644 index 00000000..2b368a69 --- /dev/null +++ b/libnm-core/nm-setting-tun.h @@ -0,0 +1,94 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2015 Red Hat, Inc. + */ + +#ifndef __NM_SETTING_TUN_H__ +#define __NM_SETTING_TUN_H__ + +#if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION) +#error "Only can be included directly." +#endif + +#include "nm-setting.h" + +G_BEGIN_DECLS + +#define NM_TYPE_SETTING_TUN (nm_setting_tun_get_type ()) +#define NM_SETTING_TUN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_TUN, NMSettingTun)) +#define NM_SETTING_TUN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_TUNCONFIG, NMSettingTunClass)) +#define NM_IS_SETTING_TUN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_TUN)) +#define NM_IS_SETTING_TUN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SETTING_TUN)) +#define NM_SETTING_TUN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_TUN, NMSettingTunClass)) + +#define NM_SETTING_TUN_SETTING_NAME "tun" + +#define NM_SETTING_TUN_MODE "mode" +#define NM_SETTING_TUN_OWNER "owner" +#define NM_SETTING_TUN_GROUP "group" +#define NM_SETTING_TUN_PI "pi" +#define NM_SETTING_TUN_VNET_HDR "vnet-hdr" +#define NM_SETTING_TUN_MULTI_QUEUE "multi-queue" + +/** + * NMSettingTunMode: + * @NM_SETTING_TUN_MODE_UNKNOWN: an unknown device type + * @NM_SETTING_TUN_MODE_TUN: a TUN device + * @NM_SETTING_TUN_MODE_TAP: a TAP device + * + * #NMSettingTunMode values indicate the device type (TUN/TAP) + */ +typedef enum { + NM_SETTING_TUN_MODE_UNKNOWN = 0, + NM_SETTING_TUN_MODE_TUN = 1, + NM_SETTING_TUN_MODE_TAP = 2, +} NMSettingTunMode; + +struct _NMSettingTun { + NMSetting parent; +}; + +typedef struct { + NMSettingClass parent; + + /*< private >*/ + gpointer padding[4]; +} NMSettingTunClass; + +NM_AVAILABLE_IN_1_2 +GType nm_setting_tun_get_type (void); +NM_AVAILABLE_IN_1_2 +NMSetting *nm_setting_tun_new (void); + +NM_AVAILABLE_IN_1_2 +NMSettingTunMode nm_setting_tun_get_mode (NMSettingTun *setting); +NM_AVAILABLE_IN_1_2 +const char *nm_setting_tun_get_owner (NMSettingTun *setting); +NM_AVAILABLE_IN_1_2 +const char *nm_setting_tun_get_group (NMSettingTun *setting); +NM_AVAILABLE_IN_1_2 +gboolean nm_setting_tun_get_pi (NMSettingTun *setting); +NM_AVAILABLE_IN_1_2 +gboolean nm_setting_tun_get_vnet_hdr (NMSettingTun *setting); +NM_AVAILABLE_IN_1_2 +gboolean nm_setting_tun_get_multi_queue (NMSettingTun *setting); + +G_END_DECLS + +#endif /* __NM_SETTING_TUN_H__ */ diff --git a/libnm-core/nm-setting-vlan.c b/libnm-core/nm-setting-vlan.c index 0547141c..8428a369 100644 --- a/libnm-core/nm-setting-vlan.c +++ b/libnm-core/nm-setting-vlan.c @@ -23,10 +23,12 @@ #include #include -#include #include "nm-setting-vlan.h" +#include "nm-default.h" +#include "nm-macros-internal.h" #include "nm-utils.h" +#include "nm-core-types-internal.h" #include "nm-setting-connection.h" #include "nm-setting-private.h" #include "nm-setting-wired.h" @@ -67,11 +69,6 @@ enum { #define MAX_SKB_PRIO G_MAXUINT32 #define MAX_8021P_PRIO 7 /* Max 802.1p priority */ -typedef struct { - guint32 from; - guint32 to; -} PriorityMap; - /** * nm_setting_vlan_new: * @@ -134,10 +131,10 @@ get_max_prio (NMVlanPriorityMap map, gboolean from) g_assert_not_reached (); } -static PriorityMap * +static NMVlanQosMapping * priority_map_new_from_str (NMVlanPriorityMap map, const char *str) { - PriorityMap *p = NULL; + NMVlanQosMapping *p = NULL; gchar **t = NULL; guint32 len; guint64 from, to; @@ -151,7 +148,7 @@ priority_map_new_from_str (NMVlanPriorityMap map, const char *str) to = g_ascii_strtoull (t[1], NULL, 10); if ((from <= get_max_prio (map, TRUE)) && (to <= get_max_prio (map, FALSE))) { - p = g_malloc0 (sizeof (PriorityMap)); + p = g_malloc0 (sizeof (NMVlanQosMapping)); p->from = from; p->to = to; } @@ -165,7 +162,7 @@ priority_map_new_from_str (NMVlanPriorityMap map, const char *str) } static void -priority_map_free (PriorityMap *map) +priority_map_free (NMVlanQosMapping *map) { g_return_if_fail (map != NULL); g_free (map); @@ -182,9 +179,44 @@ get_map (NMSettingVlan *self, NMVlanPriorityMap map) return NULL; } +static gint +prio_map_compare (gconstpointer p_a, gconstpointer p_b) +{ + const NMVlanQosMapping *a = p_a; + const NMVlanQosMapping *b = p_b; + + return a->from < b->from + ? -1 + : (a->from > b->from + ? 1 + : (a->to < b->to ? -1 : (a->to > b->to ? 1 : 0))); +} + static void set_map (NMSettingVlan *self, NMVlanPriorityMap map, GSList *list) { + /* Assert that the list is sorted */ +#if NM_MORE_ASSERTS >= 2 + { + GSList *iter, *last; + + last = list; + iter = list ? list->next : NULL; + while (iter) { + const NMVlanQosMapping *l = last->data; + const NMVlanQosMapping *m = iter->data; + + nm_assert (prio_map_compare (last->data, iter->data) < 0); + + /* Also reject duplicates (based on "from") */ + nm_assert (l->from < m->from); + + last = iter; + iter = iter->next; + } + } +#endif + if (map == NM_VLAN_INGRESS_MAP) { NM_SETTING_VLAN_GET_PRIVATE (self)->ingress_priority_map = list; g_object_notify (G_OBJECT (self), NM_SETTING_VLAN_INGRESS_PRIORITY_MAP); @@ -195,6 +227,22 @@ set_map (NMSettingVlan *self, NMVlanPriorityMap map, GSList *list) g_assert_not_reached (); } +static gboolean +check_replace_duplicate_priority (GSList *list, guint32 from, guint32 to) +{ + GSList *iter; + NMVlanQosMapping *p; + + for (iter = list; iter; iter = g_slist_next (iter)) { + p = iter->data; + if (p->from == from) { + p->to = to; + return TRUE; + } + } + return FALSE; +} + /** * nm_setting_vlan_add_priority_str: * @setting: the #NMSettingVlan @@ -213,8 +261,8 @@ nm_setting_vlan_add_priority_str (NMSettingVlan *setting, NMVlanPriorityMap map, const char *str) { - GSList *list = NULL, *iter = NULL; - PriorityMap *item = NULL; + GSList *list = NULL; + NMVlanQosMapping *item = NULL; g_return_val_if_fail (NM_IS_SETTING_VLAN (setting), FALSE); g_return_val_if_fail (map == NM_VLAN_INGRESS_MAP || map == NM_VLAN_EGRESS_MAP, FALSE); @@ -227,21 +275,16 @@ nm_setting_vlan_add_priority_str (NMSettingVlan *setting, g_return_val_if_reached (FALSE); /* Duplicates get replaced */ - for (iter = list; iter; iter = g_slist_next (iter)) { - PriorityMap *p = iter->data; - - if (p->from == item->from) { - p->to = item->to; - g_free (item); - if (map == NM_VLAN_INGRESS_MAP) - g_object_notify (G_OBJECT (setting), NM_SETTING_VLAN_INGRESS_PRIORITY_MAP); - else - g_object_notify (G_OBJECT (setting), NM_SETTING_VLAN_EGRESS_PRIORITY_MAP); - return TRUE; - } + if (check_replace_duplicate_priority (list, item->from, item->to)) { + g_free (item); + if (map == NM_VLAN_INGRESS_MAP) + g_object_notify (G_OBJECT (setting), NM_SETTING_VLAN_INGRESS_PRIORITY_MAP); + else + g_object_notify (G_OBJECT (setting), NM_SETTING_VLAN_EGRESS_PRIORITY_MAP); + return TRUE; } - set_map (setting, map, g_slist_append (list, item)); + set_map (setting, map, g_slist_insert_sorted (list, item, prio_map_compare)); return TRUE; } @@ -286,7 +329,7 @@ nm_setting_vlan_get_priority (NMSettingVlan *setting, guint32 *out_to) { GSList *list = NULL; - PriorityMap *item = NULL; + NMVlanQosMapping *item = NULL; g_return_val_if_fail (NM_IS_SETTING_VLAN (setting), FALSE); g_return_val_if_fail (map == NM_VLAN_INGRESS_MAP || map == NM_VLAN_EGRESS_MAP, FALSE); @@ -330,33 +373,111 @@ nm_setting_vlan_add_priority (NMSettingVlan *setting, guint32 from, guint32 to) { - GSList *list = NULL, *iter = NULL; - PriorityMap *item; + GSList *list = NULL; + NMVlanQosMapping *item; g_return_val_if_fail (NM_IS_SETTING_VLAN (setting), FALSE); g_return_val_if_fail (map == NM_VLAN_INGRESS_MAP || map == NM_VLAN_EGRESS_MAP, FALSE); list = get_map (setting, map); - for (iter = list; iter; iter = g_slist_next (iter)) { - item = iter->data; - if (item->from == from) { - item->to = to; - if (map == NM_VLAN_INGRESS_MAP) - g_object_notify (G_OBJECT (setting), NM_SETTING_VLAN_INGRESS_PRIORITY_MAP); - else - g_object_notify (G_OBJECT (setting), NM_SETTING_VLAN_EGRESS_PRIORITY_MAP); - return TRUE; - } + if (check_replace_duplicate_priority (list, from, to)) { + if (map == NM_VLAN_INGRESS_MAP) + g_object_notify (G_OBJECT (setting), NM_SETTING_VLAN_INGRESS_PRIORITY_MAP); + else + g_object_notify (G_OBJECT (setting), NM_SETTING_VLAN_EGRESS_PRIORITY_MAP); + return TRUE; } - item = g_malloc0 (sizeof (PriorityMap)); + item = g_malloc0 (sizeof (NMVlanQosMapping)); item->from = from; item->to = to; - set_map (setting, map, g_slist_append (list, item)); + set_map (setting, map, g_slist_insert_sorted (list, item, prio_map_compare)); return TRUE; } +gboolean +_nm_setting_vlan_set_priorities (NMSettingVlan *setting, + NMVlanPriorityMap map, + const NMVlanQosMapping *qos_map, + guint n_qos_map) +{ + gboolean has_changes = FALSE; + GSList *map_prev, *map_new; + guint i; + gint64 from_last; + + map_prev = get_map (setting, map); + + if (n_qos_map != g_slist_length (map_prev)) + has_changes = TRUE; + else { + const GSList *iter; + + iter = map_prev; + for (i = 0; i < n_qos_map; i++, iter = iter->next) { + const NMVlanQosMapping *m = iter->data; + + if ( m->from != qos_map[i].from + || m->to != qos_map[i].to) { + has_changes = TRUE; + break; + } + } + } + + if (!has_changes) + return FALSE; + + map_new = NULL; + from_last = G_MAXINT64; + for (i = n_qos_map; i > 0;) { + const NMVlanQosMapping *m = &qos_map[--i]; + NMVlanQosMapping *item; + + /* We require the array to be presorted. */ + if (m->from >= from_last) + g_return_val_if_reached (FALSE); + from_last = m->from; + + item = g_malloc0 (sizeof (NMVlanQosMapping)); + item->from = m->from; + item->to = m->to; + map_new = g_slist_prepend (map_new, item); + } + + g_slist_free_full (map_prev, g_free); + set_map (setting, map, map_new); + + return TRUE; +} + +void +_nm_setting_vlan_get_priorities (NMSettingVlan *setting, + NMVlanPriorityMap map, + NMVlanQosMapping **out_qos_map, + guint *out_n_qos_map) +{ + GSList *list; + NMVlanQosMapping *qos_map = NULL; + guint n_qos_map, i; + + list = get_map (setting, map); + + n_qos_map = g_slist_length (list); + + if (n_qos_map > 0) { + qos_map = g_new (NMVlanQosMapping, n_qos_map); + + for (i = 0; list; i++, list = list->next) { + nm_assert (i < n_qos_map); + qos_map[i] = *((const NMVlanQosMapping *) list->data); + } + } + *out_qos_map = qos_map; + *out_n_qos_map = n_qos_map; +} + /** * nm_setting_vlan_remove_priority: * @setting: the #NMSettingVlan @@ -381,7 +502,7 @@ nm_setting_vlan_remove_priority (NMSettingVlan *setting, g_return_if_fail (idx < g_slist_length (list)); item = g_slist_nth (list, idx); - priority_map_free ((PriorityMap *) (item->data)); + priority_map_free ((NMVlanQosMapping *) (item->data)); set_map (setting, map, g_slist_delete_link (list, item)); } @@ -405,7 +526,7 @@ nm_setting_vlan_remove_priority_by_value (NMSettingVlan *setting, guint32 to) { GSList *list = NULL, *iter = NULL; - PriorityMap *item; + NMVlanQosMapping *item; g_return_val_if_fail (NM_IS_SETTING_VLAN (setting), FALSE); g_return_val_if_fail (map == NM_VLAN_INGRESS_MAP || map == NM_VLAN_EGRESS_MAP, FALSE); @@ -414,7 +535,7 @@ nm_setting_vlan_remove_priority_by_value (NMSettingVlan *setting, for (iter = list; iter; iter = g_slist_next (iter)) { item = iter->data; if (item->from == from && item->to == to) { - priority_map_free ((PriorityMap *) (iter->data)); + priority_map_free ((NMVlanQosMapping *) (iter->data)); set_map (setting, map, g_slist_delete_link (list, iter)); return TRUE; } @@ -439,7 +560,7 @@ nm_setting_vlan_remove_priority_str_by_value (NMSettingVlan *setting, NMVlanPriorityMap map, const char *str) { - PriorityMap *item; + NMVlanQosMapping *item; gboolean found; g_return_val_if_fail (NM_IS_SETTING_VLAN (setting), FALSE); @@ -545,9 +666,7 @@ verify (NMSetting *setting, NMConnection *connection, GError **error) } } - if (priv->flags & ~(NM_VLAN_FLAG_REORDER_HEADERS | - NM_VLAN_FLAG_GVRP | - NM_VLAN_FLAG_LOOSE_BINDING)) { + if (priv->flags & ~NM_VLAN_FLAGS_ALL) { g_set_error_literal (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, @@ -559,6 +678,24 @@ verify (NMSetting *setting, NMConnection *connection, GError **error) return TRUE; } +static GVariant * +_override_flags_get (NMSetting *setting, const char *property) +{ + return g_variant_new_uint32 (nm_setting_vlan_get_flags ((NMSettingVlan *) setting)); +} + +static void +_override_flags_not_set (NMSetting *setting, + GVariant *connection_dict, + const char *property) +{ + /* we changed the default value for FLAGS. When an older client + * doesn't serialize the property, we assume it is the old default. */ + g_object_set (G_OBJECT (setting), + NM_SETTING_VLAN_FLAGS, (NMVlanFlags) 0, + NULL); +} + static GSList * priority_strv_to_maplist (NMVlanPriorityMap map, char **strv) { @@ -566,13 +703,15 @@ priority_strv_to_maplist (NMVlanPriorityMap map, char **strv) int i; for (i = 0; strv && strv[i]; i++) { - PriorityMap *item; + NMVlanQosMapping *item; item = priority_map_new_from_str (map, strv[i]); - if (item) - list = g_slist_prepend (list, item); + if (item) { + if (!check_replace_duplicate_priority (list, item->from, item->to)) + list = g_slist_prepend (list, item); + } } - return g_slist_reverse (list); + return g_slist_sort (list, prio_map_compare); } static void @@ -618,7 +757,7 @@ priority_maplist_to_strv (GSList *list) strv = g_ptr_array_new (); for (iter = list; iter; iter = g_slist_next (iter)) { - PriorityMap *item = iter->data; + NMVlanQosMapping *item = iter->data; g_ptr_array_add (strv, g_strdup_printf ("%d:%d", item->from, item->to)); } @@ -736,12 +875,18 @@ nm_setting_vlan_class_init (NMSettingVlanClass *setting_class) * interface. Flags include %NM_VLAN_FLAG_REORDER_HEADERS (reordering of * output packet headers), %NM_VLAN_FLAG_GVRP (use of the GVRP protocol), * and %NM_VLAN_FLAG_LOOSE_BINDING (loose binding of the interface to its - * master device's operating state). + * master device's operating state). %NM_VLAN_FLAG_MVRP (use of the MVRP + * protocol). + * + * The default value of this property is NM_VLAN_FLAG_REORDER_HEADERS, + * but it used to be 0. To preserve backward compatibility, the default-value + * in the D-Bus API continues to be 0 and a missing property on D-Bus + * is still considered as 0. **/ /* ---ifcfg-rh--- * property: flags - * variable: VLAN_FLAGS, REORDER_HDR - * values: "GVRP", "LOOSE_BINDING" for VLAN_FLAGS; 0 or 1 for REORDER_HDR + * variable: REORDER_HDR, GVRP, MVRP, VLAN_FLAGS + * values: "yes or "no" for REORDER_HDR, GVRP and MVRP; "LOOSE_BINDING" for VLAN_FLAGS * description: VLAN flags. * ---end--- */ @@ -754,6 +899,11 @@ nm_setting_vlan_class_init (NMSettingVlanClass *setting_class) G_PARAM_CONSTRUCT | NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS)); + _nm_setting_class_override_property (parent_class, NM_SETTING_VLAN_FLAGS, + NULL, + _override_flags_get, + NULL, + _override_flags_not_set); /** * NMSettingVlan:ingress-priority-map: diff --git a/libnm-core/nm-setting-vlan.h b/libnm-core/nm-setting-vlan.h index 30305d32..cf41ba17 100644 --- a/libnm-core/nm-setting-vlan.h +++ b/libnm-core/nm-setting-vlan.h @@ -79,6 +79,8 @@ typedef enum { * @NM_VLAN_FLAG_LOOSE_BINDING: indicates that this interface's operating * state is tied to the underlying network interface but other details * (like routing) are not. + * @NM_VLAN_FLAG_MVRP: indicates that this interface should use MVRP to register + * itself with it's switch * * #NMVlanFlags values control the behavior of the VLAN interface. **/ @@ -86,10 +88,19 @@ typedef enum { /*< flags >*/ NM_VLAN_FLAG_REORDER_HEADERS = 0x1, NM_VLAN_FLAG_GVRP = 0x2, NM_VLAN_FLAG_LOOSE_BINDING = 0x4, + NM_VLAN_FLAG_MVRP = 0x8, /* NOTE: if adding flags update nm-setting-vlan.c::verify() */ + + /* NOTE: these flags must correspond to the value from the kernel + * header files. */ } NMVlanFlags; +#define NM_VLAN_FLAGS_ALL (NM_VLAN_FLAG_REORDER_HEADERS | \ + NM_VLAN_FLAG_GVRP | \ + NM_VLAN_FLAG_LOOSE_BINDING | \ + NM_VLAN_FLAG_MVRP) + GType nm_setting_vlan_get_type (void); NMSetting *nm_setting_vlan_new (void); diff --git a/libnm-core/nm-setting-vpn.c b/libnm-core/nm-setting-vpn.c index e6fffa87..aae8ae13 100644 --- a/libnm-core/nm-setting-vpn.c +++ b/libnm-core/nm-setting-vpn.c @@ -24,7 +24,6 @@ #include #include #include -#include #include "nm-setting-vpn.h" #include "nm-utils.h" @@ -81,6 +80,9 @@ typedef struct { * freed with g_free(). Should contain secrets only. */ GHashTable *secrets; + + /* Timeout for the VPN service to establish the connection */ + guint32 timeout; } NMSettingVpnPrivate; enum { @@ -90,6 +92,7 @@ enum { PROP_PERSISTENT, PROP_DATA, PROP_SECRETS, + PROP_TIMEOUT, LAST_PROP }; @@ -388,6 +391,22 @@ nm_setting_vpn_foreach_secret (NMSettingVpn *setting, foreach_item_helper (NM_SETTING_VPN_GET_PRIVATE (setting)->secrets, func, user_data); } +/** + * nm_setting_vpn_get_timeout: + * @setting: the #NMSettingVpn + * + * Returns: the #NMSettingVpn:timeout property of the setting + * + * Since: 1.2 + **/ +guint32 +nm_setting_vpn_get_timeout (NMSettingVpn *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_VPN (setting), 0); + + return NM_SETTING_VPN_GET_PRIVATE (setting)->timeout; +} + static gboolean verify (NMSetting *setting, NMConnection *connection, GError **error) { @@ -754,6 +773,9 @@ set_property (GObject *object, guint prop_id, g_hash_table_unref (priv->secrets); priv->secrets = _nm_utils_copy_strdict (g_value_get_boxed (value)); break; + case PROP_TIMEOUT: + priv->timeout = g_value_get_uint (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -783,6 +805,9 @@ get_property (GObject *object, guint prop_id, case PROP_SECRETS: g_value_take_boxed (value, _nm_utils_copy_strdict (priv->secrets)); break; + case PROP_TIMEOUT: + g_value_set_uint (value, nm_setting_vpn_get_timeout (setting)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -910,4 +935,22 @@ nm_setting_vpn_class_init (NMSettingVpnClass *setting_class) G_VARIANT_TYPE ("a{ss}"), _nm_utils_strdict_to_dbus, _nm_utils_strdict_from_dbus); + + /** + * NMSettingVpn:timeout: + * + * Timeout for the VPN service to establish the connection. Some services + * may take quite a long time to connect. + * Value of 0 means a default timeout, which is 60 seconds (unless overriden + * by vpn.timeout in configuration file). Values greater than zero mean + * timeout in seconds. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_TIMEOUT, + g_param_spec_uint (NM_SETTING_VPN_TIMEOUT, "", "", + 0, G_MAXUINT32, 0, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); } diff --git a/libnm-core/nm-setting-vpn.h b/libnm-core/nm-setting-vpn.h index 487549af..31f3c7b8 100644 --- a/libnm-core/nm-setting-vpn.h +++ b/libnm-core/nm-setting-vpn.h @@ -45,6 +45,7 @@ G_BEGIN_DECLS #define NM_SETTING_VPN_PERSISTENT "persistent" #define NM_SETTING_VPN_DATA "data" #define NM_SETTING_VPN_SECRETS "secrets" +#define NM_SETTING_VPN_TIMEOUT "timeout" struct _NMSettingVpn { NMSetting parent; @@ -96,6 +97,8 @@ gboolean nm_setting_vpn_remove_secret (NMSettingVpn *setting, void nm_setting_vpn_foreach_secret (NMSettingVpn *setting, NMVpnIterFunc func, gpointer user_data); +NM_AVAILABLE_IN_1_2 +guint32 nm_setting_vpn_get_timeout (NMSettingVpn *setting); G_END_DECLS diff --git a/libnm-core/nm-setting-vxlan.c b/libnm-core/nm-setting-vxlan.c new file mode 100644 index 00000000..814623b7 --- /dev/null +++ b/libnm-core/nm-setting-vxlan.c @@ -0,0 +1,843 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2015 Red Hat, Inc. + */ + +#include "config.h" + +#include +#include + +#include "nm-setting-vxlan.h" +#include "nm-utils.h" +#include "nm-setting-private.h" + +/** + * SECTION:nm-setting-vxlan + * @short_description: Describes connection properties for VXLAN interfaces + * + * The #NMSettingVxlan object is a #NMSetting subclass that describes properties + * necessary for connection to VXLAN interfaces. + **/ + +G_DEFINE_TYPE_WITH_CODE (NMSettingVxlan, nm_setting_vxlan, NM_TYPE_SETTING, + _nm_register_setting (VXLAN, 1)) +NM_SETTING_REGISTER_TYPE (NM_TYPE_SETTING_VXLAN) + +#define NM_SETTING_VXLAN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_SETTING_VXLAN, NMSettingVxlanPrivate)) + +typedef struct { + char *parent; + guint id; + char *local; + char *remote; + guint source_port_min; + guint source_port_max; + guint destination_port; + guint tos; + guint ttl; + guint ageing; + guint limit; + gboolean learning; + gboolean proxy; + gboolean rsc; + gboolean l2_miss; + gboolean l3_miss; +} NMSettingVxlanPrivate; + +enum { + PROP_0, + PROP_PARENT, + PROP_ID, + PROP_LOCAL, + PROP_REMOTE, + PROP_SOURCE_PORT_MIN, + PROP_SOURCE_PORT_MAX, + PROP_DESTINATION_PORT, + PROP_TOS, + PROP_TTL, + PROP_AGEING, + PROP_LIMIT, + PROP_LEARNING, + PROP_PROXY, + PROP_RSC, + PROP_L2_MISS, + PROP_L3_MISS, + + LAST_PROP +}; + +#define DST_PORT_DEFAULT 8472 + +/** + * nm_setting_vxlan_new: + * + * Creates a new #NMSettingVxlan object with default values. + * + * Returns: (transfer full): the new empty #NMSettingVxlan object + * + * Since: 1.2 + **/ +NMSetting * +nm_setting_vxlan_new (void) +{ + return (NMSetting *) g_object_new (NM_TYPE_SETTING_VXLAN, NULL); +} + +/** + * nm_setting_vxlan_get_parent: + * @setting: the #NMSettingVxlan + * + * Returns: the #NMSettingVxlan:parent property of the setting + * + * Since: 1.2 + **/ +const char * +nm_setting_vxlan_get_parent (NMSettingVxlan *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_VXLAN (setting), NULL); + return NM_SETTING_VXLAN_GET_PRIVATE (setting)->parent; +} + +/** + * nm_setting_vxlan_get_id: + * @setting: the #NMSettingVxlan + * + * Returns: the #NMSettingVxlan:id property of the setting + * + * Since: 1.2 + **/ +guint +nm_setting_vxlan_get_id (NMSettingVxlan *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_VXLAN (setting), 0); + return NM_SETTING_VXLAN_GET_PRIVATE (setting)->id; +} + +/** + * nm_setting_vxlan_get_local: + * @setting: the #NMSettingVxlan + * + * Returns: the #NMSettingVxlan:local property of the setting + * + * Since: 1.2 + **/ +const char * +nm_setting_vxlan_get_local (NMSettingVxlan *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_VXLAN (setting), NULL); + return NM_SETTING_VXLAN_GET_PRIVATE (setting)->local; +} + +/** + * nm_setting_vxlan_get_remote: + * @setting: the #NMSettingVxlan + * + * Returns: the #NMSettingVxlan:remote property of the setting + * + * Since: 1.2 + **/ +const char * +nm_setting_vxlan_get_remote (NMSettingVxlan *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_VXLAN (setting), NULL); + return NM_SETTING_VXLAN_GET_PRIVATE (setting)->remote; +} + +/** + * nm_setting_vxlan_get_source_port_min: + * @setting: the #NMSettingVxlan + * + * Returns: the #NMSettingVxlan:source-port-min property of the setting + * + * Since: 1.2 + **/ +guint +nm_setting_vxlan_get_source_port_min (NMSettingVxlan *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_VXLAN (setting), 0); + return NM_SETTING_VXLAN_GET_PRIVATE (setting)->source_port_min; +} + +/** + * nm_setting_vxlan_get_source_port_max: + * @setting: the #NMSettingVxlan + * + * Returns: the #NMSettingVxlan:source-port-max property of the setting + * + * Since: 1.2 + **/ +guint +nm_setting_vxlan_get_source_port_max (NMSettingVxlan *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_VXLAN (setting), 0); + return NM_SETTING_VXLAN_GET_PRIVATE (setting)->source_port_max; +} + +/** + * nm_setting_vxlan_get_destination_port: + * @setting: the #NMSettingVxlan + * + * Returns: the #NMSettingVxlan:destination-port property of the setting + * + * Since: 1.2 + **/ +guint +nm_setting_vxlan_get_destination_port (NMSettingVxlan *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_VXLAN (setting), DST_PORT_DEFAULT); + return NM_SETTING_VXLAN_GET_PRIVATE (setting)->destination_port; +} + +/** + * nm_setting_vxlan_get_proxy: + * @setting: the #NMSettingVxlan + * + * Returns: the #NMSettingVxlan:proxy property of the setting + * + * Since: 1.2 + **/ +gboolean +nm_setting_vxlan_get_proxy (NMSettingVxlan *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_VXLAN (setting), FALSE); + return NM_SETTING_VXLAN_GET_PRIVATE (setting)->proxy; +} + +/** + * nm_setting_vxlan_get_ageing: + * @setting: the #NMSettingVxlan + * + * Returns: the #NMSettingVxlan:ageing property of the setting + * + * Since: 1.2 + **/ +guint +nm_setting_vxlan_get_ageing (NMSettingVxlan *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_VXLAN (setting), 0); + return NM_SETTING_VXLAN_GET_PRIVATE (setting)->ageing; +} + +/** + * nm_setting_vxlan_get_limit: + * @setting: the #NMSettingVxlan + * + * Returns: the #NMSettingVxlan:limit property of the setting + * + * Since: 1.2 + **/ +guint +nm_setting_vxlan_get_limit (NMSettingVxlan *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_VXLAN (setting), 0); + return NM_SETTING_VXLAN_GET_PRIVATE (setting)->limit; +} + +/** + * nm_setting_vxlan_get_tos: + * @setting: the #NMSettingVxlan + * + * Returns: the #NMSettingVxlan:tos property of the setting + * + * Since: 1.2 + **/ +guint +nm_setting_vxlan_get_tos (NMSettingVxlan *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_VXLAN (setting), 0); + return NM_SETTING_VXLAN_GET_PRIVATE (setting)->tos; +} + +/** + * nm_setting_vxlan_get_ttl: + * @setting: the #NMSettingVxlan + * + * Returns: the #NMSettingVxlan:ttl property of the setting + * + * Since: 1.2 + **/ +guint +nm_setting_vxlan_get_ttl (NMSettingVxlan *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_VXLAN (setting), 0); + return NM_SETTING_VXLAN_GET_PRIVATE (setting)->ttl; +} + +/** + * nm_setting_vxlan_get_learning: + * @setting: the #NMSettingVxlan + * + * Returns: the #NMSettingVxlan:learning property of the setting + * + * Since: 1.2 + **/ +gboolean +nm_setting_vxlan_get_learning (NMSettingVxlan *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_VXLAN (setting), FALSE); + return NM_SETTING_VXLAN_GET_PRIVATE (setting)->learning; +} + +/** + * nm_setting_vxlan_get_rsc: + * @setting: the #NMSettingVxlan + * + * Returns: the #NMSettingVxlan:rsc property of the setting + * + * Since: 1.2 + **/ +gboolean +nm_setting_vxlan_get_rsc (NMSettingVxlan *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_VXLAN (setting), FALSE); + return NM_SETTING_VXLAN_GET_PRIVATE (setting)->rsc; +} + +/** + * nm_setting_vxlan_get_l2_miss: + * @setting: the #NMSettingVxlan + * + * Returns: the #NMSettingVxlan:l2_miss property of the setting + * + * Since: 1.2 + **/ +gboolean +nm_setting_vxlan_get_l2_miss (NMSettingVxlan *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_VXLAN (setting), FALSE); + return NM_SETTING_VXLAN_GET_PRIVATE (setting)->l2_miss; +} + +/** + * nm_setting_vxlan_get_l3_miss: + * @setting: the #NMSettingVxlan + * + * Returns: the #NMSettingVxlan:l3_miss property of the setting + * + * Since: 1.2 + **/ +gboolean +nm_setting_vxlan_get_l3_miss (NMSettingVxlan *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_VXLAN (setting), FALSE); + return NM_SETTING_VXLAN_GET_PRIVATE (setting)->l3_miss; +} + +/*********************************************************************/ + +static void +nm_setting_vxlan_init (NMSettingVxlan *setting) +{ +} + +static gboolean +verify (NMSetting *setting, NMConnection *connection, GError **error) +{ + NMSettingVxlanPrivate *priv = NM_SETTING_VXLAN_GET_PRIVATE (setting); + int family = AF_UNSPEC; + + if (!priv->remote) { + g_set_error_literal (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_MISSING_PROPERTY, + _("property is missing")); + g_prefix_error (error, "%s.%s: ", + NM_SETTING_VXLAN_SETTING_NAME, + NM_SETTING_VXLAN_REMOTE); + return FALSE; + } + + if (nm_utils_ipaddr_valid (AF_INET, priv->remote)) + family = AF_INET; + else if (nm_utils_ipaddr_valid (AF_INET6, priv->remote)) + family = AF_INET6; + else { + g_set_error (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("'%s' is not a valid IP address"), + priv->remote); + g_prefix_error (error, "%s.%s: ", + NM_SETTING_VXLAN_SETTING_NAME, + NM_SETTING_VXLAN_REMOTE); + return FALSE; + } + + if (priv->local) { + if (!nm_utils_ipaddr_valid (family, priv->local)) { + g_set_error (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("'%s' is not a valid IP%c address"), + priv->local, family == AF_INET ? '4' : '6'); + g_prefix_error (error, "%s.%s: ", + NM_SETTING_VXLAN_SETTING_NAME, + NM_SETTING_VXLAN_LOCAL); + return FALSE; + } + } + + if ( priv->parent + && !nm_utils_iface_valid_name (priv->parent) + && !nm_utils_is_uuid (priv->parent)) { + g_set_error (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("'%s' is neither an UUID nor an interface name"), + priv->parent); + g_prefix_error (error, "%s.%s: ", NM_SETTING_VXLAN_SETTING_NAME, + NM_SETTING_VXLAN_PARENT); + return FALSE; + } + + if ( (priv->source_port_min || priv->source_port_max) + && (priv->source_port_min > priv->source_port_max)) { + g_set_error (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("%d is greater than local port max %d"), + priv->source_port_min, + priv->source_port_max); + g_prefix_error (error, "%s.%s: ", + NM_SETTING_VXLAN_SETTING_NAME, + NM_SETTING_VXLAN_SOURCE_PORT_MIN); + return FALSE; + } + + return TRUE; +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMSettingVxlan *setting = NM_SETTING_VXLAN (object); + NMSettingVxlanPrivate *priv = NM_SETTING_VXLAN_GET_PRIVATE (setting); + + switch (prop_id) { + case PROP_PARENT: + g_free (priv->parent); + priv->parent = g_value_dup_string (value); + break; + case PROP_ID: + priv->id = g_value_get_uint (value); + break; + case PROP_LOCAL: + g_free (priv->local); + priv->local = g_value_dup_string (value); + break; + case PROP_REMOTE: + g_free (priv->remote); + priv->remote = g_value_dup_string (value); + break; + case PROP_SOURCE_PORT_MIN: + priv->source_port_min = g_value_get_uint (value); + break; + case PROP_SOURCE_PORT_MAX: + priv->source_port_max = g_value_get_uint (value); + break; + case PROP_DESTINATION_PORT: + priv->destination_port = g_value_get_uint (value); + break; + case PROP_TOS: + priv->tos = g_value_get_uint (value); + break; + case PROP_AGEING: + priv->ageing = g_value_get_uint (value); + break; + case PROP_LIMIT: + priv->limit = g_value_get_uint (value); + break; + case PROP_PROXY: + priv->proxy = g_value_get_boolean (value); + break; + case PROP_TTL: + priv->ttl = g_value_get_uint (value); + break; + case PROP_LEARNING: + priv->learning = g_value_get_boolean (value); + break; + case PROP_RSC: + priv->rsc = g_value_get_boolean (value); + break; + case PROP_L2_MISS: + priv->l2_miss = g_value_get_boolean (value); + break; + case PROP_L3_MISS: + priv->l3_miss = g_value_get_boolean (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMSettingVxlan *setting = NM_SETTING_VXLAN (object); + NMSettingVxlanPrivate *priv = NM_SETTING_VXLAN_GET_PRIVATE (setting); + + switch (prop_id) { + case PROP_PARENT: + g_value_set_string (value, priv->parent); + break; + case PROP_ID: + g_value_set_uint (value, priv->id); + break; + case PROP_LOCAL: + g_value_set_string (value, priv->local); + break; + case PROP_REMOTE: + g_value_set_string (value, priv->remote); + break; + case PROP_SOURCE_PORT_MIN: + g_value_set_uint (value, priv->source_port_min); + break; + case PROP_SOURCE_PORT_MAX: + g_value_set_uint (value, priv->source_port_max); + break; + case PROP_DESTINATION_PORT: + g_value_set_uint (value, priv->destination_port); + break; + case PROP_TOS: + g_value_set_uint (value, priv->tos); + break; + case PROP_AGEING: + g_value_set_uint (value, priv->ageing); + break; + case PROP_LIMIT: + g_value_set_uint (value, priv->limit); + break; + case PROP_PROXY: + g_value_set_boolean (value, priv->proxy); + break; + case PROP_TTL: + g_value_set_uint (value, priv->ttl); + break; + case PROP_LEARNING: + g_value_set_boolean (value, priv->learning); + break; + case PROP_RSC: + g_value_set_boolean (value, priv->rsc); + break; + case PROP_L2_MISS: + g_value_set_boolean (value, priv->l2_miss); + break; + case PROP_L3_MISS: + g_value_set_boolean (value, priv->l3_miss); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +finalize (GObject *object) +{ + NMSettingVxlan *setting = NM_SETTING_VXLAN (object); + NMSettingVxlanPrivate *priv = NM_SETTING_VXLAN_GET_PRIVATE (setting); + + g_free (priv->parent); + g_free (priv->local); + g_free (priv->remote); + + G_OBJECT_CLASS (nm_setting_vxlan_parent_class)->finalize (object); +} + +static void +nm_setting_vxlan_class_init (NMSettingVxlanClass *setting_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (setting_class); + NMSettingClass *parent_class = NM_SETTING_CLASS (setting_class); + + g_type_class_add_private (setting_class, sizeof (NMSettingVxlanPrivate)); + + /* virtual methods */ + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->finalize = finalize; + parent_class->verify = verify; + + /* Properties */ + + /** + * NMSettingVxlan:parent: + * + * If given, specifies the parent interface name or parent connection UUID. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_PARENT, + g_param_spec_string (NM_SETTING_VXLAN_PARENT, "", "", + NULL, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + /** + * NMSettingVxlan:id: + * + * Specifies the VXLAN Network Identifer (or VXLAN Segment Identifier) to + * use. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_ID, + g_param_spec_uint (NM_SETTING_VXLAN_ID, "", "", + 0, (1 << 24) - 1, 0, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingVxlan:local: + * + * If given, specifies the source IP address to use in outgoing packets. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_LOCAL, + g_param_spec_string (NM_SETTING_VXLAN_LOCAL, "", "", + NULL, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingVxlan:remote: + * + * Specifies the unicast destination IP address to use in outgoing packets + * when the destination link layer address is not known in the VXLAN device + * forwarding database, or the multicast IP address to join. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_REMOTE, + g_param_spec_string (NM_SETTING_VXLAN_REMOTE, "", "", + NULL, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingVxlan:source-port-min: + * + * Specifies the minimum UDP source port to communicate to the remote VXLAN + * tunnel endpoint. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_SOURCE_PORT_MIN, + g_param_spec_uint (NM_SETTING_VXLAN_SOURCE_PORT_MIN, "", "", + 0, G_MAXUINT16, 0, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingVxlan:source-port-max: + * + * Specifies the maximum UDP source port to communicate to the remote VXLAN + * tunnel endpoint. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_SOURCE_PORT_MAX, + g_param_spec_uint (NM_SETTING_VXLAN_SOURCE_PORT_MAX, "", "", + 0, G_MAXUINT16, 0, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingVxlan:destination-port: + * + * Specifies the UDP destination port to communicate to the remote VXLAN + * tunnel endpoint. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_DESTINATION_PORT, + g_param_spec_uint (NM_SETTING_VXLAN_DESTINATION_PORT, "", "", + 0, G_MAXUINT16, DST_PORT_DEFAULT, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingVxlan:ageing: + * + * Specifies the lifetime in seconds of FDB entries learnt by the kernel. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_AGEING, + g_param_spec_uint (NM_SETTING_VXLAN_AGEING, "", "", + 0, G_MAXINT32, 300, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingVxlan:limit: + * + * Specifies the maximum number of FDB entries. A value of zero means that + * the kernel will store unlimited entries. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_AGEING, + g_param_spec_uint (NM_SETTING_VXLAN_LIMIT, "", "", + 0, G_MAXINT32, 0, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingVxlan:tos: + * + * Specifies the TOS value to use in outgoing packets. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_TOS, + g_param_spec_uint (NM_SETTING_VXLAN_TOS, "", "", + 0, 255, 0, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingVxlan:ttl: + * + * Specifies the time-to-live value to use in outgoing packets. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_TTL, + g_param_spec_uint (NM_SETTING_VXLAN_TTL, "", "", + 0, 255, 0, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingVxlan:proxy: + * + * Specifies whether ARP proxy is turned on. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_PROXY, + g_param_spec_boolean (NM_SETTING_VXLAN_PROXY, "", "", + FALSE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingVxlan:learning: + * + * Specifies whether unknown source link layer addresses and IP addresses + * are entered into the VXLAN device forwarding database. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_LEARNING, + g_param_spec_boolean (NM_SETTING_VXLAN_LEARNING, "", "", + TRUE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + /** + * NMSettingVxlan:rsc: + * + * Specifies whether route short circuit is turned on. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_RSC, + g_param_spec_boolean (NM_SETTING_VXLAN_RSC, "", "", + FALSE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + /** + * NMSettingVxlan:l2-miss: + * + * Specifies whether netlink LL ADDR miss notifications are generated. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_L2_MISS, + g_param_spec_boolean (NM_SETTING_VXLAN_L2_MISS, "", "", + FALSE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingVxlan:l3-miss: + * + * Specifies whether netlink IP ADDR miss notifications are generated. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_L3_MISS, + g_param_spec_boolean (NM_SETTING_VXLAN_L3_MISS, "", "", + FALSE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT | + NM_SETTING_PARAM_INFERRABLE | + G_PARAM_STATIC_STRINGS)); +} diff --git a/libnm-core/nm-setting-vxlan.h b/libnm-core/nm-setting-vxlan.h new file mode 100644 index 00000000..c410338e --- /dev/null +++ b/libnm-core/nm-setting-vxlan.h @@ -0,0 +1,109 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ + +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2015 Red Hat, Inc. + */ + +#ifndef __NM_SETTING_VXLAN_H__ +#define __NM_SETTING_VXLAN_H__ + +#if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION) +#error "Only can be included directly." +#endif + +#include "nm-setting.h" + +G_BEGIN_DECLS + +#define NM_TYPE_SETTING_VXLAN (nm_setting_vxlan_get_type ()) +#define NM_SETTING_VXLAN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SETTING_VXLAN, NMSettingVxlan)) +#define NM_SETTING_VXLAN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SETTING_VXLANCONFIG, NMSettingVxlanClass)) +#define NM_IS_SETTING_VXLAN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SETTING_VXLAN)) +#define NM_IS_SETTING_VXLAN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SETTING_VXLAN)) +#define NM_SETTING_VXLAN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SETTING_VXLAN, NMSettingVxlanClass)) + +#define NM_SETTING_VXLAN_SETTING_NAME "vxlan" + +#define NM_SETTING_VXLAN_PARENT "parent" +#define NM_SETTING_VXLAN_ID "id" +#define NM_SETTING_VXLAN_LOCAL "local" +#define NM_SETTING_VXLAN_REMOTE "remote" +#define NM_SETTING_VXLAN_SOURCE_PORT_MIN "source-port-min" +#define NM_SETTING_VXLAN_SOURCE_PORT_MAX "source-port-max" +#define NM_SETTING_VXLAN_DESTINATION_PORT "destination-port" +#define NM_SETTING_VXLAN_TOS "tos" +#define NM_SETTING_VXLAN_TTL "ttl" +#define NM_SETTING_VXLAN_AGEING "ageing" +#define NM_SETTING_VXLAN_LIMIT "limit" +#define NM_SETTING_VXLAN_PROXY "proxy" +#define NM_SETTING_VXLAN_LEARNING "learning" +#define NM_SETTING_VXLAN_RSC "rsc" +#define NM_SETTING_VXLAN_L2_MISS "l2-miss" +#define NM_SETTING_VXLAN_L3_MISS "l3-miss" + +struct _NMSettingVxlan { + NMSetting parent; +}; + +typedef struct { + NMSettingClass parent; + + /*< private >*/ + gpointer padding[4]; +} NMSettingVxlanClass; + +NM_AVAILABLE_IN_1_2 +GType nm_setting_vxlan_get_type (void); +NM_AVAILABLE_IN_1_2 +NMSetting *nm_setting_vxlan_new (void); +NM_AVAILABLE_IN_1_2 +const char *nm_setting_vxlan_get_parent (NMSettingVxlan *setting); +NM_AVAILABLE_IN_1_2 +guint nm_setting_vxlan_get_id (NMSettingVxlan *setting); +NM_AVAILABLE_IN_1_2 +const char *nm_setting_vxlan_get_local (NMSettingVxlan *setting); +NM_AVAILABLE_IN_1_2 +const char *nm_setting_vxlan_get_remote (NMSettingVxlan *setting); +NM_AVAILABLE_IN_1_2 +guint nm_setting_vxlan_get_source_port_min (NMSettingVxlan *setting); +NM_AVAILABLE_IN_1_2 +guint nm_setting_vxlan_get_source_port_max (NMSettingVxlan *setting); +NM_AVAILABLE_IN_1_2 +guint nm_setting_vxlan_get_destination_port (NMSettingVxlan *setting); +NM_AVAILABLE_IN_1_2 +guint nm_setting_vxlan_get_tos (NMSettingVxlan *setting); +NM_AVAILABLE_IN_1_2 +guint nm_setting_vxlan_get_ttl (NMSettingVxlan *setting); +NM_AVAILABLE_IN_1_2 +guint nm_setting_vxlan_get_ageing (NMSettingVxlan *setting); +NM_AVAILABLE_IN_1_2 +guint nm_setting_vxlan_get_limit (NMSettingVxlan *setting); +NM_AVAILABLE_IN_1_2 +gboolean nm_setting_vxlan_get_proxy (NMSettingVxlan *setting); +NM_AVAILABLE_IN_1_2 +gboolean nm_setting_vxlan_get_learning (NMSettingVxlan *setting); +NM_AVAILABLE_IN_1_2 +gboolean nm_setting_vxlan_get_rsc (NMSettingVxlan *setting); +NM_AVAILABLE_IN_1_2 +gboolean nm_setting_vxlan_get_l2_miss (NMSettingVxlan *setting); +NM_AVAILABLE_IN_1_2 +gboolean nm_setting_vxlan_get_l3_miss (NMSettingVxlan *setting); + +G_END_DECLS + +#endif /* __NM_SETTING_VXLAN_H__ */ diff --git a/libnm-core/nm-setting-wimax.c b/libnm-core/nm-setting-wimax.c index 541c0bbf..95a09952 100644 --- a/libnm-core/nm-setting-wimax.c +++ b/libnm-core/nm-setting-wimax.c @@ -24,7 +24,6 @@ #include #include -#include #include "nm-setting-wimax.h" #include "nm-setting-private.h" @@ -37,6 +36,10 @@ * * The #NMSettingWimax object is a #NMSetting subclass that describes properties * necessary for connection to 802.16e Mobile WiMAX networks. + * + * NetworkManager no longer supports WiMAX; while this API remains available for + * backward-compatibility reasons, it serves no real purpose, since WiMAX + * connections cannot be activated. **/ G_DEFINE_TYPE_WITH_CODE (NMSettingWimax, nm_setting_wimax, NM_TYPE_SETTING, @@ -64,6 +67,8 @@ enum { * Creates a new #NMSettingWimax object with default values. * * Returns: the new empty #NMSettingWimax object + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ NMSetting * nm_setting_wimax_new (void) @@ -79,6 +84,8 @@ nm_setting_wimax_new (void) * specific WiMAX network this setting describes a connection to. * * Returns: the WiMAX NSP name + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ const char * nm_setting_wimax_get_network_name (NMSettingWimax *setting) @@ -96,6 +103,8 @@ nm_setting_wimax_get_network_name (NMSettingWimax *setting) * to. * * Returns: the MAC address + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ const char * nm_setting_wimax_get_mac_address (NMSettingWimax *setting) @@ -217,6 +226,8 @@ nm_setting_wimax_class_init (NMSettingWimaxClass *setting_class) * * Network Service Provider (NSP) name of the WiMAX network this connection * should use. + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ g_object_class_install_property (object_class, PROP_NETWORK_NAME, @@ -231,6 +242,8 @@ nm_setting_wimax_class_init (NMSettingWimaxClass *setting_class) * If specified, this connection will only apply to the WiMAX device whose * MAC address matches. This property does not change the MAC address of the * device (known as MAC spoofing). + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ g_object_class_install_property (object_class, PROP_MAC_ADDRESS, diff --git a/libnm-core/nm-setting-wimax.h b/libnm-core/nm-setting-wimax.h index 0a585046..0a98fbb5 100644 --- a/libnm-core/nm-setting-wimax.h +++ b/libnm-core/nm-setting-wimax.h @@ -53,10 +53,14 @@ typedef struct { gpointer padding[4]; } NMSettingWimaxClass; +NM_DEPRECATED_IN_1_2 GType nm_setting_wimax_get_type (void); +NM_DEPRECATED_IN_1_2 NMSetting *nm_setting_wimax_new (void); +NM_DEPRECATED_IN_1_2 const char *nm_setting_wimax_get_network_name (NMSettingWimax *setting); +NM_DEPRECATED_IN_1_2 const char *nm_setting_wimax_get_mac_address (NMSettingWimax *setting); G_END_DECLS diff --git a/libnm-core/nm-setting-wired.c b/libnm-core/nm-setting-wired.c index c38b1874..64b66971 100644 --- a/libnm-core/nm-setting-wired.c +++ b/libnm-core/nm-setting-wired.c @@ -24,7 +24,6 @@ #include #include -#include #include "nm-setting-wired.h" #include "nm-utils.h" @@ -567,7 +566,7 @@ nm_setting_wired_get_valid_s390_options (NMSettingWired *setting) * * Returns: the Wake-on-LAN options * - * Since: 1.0.6 + * Since: 1.2 */ NMSettingWiredWakeOnLan nm_setting_wired_get_wake_on_lan (NMSettingWired *setting) @@ -576,6 +575,8 @@ nm_setting_wired_get_wake_on_lan (NMSettingWired *setting) return NM_SETTING_WIRED_GET_PRIVATE (setting)->wol; } +NM_BACKPORT_SYMBOL (libnm_1_0_6, NMSettingWiredWakeOnLan, nm_setting_wired_get_wake_on_lan, + (NMSettingWired *setting), (setting)); /** * nm_setting_wired_get_wake_on_lan_password: @@ -586,7 +587,7 @@ nm_setting_wired_get_wake_on_lan (NMSettingWired *setting) * * Returns: the Wake-on-LAN setting password, or %NULL if there is no password. * - * Since: 1.0.6 + * Since: 1.2 */ const char * nm_setting_wired_get_wake_on_lan_password (NMSettingWired *setting) @@ -595,6 +596,10 @@ nm_setting_wired_get_wake_on_lan_password (NMSettingWired *setting) return NM_SETTING_WIRED_GET_PRIVATE (setting)->wol_password; } +NM_BACKPORT_SYMBOL (libnm_1_0_6, const char *, nm_setting_wired_get_wake_on_lan_password, + (NMSettingWired *setting), (setting)); + +NM_BACKPORT_SYMBOL (libnm_1_0_6, GType, nm_setting_wired_wake_on_lan_get_type, (void), ()); static gboolean verify (NMSetting *setting, NMConnection *connection, GError **error) @@ -1195,7 +1200,7 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class) * %NM_SETTING_WIRED_WAKE_ON_LAN_IGNORE (to disable management of Wake-on-LAN in * NetworkManager). * - * Since: 1.0.6 + * Since: 1.2 **/ g_object_class_install_property (object_class, PROP_WAKE_ON_LAN, @@ -1212,7 +1217,7 @@ nm_setting_wired_class_init (NMSettingWiredClass *setting_class) * Wake-on-LAN, represented as an Ethernet MAC address. If %NULL, * no password will be required. * - * Since: 1.0.6 + * Since: 1.2 **/ g_object_class_install_property (object_class, PROP_WAKE_ON_LAN_PASSWORD, diff --git a/libnm-core/nm-setting-wired.h b/libnm-core/nm-setting-wired.h index e1fd6f67..7eb53d30 100644 --- a/libnm-core/nm-setting-wired.h +++ b/libnm-core/nm-setting-wired.h @@ -60,7 +60,7 @@ G_BEGIN_DECLS * Options for #NMSettingWired:wake-on-lan. Note that not all options * are supported by all devices. * - * Since: 1.0.6 + * Since: 1.2 */ typedef enum { /*< flags >*/ NM_SETTING_WIRED_WAKE_ON_LAN_NONE = 0, /*< skip >*/ @@ -145,9 +145,7 @@ gboolean nm_setting_wired_remove_s390_option (NMSettingWired *setting const char *key); const char ** nm_setting_wired_get_valid_s390_options (NMSettingWired *setting); -NM_AVAILABLE_IN_1_0_6 NMSettingWiredWakeOnLan nm_setting_wired_get_wake_on_lan (NMSettingWired *setting); -NM_AVAILABLE_IN_1_0_6 const char * nm_setting_wired_get_wake_on_lan_password (NMSettingWired *setting); G_END_DECLS diff --git a/libnm-core/nm-setting-wireless-security.c b/libnm-core/nm-setting-wireless-security.c index 6df5b461..7c5e3932 100644 --- a/libnm-core/nm-setting-wireless-security.c +++ b/libnm-core/nm-setting-wireless-security.c @@ -23,7 +23,6 @@ #include "config.h" #include -#include #include "nm-setting-wireless-security.h" #include "nm-setting-8021x.h" @@ -1017,6 +1016,63 @@ verify (NMSetting *setting, NMConnection *connection, GError **error) return TRUE; } +static gboolean +_verify_wep_key (const char *wep_key, + NMWepKeyType wep_key_type, + const char *property, + GError **error) +{ + if (wep_key && !nm_utils_wep_key_valid (wep_key, wep_key_type)) { + g_set_error_literal (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("property is invalid")); + g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, property); + return FALSE; + } + return TRUE; +} + +static gboolean +verify_secrets (NMSetting *setting, NMConnection *connection, GError **error) +{ + NMSettingWirelessSecurity *self = NM_SETTING_WIRELESS_SECURITY (setting); + NMSettingWirelessSecurityPrivate *priv = NM_SETTING_WIRELESS_SECURITY_GET_PRIVATE (self); + + /* LEAP */ + if ( priv->auth_alg + && !strcmp (priv->auth_alg, "leap") + && !strcmp (priv->key_mgmt, "ieee8021x")) { + if (!_nm_setting_verify_secret_string (priv->leap_password, + NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, + NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD, + error)) + return FALSE; + } + + /* WEP */ + if (!_verify_wep_key (priv->wep_key0, priv->wep_key_type, NM_SETTING_WIRELESS_SECURITY_WEP_KEY0, error)) + return FALSE; + if (!_verify_wep_key (priv->wep_key1, priv->wep_key_type, NM_SETTING_WIRELESS_SECURITY_WEP_KEY1, error)) + return FALSE; + if (!_verify_wep_key (priv->wep_key2, priv->wep_key_type, NM_SETTING_WIRELESS_SECURITY_WEP_KEY2, error)) + return FALSE; + if (!_verify_wep_key (priv->wep_key3, priv->wep_key_type, NM_SETTING_WIRELESS_SECURITY_WEP_KEY3, error)) + return FALSE; + + /* WPA-PSK */ + if (priv->psk && !nm_utils_wpa_psk_valid (priv->psk)) { + g_set_error_literal (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("property is invalid")); + g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_PSK); + return FALSE; + } + + return TRUE; +} + static gboolean get_secret_flags (NMSetting *setting, const char *secret_name, @@ -1267,6 +1323,7 @@ nm_setting_wireless_security_class_init (NMSettingWirelessSecurityClass *setting object_class->finalize = finalize; parent_class->verify = verify; + parent_class->verify_secrets = verify_secrets; parent_class->need_secrets = need_secrets; parent_class->get_secret_flags = get_secret_flags; parent_class->set_secret_flags = set_secret_flags; diff --git a/libnm-core/nm-setting-wireless.c b/libnm-core/nm-setting-wireless.c index 34c97fe8..2a148293 100644 --- a/libnm-core/nm-setting-wireless.c +++ b/libnm-core/nm-setting-wireless.c @@ -24,7 +24,6 @@ #include #include -#include #include "nm-setting-wireless.h" #include "nm-utils.h" @@ -59,6 +58,8 @@ typedef struct { guint32 mtu; GSList *seen_bssids; gboolean hidden; + guint32 powersave; + NMSettingMacRandomization mac_address_randomization; } NMSettingWirelessPrivate; enum { @@ -76,6 +77,8 @@ enum { PROP_MTU, PROP_SEEN_BSSIDS, PROP_HIDDEN, + PROP_POWERSAVE, + PROP_MAC_ADDRESS_RANDOMIZATION, LAST_PROP }; @@ -600,6 +603,39 @@ nm_setting_wireless_get_hidden (NMSettingWireless *setting) return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->hidden; } +/** + * nm_setting_wireless_get_powersave: + * @setting: the #NMSettingWireless + * + * Returns: the #NMSettingWireless:powersave property of the setting + * + * Since: 1.2 + **/ +guint32 +nm_setting_wireless_get_powersave (NMSettingWireless *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), 0); + + return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->powersave; +} + +/** + * nm_setting_wireless_get_mac_address_randomization: + * @setting: the #NMSettingWireless + * + * Returns: the #NMSettingWireless:mac-address-randomization property of the + * setting + * + * Since: 1.2 + **/ +NMSettingMacRandomization +nm_setting_wireless_get_mac_address_randomization (NMSettingWireless *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), 0); + + return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->mac_address_randomization; +} + /** * nm_setting_wireless_add_seen_bssid: * @setting: the #NMSettingWireless @@ -915,6 +951,12 @@ set_property (GObject *object, guint prop_id, case PROP_HIDDEN: priv->hidden = g_value_get_boolean (value); break; + case PROP_POWERSAVE: + priv->powersave = g_value_get_uint (value); + break; + case PROP_MAC_ADDRESS_RANDOMIZATION: + priv->mac_address_randomization = g_value_get_uint (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -968,6 +1010,12 @@ get_property (GObject *object, guint prop_id, case PROP_HIDDEN: g_value_set_boolean (value, nm_setting_wireless_get_hidden (setting)); break; + case PROP_POWERSAVE: + g_value_set_uint (value, nm_setting_wireless_get_powersave (setting)); + break; + case PROP_MAC_ADDRESS_RANDOMIZATION: + g_value_set_uint (value, nm_setting_wireless_get_mac_address_randomization (setting)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -1314,6 +1362,58 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class) G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + /** + * NMSettingWireless:powersave: + * + * If set to %FALSE, Wi-Fi power saving behavior is disabled. If set to + * %TRUE, Wi-Fi power saving behavior is enabled. All other values are + * reserved. Note that even though only boolean values are allowed, the + * property type is an unsigned integer to allow for future expansion. + * + * Since: 1.2 + **/ + /* ---ifcfg-rh--- + * property: powersave + * variable: POWERSAVE(+) + * default: no + * description: Enables or disables Wi-Fi power saving. + * example: POWERSAVE=yes + * ---end--- + */ + g_object_class_install_property + (object_class, PROP_POWERSAVE, + g_param_spec_uint (NM_SETTING_WIRELESS_POWERSAVE, "", "", + 0, G_MAXUINT32, 0, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingWireless:mac-address-randomization: + * + * One of %NM_SETTING_MAC_RANDOMIZATION_DEFAULT (never randomize unless + * the user has set a global default to randomize and the supplicant + * supports randomization), %NM_SETTING_MAC_RANDOMIZATION_NEVER (never + * randomize the MAC address), or %NM_SETTING_MAC_RANDOMIZATION_ALWAYS + * (always randomize the MAC address). + * + * Since: 1.2 + **/ + /* ---ifcfg-rh--- + * property: mac-address-randomization + * variable: MAC_ADDRESS_RANDOMIZATION(+) + * values: 0 (default), (1) never, (2) always + * default: 1 + * description: Enables or disables Wi-Fi MAC address randomization. + * example: MAC_ADDRESS_RANDOMIZATION=2 + * ---end--- + */ + g_object_class_install_property + (object_class, PROP_MAC_ADDRESS_RANDOMIZATION, + g_param_spec_uint (NM_SETTING_WIRELESS_MAC_ADDRESS_RANDOMIZATION, "", "", + 0, G_MAXUINT32, NM_SETTING_MAC_RANDOMIZATION_DEFAULT, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + /* Compatibility for deprecated property */ /* ---ifcfg-rh--- * property: security diff --git a/libnm-core/nm-setting-wireless.h b/libnm-core/nm-setting-wireless.h index ef27ded2..a4c0147f 100644 --- a/libnm-core/nm-setting-wireless.h +++ b/libnm-core/nm-setting-wireless.h @@ -54,6 +54,8 @@ G_BEGIN_DECLS #define NM_SETTING_WIRELESS_MTU "mtu" #define NM_SETTING_WIRELESS_SEEN_BSSIDS "seen-bssids" #define NM_SETTING_WIRELESS_HIDDEN "hidden" +#define NM_SETTING_WIRELESS_POWERSAVE "powersave" +#define NM_SETTING_WIRELESS_MAC_ADDRESS_RANDOMIZATION "mac-address-randomization" /** * NM_SETTING_WIRELESS_MODE_ADHOC: @@ -117,6 +119,11 @@ void nm_setting_wireless_clear_mac_blacklist_items (NMSettingWire guint32 nm_setting_wireless_get_mtu (NMSettingWireless *setting); gboolean nm_setting_wireless_get_hidden (NMSettingWireless *setting); +NM_AVAILABLE_IN_1_2 +guint32 nm_setting_wireless_get_powersave (NMSettingWireless *setting); + +NM_AVAILABLE_IN_1_2 +NMSettingMacRandomization nm_setting_wireless_get_mac_address_randomization (NMSettingWireless *setting); gboolean nm_setting_wireless_add_seen_bssid (NMSettingWireless *setting, const char *bssid); diff --git a/libnm-core/nm-setting.c b/libnm-core/nm-setting.c index e1e81b5d..b08eea10 100644 --- a/libnm-core/nm-setting.c +++ b/libnm-core/nm-setting.c @@ -23,15 +23,15 @@ #include "config.h" #include -#include -#include +#include "nm-default.h" #include "nm-setting.h" #include "nm-setting-private.h" #include "nm-utils.h" #include "nm-core-internal.h" #include "nm-utils-private.h" #include "nm-property-compare.h" +#include "nm-macros-internal.h" #include "nm-setting-connection.h" #include "nm-setting-bond.h" @@ -95,9 +95,7 @@ static void _ensure_registered (void) { if (G_UNLIKELY (registered_settings == NULL)) { -#if !GLIB_CHECK_VERSION (2, 35, 0) - g_type_init (); -#endif + nm_g_type_init (); registered_settings = g_hash_table_new (g_str_hash, g_str_equal); registered_settings_by_type = g_hash_table_new (_nm_gtype_hash, _nm_gtype_equal); } @@ -1012,6 +1010,53 @@ _nm_setting_verify (NMSetting *setting, NMConnection *connection, GError **error return NM_SETTING_VERIFY_SUCCESS; } +/** + * nm_setting_verify_secrets: + * @setting: the #NMSetting to verify secrets in + * @connection: (allow-none): the #NMConnection that @setting came from, or + * %NULL if @setting is being verified in isolation. + * @error: location to store error, or %NULL + * + * Verifies the secrets in the setting. + * The returned #GError contains information about which secret of the setting + * failed validation, and in what way that secret failed validation. + * The secret validation is done separately from main setting validation, because + * in some cases connection failure is not desired just for the secrets. + * + * Returns: %TRUE if the setting secrets are valid, %FALSE if they are not + * + * Since: 1.2 + **/ +gboolean +nm_setting_verify_secrets (NMSetting *setting, NMConnection *connection, GError **error) +{ + g_return_val_if_fail (NM_IS_SETTING (setting), NM_SETTING_VERIFY_ERROR); + g_return_val_if_fail (!connection || NM_IS_CONNECTION (connection), NM_SETTING_VERIFY_ERROR); + g_return_val_if_fail (!error || *error == NULL, NM_SETTING_VERIFY_ERROR); + + if (NM_SETTING_GET_CLASS (setting)->verify_secrets) + return NM_SETTING_GET_CLASS (setting)->verify_secrets (setting, connection, error); + + return NM_SETTING_VERIFY_SUCCESS; +} + +gboolean +_nm_setting_verify_secret_string (const char *str, + const char *setting_name, + const char *property, + GError **error) +{ + if (str && !*str) { + g_set_error_literal (error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("property is empty")); + g_prefix_error (error, "%s.%s: ", setting_name, property); + return FALSE; + } + return TRUE; +} + static gboolean compare_property (NMSetting *setting, NMSetting *other, @@ -1101,15 +1146,20 @@ nm_setting_compare (NMSetting *a, GParamSpec *prop_spec = property_specs[i]; /* Fuzzy compare ignores secrets and properties defined with the FUZZY_IGNORE flag */ - if ( (flags & NM_SETTING_COMPARE_FLAG_FUZZY) - && (prop_spec->flags & (NM_SETTING_PARAM_FUZZY_IGNORE | NM_SETTING_PARAM_SECRET))) + if ( NM_FLAGS_HAS (flags, NM_SETTING_COMPARE_FLAG_FUZZY) + && !NM_FLAGS_ANY (prop_spec->flags, NM_SETTING_PARAM_FUZZY_IGNORE | NM_SETTING_PARAM_SECRET)) continue; - if ((flags & NM_SETTING_COMPARE_FLAG_INFERRABLE) && !(prop_spec->flags & NM_SETTING_PARAM_INFERRABLE)) + if ( NM_FLAGS_HAS (flags, NM_SETTING_COMPARE_FLAG_INFERRABLE) + && !NM_FLAGS_HAS (prop_spec->flags, NM_SETTING_PARAM_INFERRABLE)) continue; - if ( (flags & NM_SETTING_COMPARE_FLAG_IGNORE_SECRETS) - && (prop_spec->flags & NM_SETTING_PARAM_SECRET)) + if ( NM_FLAGS_HAS (flags, NM_SETTING_COMPARE_FLAG_IGNORE_REAPPLY_IMMEDIATELY) + && NM_FLAGS_HAS (prop_spec->flags, NM_SETTING_PARAM_REAPPLY_IMMEDIATELY)) + continue; + + if ( NM_FLAGS_HAS (flags, NM_SETTING_COMPARE_FLAG_IGNORE_SECRETS) + && NM_FLAGS_HAS (prop_spec->flags, NM_SETTING_PARAM_SECRET)) continue; same = NM_SETTING_GET_CLASS (a)->compare_property (a, b, prop_spec, flags); @@ -1133,6 +1183,9 @@ should_compare_prop (NMSetting *setting, if ((comp_flags & NM_SETTING_COMPARE_FLAG_INFERRABLE) && !(prop_flags & NM_SETTING_PARAM_INFERRABLE)) return FALSE; + if ((comp_flags & NM_SETTING_COMPARE_FLAG_IGNORE_REAPPLY_IMMEDIATELY) && !(prop_flags & NM_SETTING_PARAM_REAPPLY_IMMEDIATELY)) + return FALSE; + if (prop_flags & NM_SETTING_PARAM_SECRET) { NMSettingSecretFlags secret_flags = NM_SETTING_SECRET_FLAG_NONE; diff --git a/libnm-core/nm-setting.h b/libnm-core/nm-setting.h index 3601fce3..3083ef60 100644 --- a/libnm-core/nm-setting.h +++ b/libnm-core/nm-setting.h @@ -127,10 +127,26 @@ typedef enum { NM_SETTING_COMPARE_FLAG_DIFF_RESULT_NO_DEFAULT = 0x00000040, NM_SETTING_COMPARE_FLAG_IGNORE_TIMESTAMP = 0x00000080, - /* 0x80000000 is used for a private flag */ + /* Higher flags like 0x80000000 and 0x40000000 are used internally as private flags */ } NMSettingCompareFlags; +/** + * NMSettingMacRandomization: + * @NM_SETTING_MAC_RANDOMIZATION_DEFAULT: the default value, which unless + * overridden by user-controlled defaults configuration, is "never". + * @NM_SETTING_MAC_RANDOMIZATION_NEVER: the device's MAC address is always used. + * @NM_SETTING_MAC_RANDOMIZATION_ALWAYS: a random MAC address is used. + * + * Controls if and how the MAC address of a device is randomzied. + **/ +typedef enum { + NM_SETTING_MAC_RANDOMIZATION_DEFAULT = 0, + NM_SETTING_MAC_RANDOMIZATION_NEVER, + NM_SETTING_MAC_RANDOMIZATION_ALWAYS, +} NMSettingMacRandomization; + + /** * NMSetting: * @@ -164,6 +180,10 @@ typedef struct { NMConnection *connection, GError **error); + gboolean (*verify_secrets) (NMSetting *setting, + NMConnection *connection, + GError **error); + GPtrArray *(*need_secrets) (NMSetting *setting); int (*update_one_secret) (NMSetting *setting, @@ -195,7 +215,7 @@ typedef struct { NMSettingCompareFlags flags); /*< private >*/ - gpointer padding[8]; + gpointer padding[7]; } NMSettingClass; /** @@ -226,6 +246,11 @@ gboolean nm_setting_verify (NMSetting *setting, NMConnection *connection, GError **error); +NM_AVAILABLE_IN_1_2 +gboolean nm_setting_verify_secrets (NMSetting *setting, + NMConnection *connection, + GError **error); + gboolean nm_setting_compare (NMSetting *a, NMSetting *b, NMSettingCompareFlags flags); diff --git a/libnm-core/nm-utils-private.h b/libnm-core/nm-utils-private.h index ffdc6315..68aaaa1c 100644 --- a/libnm-core/nm-utils-private.h +++ b/libnm-core/nm-utils-private.h @@ -21,7 +21,12 @@ #ifndef __NM_UTILS_PRIVATE_H__ #define __NM_UTILS_PRIVATE_H__ +#ifdef __NETWORKMANAGER_TYPES_H__ +#error "nm-utils-private.h" must not be used outside of libnm-core/. Do you want "nm-core-internal.h"? +#endif + #include "nm-setting-private.h" +#include "nm-setting-ip-config.h" gboolean _nm_utils_string_slist_validate (GSList *list, const char **valid_values); diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c index 987cf731..930f528e 100644 --- a/libnm-core/nm-utils.c +++ b/libnm-core/nm-utils.c @@ -29,14 +29,13 @@ #include #include #include -#include +#include +#include "nm-default.h" #include "nm-utils.h" #include "nm-utils-private.h" -#include "nm-glib-compat.h" #include "nm-setting-private.h" #include "crypto.h" -#include "gsystem-local-alloc.h" #include "nm-macros-internal.h" #include "nm-setting-bond.h" @@ -240,7 +239,7 @@ _nm_utils_init (void) bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); - g_type_init (); + nm_g_type_init (); _nm_dbus_errors_init (); } @@ -844,6 +843,30 @@ _nm_utils_ptrarray_to_strv (GPtrArray *ptrarray) return strv; } +/** + * _nm_utils_strv_equal: + * @strv1: a string array + * @strv2: a string array + * + * Compare NULL-terminated string arrays for equality. + * + * Returns: %TRUE if the arrays are equal, %FALSE otherwise. + **/ +gboolean +_nm_utils_strv_equal (char **strv1, char **strv2) +{ + if (strv1 == strv2) + return TRUE; + + if (!strv1 || !strv2) + return FALSE; + + for ( ; *strv1 && *strv2 && !strcmp (*strv1, *strv2); strv1++, strv2++) + ; + + return !*strv1 && !*strv2; +} + /** * _nm_utils_strsplit_set: * @str: string to split @@ -1730,7 +1753,7 @@ nm_utils_ip6_addresses_from_variant (GVariant *value, char **out_gateway) *out_gateway = g_strdup (nm_utils_inet6_ntop (gateway_bytes, NULL)); } } else { - g_warning ("Ignoring invalid IP4 address: %s", error->message); + g_warning ("Ignoring invalid IP6 address: %s", error->message); g_clear_error (&error); } @@ -2409,6 +2432,132 @@ nm_utils_file_is_pkcs12 (const char *filename) /**********************************************************************************************/ +gboolean +_nm_utils_check_file (const char *filename, + gint64 check_owner, + NMUtilsCheckFilePredicate check_file, + gpointer user_data, + struct stat *out_st, + GError **error) +{ + struct stat st_backup; + + if (!out_st) + out_st = &st_backup; + + if (stat (filename, out_st) != 0) { + int errsv = errno; + + g_set_error (error, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_FAILED, + _("failed stat file %s: %s"), filename, strerror (errsv)); + return FALSE; + } + + /* ignore non-files. */ + if (!S_ISREG (out_st->st_mode)) { + g_set_error (error, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_FAILED, + _("not a file (%s)"), filename); + return FALSE; + } + + /* with check_owner enabled, check that the file belongs to the + * owner or root. */ + if ( check_owner >= 0 + && (out_st->st_uid != 0 && (gint64) out_st->st_uid != check_owner)) { + g_set_error (error, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_FAILED, + _("invalid file owner %d for %s"), out_st->st_uid, filename); + return FALSE; + } + + /* with check_owner enabled, check that the file cannot be modified + * by other users (except root). */ + if ( check_owner >= 0 + && NM_FLAGS_ANY (out_st->st_mode, S_IWGRP | S_IWOTH | S_ISUID)) { + g_set_error (error, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_FAILED, + _("file permissions for %s"), filename); + return FALSE; + } + + if ( check_file + && !check_file (filename, out_st, user_data, error)) { + if (error && !*error) { + g_set_error (error, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_FAILED, + _("reject %s"), filename); + } + return FALSE; + } + + return TRUE; +} + + +gboolean +_nm_utils_check_module_file (const char *name, + int check_owner, + NMUtilsCheckFilePredicate check_file, + gpointer user_data, + GError **error) +{ + if (!g_path_is_absolute (name)) { + g_set_error (error, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_FAILED, + _("path is not absolute (%s)"), name); + return FALSE; + } + + /* Set special error code if the file doesn't exist. + * The VPN package might be split into separate packages, + * so it could be correct that the plugin file is missing. + * + * Note that nm-applet checks for this error code to fail + * gracefully. */ + if (!g_file_test (name, G_FILE_TEST_EXISTS)) { + g_set_error (error, + G_FILE_ERROR, + G_FILE_ERROR_NOENT, + _("Plugin file does not exist (%s)"), name); + return FALSE; + } + + if (!g_file_test (name, G_FILE_TEST_IS_REGULAR)) { + g_set_error (error, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_FAILED, + _("Plugin is not a valid file (%s)"), name); + return FALSE; + } + + if (g_str_has_suffix (name, ".la")) { + /* g_module_open() treats files that end with .la special. + * We don't want to parse the libtool archive. Just error out. */ + g_set_error (error, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_FAILED, + _("libtool archives are not supported (%s)"), name); + return FALSE; + } + + return _nm_utils_check_file (name, + check_owner, + check_file, + user_data, + NULL, + error); +} + +/**********************************************************************************************/ + /** * nm_utils_file_search_in_paths: * @progname: the helper program name, like "iptables" @@ -2724,13 +2873,14 @@ _wifi_freqs (gboolean bg_band) * * Returns: zero-terminated array of frequencies numbers (in MHz) * - * Since: 1.0.6 + * Since: 1.2 **/ const guint * nm_utils_wifi_2ghz_freqs (void) { return _wifi_freqs (TRUE); } +NM_BACKPORT_SYMBOL (libnm_1_0_6, const guint *, nm_utils_wifi_2ghz_freqs, (void), ()); /** * nm_utils_wifi_5ghz_freqs: @@ -2739,13 +2889,14 @@ nm_utils_wifi_2ghz_freqs (void) * * Returns: zero-terminated array of frequencies numbers (in MHz) * - * Since: 1.0.6 + * Since: 1.2 **/ const guint * nm_utils_wifi_5ghz_freqs (void) { return _wifi_freqs (FALSE); } +NM_BACKPORT_SYMBOL (libnm_1_0_6, const guint *, nm_utils_wifi_5ghz_freqs, (void), ()); /** * nm_utils_wifi_strength_bars: @@ -3501,8 +3652,9 @@ static BondMode bond_mode_table[] = { * available modes. * * Returns: bonding mode string, or NULL on error -*/ - + * + * Since: 1.2 + */ const char * nm_utils_bond_mode_int_to_string (int mode) { @@ -3521,7 +3673,9 @@ nm_utils_bond_mode_int_to_string (int mode) * The @mode string can be either a descriptive name or a number (as string). * * Returns: numeric bond mode, or -1 on error -*/ + * + * Since: 1.2 + */ int nm_utils_bond_mode_string_to_int (const char *mode) { @@ -3540,6 +3694,105 @@ nm_utils_bond_mode_string_to_int (const char *mode) /**********************************************************************************************/ +#define STRSTRDICTKEY_V1_SET 0x01 +#define STRSTRDICTKEY_V2_SET 0x02 +#define STRSTRDICTKEY_ALL_SET 0x03 + +struct _NMUtilsStrStrDictKey { + char type; + char data[1]; +}; + +guint +_nm_utils_strstrdictkey_hash (gconstpointer a) +{ + const NMUtilsStrStrDictKey *k = a; + const signed char *p; + guint32 h = 5381; + + if (k) { + if (((int) k->type) & ~STRSTRDICTKEY_ALL_SET) + g_return_val_if_reached (0); + + h = (h << 5) + h + k->type; + if (k->type & STRSTRDICTKEY_ALL_SET) { + p = (void *) k->data; + for (; *p != '\0'; p++) + h = (h << 5) + h + *p; + if (k->type == STRSTRDICTKEY_ALL_SET) { + /* the key contains two strings. Continue... */ + h = (h << 5) + h + '\0'; + for (p++; *p != '\0'; p++) + h = (h << 5) + h + *p; + } + } + } + + return h; +} + +gboolean +_nm_utils_strstrdictkey_equal (gconstpointer a, gconstpointer b) +{ + const NMUtilsStrStrDictKey *k1 = a; + const NMUtilsStrStrDictKey *k2 = b; + + if (k1 == k2) + return TRUE; + if (!k1 || !k2) + return FALSE; + + if (k1->type != k2->type) + return FALSE; + + if (k1->type & STRSTRDICTKEY_ALL_SET) { + if (strcmp (k1->data, k2->data) != 0) + return FALSE; + + if (k1->type == STRSTRDICTKEY_ALL_SET) { + gsize l = strlen (k1->data) + 1; + + return strcmp (&k1->data[l], &k2->data[l]) == 0; + } + } + + return TRUE; +} + +NMUtilsStrStrDictKey * +_nm_utils_strstrdictkey_create (const char *v1, const char *v2) +{ + char type = 0; + gsize l1 = 0, l2 = 0; + NMUtilsStrStrDictKey *k; + + if (!v1 && !v2) + return g_malloc0 (1); + + /* we need to distinguish between ("",NULL) and (NULL,""). + * Thus, in @type we encode which strings we have present + * as not-NULL. */ + if (v1) { + type |= STRSTRDICTKEY_V1_SET; + l1 = strlen (v1) + 1; + } + if (v2) { + type |= STRSTRDICTKEY_V2_SET; + l2 = strlen (v2) + 1; + } + + k = g_malloc (G_STRUCT_OFFSET (NMUtilsStrStrDictKey, data) + l1 + l2); + k->type = type; + if (v1) + memcpy (&k->data[0], v1, l1); + if (v2) + memcpy (&k->data[l1], v2, l2); + + return k; +} + +/**********************************************************************************************/ + /* _nm_utils_ascii_str_to_int64: * * A wrapper for g_ascii_strtoll, that checks whether the whole string @@ -3613,30 +3866,131 @@ _nm_utils_ascii_str_to_int64 (const char *str, guint base, gint64 min, gint64 ma return v; } +static gboolean +validate_dns_option (const char *name, gboolean numeric, gboolean ipv6, + const NMUtilsDNSOptionDesc *option_descs) +{ + const NMUtilsDNSOptionDesc *desc; + + if (!option_descs) + return !!*name; + + for (desc = option_descs; desc->name; desc++) { + if (!strcmp (name, desc->name) && + numeric == desc->numeric && + (!desc->ipv6_only || ipv6)) + return TRUE; + } + + return FALSE; +} + /** - * _nm_dbus_error_has_name: - * @error: (allow-none): a #GError, or %NULL - * @dbus_error_name: a D-Bus error name + * _nm_utils_dns_option_validate: + * @option: option string + * @out_name: (out) (allow-none): the option name + * @out_value: (out) (allow-none): the option value + * @ipv6: whether the option refers to a IPv6 configuration + * @option_descs: (allow-none): an array of NMUtilsDNSOptionDesc which describes the + * valid options + * + * Parses a DNS option in the form "name" or "name:number" and, if + * @option_descs is not NULL, checks that the option conforms to one + * of the provided descriptors. If @option_descs is NULL @ipv6 is + * not considered. + * + * Returns: %TRUE when the parsing was successful and the option is valid, + * %FALSE otherwise + */ +gboolean +_nm_utils_dns_option_validate (const char *option, char **out_name, + long *out_value, gboolean ipv6, + const NMUtilsDNSOptionDesc *option_descs) +{ + char **tokens, *ptr; + gboolean ret = FALSE; + + g_return_val_if_fail (option != NULL, FALSE); + + if (out_name) + *out_name = NULL; + if (out_value) + *out_value = -1; + + if (!option[0]) + return FALSE; + + tokens = g_strsplit (option, ":", 2); + + if (g_strv_length (tokens) == 1) { + ret = validate_dns_option (tokens[0], FALSE, ipv6, option_descs); + if (ret && out_name) + *out_name = g_strdup (tokens[0]); + goto out; + } + + if (!tokens[1][0]) { + ret = FALSE; + goto out; + } + + for (ptr = tokens[1]; *ptr; ptr++) { + if (!g_ascii_isdigit (*ptr)) { + ret = FALSE; + goto out; + } + } + + ret = FALSE; + if (validate_dns_option (tokens[0], TRUE, ipv6, option_descs)) { + int value = _nm_utils_ascii_str_to_int64 (tokens[1], 10, 0, G_MAXINT32, -1); + if (value >= 0) { + if (out_name) + *out_name = g_strdup (tokens[0]); + if (out_value) + *out_value = value; + ret = TRUE; + } + } +out: + g_strfreev (tokens); + return ret; +} + +/** + * _nm_utils_dns_option_find_idx: + * @array: an array of strings + * @option: a dns option string * - * Checks if @error is set and corresponds to the D-Bus error @dbus_error_name. + * Searches for an option in an array of strings. The match is + * performed only the option name; the option value is ignored. * - * Returns: %TRUE or %FALSE + * Returns: the index of the option in the array or -1 if was not + * found. */ -gboolean -_nm_dbus_error_has_name (GError *error, - const char *dbus_error_name) +int _nm_utils_dns_option_find_idx (GPtrArray *array, const char *option) { - gboolean has_name = FALSE; + gboolean ret; + char *option_name, *tmp_name; + int i; + + if (!_nm_utils_dns_option_validate (option, &option_name, NULL, FALSE, NULL)) + return -1; - if (error && g_dbus_error_is_remote_error (error)) { - char *error_name; + for (i = 0; i < array->len; i++) { + if (_nm_utils_dns_option_validate (array->pdata[i], &tmp_name, NULL, FALSE, NULL)) { + ret = strcmp (tmp_name, option_name); + g_free (tmp_name); + if (!ret) { + g_free (option_name); + return i; + } + } - error_name = g_dbus_error_get_remote_error (error); - has_name = !g_strcmp0 (error_name, dbus_error_name); - g_free (error_name); } - return has_name; + g_free (option_name); + return -1; } /** @@ -3651,7 +4005,7 @@ _nm_dbus_error_has_name (GError *error, * * Returns: a newly allocated string or %NULL * - * Since: 1.0.6 + * Since: 1.2 */ char *nm_utils_enum_to_str (GType type, int value) { @@ -3689,13 +4043,15 @@ char *nm_utils_enum_to_str (GType type, int value) g_type_class_unref (class); return ret; } +NM_BACKPORT_SYMBOL (libnm_1_0_6, char *, nm_utils_enum_to_str, + (GType type, int value), (type, value)); /** * nm_utils_enum_from_str: * @type: the %GType of the enum * @str: the input string - * @out_value: (out) (allow-none) the output value - * @err_token: (out) (allow-none) location to store the first unrecognized token + * @out_value: (out) (allow-none): the output value + * @err_token: (out) (allow-none): location to store the first unrecognized token * * Converts a string to the matching enum value. * @@ -3706,7 +4062,7 @@ char *nm_utils_enum_to_str (GType type, int value) * * Returns: %TRUE if the conversion was successful, %FALSE otherwise * - * Since: 1.0.6 + * Since: 1.2 */ gboolean nm_utils_enum_from_str (GType type, const char *str, int *out_value, char **err_token) @@ -3760,3 +4116,59 @@ gboolean nm_utils_enum_from_str (GType type, const char *str, g_type_class_unref (class); return ret; } +NM_BACKPORT_SYMBOL (libnm_1_0_6, gboolean, nm_utils_enum_from_str, + (GType type, const char *str, int *out_value, char **err_token), + (type, str, out_value, err_token)); + +/** + * nm_utils_enum_get_values: + * @type: the %GType of the enum + * @from: the first element to be returned + * @to: the last element to be returned + * + * Returns the list of possible values for a given enum. + * + * Returns: (transfer full): a NULL-terminated dynamically-allocated array of static strings + * or %NULL on error + * + * Since: 1.2 + */ +const char **nm_utils_enum_get_values (GType type, gint from, gint to) +{ + GTypeClass *class; + GPtrArray *array; + gint i; + + class = g_type_class_ref (type); + array = g_ptr_array_new (); + + if (G_IS_ENUM_CLASS (class)) { + GEnumClass *enum_class = G_ENUM_CLASS (class); + GEnumValue *enum_value; + + for (i = 0; i < enum_class->n_values; i++) { + enum_value = &enum_class->values[i]; + if (enum_value->value >= from && enum_value->value <= to) + g_ptr_array_add (array, (gpointer) enum_value->value_nick); + } + } else if (G_IS_FLAGS_CLASS (class)) { + GFlagsClass *flags_class = G_FLAGS_CLASS (class); + GFlagsValue *flags_value; + + for (i = 0; i < flags_class->n_values; i++) { + flags_value = &flags_class->values[i]; + if (flags_value->value >= from && flags_value->value <= to) + g_ptr_array_add (array, (gpointer) flags_value->value_nick); + } + } else { + g_type_class_unref (class); + g_ptr_array_free (array, TRUE); + g_return_val_if_reached (NULL); + } + + g_type_class_unref (class); + g_ptr_array_add (array, NULL); + + return (const char **) g_ptr_array_free (array, FALSE); +} + diff --git a/libnm-core/nm-utils.h b/libnm-core/nm-utils.h index e97b823e..407c14e2 100644 --- a/libnm-core/nm-utils.h +++ b/libnm-core/nm-utils.h @@ -15,7 +15,7 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright 2005 - 2013 Red Hat, Inc. + * Copyright 2005 - 2014 Red Hat, Inc. */ #ifndef __NM_UTILS_H__ @@ -127,6 +127,10 @@ gboolean nm_utils_file_is_pkcs12 (const char *filename); typedef gboolean (*NMUtilsFileSearchInPathsPredicate) (const char *filename, gpointer user_data); +struct stat; + +typedef gboolean (*NMUtilsCheckFilePredicate) (const char *filename, const struct stat *stat, gpointer user_data, GError **error); + const char *nm_utils_file_search_in_paths (const char *progname, const char *try_first, const char *const *paths, @@ -139,9 +143,9 @@ guint32 nm_utils_wifi_freq_to_channel (guint32 freq); guint32 nm_utils_wifi_channel_to_freq (guint32 channel, const char *band); guint32 nm_utils_wifi_find_next_channel (guint32 channel, int direction, char *band); gboolean nm_utils_wifi_is_channel_valid (guint32 channel, const char *band); -NM_AVAILABLE_IN_1_0_6 +NM_AVAILABLE_IN_1_2 const guint *nm_utils_wifi_2ghz_freqs (void); -NM_AVAILABLE_IN_1_0_6 +NM_AVAILABLE_IN_1_2 const guint *nm_utils_wifi_5ghz_freqs (void); const char *nm_utils_wifi_strength_bars (guint8 strength); @@ -188,12 +192,20 @@ gboolean nm_utils_ipaddr_valid (int family, const char *ip); gboolean nm_utils_check_virtual_device_compatibility (GType virtual_type, GType other_type); -NM_AVAILABLE_IN_1_0_6 +NM_AVAILABLE_IN_1_2 +int nm_utils_bond_mode_string_to_int (const char *mode); +NM_AVAILABLE_IN_1_2 +const char *nm_utils_bond_mode_int_to_string (int mode); + +NM_AVAILABLE_IN_1_2 char *nm_utils_enum_to_str (GType type, int value); -NM_AVAILABLE_IN_1_0_6 +NM_AVAILABLE_IN_1_2 gboolean nm_utils_enum_from_str (GType type, const char *str, int *out_value, char **err_token); +NM_AVAILABLE_IN_1_2 +const char **nm_utils_enum_get_values (GType type, gint from, gint to); + G_END_DECLS #endif /* __NM_UTILS_H__ */ diff --git a/libnm-core/nm-version.h b/libnm-core/nm-version.h index 730330ab..859a3a8c 100644 --- a/libnm-core/nm-version.h +++ b/libnm-core/nm-version.h @@ -76,16 +76,18 @@ # define NM_AVAILABLE_IN_1_0 #endif -#if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_0_4 -# define NM_AVAILABLE_IN_1_0_4 G_UNAVAILABLE(1,0.4) +#if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_2 +# define NM_DEPRECATED_IN_1_2 G_DEPRECATED +# define NM_DEPRECATED_IN_1_2_FOR(f) G_DEPRECATED_FOR(f) #else -# define NM_AVAILABLE_IN_1_0_4 +# define NM_DEPRECATED_IN_1_2 +# define NM_DEPRECATED_IN_1_2_FOR(f) #endif -#if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_0_6 -# define NM_AVAILABLE_IN_1_0_6 G_UNAVAILABLE(1,0.6) +#if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_2 +# define NM_AVAILABLE_IN_1_2 G_UNAVAILABLE(1,2) #else -# define NM_AVAILABLE_IN_1_0_6 +# define NM_AVAILABLE_IN_1_2 #endif #endif /* NM_VERSION_H */ diff --git a/libnm-core/nm-vpn-editor-plugin.c b/libnm-core/nm-vpn-editor-plugin.c new file mode 100644 index 00000000..2d4fdf9c --- /dev/null +++ b/libnm-core/nm-vpn-editor-plugin.c @@ -0,0 +1,287 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2008 Novell, Inc. + * Copyright 2008 - 2010 Red Hat, Inc. + * Copyright 2015 Red Hat, Inc. + */ + +#include "config.h" + +#include "nm-vpn-editor-plugin.h" + +#include + +#include "nm-macros-internal.h" +#include "gsystem-local-alloc.h" +#include "nm-core-internal.h" + +static void nm_vpn_editor_plugin_default_init (NMVpnEditorPluginInterface *iface); + +G_DEFINE_INTERFACE (NMVpnEditorPlugin, nm_vpn_editor_plugin, G_TYPE_OBJECT) + +static void +nm_vpn_editor_plugin_default_init (NMVpnEditorPluginInterface *iface) +{ + /* Properties */ + + /** + * NMVpnEditorPlugin:name: + * + * Short display name of the VPN plugin. + */ + g_object_interface_install_property (iface, + g_param_spec_string (NM_VPN_EDITOR_PLUGIN_NAME, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMVpnEditorPlugin:description: + * + * Longer description of the VPN plugin. + */ + g_object_interface_install_property (iface, + g_param_spec_string (NM_VPN_EDITOR_PLUGIN_DESCRIPTION, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMVpnEditorPlugin:service: + * + * D-Bus service name of the plugin's VPN service. + */ + g_object_interface_install_property (iface, + g_param_spec_string (NM_VPN_EDITOR_PLUGIN_SERVICE, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); +} + +/*********************************************************************/ + +/** + * nm_vpn_editor_plugin_load_from_file: + * @plugin_filename: The path to the share library to load. + * Apply some common heuristics to find the library, such as + * appending "so" file ending. + * If the path is not an absolute path or no matching module + * can be found, lookup inside a directory defined at compile time. + * Due to this, @check_file might be called for two different paths. + * @check_service: if not-null, check that the loaded plugin advertises + * the given service. + * @check_owner: if non-negative, check whether the file is owned + * by UID @check_owner or by root. In this case also check that + * the file is not writable by anybody else. + * @check_file: (scope call): optional callback to validate the file prior to + * loading the shared library. + * @user_data: user data for @check_file + * @error: on failure the error reason. + * + * Load the shared libary @plugin_filename and create a new + * #NMVpnEditorPlugin instace via the #NMVpnEditorPluginFactory + * function. + * + * Returns: (transfer full): a new plugin instance or %NULL on error. + * + * Since: 1.2 + */ +NMVpnEditorPlugin * +nm_vpn_editor_plugin_load_from_file (const char *plugin_filename, + const char *check_service, + int check_owner, + NMUtilsCheckFilePredicate check_file, + gpointer user_data, + GError **error) +{ + GModule *module = NULL; + gs_free_error GError *local = NULL; + NMVpnEditorPluginFactory factory = NULL; + NMVpnEditorPlugin *editor_plugin = NULL; + + g_return_val_if_fail (plugin_filename && *plugin_filename, NULL); + + /* _nm_utils_check_module_file() fails with ENOENT if the plugin file + * does not exist. That is relevant, because nm-applet checks for that. */ + if (_nm_utils_check_module_file (plugin_filename, + check_owner, + check_file, + user_data, + &local)) + module = g_module_open (plugin_filename, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL); + + if (!module) { + if (local) { + g_propagate_error (error, local); + local = NULL; + } else { + g_set_error (error, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_FAILED, + _("cannot load plugin %s"), plugin_filename); + } + return NULL; + } + g_clear_error (&local); + + if (g_module_symbol (module, "nm_vpn_editor_plugin_factory", (gpointer) &factory)) { + gs_free_error GError *factory_error = NULL; + gboolean success = FALSE; + + editor_plugin = factory (&factory_error); + + g_assert (!editor_plugin || G_IS_OBJECT (editor_plugin)); + + if (editor_plugin) { + gs_free char *plug_name = NULL, *plug_service = NULL; + + /* Validate plugin properties */ + + g_object_get (G_OBJECT (editor_plugin), + NM_VPN_EDITOR_PLUGIN_NAME, &plug_name, + NM_VPN_EDITOR_PLUGIN_SERVICE, &plug_service, + NULL); + + if (!plug_name || !*plug_name) { + g_set_error (error, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_FAILED, + _("cannot load VPN plugin in '%s': missing plugin name"), + g_module_name (module)); + } else if ( check_service + && g_strcmp0 (plug_service, check_service) != 0) { + g_set_error (error, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_FAILED, + _("cannot load VPN plugin in '%s': invalid service name"), + g_module_name (module)); + } else { + /* Success! */ + g_object_set_data_full (G_OBJECT (editor_plugin), "gmodule", module, + (GDestroyNotify) g_module_close); + success = TRUE; + } + } else { + if (factory_error) { + g_propagate_error (error, factory_error); + factory_error = NULL; + } else { + g_set_error (error, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_FAILED, + _("unknown error initializing plugin %s"), plugin_filename); + } + } + + if (!success) { + g_module_close (module); + editor_plugin = NULL; + } + } else { + g_set_error (error, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_FAILED, + _("failed to load nm_vpn_editor_plugin_factory() from %s (%s)"), + g_module_name (module), g_module_error ()); + g_module_close (module); + editor_plugin = NULL; + } + + return editor_plugin; +} + +/*********************************************************************/ + +/** + * nm_vpn_editor_plugin_get_editor: + * + * Returns: (transfer full): + */ +NMVpnEditor * +nm_vpn_editor_plugin_get_editor (NMVpnEditorPlugin *plugin, + NMConnection *connection, + GError **error) +{ + g_return_val_if_fail (NM_IS_VPN_EDITOR_PLUGIN (plugin), NULL); + + return NM_VPN_EDITOR_PLUGIN_GET_INTERFACE (plugin)->get_editor (plugin, connection, error); +} + +NMVpnEditorPluginCapability +nm_vpn_editor_plugin_get_capabilities (NMVpnEditorPlugin *plugin) +{ + g_return_val_if_fail (NM_IS_VPN_EDITOR_PLUGIN (plugin), 0); + + return NM_VPN_EDITOR_PLUGIN_GET_INTERFACE (plugin)->get_capabilities (plugin); +} + +/** + * nm_vpn_editor_plugin_import: + * + * Returns: (transfer full): + */ +NMConnection * +nm_vpn_editor_plugin_import (NMVpnEditorPlugin *plugin, + const char *path, + GError **error) +{ + g_return_val_if_fail (NM_IS_VPN_EDITOR_PLUGIN (plugin), NULL); + + if (nm_vpn_editor_plugin_get_capabilities (plugin) & NM_VPN_EDITOR_PLUGIN_CAPABILITY_IMPORT) { + g_return_val_if_fail (NM_VPN_EDITOR_PLUGIN_GET_INTERFACE (plugin)->import_from_file != NULL, NULL); + return NM_VPN_EDITOR_PLUGIN_GET_INTERFACE (plugin)->import_from_file (plugin, path, error); + } + + g_set_error (error, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_FAILED, + _("the plugin does not support import capability")); + return NULL; +} + +gboolean +nm_vpn_editor_plugin_export (NMVpnEditorPlugin *plugin, + const char *path, + NMConnection *connection, + GError **error) +{ + g_return_val_if_fail (NM_IS_VPN_EDITOR_PLUGIN (plugin), FALSE); + + if (nm_vpn_editor_plugin_get_capabilities (plugin) & NM_VPN_EDITOR_PLUGIN_CAPABILITY_EXPORT) { + g_return_val_if_fail (NM_VPN_EDITOR_PLUGIN_GET_INTERFACE (plugin)->export_to_file != NULL, FALSE); + return NM_VPN_EDITOR_PLUGIN_GET_INTERFACE (plugin)->export_to_file (plugin, path, connection, error); + } + + g_set_error (error, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_FAILED, + _("the plugin does not support export capability")); + return FALSE; +} + +char * +nm_vpn_editor_plugin_get_suggested_filename (NMVpnEditorPlugin *plugin, + NMConnection *connection) +{ + g_return_val_if_fail (NM_IS_VPN_EDITOR_PLUGIN (plugin), NULL); + + if (NM_VPN_EDITOR_PLUGIN_GET_INTERFACE (plugin)->get_suggested_filename) + return NM_VPN_EDITOR_PLUGIN_GET_INTERFACE (plugin)->get_suggested_filename (plugin, connection); + return NULL; +} + diff --git a/libnm-core/nm-vpn-editor-plugin.h b/libnm-core/nm-vpn-editor-plugin.h new file mode 100644 index 00000000..16e9533d --- /dev/null +++ b/libnm-core/nm-vpn-editor-plugin.h @@ -0,0 +1,152 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2008 Novell, Inc. + * Copyright 2008 - 2015 Red Hat, Inc. + */ + +#ifndef __NM_VPN_EDITOR_PLUGIN_H__ +#define __NM_VPN_EDITOR_PLUGIN_H__ + +#if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION) +#error "Only can be included directly." +#endif + +#include +#include + +#include "nm-connection.h" +#include "nm-utils.h" + +G_BEGIN_DECLS + +typedef struct _NMVpnEditorPlugin NMVpnEditorPlugin; +typedef struct _NMVpnEditor NMVpnEditor; + +/* Plugin's factory function that returns a GObject that implements + * NMVpnEditorPlugin. + */ +#ifndef __GI_SCANNER__ +typedef NMVpnEditorPlugin * (*NMVpnEditorPluginFactory) (GError **error); +NMVpnEditorPlugin *nm_vpn_editor_plugin_factory (GError **error); +#endif + + +/**************************************************/ +/* Editor plugin interface */ +/**************************************************/ + +#define NM_TYPE_VPN_EDITOR_PLUGIN (nm_vpn_editor_plugin_get_type ()) +#define NM_VPN_EDITOR_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_VPN_EDITOR_PLUGIN, NMVpnEditorPlugin)) +#define NM_IS_VPN_EDITOR_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_VPN_EDITOR_PLUGIN)) +#define NM_VPN_EDITOR_PLUGIN_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_VPN_EDITOR_PLUGIN, NMVpnEditorPluginInterface)) + +/** + * NMVpnEditorPluginCapability: + * @NM_VPN_EDITOR_PLUGIN_CAPABILITY_NONE: unknown or no capability + * @NM_VPN_EDITOR_PLUGIN_CAPABILITY_IMPORT: the plugin can import new connections + * @NM_VPN_EDITOR_PLUGIN_CAPABILITY_EXPORT: the plugin can export connections + * @NM_VPN_EDITOR_PLUGIN_CAPABILITY_IPV6: the plugin supports IPv6 addressing + * + * Flags that indicate certain capabilities of the plugin to editor programs. + **/ +typedef enum /*< flags >*/ { + NM_VPN_EDITOR_PLUGIN_CAPABILITY_NONE = 0x00, + NM_VPN_EDITOR_PLUGIN_CAPABILITY_IMPORT = 0x01, + NM_VPN_EDITOR_PLUGIN_CAPABILITY_EXPORT = 0x02, + NM_VPN_EDITOR_PLUGIN_CAPABILITY_IPV6 = 0x04 +} NMVpnEditorPluginCapability; + +/* Short display name of the VPN plugin */ +#define NM_VPN_EDITOR_PLUGIN_NAME "name" + +/* Longer description of the VPN plugin */ +#define NM_VPN_EDITOR_PLUGIN_DESCRIPTION "description" + +/* D-Bus service name of the plugin's VPN service */ +#define NM_VPN_EDITOR_PLUGIN_SERVICE "service" + +/** + * NMVpnEditorPluginInterface: + * @g_iface: the parent interface + * @get_editor: returns an #NMVpnEditor, pre-filled with values from @connection + * if non-%NULL. + * @get_capabilities: returns a bitmask of capabilities. + * @import_from_file: Try to import a connection from the specified path. On + * success, return a partial #NMConnection object. On error, return %NULL and + * set @error with additional information. Note that @error can be %NULL, in + * which case no additional error information should be provided. + * @export_to_file: Export the given connection to the specified path. Return + * %TRUE on success. On error, return %FALSE and set @error with additional + * error information. Note that @error can be %NULL, in which case no + * additional error information should be provided. + * @get_suggested_filename: For a given connection, return a suggested file + * name. Returned value will be %NULL or a suggested file name to be freed by + * the caller. + * + * Interface for VPN editor plugins. + */ +typedef struct { + GTypeInterface g_iface; + + NMVpnEditor * (*get_editor) (NMVpnEditorPlugin *plugin, + NMConnection *connection, + GError **error); + + NMVpnEditorPluginCapability (*get_capabilities) (NMVpnEditorPlugin *plugin); + + NMConnection * (*import_from_file) (NMVpnEditorPlugin *plugin, + const char *path, + GError **error); + + gboolean (*export_to_file) (NMVpnEditorPlugin *plugin, + const char *path, + NMConnection *connection, + GError **error); + + char * (*get_suggested_filename) (NMVpnEditorPlugin *plugin, NMConnection *connection); +} NMVpnEditorPluginInterface; + +GType nm_vpn_editor_plugin_get_type (void); + +NMVpnEditor *nm_vpn_editor_plugin_get_editor (NMVpnEditorPlugin *plugin, + NMConnection *connection, + GError **error); + +NMVpnEditorPluginCapability nm_vpn_editor_plugin_get_capabilities (NMVpnEditorPlugin *plugin); + +NMConnection *nm_vpn_editor_plugin_import (NMVpnEditorPlugin *plugin, + const char *path, + GError **error); +gboolean nm_vpn_editor_plugin_export (NMVpnEditorPlugin *plugin, + const char *path, + NMConnection *connection, + GError **error); +char *nm_vpn_editor_plugin_get_suggested_filename (NMVpnEditorPlugin *plugin, + NMConnection *connection); + +NM_AVAILABLE_IN_1_2 +NMVpnEditorPlugin *nm_vpn_editor_plugin_load_from_file (const char *plugin_filename, + const char *check_service, + int check_owner, + NMUtilsCheckFilePredicate check_file, + gpointer user_data, + GError **error); + +G_END_DECLS + +#endif /* __NM_VPN_EDITOR_PLUGIN_H__ */ diff --git a/libnm-core/nm-vpn-plugin-info.c b/libnm-core/nm-vpn-plugin-info.c new file mode 100644 index 00000000..3a4796b9 --- /dev/null +++ b/libnm-core/nm-vpn-plugin-info.c @@ -0,0 +1,1030 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2015 Red Hat, Inc. + */ + +#include "config.h" + +#include "nm-vpn-plugin-info.h" + +#include +#include +#include +#include + +#include "gsystem-local-alloc.h" +#include "nm-errors.h" +#include "nm-macros-internal.h" +#include "nm-core-internal.h" + +#define DEFAULT_DIR_ETC NMCONFDIR"/VPN" +#define DEFAULT_DIR_LIB NMLIBDIR"/VPN" + +enum { + PROP_0, + PROP_NAME, + PROP_FILENAME, + PROP_KEYFILE, + + LAST_PROP, +}; + +typedef struct { + char *filename; + char *name; + char *service; + char **aliases; + GKeyFile *keyfile; + + /* It is convenient for nm_vpn_plugin_info_lookup_property() to return a const char *, + * contrary to what g_key_file_get_string() does. Hence we must cache the returned + * value somewhere... let's put it in an internal hash table. + * This contains a clone of all the strings in keyfile. */ + GHashTable *keys; + + gboolean editor_plugin_loaded; + NMVpnEditorPlugin *editor_plugin; +} NMVpnPluginInfoPrivate; + +static void nm_vpn_plugin_info_initable_iface_init (GInitableIface *iface); + +G_DEFINE_TYPE_WITH_CODE (NMVpnPluginInfo, nm_vpn_plugin_info, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, nm_vpn_plugin_info_initable_iface_init); + ) + +#define NM_VPN_PLUGIN_INFO_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_VPN_PLUGIN_INFO, NMVpnPluginInfoPrivate)) + +/*********************************************************************/ + +/** + * nm_vpn_plugin_info_validate_filename: + * @filename: the filename to check + * + * Regular name files have a certain pattern. That basically means + * they have the file extension "name". Check if @filename + * is valid according to that pattern. + * + * Since: 1.2 + */ +gboolean +nm_vpn_plugin_info_validate_filename (const char *filename) +{ + if (!filename || !g_str_has_suffix (filename, ".name")) + return FALSE; + + /* originally, we didn't do further checks... but here we go. */ + if (filename[0] == '.') { + /* this also rejects name ".name" alone. */ + return FALSE; + } + return TRUE; +} + +static gboolean +nm_vpn_plugin_info_check_file_full (const char *filename, + gboolean check_absolute, + gboolean do_validate_filename, + gint64 check_owner, + NMUtilsCheckFilePredicate check_file, + gpointer user_data, + struct stat *out_st, + GError **error) +{ + if (!filename || !*filename) { + g_set_error (error, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_FAILED, + _("missing filename")); + return FALSE; + } + + if (check_absolute && !g_path_is_absolute (filename)) { + g_set_error (error, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_FAILED, + _("filename must be an absolute path (%s)"), filename); + return FALSE; + } + + if ( do_validate_filename + && !nm_vpn_plugin_info_validate_filename (filename)) { + g_set_error (error, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_FAILED, + _("filename has invalid format (%s)"), filename); + return FALSE; + } + + return _nm_utils_check_file (filename, + check_owner, + check_file, + user_data, + out_st, + error); +} + +/** + * _nm_vpn_plugin_info_check_file: + * @filename: + * @check_absolute: if %TRUE, only allow absolute path names. + * @do_validate_filename: if %TRUE, only accept the filename if + * nm_vpn_plugin_info_validate_filename() succeeds. + * @check_owner: if non-negative, only accept the file if the + * owner UID is equal to @check_owner or if the owner is 0. + * In this case, also check that the file is not writable by + * other users. + * @check_file: pass a callback to do your own validation. + * @user_data: user data for @check_file. + * @error: (allow-none): (out): the error reason if the check fails. + * + * Check whether the file exists and is a valid name file (in keyfile format). + * Additionally, also check for file permissions. + * + * Returns: %TRUE if a file @filename exists and has valid permissions. + * + * Since: 1.2 + */ +gboolean +_nm_vpn_plugin_info_check_file (const char *filename, + gboolean check_absolute, + gboolean do_validate_filename, + gint64 check_owner, + NMUtilsCheckFilePredicate check_file, + gpointer user_data, + GError **error) +{ + return nm_vpn_plugin_info_check_file_full (filename, check_absolute, do_validate_filename, check_owner, check_file, user_data, NULL, error); +} + +typedef struct { + NMVpnPluginInfo *plugin_info; + struct stat stat; +} LoadDirInfo; + +static int +_sort_files (LoadDirInfo *a, LoadDirInfo *b) +{ + time_t ta, tb; + + ta = MAX (a->stat.st_mtime, a->stat.st_ctime); + tb = MAX (b->stat.st_mtime, b->stat.st_ctime); + if (ta < tb) + return 1; + if (ta > tb) + return -1; + return g_strcmp0 (nm_vpn_plugin_info_get_filename (a->plugin_info), + nm_vpn_plugin_info_get_filename (b->plugin_info)); +} + +/** + * _nm_vpn_plugin_info_get_default_dir_etc: + * + * Returns: (transfer none): compile time constant of the default + * VPN plugin directory. + */ +const char * +_nm_vpn_plugin_info_get_default_dir_etc () +{ + return DEFAULT_DIR_ETC; +} + +/** + * _nm_vpn_plugin_info_get_default_dir_lib: + * + * Returns: (transfer none): compile time constant of the default + * VPN plugin directory. + */ +const char * +_nm_vpn_plugin_info_get_default_dir_lib () +{ + return DEFAULT_DIR_LIB; +} + +/** + * _nm_vpn_plugin_info_get_default_dir_user: + * + * Returns: The user can specify a different directory for VPN plugins + * by setting NM_VPN_PLUGIN_DIR environment variable. Return + * that directory. + */ +const char * +_nm_vpn_plugin_info_get_default_dir_user () +{ + return g_getenv ("NM_VPN_PLUGIN_DIR"); +} + +/** + * _nm_vpn_plugin_info_list_load_dir: + * @dirname: the name of the directory to load. + * @do_validate_filename: only consider filenames that have a certain + * pattern (i.e. end with ".name"). + * @check_owner: if set to a non-negative number, check that the file + * owner is either the same uid or 0. In that case, also check + * that the file is not writable by group or other. + * @check_file: (allow-none): callback to check whether the file is valid. + * @user_data: data for @check_file + * + * Iterate over the content of @dirname and load name files. + * + * Returns: (transfer full) (element-type NMVpnPluginInfo): list of loaded plugin infos. + */ +GSList * +_nm_vpn_plugin_info_list_load_dir (const char *dirname, + gboolean do_validate_filename, + gint64 check_owner, + NMUtilsCheckFilePredicate check_file, + gpointer user_data) +{ + GDir *dir; + const char *fn; + GArray *array; + GSList *res = NULL; + guint i; + + g_return_val_if_fail (dirname && dirname[0], NULL); + + dir = g_dir_open (dirname, 0, NULL); + if (!dir) + return NULL; + + array = g_array_new (FALSE, FALSE, sizeof (LoadDirInfo)); + + while ((fn = g_dir_read_name (dir))) { + gs_free char *filename = NULL; + LoadDirInfo info = { 0 }; + + filename = g_build_filename (dirname, fn, NULL); + if (nm_vpn_plugin_info_check_file_full (filename, + FALSE, + do_validate_filename, + check_owner, + check_file, + user_data, + &info.stat, + NULL)) { + info.plugin_info = nm_vpn_plugin_info_new_from_file (filename, NULL); + if (info.plugin_info) { + g_array_append_val (array, info); + continue; + } + } + } + g_dir_close (dir); + + /* sort the files so that we have a stable behavior. The directory might contain + * duplicate VPNs, so while nm_vpn_plugin_info_list_load() would load them all, the + * caller probably wants to reject duplicates. Having a stable order means we always + * reject the same files in face of duplicates. */ + g_array_sort (array, (GCompareFunc) _sort_files); + + for (i = 0; i < array->len; i++) + res = g_slist_prepend (res, g_array_index (array, LoadDirInfo, i).plugin_info); + + g_array_unref (array); + + return g_slist_reverse (res); +} + +/** + * nm_vpn_plugin_info_list_load: + * + * Returns: (element-type NMVpnPluginInfo) (transfer full): list of plugins + * loaded from the default directories rejecting duplicates. + * + * Since: 1.2 + */ +GSList * +nm_vpn_plugin_info_list_load () +{ + int i; + gint64 uid; + GSList *list = NULL; + GSList *infos, *info; + const char *dir[] = { + /* We load plugins from NM_VPN_PLUGIN_DIR *and* DEFAULT_DIR*, with + * preference to the former. + * + * load user directory with highest priority. */ + _nm_vpn_plugin_info_get_default_dir_user (), + + /* lib directory has higher priority then etc. The reason is that + * etc is deprecated and used by old plugins. We expect newer plugins + * to install their file in lib, where they have higher priority. + * + * Optimally, there are no duplicates anyway, so it doesn't really matter. */ + _nm_vpn_plugin_info_get_default_dir_lib (), + _nm_vpn_plugin_info_get_default_dir_etc (), + }; + + uid = getuid (); + + for (i = 0; i < G_N_ELEMENTS (dir); i++) { + if ( !dir[i] + || _nm_utils_strv_find_first ((char **) dir, i, dir[i]) >= 0) + continue; + + infos = _nm_vpn_plugin_info_list_load_dir (dir[i], TRUE, uid, NULL, NULL); + + for (info = infos; info; info = info->next) + nm_vpn_plugin_info_list_add (&list, info->data, NULL); + + g_slist_free_full (infos, g_object_unref); + } + return list; +} + +/*********************************************************************/ + +static gboolean +_check_no_conflict (NMVpnPluginInfo *i1, NMVpnPluginInfo *i2, GError **error) +{ + NMVpnPluginInfoPrivate *priv1, *priv2; + uint i; + struct { + const char *group; + const char *key; + } check_list[] = { + { NM_VPN_PLUGIN_INFO_KF_GROUP_CONNECTION, "service" }, + { NM_VPN_PLUGIN_INFO_KF_GROUP_LIBNM, "plugin" }, + { NM_VPN_PLUGIN_INFO_KF_GROUP_GNOME, "properties" }, + }; + + priv1 = NM_VPN_PLUGIN_INFO_GET_PRIVATE (i1); + priv2 = NM_VPN_PLUGIN_INFO_GET_PRIVATE (i2); + + for (i = 0; i < G_N_ELEMENTS (check_list); i++) { + gs_free NMUtilsStrStrDictKey *k = NULL; + const char *s1, *s2; + + k = _nm_utils_strstrdictkey_create (check_list[i].group, check_list[i].key); + s1 = g_hash_table_lookup (priv1->keys, k); + if (!s1) + continue; + s2 = g_hash_table_lookup (priv2->keys, k); + if (!s2) + continue; + + if (strcmp (s1, s2) == 0) { + g_set_error (error, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_FAILED, + _("there exists a conflicting plugin (%s) that has the same %s.%s value"), + priv2->name, + check_list[i].group, check_list[i].key); + return FALSE; + } + } + return TRUE; +} + +/** + * nm_vpn_plugin_info_list_add: + * @list: (element-type NMVpnPluginInfo): list of plugins + * @plugin_info: instance to add + * @error: failure reason + * + * Returns: %TRUE if the plugin was added to @list. This will fail + * to add duplicate plugins. + * + * Since: 1.2 + */ +gboolean +nm_vpn_plugin_info_list_add (GSList **list, NMVpnPluginInfo *plugin_info, GError **error) +{ + GSList *iter; + const char *name; + + g_return_val_if_fail (list, FALSE); + g_return_val_if_fail (NM_IS_VPN_PLUGIN_INFO (plugin_info), FALSE); + + name = nm_vpn_plugin_info_get_name (plugin_info); + for (iter = *list; iter; iter = iter->next) { + if (iter->data == plugin_info) + return TRUE; + + if (strcmp (nm_vpn_plugin_info_get_name (iter->data), name) == 0) { + g_set_error (error, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_FAILED, + _("there exists a conflicting plugin with the same name (%s)"), + name); + return FALSE; + } + + /* the plugin must have unique values for certain properties. E.g. two different + * plugins cannot share the same service name. */ + if (!_check_no_conflict (plugin_info, iter->data, error)) + return FALSE; + } + + *list = g_slist_append (*list, g_object_ref (plugin_info)); + return TRUE; +} + +/** + * nm_vpn_plugin_info_list_remove: + * @list: (element-type NMVpnPluginInfo): list of plugins + * @plugin_info: instance + * + * Remove @plugin_info from @list. + * + * Returns: %TRUE if @plugin_info was in @list and successfully removed. + * + * Since: 1.2 + */ +gboolean +nm_vpn_plugin_info_list_remove (GSList **list, NMVpnPluginInfo *plugin_info) +{ + g_return_val_if_fail (list, FALSE); + g_return_val_if_fail (NM_IS_VPN_PLUGIN_INFO (plugin_info), FALSE); + + if (!g_slist_find (*list, plugin_info)) + return FALSE; + + *list = g_slist_remove (*list, plugin_info); + g_object_unref (plugin_info); + return TRUE; +} + +/** + * nm_vpn_plugin_info_list_find_by_name: + * @list: (element-type NMVpnPluginInfo): list of plugins + * @name: name to search + * + * Returns: (transfer none): the first plugin with a matching @name (or %NULL). + * + * Since: 1.2 + */ +NMVpnPluginInfo * +nm_vpn_plugin_info_list_find_by_name (GSList *list, const char *name) +{ + GSList *iter; + + if (!name) + g_return_val_if_reached (NULL); + + for (iter = list; iter; iter = iter->next) { + if (strcmp (nm_vpn_plugin_info_get_name (iter->data), name) == 0) + return iter->data; + } + return NULL; +} + +/** + * nm_vpn_plugin_info_list_find_by_filename: + * @list: (element-type NMVpnPluginInfo): list of plugins + * @filename: filename to search + * + * Returns: (transfer none): the first plugin with a matching @filename (or %NULL). + * + * Since: 1.2 + */ +NMVpnPluginInfo * +nm_vpn_plugin_info_list_find_by_filename (GSList *list, const char *filename) +{ + GSList *iter; + + if (!filename) + g_return_val_if_reached (NULL); + + for (iter = list; iter; iter = iter->next) { + if (g_strcmp0 (nm_vpn_plugin_info_get_filename (iter->data), filename) == 0) + return iter->data; + } + return NULL; +} + +/** + * nm_vpn_plugin_info_list_find_by_service: + * @list: (element-type NMVpnPluginInfo): list of plugins + * @service: service to search + * + * Returns: (transfer none): the first plugin with a matching @service (or %NULL). + * + * Since: 1.2 + */ +NMVpnPluginInfo * +nm_vpn_plugin_info_list_find_by_service (GSList *list, const char *service) +{ + GSList *iter; + + if (!service) + g_return_val_if_reached (NULL); + + /* First, consider the primary service name. */ + for (iter = list; iter; iter = iter->next) { + if (strcmp (NM_VPN_PLUGIN_INFO_GET_PRIVATE (iter->data)->service, service) == 0) + return iter->data; + } + + /* Then look into the aliases. */ + for (iter = list; iter; iter = iter->next) { + char **aliases = (NM_VPN_PLUGIN_INFO_GET_PRIVATE (iter->data))->aliases; + + if (!aliases) + continue; + if (_nm_utils_strv_find_first (aliases, -1, service) >= 0) + return iter->data; + } + return NULL; +} + +/*********************************************************************/ + +/** + * nm_vpn_plugin_info_get_filename: + * @self: plugin info instance + * + * Returns: (transfer none): the filename. Can be %NULL. + * + * Since: 1.2 + */ +const char * +nm_vpn_plugin_info_get_filename (NMVpnPluginInfo *self) +{ + g_return_val_if_fail (NM_IS_VPN_PLUGIN_INFO (self), NULL); + + return NM_VPN_PLUGIN_INFO_GET_PRIVATE (self)->filename; +} + +/** + * nm_vpn_plugin_info_get_name: + * @self: plugin info instance + * + * Returns: (transfer none): the name. Cannot be %NULL. + * + * Since: 1.2 + */ +const char * +nm_vpn_plugin_info_get_name (NMVpnPluginInfo *self) +{ + g_return_val_if_fail (NM_IS_VPN_PLUGIN_INFO (self), NULL); + + return NM_VPN_PLUGIN_INFO_GET_PRIVATE (self)->name; +} + +/** + * nm_vpn_plugin_info_get_plugin: + * @self: plugin info instance + * + * Returns: (transfer none): the plugin. Can be %NULL. + * + * Since: 1.2 + */ +const char * +nm_vpn_plugin_info_get_plugin (NMVpnPluginInfo *self) +{ + g_return_val_if_fail (NM_IS_VPN_PLUGIN_INFO (self), NULL); + + return g_hash_table_lookup (NM_VPN_PLUGIN_INFO_GET_PRIVATE (self)->keys, + _nm_utils_strstrdictkey_static (NM_VPN_PLUGIN_INFO_KF_GROUP_LIBNM, "plugin")); +} + +/** + * nm_vpn_plugin_info_get_program: + * @self: plugin info instance + * + * Returns: (transfer none): the program. Can be %NULL. + * + * Since: 1.2 + */ +const char * +nm_vpn_plugin_info_get_program (NMVpnPluginInfo *self) +{ + g_return_val_if_fail (NM_IS_VPN_PLUGIN_INFO (self), NULL); + + return g_hash_table_lookup (NM_VPN_PLUGIN_INFO_GET_PRIVATE (self)->keys, + _nm_utils_strstrdictkey_static (NM_VPN_PLUGIN_INFO_KF_GROUP_CONNECTION, "program")); +} + +/** + * nm_vpn_plugin_info_supports_multiple: + * @self: plugin info instance + * + * Returns: %TRUE if the service supports multiple instances with different bus names, otherwise %FALSE + * + * Since: 1.2 + */ +gboolean +nm_vpn_plugin_info_supports_multiple (NMVpnPluginInfo *self) +{ + g_return_val_if_fail (NM_IS_VPN_PLUGIN_INFO (self), FALSE); + + return g_key_file_get_boolean (NM_VPN_PLUGIN_INFO_GET_PRIVATE (self)->keyfile, + NM_VPN_PLUGIN_INFO_KF_GROUP_CONNECTION, + "supports-multiple-connections", + NULL); +} + + +/** + * nm_vpn_plugin_info_lookup_property: + * @self: plugin info instance + * @group: group name + * @key: name of the property + * + * Returns: (transfer none): #NMVpnPluginInfo is internally a #GKeyFile. Returns the matching + * property. + * + * Since: 1.2 + */ +const char * +nm_vpn_plugin_info_lookup_property (NMVpnPluginInfo *self, const char *group, const char *key) +{ + NMVpnPluginInfoPrivate *priv; + gs_free NMUtilsStrStrDictKey *k = NULL; + + g_return_val_if_fail (NM_IS_VPN_PLUGIN_INFO (self), NULL); + g_return_val_if_fail (group, NULL); + g_return_val_if_fail (key, NULL); + + priv = NM_VPN_PLUGIN_INFO_GET_PRIVATE (self); + + k = _nm_utils_strstrdictkey_create (group, key); + return g_hash_table_lookup (priv->keys, k); +} + +/*********************************************************************/ + +/** + * nm_vpn_plugin_info_get_editor_plugin: + * @self: plugin info instance + * + * Returns: (transfer none): the cached #NMVpnEditorPlugin instance. + * + * Since: 1.2 + */ +NMVpnEditorPlugin * +nm_vpn_plugin_info_get_editor_plugin (NMVpnPluginInfo *self) +{ + g_return_val_if_fail (NM_IS_VPN_PLUGIN_INFO (self), NULL); + + return NM_VPN_PLUGIN_INFO_GET_PRIVATE (self)->editor_plugin; +} + +/** + * nm_vpn_plugin_info_set_editor_plugin: + * @self: plugin info instance + * @plugin: (allow-none): plugin instance + * + * Set the internal plugin instance. If %NULL, only clear the previous instance. + * + * Since: 1.2 + */ +void +nm_vpn_plugin_info_set_editor_plugin (NMVpnPluginInfo *self, NMVpnEditorPlugin *plugin) +{ + NMVpnPluginInfoPrivate *priv; + NMVpnEditorPlugin *old; + + g_return_if_fail (NM_IS_VPN_PLUGIN_INFO (self)); + g_return_if_fail (!plugin || G_IS_OBJECT (plugin)); + + priv = NM_VPN_PLUGIN_INFO_GET_PRIVATE (self); + + if (!plugin) { + priv->editor_plugin_loaded = FALSE; + g_clear_object (&priv->editor_plugin); + } else { + old = priv->editor_plugin; + priv->editor_plugin = g_object_ref (plugin); + priv->editor_plugin_loaded = TRUE; + if (old) + g_object_unref (old); + } +} + +/** + * nm_vpn_plugin_info_load_editor_plugin: + * @self: plugin info instance + * @error: error reason on failure + * + * Returns: (transfer none): loads the plugin and returns the newly created + * instance. The plugin is owned by @self and can be later retrieved again + * via nm_vpn_plugin_info_get_editor_plugin(). You can load the + * plugin only once, unless you reset the state via + * nm_vpn_plugin_info_set_editor_plugin(). + * + * Since: 1.2 + */ +NMVpnEditorPlugin * +nm_vpn_plugin_info_load_editor_plugin (NMVpnPluginInfo *self, GError **error) +{ + NMVpnPluginInfoPrivate *priv; + const char *plugin_filename; + + g_return_val_if_fail (NM_IS_VPN_PLUGIN_INFO (self), NULL); + + priv = NM_VPN_PLUGIN_INFO_GET_PRIVATE (self); + + if (priv->editor_plugin) + return priv->editor_plugin; + + plugin_filename = nm_vpn_plugin_info_get_plugin (self); + if (!plugin_filename || !*plugin_filename) { + g_set_error (error, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_FAILED, + _("missing \"plugin\" setting")); + return NULL; + } + + /* We only try once to load the plugin. If we previously tried and it was + * unsuccessful, error out immediately. */ + if (priv->editor_plugin_loaded) { + g_set_error (error, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_FAILED, + _("%s: don't retry loading plugin which already failed previously"), priv->name); + return NULL; + } + + priv->editor_plugin_loaded = TRUE; + priv->editor_plugin = nm_vpn_editor_plugin_load_from_file (plugin_filename, + priv->service, + getuid (), + NULL, + NULL, + error); + return priv->editor_plugin; +} + +/*********************************************************************/ + +/** + * nm_vpn_plugin_info_new_from_file: + * @filename: filename to read. + * @error: on failure, the error reason. + * + * Read the plugin info from file @filename. Does not do + * any further verification on the file. You might want to check + * file permissions and ownership of the file. + * + * Returns: %NULL if there is any error or a newly created + * #NMVpnPluginInfo instance. + * + * Since: 1.2 + */ +NMVpnPluginInfo * +nm_vpn_plugin_info_new_from_file (const char *filename, + GError **error) +{ + g_return_val_if_fail (filename, NULL); + + return NM_VPN_PLUGIN_INFO (g_initable_new (NM_TYPE_VPN_PLUGIN_INFO, + NULL, + error, + NM_VPN_PLUGIN_INFO_FILENAME, filename, + NULL)); +} + +/** + * nm_vpn_plugin_info_new_with_data: + * @filename: optional filename. + * @keyfile: inject data for the plugin info instance. + * @error: construction may fail if the keyfile lacks mandatory fields. + * In this case, return the error reason. + * + * This constructor does not read any data from file but + * takes instead a @keyfile argument. + * + * Returns: new plugin info instance. + * + * Since: 1.2 + */ +NMVpnPluginInfo * +nm_vpn_plugin_info_new_with_data (const char *filename, + GKeyFile *keyfile, + GError **error) +{ + g_return_val_if_fail (keyfile, NULL); + + return NM_VPN_PLUGIN_INFO (g_initable_new (NM_TYPE_VPN_PLUGIN_INFO, + NULL, + error, + NM_VPN_PLUGIN_INFO_FILENAME, filename, + NM_VPN_PLUGIN_INFO_KEYFILE, keyfile, + NULL)); +} + +/*********************************************************************/ + +static void +nm_vpn_plugin_info_init (NMVpnPluginInfo *plugin) +{ +} + +static gboolean +init_sync (GInitable *initable, GCancellable *cancellable, GError **error) +{ + NMVpnPluginInfo *self = NM_VPN_PLUGIN_INFO (initable); + NMVpnPluginInfoPrivate *priv = NM_VPN_PLUGIN_INFO_GET_PRIVATE (self); + gs_strfreev char **groups = NULL; + guint i, j; + + if (!priv->keyfile) { + if (!priv->filename) { + g_set_error_literal (error, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_BAD_ARGUMENTS, + _("missing filename to load VPN plugin info")); + return FALSE; + } + priv->keyfile = g_key_file_new (); + if (!g_key_file_load_from_file (priv->keyfile, priv->filename, G_KEY_FILE_NONE, error)) + return FALSE; + } + + /* we reqire at least a "name" */ + priv->name = g_key_file_get_string (priv->keyfile, NM_VPN_PLUGIN_INFO_KF_GROUP_CONNECTION, "name", NULL); + if (!priv->name || !priv->name[0]) { + g_set_error_literal (error, NM_VPN_PLUGIN_ERROR, NM_VPN_PLUGIN_ERROR_BAD_ARGUMENTS, + _("missing name for VPN plugin info")); + return FALSE; + } + + /* we also require "service", because that how we associate NMSettingVpn:service-type with the + * NMVpnPluginInfo. */ + priv->service = g_key_file_get_string (priv->keyfile, NM_VPN_PLUGIN_INFO_KF_GROUP_CONNECTION, "service", NULL); + if (!priv->service || !*priv->service) { + g_set_error_literal (error, NM_VPN_PLUGIN_ERROR, NM_VPN_PLUGIN_ERROR_BAD_ARGUMENTS, + _("missing service for VPN plugin info")); + return FALSE; + } + + priv->aliases = g_key_file_get_string_list (priv->keyfile, NM_VPN_PLUGIN_INFO_KF_GROUP_CONNECTION, "aliases", NULL, NULL); + + priv->keys = g_hash_table_new_full (_nm_utils_strstrdictkey_hash, + _nm_utils_strstrdictkey_equal, + g_free, g_free); + groups = g_key_file_get_groups (priv->keyfile, NULL); + for (i = 0; groups && groups[i]; i++) { + gs_strfreev char **keys = NULL; + + keys = g_key_file_get_keys (priv->keyfile, groups[i], NULL, NULL); + for (j = 0; keys && keys[j]; j++) { + char *s; + + /* Lookup the value via get_string(). We want that behavior. + * You could still lookup the original values via g_key_file_get_value() + * based on priv->keyfile. */ + s = g_key_file_get_string (priv->keyfile, groups[i], keys[j], NULL); + if (s) + g_hash_table_insert (priv->keys, _nm_utils_strstrdictkey_create (groups[i], keys[j]), s); + } + } + + return TRUE; +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMVpnPluginInfoPrivate *priv = NM_VPN_PLUGIN_INFO_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_FILENAME: + priv->filename = g_value_dup_string (value); + break; + case PROP_KEYFILE: + priv->keyfile = g_value_dup_boxed (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMVpnPluginInfoPrivate *priv = NM_VPN_PLUGIN_INFO_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_NAME: + g_value_set_string (value, priv->name); + break; + case PROP_FILENAME: + g_value_set_string (value, priv->filename); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +dispose (GObject *object) +{ + NMVpnPluginInfo *self = NM_VPN_PLUGIN_INFO (object); + NMVpnPluginInfoPrivate *priv = NM_VPN_PLUGIN_INFO_GET_PRIVATE (self); + + g_clear_object (&priv->editor_plugin); + + G_OBJECT_CLASS (nm_vpn_plugin_info_parent_class)->dispose (object); +} + +static void +finalize (GObject *object) +{ + NMVpnPluginInfo *self = NM_VPN_PLUGIN_INFO (object); + NMVpnPluginInfoPrivate *priv = NM_VPN_PLUGIN_INFO_GET_PRIVATE (self); + + g_free (priv->name); + g_free (priv->service); + g_strfreev (priv->aliases); + g_free (priv->filename); + g_key_file_unref (priv->keyfile); + g_hash_table_unref (priv->keys); + + G_OBJECT_CLASS (nm_vpn_plugin_info_parent_class)->finalize (object); +} + +static void +nm_vpn_plugin_info_class_init (NMVpnPluginInfoClass *plugin_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (plugin_class); + + g_type_class_add_private (object_class, sizeof (NMVpnPluginInfoPrivate)); + + /* virtual methods */ + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->dispose = dispose; + object_class->finalize = finalize; + + /* properties */ + + /** + * NMVpnPluginInfo:name: + * + * The name of the VPN plugin. + * + * Since: 1.2 + */ + g_object_class_install_property + (object_class, PROP_NAME, + g_param_spec_string (NM_VPN_PLUGIN_INFO_NAME, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMVpnPluginInfo:filename: + * + * The filename from which the info was loaded. + * Can be %NULL if the instance was not loaded from + * a file (i.e. the keyfile instance was passed to the + * constructor). + * + * Since: 1.2 + */ + g_object_class_install_property + (object_class, PROP_FILENAME, + g_param_spec_string (NM_VPN_PLUGIN_INFO_FILENAME, "", "", + NULL, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + + /** + * NMVpnPluginInfo:keyfile: + * + * Initalize the instance with a different keyfile instance. + * When passing a keyfile instance, the constructor will not + * try to read from filename. + * + * Since: 1.2 + */ + g_object_class_install_property + (object_class, PROP_KEYFILE, + g_param_spec_boxed (NM_VPN_PLUGIN_INFO_KEYFILE, "", "", + G_TYPE_KEY_FILE, + G_PARAM_WRITABLE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); +} + +static void +nm_vpn_plugin_info_initable_iface_init (GInitableIface *iface) +{ + iface->init = init_sync; +} + diff --git a/libnm-core/nm-vpn-plugin-info.h b/libnm-core/nm-vpn-plugin-info.h new file mode 100644 index 00000000..667a4fe2 --- /dev/null +++ b/libnm-core/nm-vpn-plugin-info.h @@ -0,0 +1,114 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2015 Red Hat, Inc. + */ + +#ifndef __NM_VPN_PLUGIN_INFO_H__ +#define __NM_VPN_PLUGIN_INFO_H__ + +#include +#include + +#include "nm-utils.h" +#include "nm-vpn-editor-plugin.h" + +G_BEGIN_DECLS + +#define NM_TYPE_VPN_PLUGIN_INFO (nm_vpn_plugin_info_get_type ()) +#define NM_VPN_PLUGIN_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_VPN_PLUGIN_INFO, NMVpnPluginInfo)) +#define NM_VPN_PLUGIN_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_VPN_PLUGIN_INFO, NMVpnPluginInfoClass)) +#define NM_IS_VPN_PLUGIN_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_VPN_PLUGIN_INFO)) +#define NM_IS_VPN_PLUGIN_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_VPN_PLUGIN_INFO)) +#define NM_VPN_PLUGIN_INFO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_VPN_PLUGIN_INFO, NMVpnPluginInfoClass)) + +#define NM_VPN_PLUGIN_INFO_NAME "name" +#define NM_VPN_PLUGIN_INFO_FILENAME "filename" +#define NM_VPN_PLUGIN_INFO_KEYFILE "keyfile" + +#define NM_VPN_PLUGIN_INFO_KF_GROUP_CONNECTION "VPN Connection" +#define NM_VPN_PLUGIN_INFO_KF_GROUP_LIBNM "libnm" +#define NM_VPN_PLUGIN_INFO_KF_GROUP_GNOME "GNOME" + +typedef struct { + NM_AVAILABLE_IN_1_2 + GObject parent; +} NMVpnPluginInfo; + +typedef struct { + NM_AVAILABLE_IN_1_2 + GObjectClass parent; + + /*< private >*/ + NM_AVAILABLE_IN_1_2 + gpointer padding[8]; +} NMVpnPluginInfoClass NM_AVAILABLE_IN_1_2; + +NM_AVAILABLE_IN_1_2 +GType nm_vpn_plugin_info_get_type (void); + +NM_AVAILABLE_IN_1_2 +NMVpnPluginInfo *nm_vpn_plugin_info_new_from_file (const char *filename, + GError **error); + +NM_AVAILABLE_IN_1_2 +NMVpnPluginInfo *nm_vpn_plugin_info_new_with_data (const char *filename, + GKeyFile *keyfile, + GError **error); + +NM_AVAILABLE_IN_1_2 +const char *nm_vpn_plugin_info_get_name (NMVpnPluginInfo *self); +NM_AVAILABLE_IN_1_2 +const char *nm_vpn_plugin_info_get_filename (NMVpnPluginInfo *self); +NM_AVAILABLE_IN_1_2 +const char *nm_vpn_plugin_info_get_plugin (NMVpnPluginInfo *self); +NM_AVAILABLE_IN_1_2 +const char *nm_vpn_plugin_info_get_program (NMVpnPluginInfo *self); +NM_AVAILABLE_IN_1_2 +gboolean nm_vpn_plugin_info_supports_multiple (NMVpnPluginInfo *self); +NM_AVAILABLE_IN_1_2 +const char *nm_vpn_plugin_info_lookup_property (NMVpnPluginInfo *self, const char *group, const char *key); + +NM_AVAILABLE_IN_1_2 +gboolean nm_vpn_plugin_info_validate_filename (const char *filename); + +NM_AVAILABLE_IN_1_2 +GSList *nm_vpn_plugin_info_list_load (void); +NM_AVAILABLE_IN_1_2 +gboolean nm_vpn_plugin_info_list_add (GSList **list, NMVpnPluginInfo *plugin_info, GError **error); +NM_AVAILABLE_IN_1_2 +gboolean nm_vpn_plugin_info_list_remove (GSList **list, NMVpnPluginInfo *plugin_info); +NM_AVAILABLE_IN_1_2 +NMVpnPluginInfo *nm_vpn_plugin_info_list_find_by_name (GSList *list, const char *name); +NM_AVAILABLE_IN_1_2 +NMVpnPluginInfo *nm_vpn_plugin_info_list_find_by_filename (GSList *list, const char *filename); +NM_AVAILABLE_IN_1_2 +NMVpnPluginInfo *nm_vpn_plugin_info_list_find_by_service (GSList *list, const char *service); + + +NM_AVAILABLE_IN_1_2 +NMVpnEditorPlugin *nm_vpn_plugin_info_get_editor_plugin (NMVpnPluginInfo *self); +NM_AVAILABLE_IN_1_2 +void nm_vpn_plugin_info_set_editor_plugin (NMVpnPluginInfo *self, + NMVpnEditorPlugin *plugin); +NM_AVAILABLE_IN_1_2 +NMVpnEditorPlugin *nm_vpn_plugin_info_load_editor_plugin (NMVpnPluginInfo *self, + GError **error); + +G_END_DECLS + +#endif /* __NM_VPN_PLUGIN_INFO_H__ */ diff --git a/libnm-core/tests/Makefile.am b/libnm-core/tests/Makefile.am index bcccfda9..92c816fd 100644 --- a/libnm-core/tests/Makefile.am +++ b/libnm-core/tests/Makefile.am @@ -1,5 +1,3 @@ -if ENABLE_TESTS - include $(GLIB_MAKEFILE) GLIB_GENERATED = nm-core-tests-enum-types.h nm-core-tests-enum-types.c @@ -9,11 +7,13 @@ GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM BUILT_SOURCES = $(GLIB_GENERATED) +if ENABLE_TESTS + certsdir = $(srcdir)/certs AM_CPPFLAGS = \ - -I${top_srcdir}/include \ - -I${top_builddir}/include \ + -I${top_srcdir}/shared \ + -I${top_builddir}/shared \ -I$(top_srcdir)/libnm-core \ -I$(top_builddir)/libnm-core \ -DNETWORKMANAGER_COMPILATION \ diff --git a/libnm-core/tests/Makefile.in b/libnm-core/tests/Makefile.in index e46146a4..43892d75 100644 --- a/libnm-core/tests/Makefile.in +++ b/libnm-core/tests/Makefile.in @@ -460,7 +460,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -472,8 +471,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -483,6 +480,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -537,16 +535,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -583,6 +578,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -611,7 +608,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -626,6 +622,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -686,6 +684,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -693,6 +692,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -708,15 +708,15 @@ with_dhcpcd = @with_dhcpcd@ with_netconfig = @with_netconfig@ with_resolvconf = @with_resolvconf@ with_valgrind = @with_valgrind@ -@ENABLE_TESTS_TRUE@GLIB_GENERATED = nm-core-tests-enum-types.h nm-core-tests-enum-types.c -@ENABLE_TESTS_TRUE@nm_core_tests_enum_types_sources = test-general-enums.h -@ENABLE_TESTS_TRUE@GLIB_MKENUMS_H_FLAGS = --identifier-prefix NM -@ENABLE_TESTS_TRUE@GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM -@ENABLE_TESTS_TRUE@BUILT_SOURCES = $(GLIB_GENERATED) +GLIB_GENERATED = nm-core-tests-enum-types.h nm-core-tests-enum-types.c +nm_core_tests_enum_types_sources = test-general-enums.h +GLIB_MKENUMS_H_FLAGS = --identifier-prefix NM +GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM +BUILT_SOURCES = $(GLIB_GENERATED) @ENABLE_TESTS_TRUE@certsdir = $(srcdir)/certs @ENABLE_TESTS_TRUE@AM_CPPFLAGS = \ -@ENABLE_TESTS_TRUE@ -I${top_srcdir}/include \ -@ENABLE_TESTS_TRUE@ -I${top_builddir}/include \ +@ENABLE_TESTS_TRUE@ -I${top_srcdir}/shared \ +@ENABLE_TESTS_TRUE@ -I${top_builddir}/shared \ @ENABLE_TESTS_TRUE@ -I$(top_srcdir)/libnm-core \ @ENABLE_TESTS_TRUE@ -I$(top_builddir)/libnm-core \ @ENABLE_TESTS_TRUE@ -DNETWORKMANAGER_COMPILATION \ @@ -1306,8 +1306,7 @@ uninstall-am: .PRECIOUS: Makefile - -@ENABLE_TESTS_TRUE@include $(GLIB_MAKEFILE) +include $(GLIB_MAKEFILE) @ENABLE_TESTS_TRUE@@VALGRIND_RULES@ diff --git a/libnm-core/tests/nm-core-tests-enum-types.c b/libnm-core/tests/nm-core-tests-enum-types.c index 80271e52..e6eaa60b 100644 --- a/libnm-core/tests/nm-core-tests-enum-types.c +++ b/libnm-core/tests/nm-core-tests-enum-types.c @@ -3,6 +3,8 @@ /* Generated by glib-mkenums. Do not edit */ +#include "config.h" + #include "nm-core-tests-enum-types.h" #include "test-general-enums.h" diff --git a/libnm-core/tests/test-compare.c b/libnm-core/tests/test-compare.c index 12db9c23..914330fe 100644 --- a/libnm-core/tests/test-compare.c +++ b/libnm-core/tests/test-compare.c @@ -24,8 +24,7 @@ #include #include -#include "nm-glib-compat.h" - +#include "nm-default.h" #include "nm-property-compare.h" #include "nm-test-utils.h" diff --git a/libnm-core/tests/test-crypto.c b/libnm-core/tests/test-crypto.c index e4ca8086..926cddb0 100644 --- a/libnm-core/tests/test-crypto.c +++ b/libnm-core/tests/test-crypto.c @@ -23,13 +23,12 @@ #include "config.h" -#include #include #include -#include #include #include +#include "nm-default.h" #include "crypto.h" #include "nm-utils.h" #include "nm-errors.h" diff --git a/libnm-core/tests/test-general.c b/libnm-core/tests/test-general.c index 53d8195c..e8eb0baf 100644 --- a/libnm-core/tests/test-general.c +++ b/libnm-core/tests/test-general.c @@ -7,7 +7,7 @@ * 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 + * but WITHOUT SC WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * @@ -23,14 +23,14 @@ #include "config.h" -#include #include #include -#include "gsystem-local-alloc.h" +#include "nm-default.h" #include "nm-setting-private.h" #include "nm-utils.h" +#include "nm-utils-private.h" #include "nm-core-internal.h" #include "nm-core-tests-enum-types.h" @@ -60,11 +60,19 @@ #include "nm-setting-wireless.h" #include "nm-setting-wireless-security.h" #include "nm-simple-connection.h" -#include "nm-glib-compat.h" +#include "nm-keyfile-internal.h" #include "nm-test-utils.h" #include "test-general-enums.h" +/* When passing a "bool" typed argument to a variadic function that + * expects a gboolean, the compiler will promote the integer type + * to have at least size (int). That way: + * g_object_set (obj, PROP_BOOL, bool_val, NULL); + * will just work correctly. */ +G_STATIC_ASSERT (sizeof (gboolean) == sizeof (int)); +G_STATIC_ASSERT (sizeof (bool) <= sizeof (int)); + static void vpn_check_func (const char *key, const char *value, gpointer user_data) { @@ -748,6 +756,35 @@ test_setting_gsm_without_number (void) NM_CONNECTION_ERROR_INVALID_PROPERTY); } +static void +test_setting_gsm_sim_operator_id (void) +{ + gs_unref_object NMSettingGsm *s_gsm = NULL; + + s_gsm = (NMSettingGsm *) nm_setting_gsm_new (); + g_assert (s_gsm); + + /* Valid */ + g_object_set (s_gsm, NM_SETTING_GSM_SIM_OPERATOR_ID, "12345", NULL); + nmtst_assert_setting_verifies (NM_SETTING (s_gsm)); + + g_object_set (s_gsm, NM_SETTING_GSM_SIM_OPERATOR_ID, "123456", NULL); + nmtst_assert_setting_verifies (NM_SETTING (s_gsm)); + + /* Invalid */ + g_object_set (s_gsm, NM_SETTING_GSM_SIM_OPERATOR_ID, "", NULL); + nmtst_assert_setting_verify_fails (NM_SETTING (s_gsm), NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY); + + g_object_set (s_gsm, NM_SETTING_GSM_SIM_OPERATOR_ID, " ", NULL); + nmtst_assert_setting_verify_fails (NM_SETTING (s_gsm), NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY); + + g_object_set (s_gsm, NM_SETTING_GSM_SIM_OPERATOR_ID, "abcdef", NULL); + nmtst_assert_setting_verify_fails (NM_SETTING (s_gsm), NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY); +} + static NMSettingWirelessSecurity * make_test_wsec_setting (const char *detail) { @@ -1972,6 +2009,7 @@ test_connection_diff_a_only (void) { NM_SETTING_CONNECTION_SECONDARIES, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_CONNECTION_GATEWAY_PING_TIMEOUT, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_CONNECTION_METERED, NM_SETTING_DIFF_RESULT_IN_A }, + { NM_SETTING_CONNECTION_LLDP, NM_SETTING_DIFF_RESULT_IN_A }, { NULL, NM_SETTING_DIFF_RESULT_UNKNOWN } } }, { NM_SETTING_WIRED_SETTING_NAME, { @@ -1994,6 +2032,7 @@ test_connection_diff_a_only (void) { NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_IP_CONFIG_DNS, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_IP_CONFIG_DNS_SEARCH, NM_SETTING_DIFF_RESULT_IN_A }, + { NM_SETTING_IP_CONFIG_DNS_OPTIONS, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_IP_CONFIG_ADDRESSES, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_IP_CONFIG_GATEWAY, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_IP_CONFIG_ROUTES, NM_SETTING_DIFF_RESULT_IN_A }, @@ -2001,8 +2040,10 @@ test_connection_diff_a_only (void) { NM_SETTING_IP_CONFIG_IGNORE_AUTO_ROUTES, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_IP_CONFIG_IGNORE_AUTO_DNS, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID, NM_SETTING_DIFF_RESULT_IN_A }, + { NM_SETTING_IP4_CONFIG_DHCP_TIMEOUT, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_IP_CONFIG_DHCP_HOSTNAME, NM_SETTING_DIFF_RESULT_IN_A }, + { NM_SETTING_IP4_CONFIG_DHCP_FQDN, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_IP_CONFIG_NEVER_DEFAULT, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_IP_CONFIG_MAY_FAIL, NM_SETTING_DIFF_RESULT_IN_A }, { NULL, NM_SETTING_DIFF_RESULT_UNKNOWN }, @@ -2851,7 +2892,7 @@ test_setting_ip4_changed_signal (void) ASSERT_CHANGED (nm_setting_ip_config_add_dns (s_ip4, "11.22.0.0")); ASSERT_CHANGED (nm_setting_ip_config_remove_dns (s_ip4, 0)); - g_test_expect_message ("libnm", G_LOG_LEVEL_CRITICAL, "*i < priv->dns->len*"); + g_test_expect_message ("libnm", G_LOG_LEVEL_CRITICAL, "*idx < priv->dns->len*"); ASSERT_UNCHANGED (nm_setting_ip_config_remove_dns (s_ip4, 1)); g_test_assert_expected_messages (); @@ -2861,7 +2902,7 @@ test_setting_ip4_changed_signal (void) ASSERT_CHANGED (nm_setting_ip_config_add_dns_search (s_ip4, "foobar.com")); ASSERT_CHANGED (nm_setting_ip_config_remove_dns_search (s_ip4, 0)); - g_test_expect_message ("libnm", G_LOG_LEVEL_CRITICAL, "*i < priv->dns_search->len*"); + g_test_expect_message ("libnm", G_LOG_LEVEL_CRITICAL, "*idx < priv->dns_search->len*"); ASSERT_UNCHANGED (nm_setting_ip_config_remove_dns_search (s_ip4, 1)); g_test_assert_expected_messages (); @@ -2873,7 +2914,7 @@ test_setting_ip4_changed_signal (void) ASSERT_CHANGED (nm_setting_ip_config_add_address (s_ip4, addr)); ASSERT_CHANGED (nm_setting_ip_config_remove_address (s_ip4, 0)); - g_test_expect_message ("libnm", G_LOG_LEVEL_CRITICAL, "*i < priv->addresses->len*"); + g_test_expect_message ("libnm", G_LOG_LEVEL_CRITICAL, "*idx < priv->addresses->len*"); ASSERT_UNCHANGED (nm_setting_ip_config_remove_address (s_ip4, 1)); g_test_assert_expected_messages (); @@ -2886,13 +2927,20 @@ test_setting_ip4_changed_signal (void) ASSERT_CHANGED (nm_setting_ip_config_add_route (s_ip4, route)); ASSERT_CHANGED (nm_setting_ip_config_remove_route (s_ip4, 0)); - g_test_expect_message ("libnm", G_LOG_LEVEL_CRITICAL, "*i < priv->routes->len*"); + g_test_expect_message ("libnm", G_LOG_LEVEL_CRITICAL, "*idx < priv->routes->len*"); ASSERT_UNCHANGED (nm_setting_ip_config_remove_route (s_ip4, 1)); g_test_assert_expected_messages (); nm_setting_ip_config_add_route (s_ip4, route); ASSERT_CHANGED (nm_setting_ip_config_clear_routes (s_ip4)); + ASSERT_CHANGED (nm_setting_ip_config_add_dns_option (s_ip4, "debug")); + ASSERT_CHANGED (nm_setting_ip_config_remove_dns_option (s_ip4, 0)); + + g_test_expect_message ("libnm", G_LOG_LEVEL_CRITICAL, "*idx < priv->dns_options->len*"); + ASSERT_UNCHANGED (nm_setting_ip_config_remove_dns_option (s_ip4, 1)); + g_test_assert_expected_messages (); + nm_ip_address_unref (addr); nm_ip_route_unref (route); g_object_unref (connection); @@ -2920,7 +2968,7 @@ test_setting_ip6_changed_signal (void) ASSERT_CHANGED (nm_setting_ip_config_add_dns (s_ip6, "1:2:3::4:5:6")); ASSERT_CHANGED (nm_setting_ip_config_remove_dns (s_ip6, 0)); - g_test_expect_message ("libnm", G_LOG_LEVEL_CRITICAL, "*i < priv->dns->len*"); + g_test_expect_message ("libnm", G_LOG_LEVEL_CRITICAL, "*idx < priv->dns->len*"); ASSERT_UNCHANGED (nm_setting_ip_config_remove_dns (s_ip6, 1)); g_test_assert_expected_messages (); @@ -2930,7 +2978,7 @@ test_setting_ip6_changed_signal (void) ASSERT_CHANGED (nm_setting_ip_config_add_dns_search (s_ip6, "foobar.com")); ASSERT_CHANGED (nm_setting_ip_config_remove_dns_search (s_ip6, 0)); - g_test_expect_message ("libnm", G_LOG_LEVEL_CRITICAL, "*i < priv->dns_search->len*"); + g_test_expect_message ("libnm", G_LOG_LEVEL_CRITICAL, "*idx < priv->dns_search->len*"); ASSERT_UNCHANGED (nm_setting_ip_config_remove_dns_search (s_ip6, 1)); g_test_assert_expected_messages (); @@ -2943,7 +2991,7 @@ test_setting_ip6_changed_signal (void) ASSERT_CHANGED (nm_setting_ip_config_add_address (s_ip6, addr)); ASSERT_CHANGED (nm_setting_ip_config_remove_address (s_ip6, 0)); - g_test_expect_message ("libnm", G_LOG_LEVEL_CRITICAL, "*i < priv->addresses->len*"); + g_test_expect_message ("libnm", G_LOG_LEVEL_CRITICAL, "*idx < priv->addresses->len*"); ASSERT_UNCHANGED (nm_setting_ip_config_remove_address (s_ip6, 1)); g_test_assert_expected_messages (); @@ -2956,7 +3004,7 @@ test_setting_ip6_changed_signal (void) ASSERT_CHANGED (nm_setting_ip_config_add_route (s_ip6, route)); ASSERT_CHANGED (nm_setting_ip_config_remove_route (s_ip6, 0)); - g_test_expect_message ("libnm", G_LOG_LEVEL_CRITICAL, "*i < priv->routes->len*"); + g_test_expect_message ("libnm", G_LOG_LEVEL_CRITICAL, "*idx < priv->routes->len*"); ASSERT_UNCHANGED (nm_setting_ip_config_remove_route (s_ip6, 1)); g_test_assert_expected_messages (); @@ -3963,6 +4011,51 @@ typedef struct { const guint expected_len; } HexItem; +static void +test_setting_compare_default_strv (void) +{ + gs_unref_object NMConnection *c1 = NULL, *c2 = NULL; + char **strv; + NMSettingIPConfig *s_ip2, *s_ip1; + gboolean compare; + GHashTable *out_settings = NULL; + + c1 = nmtst_create_minimal_connection ("test_compare_default_strv", NULL, + NM_SETTING_WIRED_SETTING_NAME, NULL); + nmtst_assert_connection_verifies_and_normalizable (c1); + + c2 = nm_simple_connection_new_clone (c1); + nmtst_assert_connection_verifies_without_normalization (c2); + + nmtst_assert_connection_equals (c1, FALSE, c2, FALSE); + + s_ip1 = nm_connection_get_setting_ip4_config (c1); + s_ip2 = nm_connection_get_setting_ip4_config (c2); + + nm_setting_ip_config_clear_dns_options (s_ip2, FALSE); + g_object_get (G_OBJECT (s_ip2), NM_SETTING_IP_CONFIG_DNS_OPTIONS, &strv, NULL); + g_assert (!strv); + nmtst_assert_connection_equals (c1, FALSE, c2, FALSE); + + nm_setting_ip_config_clear_dns_options (s_ip2, TRUE); + g_object_get (G_OBJECT (s_ip2), NM_SETTING_IP_CONFIG_DNS_OPTIONS, &strv, NULL); + g_assert (strv && !strv[0]); + g_strfreev (strv); + + compare = nm_setting_diff ((NMSetting *) s_ip1, (NMSetting *) s_ip2, NM_SETTING_COMPARE_FLAG_EXACT, FALSE, &out_settings); + g_assert (!compare); + g_assert (out_settings); + g_assert (g_hash_table_contains (out_settings, NM_SETTING_IP_CONFIG_DNS_OPTIONS)); + g_hash_table_unref (out_settings); + out_settings = NULL; + + compare = nm_connection_diff (c1, c2, NM_SETTING_COMPARE_FLAG_EXACT, &out_settings); + g_assert (!compare); + g_assert (out_settings); + g_hash_table_unref (out_settings); + out_settings = NULL; +} + static void test_hexstr2bin (void) { @@ -4227,6 +4320,138 @@ test_nm_utils_ascii_str_to_int64 (void) /******************************************************************************/ +static void +test_nm_utils_strstrdictkey (void) +{ +#define _VALUES_STATIC(_v1, _v2) { .v1 = _v1, .v2 = _v2, .v_static = _nm_utils_strstrdictkey_static (_v1, _v2), } + const struct { + const char *v1; + const char *v2; + NMUtilsStrStrDictKey *v_static; + } *val1, *val2, values[] = { + { NULL, NULL }, + { "", NULL }, + { NULL, "" }, + { "a", NULL }, + { NULL, "a" }, + _VALUES_STATIC ("", ""), + _VALUES_STATIC ("a", ""), + _VALUES_STATIC ("", "a"), + _VALUES_STATIC ("a", "b"), + }; + guint i, j; + + for (i = 0; i < G_N_ELEMENTS (values); i++) { + gs_free NMUtilsStrStrDictKey *key1 = NULL; + + val1 = &values[i]; + + key1 = _nm_utils_strstrdictkey_create (val1->v1, val1->v2); + if (val1->v_static) { + g_assert (_nm_utils_strstrdictkey_equal (key1, val1->v_static)); + g_assert (_nm_utils_strstrdictkey_equal (val1->v_static, key1)); + g_assert_cmpint (_nm_utils_strstrdictkey_hash (key1), ==, _nm_utils_strstrdictkey_hash (val1->v_static)); + } + + for (j = 0; j < G_N_ELEMENTS (values); j++) { + gs_free NMUtilsStrStrDictKey *key2 = NULL; + + val2 = &values[j]; + key2 = _nm_utils_strstrdictkey_create (val2->v1, val2->v2); + if (i != j) { + g_assert (!_nm_utils_strstrdictkey_equal (key1, key2)); + g_assert (!_nm_utils_strstrdictkey_equal (key2, key1)); + } + } + } +} + +/******************************************************************************/ + +static void +test_nm_utils_dns_option_validate_do (char *option, gboolean ipv6, const NMUtilsDNSOptionDesc *descs, + gboolean exp_result, char *exp_name, gboolean exp_value) +{ + char *name; + long value = 0; + gboolean result; + + result = _nm_utils_dns_option_validate (option, &name, &value, ipv6, descs); + + g_assert (result == exp_result); + g_assert_cmpstr (name, ==, exp_name); + g_assert (value == exp_value); + + g_free (name); +} + +static const NMUtilsDNSOptionDesc opt_descs[] = { + /* name num ipv6 */ + { "opt1", FALSE, FALSE }, + { "opt2", TRUE, FALSE }, + { "opt3", FALSE, TRUE }, + { "opt4", TRUE, TRUE }, + { NULL, FALSE, FALSE } +}; + +static void +test_nm_utils_dns_option_validate (void) +{ + /* opt ipv6 descs result name value */ + test_nm_utils_dns_option_validate_do ("", FALSE, NULL, FALSE, NULL, -1); + test_nm_utils_dns_option_validate_do (":", FALSE, NULL, FALSE, NULL, -1); + test_nm_utils_dns_option_validate_do (":1", FALSE, NULL, FALSE, NULL, -1); + test_nm_utils_dns_option_validate_do (":val", FALSE, NULL, FALSE, NULL, -1); + test_nm_utils_dns_option_validate_do ("opt", FALSE, NULL, TRUE, "opt", -1); + test_nm_utils_dns_option_validate_do ("opt:", FALSE, NULL, FALSE, NULL, -1); + test_nm_utils_dns_option_validate_do ("opt:12", FALSE, NULL, TRUE, "opt", 12); + test_nm_utils_dns_option_validate_do ("opt:12 ", FALSE, NULL, FALSE, NULL, -1); + test_nm_utils_dns_option_validate_do ("opt:val", FALSE, NULL, FALSE, NULL, -1); + test_nm_utils_dns_option_validate_do ("opt:2val", FALSE, NULL, FALSE, NULL, -1); + test_nm_utils_dns_option_validate_do ("opt:2:3", FALSE, NULL, FALSE, NULL, -1); + test_nm_utils_dns_option_validate_do ("opt-6", FALSE, NULL, TRUE, "opt-6", -1); + + test_nm_utils_dns_option_validate_do ("opt1", FALSE, opt_descs, TRUE, "opt1", -1); + test_nm_utils_dns_option_validate_do ("opt1", TRUE, opt_descs, TRUE, "opt1", -1); + test_nm_utils_dns_option_validate_do ("opt1:3", FALSE, opt_descs, FALSE, NULL, -1); + + test_nm_utils_dns_option_validate_do ("opt2", FALSE, opt_descs, FALSE, NULL, -1); + test_nm_utils_dns_option_validate_do ("opt2:5", FALSE, opt_descs, TRUE, "opt2", 5); + + test_nm_utils_dns_option_validate_do ("opt3", FALSE, opt_descs, FALSE, NULL, -1); + test_nm_utils_dns_option_validate_do ("opt3", TRUE, opt_descs, TRUE, "opt3", -1); + + test_nm_utils_dns_option_validate_do ("opt4", FALSE, opt_descs, FALSE, NULL, -1); + test_nm_utils_dns_option_validate_do ("opt4", TRUE, opt_descs, FALSE, NULL, -1); + test_nm_utils_dns_option_validate_do ("opt4:40", FALSE, opt_descs, FALSE, NULL, -1); + test_nm_utils_dns_option_validate_do ("opt4:40", TRUE, opt_descs, TRUE, "opt4", 40); +} + +static void +test_nm_utils_dns_option_find_idx (void) +{ + GPtrArray *options; + + options = g_ptr_array_new (); + + g_ptr_array_add (options, "debug"); + g_ptr_array_add (options, "timeout:5"); + g_ptr_array_add (options, "edns0"); + + g_assert_cmpint (_nm_utils_dns_option_find_idx (options, "debug"), ==, 0); + g_assert_cmpint (_nm_utils_dns_option_find_idx (options, "debug:1"), ==, 0); + g_assert_cmpint (_nm_utils_dns_option_find_idx (options, "timeout"), ==, 1); + g_assert_cmpint (_nm_utils_dns_option_find_idx (options, "timeout:5"), ==, 1); + g_assert_cmpint (_nm_utils_dns_option_find_idx (options, "timeout:2"), ==, 1); + g_assert_cmpint (_nm_utils_dns_option_find_idx (options, "edns0"), ==, 2); + g_assert_cmpint (_nm_utils_dns_option_find_idx (options, "rotate"), ==, -1); + g_assert_cmpint (_nm_utils_dns_option_find_idx (options, ""), ==, -1); + + g_ptr_array_free (options, TRUE); +} + +/******************************************************************************/ + enum TEST_IS_POWER_OF_TWP_ENUM_SIGNED { _DUMMY_1 = -1, }; @@ -4349,6 +4574,41 @@ test_g_ptr_array_insert (void) /******************************************************************************/ +static void +test_g_hash_table_get_keys_as_array (void) +{ + GHashTable *table = g_hash_table_new (g_str_hash, g_str_equal); + guint length = 0; + char **keys; + + g_hash_table_insert (table, "one", "1"); + g_hash_table_insert (table, "two", "2"); + g_hash_table_insert (table, "three", "3"); + + keys = (char **) _nm_g_hash_table_get_keys_as_array (table, &length); + g_assert (keys); + g_assert_cmpuint (length, ==, 3); + + g_assert ( !strcmp (keys[0], "one") + || !strcmp (keys[1], "one") + || !strcmp (keys[2], "one")); + + g_assert ( !strcmp (keys[0], "two") + || !strcmp (keys[1], "two") + || !strcmp (keys[2], "two")); + + g_assert ( !strcmp (keys[0], "three") + || !strcmp (keys[1], "three") + || !strcmp (keys[2], "three")); + + g_assert (!keys[3]); + + g_free (keys); + g_hash_table_unref (table); +} + +/******************************************************************************/ + static int _test_find_binary_search_cmp (gconstpointer a, gconstpointer b, gpointer dummy) { @@ -4451,6 +4711,101 @@ test_nm_utils_ptrarray_find_binary_search (void) test_find_binary_search_do (-3, -2, -1, 1, 2, 3, 4); } +/******************************************************************************/ +static void +test_nm_utils_enum_from_str_do (GType type, const char *str, + gboolean exp_result, int exp_flags, + const char *exp_err_token) +{ + int flags = 1; + char *err_token = NULL; + gboolean result; + + result = nm_utils_enum_from_str (type, str, &flags, &err_token); + + g_assert (result == exp_result); + g_assert_cmpint (flags, ==, exp_flags); + g_assert_cmpstr (err_token, ==, exp_err_token); + + g_free (err_token); +} + +static void +test_nm_utils_enum_to_str_do (GType type, int flags, const char *exp_str) +{ + char *str; + + str = nm_utils_enum_to_str (type, flags); + g_assert_cmpstr (str, ==, exp_str); + g_free (str); +} + +static void +test_nm_utils_enum_get_values_do (GType type, int from, int to, const char *exp_str) +{ + const char **strv; + char *str; + + strv = nm_utils_enum_get_values (type, from, to); + g_assert (strv); + str = g_strjoinv (",", (char **) strv); + g_assert_cmpstr (str, ==, exp_str); + g_free (str); + g_free (strv); +} + + +static void test_nm_utils_enum (void) +{ + GType bool_enum = nm_test_general_bool_enum_get_type(); + GType meta_flags = nm_test_general_meta_flags_get_type(); + GType color_flags = nm_test_general_color_flags_get_type(); + + test_nm_utils_enum_to_str_do (bool_enum, NM_TEST_GENERAL_BOOL_ENUM_YES, "yes"); + test_nm_utils_enum_to_str_do (bool_enum, NM_TEST_GENERAL_BOOL_ENUM_UNKNOWN, "unknown"); + test_nm_utils_enum_to_str_do (bool_enum, NM_TEST_GENERAL_BOOL_ENUM_INVALID, NULL); + + test_nm_utils_enum_to_str_do (meta_flags, NM_TEST_GENERAL_META_FLAGS_NONE, ""); + test_nm_utils_enum_to_str_do (meta_flags, NM_TEST_GENERAL_META_FLAGS_BAZ, "baz"); + test_nm_utils_enum_to_str_do (meta_flags, NM_TEST_GENERAL_META_FLAGS_FOO | + NM_TEST_GENERAL_META_FLAGS_BAR | + NM_TEST_GENERAL_META_FLAGS_BAZ, "foo, bar, baz"); + + test_nm_utils_enum_to_str_do (color_flags, NM_TEST_GENERAL_COLOR_FLAGS_RED, "red"); + test_nm_utils_enum_to_str_do (color_flags, NM_TEST_GENERAL_COLOR_FLAGS_WHITE, ""); + test_nm_utils_enum_to_str_do (color_flags, NM_TEST_GENERAL_COLOR_FLAGS_RED | + NM_TEST_GENERAL_COLOR_FLAGS_GREEN, "red, green"); + + test_nm_utils_enum_from_str_do (bool_enum, "", FALSE, 0, NULL); + test_nm_utils_enum_from_str_do (bool_enum, " ", FALSE, 0, NULL); + test_nm_utils_enum_from_str_do (bool_enum, "invalid", FALSE, 0, NULL); + test_nm_utils_enum_from_str_do (bool_enum, "yes", TRUE, NM_TEST_GENERAL_BOOL_ENUM_YES, NULL); + test_nm_utils_enum_from_str_do (bool_enum, "no", TRUE, NM_TEST_GENERAL_BOOL_ENUM_NO, NULL); + test_nm_utils_enum_from_str_do (bool_enum, "yes,no", FALSE, 0, NULL); + + test_nm_utils_enum_from_str_do (meta_flags, "", TRUE, 0, NULL); + test_nm_utils_enum_from_str_do (meta_flags, " ", TRUE, 0, NULL); + test_nm_utils_enum_from_str_do (meta_flags, "foo", TRUE, NM_TEST_GENERAL_META_FLAGS_FOO, NULL); + test_nm_utils_enum_from_str_do (meta_flags, "foo,baz", TRUE, NM_TEST_GENERAL_META_FLAGS_FOO | + NM_TEST_GENERAL_META_FLAGS_BAZ, NULL); + test_nm_utils_enum_from_str_do (meta_flags, "foo, baz", TRUE, NM_TEST_GENERAL_META_FLAGS_FOO | + NM_TEST_GENERAL_META_FLAGS_BAZ, NULL); + test_nm_utils_enum_from_str_do (meta_flags, "foo,,bar", TRUE, NM_TEST_GENERAL_META_FLAGS_FOO | + NM_TEST_GENERAL_META_FLAGS_BAR, NULL); + test_nm_utils_enum_from_str_do (meta_flags, "foo,baz,quux,bar", FALSE, 0, "quux"); + + test_nm_utils_enum_from_str_do (color_flags, "green", TRUE, NM_TEST_GENERAL_COLOR_FLAGS_GREEN, NULL); + test_nm_utils_enum_from_str_do (color_flags, "blue,red", TRUE, NM_TEST_GENERAL_COLOR_FLAGS_BLUE | + NM_TEST_GENERAL_COLOR_FLAGS_RED, NULL); + test_nm_utils_enum_from_str_do (color_flags, "blue,white", FALSE, 0, "white"); + + test_nm_utils_enum_get_values_do (bool_enum, 0, G_MAXINT, "no,yes,maybe,unknown"); + test_nm_utils_enum_get_values_do (bool_enum, NM_TEST_GENERAL_BOOL_ENUM_YES, + NM_TEST_GENERAL_BOOL_ENUM_MAYBE, "yes,maybe"); + test_nm_utils_enum_get_values_do (meta_flags, 0, G_MAXINT, "none,foo,bar,baz"); + test_nm_utils_enum_get_values_do (color_flags, 0, G_MAXINT, "blue,red,green"); +} + /******************************************************************************/ static int @@ -4540,81 +4895,6 @@ test_nm_in_set (void) /******************************************************************************/ -static void -test_nm_utils_enum_from_str_do (GType type, const char *str, - gboolean exp_result, int exp_flags, - const char *exp_err_token) -{ - int flags = 1; - char *err_token = NULL; - gboolean result; - - result = nm_utils_enum_from_str (type, str, &flags, &err_token); - - g_assert (result == exp_result); - g_assert_cmpint (flags, ==, exp_flags); - g_assert_cmpstr (err_token, ==, exp_err_token); - - g_free (err_token); -} - -static void -test_nm_utils_enum_to_str_do (GType type, int flags, const char *exp_str) -{ - char *str; - - str = nm_utils_enum_to_str (type, flags); - g_assert_cmpstr (str, ==, exp_str); - g_free (str); -} - -static void test_nm_utils_enum (void) -{ - GType bool_enum = nm_test_general_bool_enum_get_type(); - GType meta_flags = nm_test_general_meta_flags_get_type(); - GType color_flags = nm_test_general_color_flags_get_type(); - - test_nm_utils_enum_to_str_do (bool_enum, NM_TEST_GENERAL_BOOL_ENUM_YES, "yes"); - test_nm_utils_enum_to_str_do (bool_enum, NM_TEST_GENERAL_BOOL_ENUM_UNKNOWN, "unknown"); - test_nm_utils_enum_to_str_do (bool_enum, NM_TEST_GENERAL_BOOL_ENUM_INVALID, NULL); - - test_nm_utils_enum_to_str_do (meta_flags, NM_TEST_GENERAL_META_FLAGS_NONE, ""); - test_nm_utils_enum_to_str_do (meta_flags, NM_TEST_GENERAL_META_FLAGS_BAZ, "baz"); - test_nm_utils_enum_to_str_do (meta_flags, NM_TEST_GENERAL_META_FLAGS_FOO | - NM_TEST_GENERAL_META_FLAGS_BAR | - NM_TEST_GENERAL_META_FLAGS_BAZ, "foo, bar, baz"); - - test_nm_utils_enum_to_str_do (color_flags, NM_TEST_GENERAL_COLOR_FLAGS_RED, "red"); - test_nm_utils_enum_to_str_do (color_flags, NM_TEST_GENERAL_COLOR_FLAGS_WHITE, ""); - test_nm_utils_enum_to_str_do (color_flags, NM_TEST_GENERAL_COLOR_FLAGS_RED | - NM_TEST_GENERAL_COLOR_FLAGS_GREEN, "red, green"); - - test_nm_utils_enum_from_str_do (bool_enum, "", FALSE, 0, NULL); - test_nm_utils_enum_from_str_do (bool_enum, " ", FALSE, 0, NULL); - test_nm_utils_enum_from_str_do (bool_enum, "invalid", FALSE, 0, NULL); - test_nm_utils_enum_from_str_do (bool_enum, "yes", TRUE, NM_TEST_GENERAL_BOOL_ENUM_YES, NULL); - test_nm_utils_enum_from_str_do (bool_enum, "no", TRUE, NM_TEST_GENERAL_BOOL_ENUM_NO, NULL); - test_nm_utils_enum_from_str_do (bool_enum, "yes,no", FALSE, 0, NULL); - - test_nm_utils_enum_from_str_do (meta_flags, "", TRUE, 0, NULL); - test_nm_utils_enum_from_str_do (meta_flags, " ", TRUE, 0, NULL); - test_nm_utils_enum_from_str_do (meta_flags, "foo", TRUE, NM_TEST_GENERAL_META_FLAGS_FOO, NULL); - test_nm_utils_enum_from_str_do (meta_flags, "foo,baz", TRUE, NM_TEST_GENERAL_META_FLAGS_FOO | - NM_TEST_GENERAL_META_FLAGS_BAZ, NULL); - test_nm_utils_enum_from_str_do (meta_flags, "foo, baz", TRUE, NM_TEST_GENERAL_META_FLAGS_FOO | - NM_TEST_GENERAL_META_FLAGS_BAZ, NULL); - test_nm_utils_enum_from_str_do (meta_flags, "foo,,bar", TRUE, NM_TEST_GENERAL_META_FLAGS_FOO | - NM_TEST_GENERAL_META_FLAGS_BAR, NULL); - test_nm_utils_enum_from_str_do (meta_flags, "foo,baz,quux,bar", FALSE, 0, "quux"); - - test_nm_utils_enum_from_str_do (color_flags, "green", TRUE, NM_TEST_GENERAL_COLOR_FLAGS_GREEN, NULL); - test_nm_utils_enum_from_str_do (color_flags, "blue,red", TRUE, NM_TEST_GENERAL_COLOR_FLAGS_BLUE | - NM_TEST_GENERAL_COLOR_FLAGS_RED, NULL); - test_nm_utils_enum_from_str_do (color_flags, "blue,white", FALSE, 0, "white"); -} - -/******************************************************************************/ - NMTST_DEFINE (); int main (int argc, char **argv) @@ -4632,6 +4912,7 @@ int main (int argc, char **argv) g_test_add_func ("/core/general/test_setting_gsm_apn_bad_chars", test_setting_gsm_apn_bad_chars); g_test_add_func ("/core/general/test_setting_gsm_apn_underscore", test_setting_gsm_apn_underscore); g_test_add_func ("/core/general/test_setting_gsm_without_number", test_setting_gsm_without_number); + g_test_add_func ("/core/general/test_setting_gsm_sim_operator_id", test_setting_gsm_sim_operator_id); g_test_add_func ("/core/general/test_setting_to_dbus_all", test_setting_to_dbus_all); g_test_add_func ("/core/general/test_setting_to_dbus_no_secrets", test_setting_to_dbus_no_secrets); g_test_add_func ("/core/general/test_setting_to_dbus_only_secrets", test_setting_to_dbus_only_secrets); @@ -4710,6 +4991,7 @@ int main (int argc, char **argv) g_test_add_func ("/core/general/test_setting_802_1x_changed_signal", test_setting_802_1x_changed_signal); g_test_add_func ("/core/general/test_setting_ip4_gateway", test_setting_ip4_gateway); g_test_add_func ("/core/general/test_setting_ip6_gateway", test_setting_ip6_gateway); + g_test_add_func ("/core/general/test_setting_compare_default_strv", test_setting_compare_default_strv); g_test_add_func ("/core/general/hexstr2bin", test_hexstr2bin); g_test_add_func ("/core/general/test_nm_utils_uuid_generate_from_string", test_nm_utils_uuid_generate_from_string); @@ -4718,7 +5000,12 @@ int main (int argc, char **argv) g_test_add_func ("/core/general/_nm_utils_ascii_str_to_int64", test_nm_utils_ascii_str_to_int64); g_test_add_func ("/core/general/nm_utils_is_power_of_two", test_nm_utils_is_power_of_two); g_test_add_func ("/core/general/_glib_compat_g_ptr_array_insert", test_g_ptr_array_insert); + g_test_add_func ("/core/general/_glib_compat_g_hash_table_get_keys_as_array", test_g_hash_table_get_keys_as_array); g_test_add_func ("/core/general/_nm_utils_ptrarray_find_binary_search", test_nm_utils_ptrarray_find_binary_search); + g_test_add_func ("/core/general/_nm_utils_strstrdictkey", test_nm_utils_strstrdictkey); + + g_test_add_func ("/core/general/_nm_utils_dns_option_validate", test_nm_utils_dns_option_validate); + g_test_add_func ("/core/general/_nm_utils_dns_option_find_idx", test_nm_utils_dns_option_find_idx); g_test_add_func ("/core/general/test_nm_utils_enum", test_nm_utils_enum); diff --git a/libnm-core/tests/test-secrets.c b/libnm-core/tests/test-secrets.c index 178fddd5..4c0c7f5d 100644 --- a/libnm-core/tests/test-secrets.c +++ b/libnm-core/tests/test-secrets.c @@ -21,9 +21,9 @@ #include "config.h" -#include #include +#include "nm-default.h" #include "nm-setting-8021x.h" #include "nm-setting-cdma.h" #include "nm-setting-connection.h" diff --git a/libnm-core/tests/test-setting-8021x.c b/libnm-core/tests/test-setting-8021x.c index 16f6016e..49d7448e 100644 --- a/libnm-core/tests/test-setting-8021x.c +++ b/libnm-core/tests/test-setting-8021x.c @@ -21,11 +21,11 @@ #include "config.h" -#include #include #include +#include "nm-default.h" #include "nm-setting-connection.h" #include "nm-setting-8021x.h" diff --git a/libnm-core/tests/test-setting-dcb.c b/libnm-core/tests/test-setting-dcb.c index f7554e81..f8b789c1 100644 --- a/libnm-core/tests/test-setting-dcb.c +++ b/libnm-core/tests/test-setting-dcb.c @@ -21,14 +21,14 @@ #include "config.h" -#include #include #include -#include +#include "nm-default.h" #include "nm-setting-dcb.h" #include "nm-connection.h" #include "nm-errors.h" -#include "gsystem-local-alloc.h" + +#include "nm-test-utils.h" #define DCB_FLAGS_ALL (NM_SETTING_DCB_FLAG_ENABLE | \ NM_SETTING_DCB_FLAG_ADVERTISE | \ @@ -303,18 +303,12 @@ test_dcb_bandwidth_sums (void) #define TPATH "/libnm/settings/dcb/" +NMTST_DEFINE (); + int main (int argc, char **argv) { - g_test_init (&argc, &argv, NULL); - -#if !GLIB_CHECK_VERSION (2, 35, 0) - g_type_init (); -#endif - -#if !GLIB_CHECK_VERSION(2,34,0) - g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL); -#endif + nmtst_init (&argc, &argv, TRUE); g_test_add_func (TPATH "flags-valid", test_dcb_flags_valid); g_test_add_func (TPATH "flags-invalid", test_dcb_flags_invalid); diff --git a/libnm-core/tests/test-settings-defaults.c b/libnm-core/tests/test-settings-defaults.c index 7d7715cb..21e16f3d 100644 --- a/libnm-core/tests/test-settings-defaults.c +++ b/libnm-core/tests/test-settings-defaults.c @@ -21,11 +21,11 @@ #include "config.h" -#include #include #include +#include "nm-default.h" #include "nm-setting-8021x.h" #include "nm-setting-cdma.h" #include "nm-setting-connection.h" diff --git a/libnm-glib/Makefile.am b/libnm-glib/Makefile.am index f131c467..676b0671 100644 --- a/libnm-glib/Makefile.am +++ b/libnm-glib/Makefile.am @@ -3,11 +3,12 @@ include $(GLIB_MAKEFILE) SUBDIRS = . tests AM_CPPFLAGS = \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ + -I$(top_srcdir)/shared \ + -I$(top_builddir)/shared \ -I$(top_srcdir)/libnm-util \ -I$(top_builddir)/libnm-util \ -DG_LOG_DOMAIN=\""libnm-glib"\" \ + -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY \ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) diff --git a/libnm-glib/Makefile.in b/libnm-glib/Makefile.in index 26e9f4ee..25a9f7c0 100644 --- a/libnm-glib/Makefile.in +++ b/libnm-glib/Makefile.in @@ -345,7 +345,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -357,8 +356,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -368,6 +365,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -422,16 +420,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -468,6 +463,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -496,7 +493,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -511,6 +507,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -571,6 +569,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -578,6 +577,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -595,11 +595,12 @@ with_resolvconf = @with_resolvconf@ with_valgrind = @with_valgrind@ SUBDIRS = . tests AM_CPPFLAGS = \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ + -I$(top_srcdir)/shared \ + -I$(top_builddir)/shared \ -I$(top_srcdir)/libnm-util \ -I$(top_builddir)/libnm-util \ -DG_LOG_DOMAIN=\""libnm-glib"\" \ + -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY \ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) diff --git a/libnm-glib/libnm-glib-test.c b/libnm-glib/libnm-glib-test.c index 7dc6823e..9c8085d3 100644 --- a/libnm-glib/libnm-glib-test.c +++ b/libnm-glib/libnm-glib-test.c @@ -30,10 +30,13 @@ #include #include + +#include "nm-default.h" #include "nm-client.h" #include "nm-device.h" #include "nm-device-ethernet.h" #include "nm-device-wifi.h" +#include "nm-device-generic.h" #include "nm-utils.h" #include "nm-active-connection.h" #include "nm-vpn-connection.h" @@ -209,6 +212,12 @@ dump_wireless (NMDeviceWifi *device) } } +static void +dump_generic (NMDeviceGeneric *device) +{ + g_print ("HW address: %s\n", nm_device_generic_get_hw_address (device)); +} + static void dump_wired (NMDeviceEthernet *device) { @@ -251,6 +260,8 @@ dump_device (NMDevice *device) dump_wired (NM_DEVICE_ETHERNET (device)); else if (NM_IS_DEVICE_WIFI (device)) dump_wireless (NM_DEVICE_WIFI (device)); + else if (NM_IS_DEVICE_GENERIC (device)) + dump_generic (NM_DEVICE_GENERIC (device)); dump_dhcp4_config (nm_device_get_dhcp4_config (device)); } @@ -392,9 +403,7 @@ main (int argc, char *argv[]) { NMClient *client; -#if !GLIB_CHECK_VERSION (2, 35, 0) - g_type_init (); -#endif + nm_g_type_init (); client = nm_client_new (); if (!client) { diff --git a/libnm-glib/libnm-glib.ver b/libnm-glib/libnm-glib.ver index dc982e56..bce31b0b 100644 --- a/libnm-glib/libnm-glib.ver +++ b/libnm-glib/libnm-glib.ver @@ -47,6 +47,7 @@ global: nm_client_error_quark; nm_client_get_activating_connection; nm_client_get_active_connections; + nm_client_get_all_devices; nm_client_get_connectivity; nm_client_get_device_by_iface; nm_client_get_device_by_path; @@ -158,6 +159,7 @@ global: nm_device_infiniband_get_hw_address; nm_device_infiniband_get_type; nm_device_infiniband_new; + nm_device_is_real; nm_device_is_software; nm_device_modem_error_get_type; nm_device_modem_error_quark; @@ -173,6 +175,7 @@ global: nm_device_olpc_mesh_get_type; nm_device_olpc_mesh_new; nm_device_set_autoconnect; + nm_device_set_managed; nm_device_team_error_get_type; nm_device_team_error_quark; nm_device_team_get_carrier; diff --git a/libnm-glib/libnm_glib.c b/libnm-glib/libnm_glib.c index fed80160..09d9bea9 100644 --- a/libnm-glib/libnm_glib.c +++ b/libnm-glib/libnm_glib.c @@ -26,9 +26,9 @@ #include #include #include -#include #include #include +#include "nm-default.h" #include "NetworkManager.h" #include "libnm_glib.h" @@ -495,9 +495,7 @@ libnm_glib_init (void) { libnm_glib_ctx *ctx = NULL; -#if !GLIB_CHECK_VERSION (2, 35, 0) - g_type_init (); -#endif + nm_g_type_init (); if (!g_thread_supported ()) g_thread_init (NULL); diff --git a/libnm-glib/nm-access-point.c b/libnm-glib/nm-access-point.c index b980943a..3a420ea1 100644 --- a/libnm-glib/nm-access-point.c +++ b/libnm-glib/nm-access-point.c @@ -24,14 +24,13 @@ #include #include -#include "nm-glib-compat.h" - #include #include #include #include #include +#include "nm-default.h" #include "nm-access-point.h" #include "NetworkManager.h" #include "nm-types-private.h" @@ -53,7 +52,7 @@ typedef struct { NM80211Mode mode; guint32 max_bitrate; guint8 strength; - gint32 last_seen; + gint last_seen; } NMAccessPointPrivate; enum { @@ -277,9 +276,9 @@ nm_access_point_get_strength (NMAccessPoint *ap) * * Returns: the last seen time in seconds * - * Since: 1.0.6 + * Since: 1.2 **/ -gint32 +gint nm_access_point_get_last_seen (NMAccessPoint *ap) { g_return_val_if_fail (NM_IS_ACCESS_POINT (ap), -1); @@ -707,7 +706,7 @@ nm_access_point_class_init (NMAccessPointClass *ap_class) * access point was found in scan results. A value of -1 means the * access point has not been found in a scan. * - * Since: 1.0.6 + * Since: 1.2 **/ g_object_class_install_property (object_class, PROP_LAST_SEEN, diff --git a/libnm-glib/nm-access-point.h b/libnm-glib/nm-access-point.h index 57bd6ed1..7ea8f812 100644 --- a/libnm-glib/nm-access-point.h +++ b/libnm-glib/nm-access-point.h @@ -81,8 +81,8 @@ guint32 nm_access_point_get_frequency (NMAccessPoint *ap); NM80211Mode nm_access_point_get_mode (NMAccessPoint *ap); guint32 nm_access_point_get_max_bitrate (NMAccessPoint *ap); guint8 nm_access_point_get_strength (NMAccessPoint *ap); -NM_AVAILABLE_IN_1_0_6 -gint32 nm_access_point_get_last_seen (NMAccessPoint *ap); +NM_AVAILABLE_IN_1_2 +gint nm_access_point_get_last_seen (NMAccessPoint *ap); GSList * nm_access_point_filter_connections (NMAccessPoint *ap, const GSList *connections); diff --git a/libnm-glib/nm-active-connection.c b/libnm-glib/nm-active-connection.c index 7067a110..539eb75f 100644 --- a/libnm-glib/nm-active-connection.c +++ b/libnm-glib/nm-active-connection.c @@ -23,6 +23,7 @@ #include +#include "nm-default.h" #include "NetworkManager.h" #include "nm-active-connection.h" #include "nm-object-private.h" @@ -31,7 +32,6 @@ #include "nm-device-private.h" #include "nm-connection.h" #include "nm-vpn-connection.h" -#include "nm-glib-compat.h" #include "nm-dbus-helpers-private.h" static GType _nm_active_connection_type_for_path (DBusGConnection *connection, @@ -120,7 +120,7 @@ _nm_active_connection_type_for_path (DBusGConnection *connection, GValue value = G_VALUE_INIT; GType type; - proxy = _nm_dbus_new_proxy_for_connection (connection, path, "org.freedesktop.DBus.Properties"); + proxy = _nm_dbus_new_proxy_for_connection (connection, path, DBUS_INTERFACE_PROPERTIES); if (!proxy) { g_warning ("%s: couldn't create D-Bus object proxy.", __func__); return G_TYPE_INVALID; @@ -197,7 +197,7 @@ _nm_active_connection_type_for_path_async (DBusGConnection *connection, async_data->callback = callback; async_data->user_data = user_data; - proxy = _nm_dbus_new_proxy_for_connection (connection, path, "org.freedesktop.DBus.Properties"); + proxy = _nm_dbus_new_proxy_for_connection (connection, path, DBUS_INTERFACE_PROPERTIES); dbus_g_proxy_begin_call (proxy, "Get", async_got_type, async_data, NULL, G_TYPE_STRING, NM_DBUS_INTERFACE_ACTIVE_CONNECTION, diff --git a/libnm-glib/nm-client.c b/libnm-glib/nm-client.c index 40add09c..248b9d97 100644 --- a/libnm-glib/nm-client.c +++ b/libnm-glib/nm-client.c @@ -25,6 +25,7 @@ #include #include +#include "nm-default.h" #include "nm-client.h" #include "nm-device-ethernet.h" #include "nm-device-wifi.h" @@ -35,7 +36,6 @@ #include "nm-vpn-connection.h" #include "nm-object-cache.h" #include "nm-dbus-glib-types.h" -#include "nm-glib-compat.h" void _nm_device_wifi_set_wireless_enabled (NMDeviceWifi *device, gboolean enabled); @@ -59,6 +59,7 @@ typedef struct { NMState state; gboolean startup; GPtrArray *devices; + GPtrArray *all_devices; GPtrArray *active_connections; NMConnectivityState connectivity; NMActiveConnection *primary_connection; @@ -101,6 +102,7 @@ enum { PROP_PRIMARY_CONNECTION, PROP_ACTIVATING_CONNECTION, PROP_DEVICES, + PROP_ALL_DEVICES, LAST_PROP }; @@ -108,6 +110,8 @@ enum { enum { DEVICE_ADDED, DEVICE_REMOVED, + ANY_DEVICE_ADDED, + ANY_DEVICE_REMOVED, PERMISSION_CHANGED, LAST_SIGNAL @@ -160,8 +164,8 @@ poke_wireless_devices_with_rf_status (NMClient *client) NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (client); int i; - for (i = 0; priv->devices && (i < priv->devices->len); i++) { - NMDevice *device = g_ptr_array_index (priv->devices, i); + for (i = 0; priv->all_devices && (i < priv->all_devices->len); i++) { + NMDevice *device = g_ptr_array_index (priv->all_devices, i); if (NM_IS_DEVICE_WIFI (device)) _nm_device_wifi_set_wireless_enabled (NM_DEVICE_WIFI (device), priv->wireless_enabled); @@ -194,6 +198,7 @@ register_properties (NMClient *client) { NM_CLIENT_PRIMARY_CONNECTION, &priv->primary_connection, NULL, NM_TYPE_ACTIVE_CONNECTION }, { NM_CLIENT_ACTIVATING_CONNECTION, &priv->activating_connection, NULL, NM_TYPE_ACTIVE_CONNECTION }, { NM_CLIENT_DEVICES, &priv->devices, NULL, NM_TYPE_DEVICE, "device" }, + { NM_CLIENT_ALL_DEVICES, &priv->all_devices, NULL, NM_TYPE_DEVICE, "any-device" }, { NULL }, }; @@ -378,6 +383,34 @@ nm_client_get_devices (NMClient *client) return handle_ptr_array_return (NM_CLIENT_GET_PRIVATE (client)->devices); } +/** + * nm_client_get_all_devices: + * @client: a #NMClient + * + * Gets both real devices and device placeholders (eg, software devices which + * do not currently exist, but could be created automatically by NetworkManager + * if one of their NMDevice::ActivatableConnections was activated). Use + * nm_device_is_real() to determine whether each device is a real device or + * a placeholder. + * + * Use nm_device_get_type() or the NM_IS_DEVICE_XXXX() functions to determine + * what kind of device each member of the returned array is, and then you may + * use device-specific methods such as nm_device_ethernet_get_hw_address(). + * + * Returns: (transfer none) (element-type NMDevice): a #GPtrArray + * containing all the #NMDevices. The returned array is owned by the + * #NMClient object and should not be modified. + * + * Since: 1.2 + **/ +const GPtrArray * +nm_client_get_all_devices (NMClient *client) +{ + g_return_val_if_fail (NM_IS_CLIENT (client), NULL); + + return NM_CLIENT_GET_PRIVATE (client)->all_devices; +} + /** * nm_client_get_device_by_path: * @client: a #NMClient @@ -1291,25 +1324,55 @@ nm_client_get_activating_connection (NMClient *client) /****************************************************************/ static void -free_devices (NMClient *client, gboolean emit_signals) +free_devices (NMClient *client, gboolean in_dispose) { NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (client); - GPtrArray *devices; - NMDevice *device; - int i; + gs_unref_ptrarray GPtrArray *real_devices = NULL; + gs_unref_ptrarray GPtrArray *all_devices = NULL; + GPtrArray *devices = NULL; + guint i, j; - if (!priv->devices) - return; + real_devices = priv->devices; + all_devices = priv->all_devices; - devices = priv->devices; - priv->devices = NULL; - for (i = 0; i < devices->len; i++) { - device = devices->pdata[i]; - if (emit_signals) - g_signal_emit (client, signals[DEVICE_REMOVED], 0, device); - g_object_unref (device); + if (in_dispose) { + priv->devices = NULL; + priv->all_devices = NULL; + } else { + priv->devices = g_ptr_array_new (); + priv->all_devices = g_ptr_array_new (); + } + + if (all_devices && all_devices->len > 0) + devices = all_devices; + else if (devices && devices->len > 0) + devices = real_devices; + + if (real_devices && devices != real_devices) { + for (i = 0; i < real_devices->len; i++) { + NMDevice *d = real_devices->pdata[i]; + + if (all_devices) { + for (j = 0; j < all_devices->len; j++) { + if (d == all_devices->pdata[j]) + goto next; + } + } + if (!in_dispose) + g_signal_emit (client, signals[DEVICE_REMOVED], 0, d); +next: + g_object_unref (d); + } + } + if (devices) { + for (i = 0; i < devices->len; i++) { + NMDevice *d = devices->pdata[i]; + + if (!in_dispose) + g_signal_emit (client, signals[DEVICE_REMOVED], 0, d); + g_object_unref (d); + } } - g_ptr_array_free (devices, TRUE); } static void @@ -1382,7 +1445,7 @@ proxy_name_owner_changed (DBusGProxy *proxy, _nm_object_queue_notify (NM_OBJECT (client), NM_CLIENT_MANAGER_RUNNING); _nm_object_suppress_property_updates (NM_OBJECT (client), TRUE); poke_wireless_devices_with_rf_status (client); - free_devices (client, TRUE); + free_devices (client, FALSE); free_active_connections (client, TRUE); update_permissions (client, NULL); priv->wireless_enabled = FALSE; @@ -1798,23 +1861,19 @@ constructed (GObject *object) object, NULL); - if (_nm_object_is_connection_private (NM_OBJECT (object))) - priv->manager_running = TRUE; - else { - priv->bus_proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (NM_OBJECT (object)), - DBUS_SERVICE_DBUS, - DBUS_PATH_DBUS, - DBUS_INTERFACE_DBUS); - g_assert (priv->bus_proxy); - - dbus_g_proxy_add_signal (priv->bus_proxy, "NameOwnerChanged", - G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, - G_TYPE_INVALID); - dbus_g_proxy_connect_signal (priv->bus_proxy, - "NameOwnerChanged", - G_CALLBACK (proxy_name_owner_changed), - object, NULL); - } + priv->bus_proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (NM_OBJECT (object)), + DBUS_SERVICE_DBUS, + DBUS_PATH_DBUS, + DBUS_INTERFACE_DBUS); + g_assert (priv->bus_proxy); + + dbus_g_proxy_add_signal (priv->bus_proxy, "NameOwnerChanged", + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->bus_proxy, + "NameOwnerChanged", + G_CALLBACK (proxy_name_owner_changed), + object, NULL); g_signal_connect (object, "notify::" NM_CLIENT_WIRELESS_ENABLED, G_CALLBACK (wireless_enabled_cb), NULL); @@ -1835,15 +1894,13 @@ init_sync (GInitable *initable, GCancellable *cancellable, GError **error) if (!nm_client_parent_initable_iface->init (initable, cancellable, error)) return FALSE; - if (!_nm_object_is_connection_private (NM_OBJECT (client))) { - if (!dbus_g_proxy_call (priv->bus_proxy, - "NameHasOwner", error, - G_TYPE_STRING, NM_DBUS_SERVICE, - G_TYPE_INVALID, - G_TYPE_BOOLEAN, &priv->manager_running, - G_TYPE_INVALID)) - return FALSE; - } + if (!dbus_g_proxy_call (priv->bus_proxy, + "NameHasOwner", error, + G_TYPE_STRING, NM_DBUS_SERVICE, + G_TYPE_INVALID, + G_TYPE_BOOLEAN, &priv->manager_running, + G_TYPE_INVALID)) + return FALSE; if (priv->manager_running && !get_permissions_sync (client, error)) return FALSE; @@ -1953,16 +2010,12 @@ init_async (GAsyncInitable *initable, int io_priority, user_data, init_async); g_simple_async_result_set_op_res_gboolean (init_data->result, TRUE); - if (_nm_object_is_connection_private (NM_OBJECT (init_data->client))) - finish_init (init_data); - else { - /* Check if NM is running */ - dbus_g_proxy_begin_call (priv->bus_proxy, "NameHasOwner", - init_async_got_manager_running, - init_data, NULL, - G_TYPE_STRING, NM_DBUS_SERVICE, - G_TYPE_INVALID); - } + /* Check if NM is running */ + dbus_g_proxy_begin_call (priv->bus_proxy, "NameHasOwner", + init_async_got_manager_running, + init_data, NULL, + G_TYPE_STRING, NM_DBUS_SERVICE, + G_TYPE_INVALID); } static gboolean @@ -1990,7 +2043,7 @@ dispose (GObject *object) g_clear_object (&priv->client_proxy); g_clear_object (&priv->bus_proxy); - free_devices (client, FALSE); + free_devices (client, TRUE); free_active_connections (client, FALSE); g_clear_object (&priv->primary_connection); g_clear_object (&priv->activating_connection); @@ -2116,6 +2169,9 @@ get_property (GObject *object, case PROP_DEVICES: g_value_set_boxed (value, nm_client_get_devices (self)); break; + case PROP_ALL_DEVICES: + g_value_set_boxed (value, nm_client_get_all_devices (self)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -2333,7 +2389,7 @@ nm_client_class_init (NMClientClass *client_class) /** * NMClient:devices: * - * List of known network devices. + * List of real network devices. Does not include placeholder devices. * * Since: 0.9.10 **/ @@ -2344,6 +2400,20 @@ nm_client_class_init (NMClientClass *client_class) G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + /** + * NMClient:all-devices: + * + * List of both real devices and device placeholders. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_ALL_DEVICES, + g_param_spec_boxed (NM_CLIENT_ALL_DEVICES, "", "", + NM_TYPE_OBJECT_ARRAY, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + /* signals */ /** @@ -2351,7 +2421,8 @@ nm_client_class_init (NMClientClass *client_class) * @client: the client that received the signal * @device: (type NMDevice): the new device * - * Notifies that a #NMDevice is added. + * Notifies that a #NMDevice is added. This signal is not emitted for + * placeholder devices. **/ signals[DEVICE_ADDED] = g_signal_new ("device-added", @@ -2367,7 +2438,8 @@ nm_client_class_init (NMClientClass *client_class) * @client: the client that received the signal * @device: (type NMDevice): the removed device * - * Notifies that a #NMDevice is removed. + * Notifies that a #NMDevice is removed. This signal is not emitted for + * placeholder devices. **/ signals[DEVICE_REMOVED] = g_signal_new ("device-removed", @@ -2378,6 +2450,38 @@ nm_client_class_init (NMClientClass *client_class) G_TYPE_NONE, 1, G_TYPE_OBJECT); + /** + * NMClient::any-device-added: + * @client: the client that received the signal + * @device: (type NMDevice): the new device + * + * Notifies that a #NMDevice is added. This signal is emitted for both + * regular devices and placeholder devices. + **/ + signals[ANY_DEVICE_ADDED] = + g_signal_new ("any-device-added", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + 0, NULL, NULL, NULL, + G_TYPE_NONE, 1, + G_TYPE_OBJECT); + + /** + * NMClient::any-device-removed: + * @client: the client that received the signal + * @device: (type NMDevice): the removed device + * + * Notifies that a #NMDevice is removed. This signal is emitted for both + * regular devices and placeholder devices. + **/ + signals[ANY_DEVICE_REMOVED] = + g_signal_new ("any-device-removed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + 0, NULL, NULL, NULL, + G_TYPE_NONE, 1, + G_TYPE_OBJECT); + /** * NMClient::permission-changed: * @client: the client that received the signal diff --git a/libnm-glib/nm-client.h b/libnm-glib/nm-client.h index ffe513cb..39af321e 100644 --- a/libnm-glib/nm-client.h +++ b/libnm-glib/nm-client.h @@ -57,6 +57,7 @@ G_BEGIN_DECLS #define NM_CLIENT_PRIMARY_CONNECTION "primary-connection" #define NM_CLIENT_ACTIVATING_CONNECTION "activating-connection" #define NM_CLIENT_DEVICES "devices" +#define NM_CLIENT_ALL_DEVICES "all-devices" /** * NMClientPermission: @@ -175,6 +176,8 @@ NMClient *nm_client_new_finish (GAsyncResult *result, GError **error); const GPtrArray *nm_client_get_devices (NMClient *client); +NM_AVAILABLE_IN_1_2 +const GPtrArray *nm_client_get_all_devices(NMClient *client); NMDevice *nm_client_get_device_by_path (NMClient *client, const char *object_path); NMDevice *nm_client_get_device_by_iface (NMClient *client, const char *iface); diff --git a/libnm-glib/nm-dbus-helpers-private.h b/libnm-glib/nm-dbus-helpers-private.h index 8a350e78..c78bf1da 100644 --- a/libnm-glib/nm-dbus-helpers-private.h +++ b/libnm-glib/nm-dbus-helpers-private.h @@ -21,13 +21,12 @@ #ifndef NM_DBUS_HELPERS_PRIVATE_H #define NM_DBUS_HELPERS_PRIVATE_H -#include #include #include -DBusGConnection *_nm_dbus_new_connection (GError **error); +#include "nm-default.h" -gboolean _nm_dbus_is_connection_private (DBusGConnection *connection); +DBusGConnection *_nm_dbus_new_connection (GError **error); DBusGProxy * _nm_dbus_new_proxy_for_connection (DBusGConnection *connection, const char *path, diff --git a/libnm-glib/nm-dbus-helpers.c b/libnm-glib/nm-dbus-helpers.c index 00e04ab4..db75eb24 100644 --- a/libnm-glib/nm-dbus-helpers.c +++ b/libnm-glib/nm-dbus-helpers.c @@ -21,80 +21,27 @@ #include "config.h" #include -#include #include #include +#include "nm-default.h" #include "nm-dbus-helpers-private.h" #include "NetworkManager.h" -static dbus_int32_t priv_slot = -1; - -static gboolean -_ensure_dbus_data_slot (void) -{ - static gsize init_value = 0; - gboolean success = TRUE; - - if (g_once_init_enter (&init_value)) { - success = dbus_connection_allocate_data_slot (&priv_slot); - g_once_init_leave (&init_value, 1); - } - return success; -} - DBusGConnection * _nm_dbus_new_connection (GError **error) { DBusGConnection *connection = NULL; - if (!_ensure_dbus_data_slot ()) { - g_set_error (error, DBUS_GERROR, DBUS_GERROR_FAILED, "failed to allocated data slot"); - return NULL; - } - -#if HAVE_DBUS_GLIB_100 - /* If running as root try the private bus first */ - if (0 == geteuid ()) { - connection = dbus_g_connection_open ("unix:path=" NMRUNDIR "/private", error); - if (connection) { - DBusConnection *dbus_connection = dbus_g_connection_get_connection (connection); - - /* Mark this connection as private */ - dbus_connection_set_data (dbus_connection, priv_slot, GUINT_TO_POINTER (TRUE), NULL); - dbus_connection_set_exit_on_disconnect (dbus_connection, FALSE); - return connection; - } - /* Fall back to a bus if for some reason private socket isn't available */ - g_clear_error (error); - } -#endif - if (connection == NULL) connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, error); return connection; } -gboolean -_nm_dbus_is_connection_private (DBusGConnection *connection) -{ - if (!_ensure_dbus_data_slot ()) - return FALSE; - return !!dbus_connection_get_data (dbus_g_connection_get_connection (connection), priv_slot); -} - DBusGProxy * _nm_dbus_new_proxy_for_connection (DBusGConnection *connection, const char *path, const char *interface) { - /* Private connections can't use dbus_g_proxy_new_for_name() or - * dbus_g_proxy_new_for_name_owner() because peer-to-peer connections don't - * have either a bus daemon or name owners, both of which those functions - * require. - */ - if (_nm_dbus_is_connection_private (connection)) - return dbus_g_proxy_new_for_peer (connection, path, interface); - return dbus_g_proxy_new_for_name (connection, NM_DBUS_SERVICE, path, interface); } diff --git a/libnm-glib/nm-device-bond.c b/libnm-glib/nm-device-bond.c index 786d4f16..12df490f 100644 --- a/libnm-glib/nm-device-bond.c +++ b/libnm-glib/nm-device-bond.c @@ -23,12 +23,11 @@ #include #include -#include "nm-glib-compat.h" - #include #include #include +#include "nm-default.h" #include "nm-device-bond.h" #include "nm-device-private.h" #include "nm-object-private.h" diff --git a/libnm-glib/nm-device-bridge.c b/libnm-glib/nm-device-bridge.c index ef69fb26..d08104d1 100644 --- a/libnm-glib/nm-device-bridge.c +++ b/libnm-glib/nm-device-bridge.c @@ -23,12 +23,11 @@ #include #include -#include "nm-glib-compat.h" - #include #include #include +#include "nm-default.h" #include "nm-device-bridge.h" #include "nm-device-private.h" #include "nm-object-private.h" diff --git a/libnm-glib/nm-device-bt.c b/libnm-glib/nm-device-bt.c index 58d48344..3d7d183b 100644 --- a/libnm-glib/nm-device-bt.c +++ b/libnm-glib/nm-device-bt.c @@ -24,11 +24,10 @@ #include #include -#include "nm-glib-compat.h" - #include #include +#include "nm-default.h" #include "nm-device-bt.h" #include "nm-device-private.h" #include "nm-object-private.h" diff --git a/libnm-glib/nm-device-ethernet.c b/libnm-glib/nm-device-ethernet.c index d27a980f..b5914616 100644 --- a/libnm-glib/nm-device-ethernet.c +++ b/libnm-glib/nm-device-ethernet.c @@ -24,12 +24,11 @@ #include #include -#include "nm-glib-compat.h" - #include #include #include +#include "nm-default.h" #include "nm-device-ethernet.h" #include "nm-device-private.h" #include "nm-object-private.h" diff --git a/libnm-glib/nm-device-generic.c b/libnm-glib/nm-device-generic.c index a17a6735..a7b2fa04 100644 --- a/libnm-glib/nm-device-generic.c +++ b/libnm-glib/nm-device-generic.c @@ -184,15 +184,41 @@ register_properties (NMDeviceGeneric *device) property_info); } +static const char * +_device_type_to_interface (NMDeviceType type) +{ + switch (type) { + case NM_DEVICE_TYPE_GENERIC: + return NM_DBUS_INTERFACE_DEVICE_GENERIC; + case NM_DEVICE_TYPE_TUN: + return NM_DBUS_INTERFACE_DEVICE_TUN; + default: + return NULL; + } +} + static void constructed (GObject *object) { NMDeviceGenericPrivate *priv = NM_DEVICE_GENERIC_GET_PRIVATE (object); + NMDeviceType type; + DBusGConnection *connection; + const char *path, *interface; G_OBJECT_CLASS (nm_device_generic_parent_class)->constructed (object); - priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE_GENERIC); - register_properties (NM_DEVICE_GENERIC (object)); + g_object_get (object, + NM_OBJECT_DBUS_CONNECTION, &connection, + NM_OBJECT_DBUS_PATH, &path, + NULL); + + type = _nm_device_type_for_path (connection, path); + interface = _device_type_to_interface (type); + + if (interface) { + priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, interface); + register_properties (NM_DEVICE_GENERIC (object)); + } } static void diff --git a/libnm-glib/nm-device-infiniband.c b/libnm-glib/nm-device-infiniband.c index 663b3651..b9af8879 100644 --- a/libnm-glib/nm-device-infiniband.c +++ b/libnm-glib/nm-device-infiniband.c @@ -24,12 +24,11 @@ #include #include -#include "nm-glib-compat.h" - #include #include #include +#include "nm-default.h" #include "nm-device-infiniband.h" #include "nm-device-private.h" #include "nm-object-private.h" diff --git a/libnm-glib/nm-device-modem.c b/libnm-glib/nm-device-modem.c index 524d86ce..88c15dd7 100644 --- a/libnm-glib/nm-device-modem.c +++ b/libnm-glib/nm-device-modem.c @@ -23,12 +23,11 @@ #include -#include "nm-glib-compat.h" - #include #include #include +#include "nm-default.h" #include "nm-device-modem.h" #include "nm-device-private.h" #include "nm-object-private.h" diff --git a/libnm-glib/nm-device-olpc-mesh.c b/libnm-glib/nm-device-olpc-mesh.c index e68fda62..69acce45 100644 --- a/libnm-glib/nm-device-olpc-mesh.c +++ b/libnm-glib/nm-device-olpc-mesh.c @@ -22,11 +22,10 @@ #include -#include "nm-glib-compat.h" - #include #include +#include "nm-default.h" #include "nm-device-olpc-mesh.h" #include "nm-device-private.h" #include "nm-object-private.h" diff --git a/libnm-glib/nm-device-private.h b/libnm-glib/nm-device-private.h index 82d676f9..1a29c97d 100644 --- a/libnm-glib/nm-device-private.h +++ b/libnm-glib/nm-device-private.h @@ -22,5 +22,6 @@ #define NM_DEVICE_PRIVATE_H void _nm_device_set_device_type (NMDevice *device, NMDeviceType dtype); +NMDeviceType _nm_device_type_for_path (DBusGConnection *connection, const char *path); #endif /* NM_DEVICE_PRIVATE_H */ diff --git a/libnm-glib/nm-device-team.c b/libnm-glib/nm-device-team.c index d9a5fce0..e7622962 100644 --- a/libnm-glib/nm-device-team.c +++ b/libnm-glib/nm-device-team.c @@ -23,12 +23,11 @@ #include #include -#include "nm-glib-compat.h" - #include #include #include +#include "nm-default.h" #include "nm-device-team.h" #include "nm-device-private.h" #include "nm-object-private.h" diff --git a/libnm-glib/nm-device-vlan.c b/libnm-glib/nm-device-vlan.c index 26c234bd..fe3db03a 100644 --- a/libnm-glib/nm-device-vlan.c +++ b/libnm-glib/nm-device-vlan.c @@ -23,12 +23,11 @@ #include #include -#include "nm-glib-compat.h" - #include #include #include +#include "nm-default.h" #include "nm-device-vlan.h" #include "nm-device-private.h" #include "nm-object-private.h" diff --git a/libnm-glib/nm-device-wifi.c b/libnm-glib/nm-device-wifi.c index 28609c79..05b47b4d 100644 --- a/libnm-glib/nm-device-wifi.c +++ b/libnm-glib/nm-device-wifi.c @@ -24,12 +24,11 @@ #include #include -#include "nm-glib-compat.h" - #include #include #include +#include "nm-default.h" #include "nm-device-wifi.h" #include "nm-device-private.h" #include "nm-object-private.h" diff --git a/libnm-glib/nm-device-wimax.c b/libnm-glib/nm-device-wimax.c index f0187fdc..70c8b14e 100644 --- a/libnm-glib/nm-device-wimax.c +++ b/libnm-glib/nm-device-wimax.c @@ -24,11 +24,10 @@ #include #include -#include "nm-glib-compat.h" - #include #include +#include "nm-default.h" #include "nm-device-wimax.h" #include "nm-object-private.h" #include "nm-object-cache.h" @@ -84,6 +83,8 @@ static guint signals[LAST_SIGNAL] = { 0 }; * Registers an error quark for #NMDeviceWimax if necessary. * * Returns: the error quark used for #NMDeviceWimax errors. + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ GQuark nm_device_wimax_error_quark (void) @@ -103,6 +104,8 @@ nm_device_wimax_error_quark (void) * Creates a new #NMDeviceWimax. * * Returns: (transfer full): a new WiMAX device + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ GObject * nm_device_wimax_new (DBusGConnection *connection, const char *path) @@ -128,6 +131,8 @@ nm_device_wimax_new (DBusGConnection *connection, const char *path) * * Returns: the hardware address. This is the internal string used by the * device, and must not be modified. + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ const char * nm_device_wimax_get_hw_address (NMDeviceWimax *wimax) @@ -145,6 +150,8 @@ nm_device_wimax_get_hw_address (NMDeviceWimax *wimax) * Gets the active #NMWimaxNsp. * * Returns: (transfer full): the access point or %NULL if none is active + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ NMWimaxNsp * nm_device_wimax_get_active_nsp (NMDeviceWimax *wimax) @@ -182,6 +189,8 @@ nm_device_wimax_get_active_nsp (NMDeviceWimax *wimax) * Returns: (element-type NMWimaxNsp): a #GPtrArray containing * all the scanned #NMWimaxNsps. * The returned array is owned by the client and should not be modified. + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ const GPtrArray * nm_device_wimax_get_nsps (NMDeviceWimax *wimax) @@ -200,6 +209,8 @@ nm_device_wimax_get_nsps (NMDeviceWimax *wimax) * Gets a #NMWimaxNsp by path. * * Returns: (transfer none): the access point or %NULL if none is found. + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ NMWimaxNsp * nm_device_wimax_get_nsp_by_path (NMDeviceWimax *wimax, @@ -264,6 +275,8 @@ clean_up_nsps (NMDeviceWimax *self, gboolean notify) * device is not connected. * * Returns: the center frequency in KHz, or 0 + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ guint nm_device_wimax_get_center_frequency (NMDeviceWimax *self) @@ -284,6 +297,8 @@ nm_device_wimax_get_center_frequency (NMDeviceWimax *self) * device is not connected. * * Returns: the RSSI in dBm, or 0 + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ gint nm_device_wimax_get_rssi (NMDeviceWimax *self) @@ -303,6 +318,8 @@ nm_device_wimax_get_rssi (NMDeviceWimax *self) * meaning when the device is not connected. * * Returns: the CINR in dB, or 0 + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ gint nm_device_wimax_get_cinr (NMDeviceWimax *self) @@ -322,6 +339,8 @@ nm_device_wimax_get_cinr (NMDeviceWimax *self) * -5.5 dBm. Has no meaning when the device is not connected. * * Returns: the TX power in dBm, or 0 + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ gint nm_device_wimax_get_tx_power (NMDeviceWimax *self) @@ -339,6 +358,8 @@ nm_device_wimax_get_tx_power (NMDeviceWimax *self) * Gets the ID of the serving Base Station when the device is connected. * * Returns: the ID of the serving Base Station, or %NULL + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ const char * nm_device_wimax_get_bsid (NMDeviceWimax *self) @@ -614,6 +635,8 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class) * NMDeviceWimax:hw-address: * * The hardware (MAC) address of the device. + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ g_object_class_install_property (object_class, PROP_HW_ADDRESS, @@ -626,6 +649,8 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class) * NMDeviceWimax:active-nsp: * * The active #NMWimaxNsp of the device. + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ g_object_class_install_property (object_class, PROP_ACTIVE_NSP, @@ -640,6 +665,8 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class) * The center frequency (in KHz) of the radio channel the device is using to * communicate with the network when connected. Has no meaning when the * device is not connected. + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ g_object_class_install_property (object_class, PROP_CENTER_FREQ, @@ -655,6 +682,8 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class) * the raw received RF signal from the base station is, but does not * indicate the overall quality of the radio link. Has no meaning when the * device is not connected. + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ g_object_class_install_property (object_class, PROP_RSSI, @@ -669,6 +698,8 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class) * CINR (Carrier to Interference + Noise Ratio) of the current radio link * in dB. CINR is a more accurate measure of radio link quality. Has no * meaning when the device is not connected. + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ g_object_class_install_property (object_class, PROP_CINR, @@ -683,6 +714,8 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class) * Average power of the last burst transmitted by the device, in units of * 0.5 dBm. i.e. a TxPower of -11 represents an actual device TX power of * -5.5 dBm. Has no meaning when the device is not connected. + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ g_object_class_install_property (object_class, PROP_TX_POWER, @@ -696,6 +729,8 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class) * * The ID of the serving base station as received from the network. Has * no meaning when the device is not connected. + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ g_object_class_install_property (object_class, PROP_BSID, @@ -710,6 +745,7 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class) * List of all WiMAX Network Service Providers the device can see. * * Since: 0.9.10 + * Deprecated: 1.2: WiMAX is no longer supported. **/ g_object_class_install_property (object_class, PROP_NSPS, @@ -726,6 +762,8 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class) * @nsp: the new NSP * * Notifies that a #NMWimaxNsp is added to the wimax device. + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ signals[NSP_ADDED] = g_signal_new ("nsp-added", @@ -743,6 +781,8 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class) * @nsp: the removed NSP * * Notifies that a #NMWimaxNsp is removed from the wimax device. + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ signals[NSP_REMOVED] = g_signal_new ("nsp-removed", diff --git a/libnm-glib/nm-device-wimax.h b/libnm-glib/nm-device-wimax.h index 1b889d95..24e46348 100644 --- a/libnm-glib/nm-device-wimax.h +++ b/libnm-glib/nm-device-wimax.h @@ -51,6 +51,7 @@ typedef enum { } NMDeviceWimaxError; #define NM_DEVICE_WIMAX_ERROR nm_device_wimax_error_quark () +NM_DEPRECATED_IN_1_2 GQuark nm_device_wimax_error_quark (void); #define NM_DEVICE_WIMAX_HW_ADDRESS "hw-address" @@ -74,22 +75,33 @@ typedef struct { void (*nsp_removed) (NMDeviceWimax *self, NMWimaxNsp *nsp); } NMDeviceWimaxClass; +NM_DEPRECATED_IN_1_2 GType nm_device_wimax_get_type (void); +NM_DEPRECATED_IN_1_2 GObject *nm_device_wimax_new (DBusGConnection *connection, const char *path); +NM_DEPRECATED_IN_1_2 const char *nm_device_wimax_get_hw_address (NMDeviceWimax *wimax); +NM_DEPRECATED_IN_1_2 NMWimaxNsp *nm_device_wimax_get_active_nsp (NMDeviceWimax *wimax); +NM_DEPRECATED_IN_1_2 NMWimaxNsp *nm_device_wimax_get_nsp_by_path (NMDeviceWimax *wimax, const char *path); +NM_DEPRECATED_IN_1_2 const GPtrArray *nm_device_wimax_get_nsps (NMDeviceWimax *wimax); +NM_DEPRECATED_IN_1_2 guint nm_device_wimax_get_center_frequency (NMDeviceWimax *self); +NM_DEPRECATED_IN_1_2 gint nm_device_wimax_get_rssi (NMDeviceWimax *self); +NM_DEPRECATED_IN_1_2 gint nm_device_wimax_get_cinr (NMDeviceWimax *self); +NM_DEPRECATED_IN_1_2 gint nm_device_wimax_get_tx_power (NMDeviceWimax *self); +NM_DEPRECATED_IN_1_2 const char * nm_device_wimax_get_bsid (NMDeviceWimax *self); G_END_DECLS diff --git a/libnm-glib/nm-device.c b/libnm-glib/nm-device.c index bd5d1637..b1f8cfb2 100644 --- a/libnm-glib/nm-device.c +++ b/libnm-glib/nm-device.c @@ -23,9 +23,9 @@ #include -#include #include +#include "nm-default.h" #include "NetworkManager.h" #include "nm-device-ethernet.h" #include "nm-device-adsl.h" @@ -47,21 +47,20 @@ #include "nm-remote-connection.h" #include "nm-types.h" #include "nm-dbus-glib-types.h" -#include "nm-glib-compat.h" #include "nm-utils.h" #include "nm-dbus-helpers-private.h" -static GType _nm_device_type_for_path (DBusGConnection *connection, - const char *path); -static void _nm_device_type_for_path_async (DBusGConnection *connection, - const char *path, - NMObjectTypeCallbackFunc callback, - gpointer user_data); +static GType _nm_device_gtype_for_path (DBusGConnection *connection, + const char *path); +static void _nm_device_gtype_for_path_async (DBusGConnection *connection, + const char *path, + NMObjectTypeCallbackFunc callback, + gpointer user_data); gboolean connection_compatible (NMDevice *device, NMConnection *connection, GError **error); G_DEFINE_TYPE_WITH_CODE (NMDevice, nm_device, NM_TYPE_OBJECT, - _nm_object_register_type_func (g_define_type_id, _nm_device_type_for_path, - _nm_device_type_for_path_async); + _nm_object_register_type_func (g_define_type_id, _nm_device_gtype_for_path, + _nm_device_gtype_for_path_async); ) #define DBUS_G_TYPE_UINT_STRUCT (dbus_g_type_get_struct ("GValueArray", G_TYPE_UINT, G_TYPE_UINT, G_TYPE_INVALID)) @@ -80,6 +79,7 @@ typedef struct { char *firmware_version; char *type_description; NMDeviceCapabilities capabilities; + gboolean real; gboolean managed; gboolean firmware_missing; gboolean autoconnect; @@ -111,6 +111,7 @@ enum { PROP_DRIVER_VERSION, PROP_FIRMWARE_VERSION, PROP_CAPABILITIES, + PROP_REAL, PROP_MANAGED, PROP_AUTOCONNECT, PROP_FIRMWARE_MISSING, @@ -197,6 +198,7 @@ register_properties (NMDevice *device) { NM_DEVICE_DRIVER_VERSION, &priv->driver_version }, { NM_DEVICE_FIRMWARE_VERSION, &priv->firmware_version }, { NM_DEVICE_CAPABILITIES, &priv->capabilities }, + { NM_DEVICE_REAL, &priv->real }, { NM_DEVICE_MANAGED, &priv->managed }, { NM_DEVICE_AUTOCONNECT, &priv->autoconnect }, { NM_DEVICE_FIRMWARE_MISSING, &priv->firmware_missing }, @@ -321,10 +323,12 @@ _nm_device_gtype_from_dtype (NMDeviceType dtype) case NM_DEVICE_TYPE_VLAN: return NM_TYPE_DEVICE_VLAN; case NM_DEVICE_TYPE_GENERIC: + case NM_DEVICE_TYPE_TUN: + case NM_DEVICE_TYPE_IP_TUNNEL: return NM_TYPE_DEVICE_GENERIC; default: - g_warning ("Unknown device type %d", dtype); - return G_TYPE_INVALID; + /* Fall back to NMDeviceGeneric for unknown devices */ + return NM_TYPE_DEVICE_GENERIC; } } @@ -445,6 +449,9 @@ get_property (GObject *object, case PROP_CAPABILITIES: g_value_set_uint (value, nm_device_get_capabilities (device)); break; + case PROP_REAL: + g_value_set_boolean (value, nm_device_is_real (device)); + break; case PROP_MANAGED: g_value_set_boolean (value, nm_device_get_managed (device)); break; @@ -516,6 +523,11 @@ set_property (GObject *object, /* Construct only */ priv->device_type = g_value_get_uint (value); break; + case PROP_MANAGED: + b = g_value_get_boolean (value); + if (priv->managed != b) + nm_device_set_managed (NM_DEVICE (object), b); + break; case PROP_AUTOCONNECT: b = g_value_get_boolean (value); if (priv->autoconnect != b) @@ -646,6 +658,22 @@ nm_device_class_init (NMDeviceClass *device_class) G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + /** + * NMDevice:real: + * + * Whether the device is real or is a placeholder device that could + * be created automatically by NetworkManager if one of its + * #NMDevice:available-connections was activated. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_REAL, + g_param_spec_boolean (NM_DEVICE_REAL, "", "", + FALSE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + /** * NMDevice:managed: * @@ -878,16 +906,14 @@ _nm_device_set_device_type (NMDevice *device, NMDeviceType dtype) g_warn_if_fail (dtype == priv->device_type); } -static GType -_nm_device_type_for_path (DBusGConnection *connection, - const char *path) +NMDeviceType +_nm_device_type_for_path (DBusGConnection *connection, const char *path) { DBusGProxy *proxy; GError *err = NULL; GValue value = G_VALUE_INIT; - NMDeviceType nm_dtype; - proxy = _nm_dbus_new_proxy_for_connection (connection, path, "org.freedesktop.DBus.Properties"); + proxy = _nm_dbus_new_proxy_for_connection (connection, path, DBUS_INTERFACE_PROPERTIES); if (!proxy) { g_warning ("%s: couldn't create D-Bus object proxy.", __func__); return G_TYPE_INVALID; @@ -906,8 +932,14 @@ _nm_device_type_for_path (DBusGConnection *connection, } g_object_unref (proxy); - nm_dtype = g_value_get_uint (&value); - return _nm_device_gtype_from_dtype (nm_dtype); + return g_value_get_uint (&value); +} + +static GType +_nm_device_gtype_for_path (DBusGConnection *connection, + const char *path) +{ + return _nm_device_gtype_from_dtype (_nm_device_type_for_path (connection, path)); } /** @@ -928,7 +960,7 @@ nm_device_new (DBusGConnection *connection, const char *path) g_return_val_if_fail (connection != NULL, NULL); g_return_val_if_fail (path != NULL, NULL); - dtype = _nm_device_type_for_path (connection, path); + dtype = _nm_device_gtype_for_path (connection, path); if (dtype == G_TYPE_INVALID) return NULL; @@ -974,7 +1006,7 @@ async_got_type (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data) } static void -_nm_device_type_for_path_async (DBusGConnection *connection, +_nm_device_gtype_for_path_async (DBusGConnection *connection, const char *path, NMObjectTypeCallbackFunc callback, gpointer user_data) @@ -987,7 +1019,7 @@ _nm_device_type_for_path_async (DBusGConnection *connection, async_data->callback = callback; async_data->user_data = user_data; - proxy = _nm_dbus_new_proxy_for_connection (connection, path, "org.freedesktop.DBus.Properties"); + proxy = _nm_dbus_new_proxy_for_connection (connection, path, DBUS_INTERFACE_PROPERTIES); dbus_g_proxy_begin_call (proxy, "Get", async_got_type, async_data, NULL, G_TYPE_STRING, NM_DBUS_INTERFACE_DEVICE, @@ -1214,6 +1246,35 @@ nm_device_get_managed (NMDevice *device) return NM_DEVICE_GET_PRIVATE (device)->managed; } +/** + * nm_device_set_managed: + * @device: a #NMDevice + * @managed: %TRUE to make the device managed by NetworkManager. + * + * Enables or disables management of #NMDevice by NetworkManager. + * + * Since: 1.2 + **/ +void +nm_device_set_managed (NMDevice *device, gboolean managed) +{ + GValue value = G_VALUE_INIT; + + g_return_if_fail (NM_IS_DEVICE (device)); + + managed = !!managed; + + g_value_init (&value, G_TYPE_BOOLEAN); + g_value_set_boolean (&value, managed); + + NM_DEVICE_GET_PRIVATE (device)->managed = managed; + + _nm_object_set_property (NM_OBJECT (device), + NM_DBUS_INTERFACE_DEVICE, + "Managed", + &value); +} + /** * nm_device_get_autoconnect: * @device: a #NMDevice @@ -2066,6 +2127,25 @@ nm_device_get_mtu (NMDevice *device) return NM_DEVICE_GET_PRIVATE (device)->mtu; } +/** + * nm_device_is_real: + * @device: a #NMDevice + * + * Returns: %TRUE if the device exists, or %FALSE if it is a placeholder device + * that could be automatically created by NetworkManager if one of its + * #NMDevice:available-connections was activated. + * + * Since: 1.2 + **/ +gboolean +nm_device_is_real (NMDevice *device) +{ + g_return_val_if_fail (NM_IS_DEVICE (device), FALSE); + + _nm_object_ensure_inited (NM_OBJECT (device)); + return NM_DEVICE_GET_PRIVATE (device)->real; +} + /** * nm_device_is_software: * @device: a #NMDevice diff --git a/libnm-glib/nm-device.h b/libnm-glib/nm-device.h index 707fddf8..d2d154dc 100644 --- a/libnm-glib/nm-device.h +++ b/libnm-glib/nm-device.h @@ -66,6 +66,7 @@ GQuark nm_device_error_quark (void); #define NM_DEVICE_DRIVER_VERSION "driver-version" #define NM_DEVICE_FIRMWARE_VERSION "firmware-version" #define NM_DEVICE_CAPABILITIES "capabilities" +#define NM_DEVICE_REAL "real" #define NM_DEVICE_MANAGED "managed" #define NM_DEVICE_AUTOCONNECT "autoconnect" #define NM_DEVICE_FIRMWARE_MISSING "firmware-missing" @@ -127,6 +128,8 @@ NM_AVAILABLE_IN_0_9_10 const char * nm_device_get_hw_address (NMDevice *device); NMDeviceCapabilities nm_device_get_capabilities (NMDevice *device); gboolean nm_device_get_managed (NMDevice *device); +NM_AVAILABLE_IN_1_2 +void nm_device_set_managed (NMDevice *device, gboolean managed); gboolean nm_device_get_autoconnect (NMDevice *device); void nm_device_set_autoconnect (NMDevice *device, gboolean autoconnect); gboolean nm_device_get_firmware_missing (NMDevice *device); @@ -144,6 +147,8 @@ NM_AVAILABLE_IN_0_9_10 guint32 nm_device_get_mtu (NMDevice *device); NM_AVAILABLE_IN_1_0 gboolean nm_device_is_software (NMDevice *device); +NM_AVAILABLE_IN_1_2 +gboolean nm_device_is_real (NMDevice *device); const char * nm_device_get_product (NMDevice *device); const char * nm_device_get_vendor (NMDevice *device); diff --git a/libnm-glib/nm-glib-enum-types.c b/libnm-glib/nm-glib-enum-types.c index 8e8b0ff9..f3030aa5 100644 --- a/libnm-glib/nm-glib-enum-types.c +++ b/libnm-glib/nm-glib-enum-types.c @@ -3,6 +3,8 @@ /* Generated by glib-mkenums. Do not edit */ +#include "config.h" + #include "nm-glib-enum-types.h" #include "nm-object.h" diff --git a/libnm-glib/nm-object-cache.c b/libnm-glib/nm-object-cache.c index 752c606a..82af1140 100644 --- a/libnm-glib/nm-object-cache.c +++ b/libnm-glib/nm-object-cache.c @@ -21,7 +21,7 @@ #include "config.h" #include -#include +#include "nm-default.h" #include "nm-object-cache.h" #include "nm-object.h" diff --git a/libnm-glib/nm-object-cache.h b/libnm-glib/nm-object-cache.h index 7aca3b4f..30b62f08 100644 --- a/libnm-glib/nm-object-cache.h +++ b/libnm-glib/nm-object-cache.h @@ -21,8 +21,7 @@ #ifndef NM_OBJECT_CACHE_H #define NM_OBJECT_CACHE_H -#include -#include +#include "nm-default.h" #include "nm-object.h" G_BEGIN_DECLS diff --git a/libnm-glib/nm-object-private.h b/libnm-glib/nm-object-private.h index 75e63b2e..8878354f 100644 --- a/libnm-glib/nm-object-private.h +++ b/libnm-glib/nm-object-private.h @@ -21,7 +21,7 @@ #ifndef NM_OBJECT_PRIVATE_H #define NM_OBJECT_PRIVATE_H -#include +#include "nm-default.h" #include "nm-object.h" void _nm_object_ensure_inited (NMObject *object); @@ -42,8 +42,6 @@ DBusGProxy *_nm_object_new_proxy (NMObject *self, const char *path, const char *interface); -gboolean _nm_object_is_connection_private (NMObject *self); - void _nm_object_register_properties (NMObject *object, DBusGProxy *proxy, const NMPropertiesInfo *info); diff --git a/libnm-glib/nm-object.c b/libnm-glib/nm-object.c index fb25c1ac..f2f46e01 100644 --- a/libnm-glib/nm-object.c +++ b/libnm-glib/nm-object.c @@ -22,16 +22,15 @@ #include "config.h" #include -#include #include #include #include +#include "nm-default.h" #include "NetworkManager.h" #include "nm-object.h" #include "nm-object-cache.h" #include "nm-object-private.h" #include "nm-dbus-glib-types.h" -#include "nm-glib-compat.h" #include "nm-types.h" #include "nm-dbus-helpers-private.h" @@ -59,7 +58,7 @@ typedef struct { const char *signal_prefix; } PropertyInfo; -static void reload_complete (NMObject *object); +static void reload_complete (NMObject *object, gboolean emit_now); typedef struct { DBusGConnection *connection; @@ -73,7 +72,7 @@ typedef struct { NMObject *parent; gboolean suppress_property_updates; - GSList *notify_props; + GSList *notify_items; guint32 notify_id; gboolean inited; @@ -115,6 +114,27 @@ nm_object_error_quark (void) return quark; } +typedef enum { + NOTIFY_SIGNAL_PENDING_NONE, + NOTIFY_SIGNAL_PENDING_ADDED, + NOTIFY_SIGNAL_PENDING_REMOVED, + NOTIFY_SIGNAL_PENDING_ADDED_REMOVED, +} NotifySignalPending; + +typedef struct { + const char *property; + const char *signal_prefix; + NotifySignalPending pending; + NMObject *changed; +} NotifyItem; + +static void +notify_item_free (NotifyItem *item) +{ + g_clear_object (&item->changed); + g_slice_free (NotifyItem, item); +} + static void proxy_name_owner_changed (DBusGProxy *proxy, const char *name, @@ -173,25 +193,21 @@ constructed (GObject *object) if (G_OBJECT_CLASS (nm_object_parent_class)->constructed) G_OBJECT_CLASS (nm_object_parent_class)->constructed (object); - priv->properties_proxy = _nm_object_new_proxy (self, NULL, "org.freedesktop.DBus.Properties"); - - if (_nm_object_is_connection_private (self)) - priv->nm_running = TRUE; - else { - priv->bus_proxy = dbus_g_proxy_new_for_name (priv->connection, - DBUS_SERVICE_DBUS, - DBUS_PATH_DBUS, - DBUS_INTERFACE_DBUS); - g_assert (priv->bus_proxy); - - dbus_g_proxy_add_signal (priv->bus_proxy, "NameOwnerChanged", - G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, - G_TYPE_INVALID); - dbus_g_proxy_connect_signal (priv->bus_proxy, - "NameOwnerChanged", - G_CALLBACK (proxy_name_owner_changed), - object, NULL); - } + priv->properties_proxy = _nm_object_new_proxy (self, NULL, DBUS_INTERFACE_PROPERTIES); + + priv->bus_proxy = dbus_g_proxy_new_for_name (priv->connection, + DBUS_SERVICE_DBUS, + DBUS_PATH_DBUS, + DBUS_INTERFACE_DBUS); + g_assert (priv->bus_proxy); + + dbus_g_proxy_add_signal (priv->bus_proxy, "NameOwnerChanged", + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->bus_proxy, + "NameOwnerChanged", + G_CALLBACK (proxy_name_owner_changed), + object, NULL); } static gboolean @@ -273,16 +289,12 @@ init_async (GAsyncInitable *initable, int io_priority, simple = g_simple_async_result_new (G_OBJECT (initable), callback, user_data, init_async); - if (_nm_object_is_connection_private (NM_OBJECT (initable))) - _nm_object_reload_properties_async (NM_OBJECT (initable), init_async_got_properties, simple); - else { - /* Check if NM is running */ - dbus_g_proxy_begin_call (priv->bus_proxy, "NameHasOwner", - init_async_got_manager_running, - simple, NULL, - G_TYPE_STRING, NM_DBUS_SERVICE, - G_TYPE_INVALID); - } + /* Check if NM is running */ + dbus_g_proxy_begin_call (priv->bus_proxy, "NameHasOwner", + init_async_got_manager_running, + simple, NULL, + G_TYPE_STRING, NM_DBUS_SERVICE, + G_TYPE_INVALID); } static gboolean @@ -306,8 +318,8 @@ dispose (GObject *object) priv->notify_id = 0; } - g_slist_free_full (priv->notify_props, g_free); - priv->notify_props = NULL; + g_slist_free_full (priv->notify_items, (GDestroyNotify) notify_item_free); + priv->notify_items = NULL; g_slist_free_full (priv->property_interfaces, g_free); priv->property_interfaces = NULL; @@ -493,52 +505,155 @@ deferred_notify_cb (gpointer data) { NMObject *object = NM_OBJECT (data); NMObjectPrivate *priv = NM_OBJECT_GET_PRIVATE (object); + NMObjectClass *object_class = NM_OBJECT_GET_CLASS (object); GSList *props, *iter; priv->notify_id = 0; - /* Clear priv->notify_props early so that an NMObject subclass that + /* Wait until all reloads are done before notifying */ + if (priv->reload_remaining) + return G_SOURCE_REMOVE; + + /* Clear priv->notify_items early so that an NMObject subclass that * listens to property changes can queue up other property changes * during the g_object_notify() call separately from the property * list we're iterating. */ - props = g_slist_reverse (priv->notify_props); - priv->notify_props = NULL; + props = g_slist_reverse (priv->notify_items); + priv->notify_items = NULL; g_object_ref (object); + + /* Emit property change notifications first */ for (iter = props; iter; iter = g_slist_next (iter)) { - g_object_notify (G_OBJECT (object), (const char *) iter->data); - g_free (iter->data); + NotifyItem *item = iter->data; + + if (item->property) + g_object_notify (G_OBJECT (object), item->property); + } + + /* And added/removed signals second */ + for (iter = props; iter; iter = g_slist_next (iter)) { + NotifyItem *item = iter->data; + char buf[50]; + gint ret = 0; + + switch (item->pending) { + case NOTIFY_SIGNAL_PENDING_ADDED: + ret = g_snprintf (buf, sizeof (buf), "%s-added", item->signal_prefix); + break; + case NOTIFY_SIGNAL_PENDING_REMOVED: + ret = g_snprintf (buf, sizeof (buf), "%s-removed", item->signal_prefix); + break; + case NOTIFY_SIGNAL_PENDING_ADDED_REMOVED: + // XXX + if (object_class->object_creation_failed) + object_class->object_creation_failed (object, NULL, g_strdup (nm_object_get_path (item->changed))); + break; + case NOTIFY_SIGNAL_PENDING_NONE: + default: + break; + } + if (ret > 0) { + g_assert (ret < sizeof (buf)); + g_signal_emit_by_name (object, buf, item->changed); + } } g_object_unref (object); - g_slist_free (props); - return FALSE; + g_slist_free_full (props, (GDestroyNotify) notify_item_free); + return G_SOURCE_REMOVE; } -void -_nm_object_queue_notify (NMObject *object, const char *property) +static void +_nm_object_defer_notify (NMObject *object) +{ + NMObjectPrivate *priv = NM_OBJECT_GET_PRIVATE (object); + + if (!priv->notify_id) + priv->notify_id = g_idle_add_full (G_PRIORITY_LOW, deferred_notify_cb, object, NULL); +} + +static void +_nm_object_queue_notify_full (NMObject *object, + const char *property, + const char *signal_prefix, + gboolean added, + NMObject *changed) { NMObjectPrivate *priv; - gboolean found = FALSE; + NotifyItem *item; GSList *iter; g_return_if_fail (NM_IS_OBJECT (object)); - g_return_if_fail (property != NULL); + g_return_if_fail (!signal_prefix != !property); + g_return_if_fail (!signal_prefix == !changed); priv = NM_OBJECT_GET_PRIVATE (object); - if (!priv->notify_id) - priv->notify_id = g_idle_add_full (G_PRIORITY_LOW, deferred_notify_cb, object, NULL); - - for (iter = priv->notify_props; iter; iter = g_slist_next (iter)) { - if (!strcmp ((char *) iter->data, property)) { - found = TRUE; - break; + _nm_object_defer_notify (object); + + property = g_intern_string (property); + signal_prefix = g_intern_string (signal_prefix); + for (iter = priv->notify_items; iter; iter = g_slist_next (iter)) { + item = iter->data; + + if (property && (property == item->property)) + return; + + /* Collapse signals for the same object (such as "added->removed") to + * ensure we don't emit signals when their sum should have no effect. + * The "added->removed->removed" sequence requires special handling, + * hence the addition of the ADDED_REMOVED state to ensure that no + * signal is emitted in this case: + * + * Without the ADDED_REMOVED state: + * NONE + added -> ADDED + * ADDED + removed -> NONE + * NONE + removed -> REMOVED (would emit 'removed' signal) + * + * With the ADDED_REMOVED state: + * NONE | ADDED_REMOVED + added -> ADDED + * ADDED + removed -> ADDED_REMOVED + * ADDED_REMOVED + removed -> ADDED_REMOVED (emits no signal) + */ + if (signal_prefix && (changed == item->changed) && (item->signal_prefix == signal_prefix)) { + switch (item->pending) { + case NOTIFY_SIGNAL_PENDING_ADDED: + if (!added) + item->pending = NOTIFY_SIGNAL_PENDING_ADDED_REMOVED; + break; + case NOTIFY_SIGNAL_PENDING_REMOVED: + if (added) + item->pending = NOTIFY_SIGNAL_PENDING_NONE; + break; + case NOTIFY_SIGNAL_PENDING_ADDED_REMOVED: + if (added) + item->pending = NOTIFY_SIGNAL_PENDING_ADDED; + break; + case NOTIFY_SIGNAL_PENDING_NONE: + item->pending = added ? NOTIFY_SIGNAL_PENDING_ADDED : NOTIFY_SIGNAL_PENDING_REMOVED; + break; + default: + g_assert_not_reached (); + } + return; } } - if (!found) - priv->notify_props = g_slist_prepend (priv->notify_props, g_strdup (property)); + item = g_slice_new0 (NotifyItem); + item->property = property; + if (signal_prefix) { + item->signal_prefix = signal_prefix; + item->pending = added ? NOTIFY_SIGNAL_PENDING_ADDED : NOTIFY_SIGNAL_PENDING_REMOVED; + item->changed = changed ? g_object_ref (changed) : NULL; + } + priv->notify_items = g_slist_prepend (priv->notify_items, item); +} + +void +_nm_object_queue_notify (NMObject *object, const char *property) +{ + _nm_object_queue_notify_full (object, property, NULL, FALSE, NULL); } void @@ -768,17 +883,12 @@ array_diff (GPtrArray *needles, GPtrArray *haystack, GPtrArray *diff) } static void -emit_added_removed_signal (NMObject *self, - const char *signal_prefix, - NMObject *changed, - gboolean added) +queue_added_removed_signal (NMObject *self, + const char *signal_prefix, + NMObject *changed, + gboolean added) { - char buf[50]; - int ret; - - ret = g_snprintf (buf, sizeof (buf), "%s-%s", signal_prefix, added ? "added" : "removed"); - g_assert (ret < sizeof (buf)); - g_signal_emit_by_name (self, buf, changed); + _nm_object_queue_notify_full (self, NULL, signal_prefix, added, changed); } static void @@ -818,17 +928,17 @@ object_property_complete (ObjectCreatedData *odata) /* Emit added & removed */ for (i = 0; i < removed->len; i++) { - emit_added_removed_signal (self, - pi->signal_prefix, - g_ptr_array_index (removed, i), - FALSE); + queue_added_removed_signal (self, + pi->signal_prefix, + g_ptr_array_index (removed, i), + FALSE); } for (i = 0; i < added->len; i++) { - emit_added_removed_signal (self, - pi->signal_prefix, - g_ptr_array_index (added, i), - TRUE); + queue_added_removed_signal (self, + pi->signal_prefix, + g_ptr_array_index (added, i), + TRUE); } different = removed->len || added->len; @@ -859,8 +969,8 @@ object_property_complete (ObjectCreatedData *odata) if (different && odata->property_name) _nm_object_queue_notify (self, odata->property_name); - if (priv->reload_results && --priv->reload_remaining == 0) - reload_complete (self); + if (--priv->reload_remaining == 0) + reload_complete (self, FALSE); g_object_unref (self); g_free (odata->objects); @@ -907,8 +1017,7 @@ handle_object_property (NMObject *self, const char *property_name, GValue *value odata->array = FALSE; odata->property_name = property_name; - if (priv->reload_results) - priv->reload_remaining++; + priv->reload_remaining++; path = g_value_get_boxed (value); @@ -955,8 +1064,7 @@ handle_object_array_property (NMObject *self, const char *property_name, GValue odata->array = TRUE; odata->property_name = property_name; - if (priv->reload_results) - priv->reload_remaining++; + priv->reload_remaining++; if (paths->len == 0) { object_property_complete (odata); @@ -1137,8 +1245,8 @@ demarshal_generic (NMObject *object, HANDLE_TYPE(DOUBLE, double, double) HANDLE_TYPE(INT, int, int) HANDLE_TYPE(UINT, uint, uint) - HANDLE_TYPE(INT64, int, int) - HANDLE_TYPE(UINT64, uint, uint) + HANDLE_TYPE(INT64, int64, int64) + HANDLE_TYPE(UINT64, uint64, uint64) HANDLE_TYPE(LONG, long, long) HANDLE_TYPE(ULONG, ulong, ulong) } else { @@ -1223,6 +1331,8 @@ _nm_object_reload_properties (NMObject *object, GError **error) if (!priv->property_interfaces || !priv->nm_running) return TRUE; + priv->reload_remaining++; + for (p = priv->property_interfaces; p; p = p->next) { if (!dbus_g_proxy_call (priv->properties_proxy, "GetAll", error, G_TYPE_STRING, p->data, @@ -1235,6 +1345,9 @@ _nm_object_reload_properties (NMObject *object, GError **error) g_hash_table_destroy (props); } + if (--priv->reload_remaining == 0) + reload_complete (object, TRUE); + return TRUE; } @@ -1331,13 +1444,22 @@ _nm_object_set_property (NMObject *object, } static void -reload_complete (NMObject *object) +reload_complete (NMObject *object, gboolean emit_now) { NMObjectPrivate *priv = NM_OBJECT_GET_PRIVATE (object); GSimpleAsyncResult *simple; GSList *results, *iter; GError *error; + if (emit_now) { + if (priv->notify_id) { + g_source_remove (priv->notify_id); + priv->notify_id = 0; + } + deferred_notify_cb (object); + } else + _nm_object_defer_notify (object); + results = priv->reload_results; priv->reload_results = NULL; error = priv->reload_error; @@ -1380,7 +1502,7 @@ reload_got_properties (DBusGProxy *proxy, DBusGProxyCall *call, } if (--priv->reload_remaining == 0) - reload_complete (object); + reload_complete (object, FALSE); } void @@ -1439,9 +1561,3 @@ _nm_object_new_proxy (NMObject *self, const char *path, const char *interface) return _nm_dbus_new_proxy_for_connection (priv->connection, path ? path : priv->path, interface); } - -gboolean -_nm_object_is_connection_private (NMObject *self) -{ - return _nm_dbus_is_connection_private (NM_OBJECT_GET_PRIVATE (self)->connection); -} diff --git a/libnm-glib/nm-remote-connection.c b/libnm-glib/nm-remote-connection.c index 3a70e81e..4298129b 100644 --- a/libnm-glib/nm-remote-connection.c +++ b/libnm-glib/nm-remote-connection.c @@ -22,17 +22,15 @@ #include "config.h" #include -#include -#include #include #include #include +#include "nm-default.h" #include "nm-remote-connection.h" #include "nm-remote-connection-private.h" #include "nm-object-private.h" #include "nm-dbus-glib-types.h" -#include "nm-glib-compat.h" #include "nm-dbus-helpers-private.h" #define NM_REMOTE_CONNECTION_BUS "bus" @@ -498,6 +496,9 @@ updated_get_settings_cb (DBusGProxy *proxy, priv->visible = FALSE; g_signal_emit (self, signals[VISIBLE], 0, FALSE); } else { + gs_unref_object NMConnection *self_alive = NULL; + + self_alive = g_object_ref (self); replace_settings (self, new_settings); g_hash_table_destroy (new_settings); @@ -620,6 +621,7 @@ init_sync (GInitable *initable, GCancellable *cancellable, GError **error) { NMRemoteConnectionPrivate *priv = NM_REMOTE_CONNECTION_GET_PRIVATE (initable); GHashTable *hash; + gs_unref_object NMConnection *self_alive = NULL; if (!dbus_g_proxy_call (priv->proxy, "GetSettings", error, G_TYPE_INVALID, @@ -627,6 +629,7 @@ init_sync (GInitable *initable, GCancellable *cancellable, GError **error) G_TYPE_INVALID)) return FALSE; priv->visible = TRUE; + self_alive = g_object_ref (initable); replace_settings (NM_REMOTE_CONNECTION (initable), hash); g_hash_table_destroy (hash); @@ -690,6 +693,7 @@ init_get_settings_cb (DBusGProxy *proxy, NMRemoteConnectionPrivate *priv = NM_REMOTE_CONNECTION_GET_PRIVATE (init_data->connection); GHashTable *settings; GError *error = NULL; + gs_unref_object NMConnection *self_alive = NULL; dbus_g_proxy_end_call (proxy, call, &error, DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT, &settings, @@ -700,6 +704,7 @@ init_get_settings_cb (DBusGProxy *proxy, } priv->visible = TRUE; + self_alive = g_object_ref (init_data->connection); replace_settings (init_data->connection, settings); g_hash_table_destroy (settings); diff --git a/libnm-glib/nm-remote-settings.c b/libnm-glib/nm-remote-settings.c index 80a274f5..421f7030 100644 --- a/libnm-glib/nm-remote-settings.c +++ b/libnm-glib/nm-remote-settings.c @@ -25,12 +25,12 @@ #include #include +#include "nm-default.h" #include "nm-dbus-glib-types.h" #include "nm-remote-settings.h" #include "nm-remote-connection-private.h" #include "nm-object-private.h" #include "nm-dbus-helpers-private.h" -#include "nm-glib-compat.h" #include "nm-object-private.h" /** @@ -132,7 +132,6 @@ G_DEFINE_TYPE_WITH_CODE (NMRemoteSettings, nm_remote_settings, G_TYPE_OBJECT, typedef struct { DBusGConnection *bus; - gboolean private_bus; gboolean inited; DBusGProxy *proxy; @@ -1177,26 +1176,24 @@ constructed (GObject *object) priv = NM_REMOTE_SETTINGS_GET_PRIVATE (object); - if (priv->private_bus == FALSE) { - /* D-Bus proxy for clearing connections on NameOwnerChanged */ - priv->dbus_proxy = dbus_g_proxy_new_for_name (priv->bus, - DBUS_SERVICE_DBUS, - DBUS_PATH_DBUS, - DBUS_INTERFACE_DBUS); - g_assert (priv->dbus_proxy); - - dbus_g_object_register_marshaller (g_cclosure_marshal_generic, - G_TYPE_NONE, - G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, - G_TYPE_INVALID); - dbus_g_proxy_add_signal (priv->dbus_proxy, "NameOwnerChanged", - G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, - G_TYPE_INVALID); - dbus_g_proxy_connect_signal (priv->dbus_proxy, - "NameOwnerChanged", - G_CALLBACK (name_owner_changed), - object, NULL); - } + /* D-Bus proxy for clearing connections on NameOwnerChanged */ + priv->dbus_proxy = dbus_g_proxy_new_for_name (priv->bus, + DBUS_SERVICE_DBUS, + DBUS_PATH_DBUS, + DBUS_INTERFACE_DBUS); + g_assert (priv->dbus_proxy); + + dbus_g_object_register_marshaller (g_cclosure_marshal_generic, + G_TYPE_NONE, + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_INVALID); + dbus_g_proxy_add_signal (priv->dbus_proxy, "NameOwnerChanged", + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->dbus_proxy, + "NameOwnerChanged", + G_CALLBACK (name_owner_changed), + object, NULL); priv->proxy = _nm_dbus_new_proxy_for_connection (priv->bus, NM_DBUS_PATH_SETTINGS, @@ -1215,7 +1212,7 @@ constructed (GObject *object) /* D-Bus properties proxy */ priv->props_proxy = _nm_dbus_new_proxy_for_connection (priv->bus, NM_DBUS_PATH_SETTINGS, - "org.freedesktop.DBus.Properties"); + DBUS_INTERFACE_PROPERTIES); g_assert (priv->props_proxy); /* Monitor properties */ @@ -1239,23 +1236,20 @@ init_sync (GInitable *initable, GCancellable *cancellable, GError **error) NMRemoteSettingsPrivate *priv = NM_REMOTE_SETTINGS_GET_PRIVATE (settings); GHashTable *props; - if (priv->private_bus == FALSE) { - if (!dbus_g_proxy_call (priv->dbus_proxy, "NameHasOwner", error, - G_TYPE_STRING, NM_DBUS_SERVICE, - G_TYPE_INVALID, - G_TYPE_BOOLEAN, &priv->service_running, - G_TYPE_INVALID)) { - priv->service_running = FALSE; - return FALSE; - } + if (!dbus_g_proxy_call (priv->dbus_proxy, "NameHasOwner", error, + G_TYPE_STRING, NM_DBUS_SERVICE, + G_TYPE_INVALID, + G_TYPE_BOOLEAN, &priv->service_running, + G_TYPE_INVALID)) { + priv->service_running = FALSE; + return FALSE; + } - /* If NM isn't running we'll grab properties from name_owner_changed() - * when it starts. - */ - if (!priv->service_running) - return TRUE; - } else - priv->service_running = TRUE; + /* If NM isn't running we'll grab properties from name_owner_changed() + * when it starts. + */ + if (!priv->service_running) + return TRUE; priv->listcon_call = dbus_g_proxy_begin_call (priv->proxy, "ListConnections", fetch_connections_done, NM_REMOTE_SETTINGS (initable), NULL, @@ -1376,17 +1370,12 @@ init_async (GAsyncInitable *initable, int io_priority, init_data->result = g_simple_async_result_new (G_OBJECT (initable), callback, user_data, init_async); - if (priv->private_bus) { - priv->service_running = TRUE; - init_get_properties (init_data); - } else { - /* Check if NM is running */ - dbus_g_proxy_begin_call (priv->dbus_proxy, "NameHasOwner", - init_async_got_manager_running, - init_data, NULL, - G_TYPE_STRING, NM_DBUS_SERVICE, - G_TYPE_INVALID); - } + /* Check if NM is running */ + dbus_g_proxy_begin_call (priv->dbus_proxy, "NameHasOwner", + init_async_got_manager_running, + init_data, NULL, + G_TYPE_STRING, NM_DBUS_SERVICE, + G_TYPE_INVALID); } static gboolean @@ -1444,10 +1433,8 @@ set_property (GObject *object, guint prop_id, case PROP_BUS: /* Construct only */ priv->bus = g_value_dup_boxed (value); - if (!priv->bus) { + if (!priv->bus) priv->bus = _nm_dbus_new_connection (NULL); - priv->private_bus = _nm_dbus_is_connection_private (priv->bus); - } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); diff --git a/libnm-glib/nm-secret-agent.c b/libnm-glib/nm-secret-agent.c index 04f8dd8b..99871ad2 100644 --- a/libnm-glib/nm-secret-agent.c +++ b/libnm-glib/nm-secret-agent.c @@ -23,7 +23,7 @@ #include #include -#include "nm-glib-compat.h" +#include "nm-default.h" #include "NetworkManager.h" #include "nm-secret-agent.h" #include "nm-glib-enum-types.h" @@ -65,7 +65,6 @@ typedef struct { NMSecretAgentCapabilities capabilities; DBusGConnection *bus; - gboolean private_bus; DBusGProxy *dbus_proxy; DBusGProxy *manager_proxy; DBusGProxyCall *reg_call; @@ -227,12 +226,6 @@ verify_sender (NMSecretAgent *self, g_return_val_if_fail (context != NULL, FALSE); - /* Private bus connection is always to NetworkManager, which is always - * UID 0. - */ - if (priv->private_bus) - return TRUE; - /* Verify the sender's UID is 0, and that the sender is the same as * NetworkManager's bus name owner. */ @@ -626,7 +619,7 @@ nm_secret_agent_register (NMSecretAgent *self) g_return_val_if_fail (class->save_secrets != NULL, FALSE); g_return_val_if_fail (class->delete_secrets != NULL, FALSE); - if (!priv->nm_owner && !priv->private_bus) + if (!priv->nm_owner) return FALSE; priv->suppress_auto = FALSE; @@ -671,7 +664,7 @@ nm_secret_agent_unregister (NMSecretAgent *self) g_return_val_if_fail (priv->bus != NULL, FALSE); g_return_val_if_fail (priv->manager_proxy != NULL, FALSE); - if (!priv->nm_owner && !priv->private_bus) + if (!priv->nm_owner) return FALSE; dbus_g_proxy_call_no_reply (priv->manager_proxy, "Unregister", G_TYPE_INVALID); @@ -853,29 +846,26 @@ nm_secret_agent_init (NMSecretAgent *self) g_error_free (error); return; } - priv->private_bus = _nm_dbus_is_connection_private (priv->bus); - - if (priv->private_bus == FALSE) { - priv->dbus_proxy = dbus_g_proxy_new_for_name (priv->bus, - DBUS_SERVICE_DBUS, - DBUS_PATH_DBUS, - DBUS_INTERFACE_DBUS); - g_assert (priv->dbus_proxy); - - dbus_g_object_register_marshaller (g_cclosure_marshal_generic, - G_TYPE_NONE, - G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, - G_TYPE_INVALID); - dbus_g_proxy_add_signal (priv->dbus_proxy, "NameOwnerChanged", - G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, - G_TYPE_INVALID); - dbus_g_proxy_connect_signal (priv->dbus_proxy, - "NameOwnerChanged", - G_CALLBACK (name_owner_changed), - self, NULL); - - get_nm_owner (self); - } + + priv->dbus_proxy = dbus_g_proxy_new_for_name (priv->bus, + DBUS_SERVICE_DBUS, + DBUS_PATH_DBUS, + DBUS_INTERFACE_DBUS); + g_assert (priv->dbus_proxy); + + dbus_g_object_register_marshaller (g_cclosure_marshal_generic, + G_TYPE_NONE, + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_INVALID); + dbus_g_proxy_add_signal (priv->dbus_proxy, "NameOwnerChanged", + G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_INVALID); + dbus_g_proxy_connect_signal (priv->dbus_proxy, + "NameOwnerChanged", + G_CALLBACK (name_owner_changed), + self, NULL); + + get_nm_owner (self); priv->manager_proxy = _nm_dbus_new_proxy_for_connection (priv->bus, NM_DBUS_PATH_AGENT_MANAGER, @@ -885,7 +875,7 @@ nm_secret_agent_init (NMSecretAgent *self) return; } - if (priv->nm_owner || priv->private_bus) + if (priv->nm_owner) priv->auto_register_id = g_idle_add (auto_register_cb, self); } diff --git a/libnm-glib/nm-types.c b/libnm-glib/nm-types.c index 5b434aa9..30936f4e 100644 --- a/libnm-glib/nm-types.c +++ b/libnm-glib/nm-types.c @@ -20,9 +20,9 @@ #include "config.h" -#include #include #include +#include "nm-default.h" #include "nm-types.h" #include "nm-types-private.h" #include "nm-object-private.h" diff --git a/libnm-glib/nm-vpn-enum-types.c b/libnm-glib/nm-vpn-enum-types.c index 45418518..e47f38da 100644 --- a/libnm-glib/nm-vpn-enum-types.c +++ b/libnm-glib/nm-vpn-enum-types.c @@ -3,6 +3,8 @@ /* Generated by glib-mkenums. Do not edit */ +#include "config.h" + #include "nm-vpn-enum-types.h" #include "nm-vpn-plugin.h" diff --git a/libnm-glib/nm-vpn-plugin-ui-interface.h b/libnm-glib/nm-vpn-plugin-ui-interface.h index 9c6e49eb..e671e6cf 100644 --- a/libnm-glib/nm-vpn-plugin-ui-interface.h +++ b/libnm-glib/nm-vpn-plugin-ui-interface.h @@ -224,6 +224,52 @@ gboolean nm_vpn_plugin_ui_widget_interface_save_secrets (NMVpnPluginUiWidgetInte NMConnection *connection, GError **error); + +#ifdef NM_VPN_LIBNM_COMPAT +#define nm_vpn_editor_plugin_factory nm_vpn_plugin_ui_factory + +#define NM_TYPE_VPN_EDITOR_PLUGIN NM_TYPE_VPN_PLUGIN_UI_INTERFACE +#define NM_VPN_EDITOR_PLUGIN(obj) NM_VPN_PLUGIN_UI_INTERFACE(obj) +#define NM_IS_VPN_EDITOR_PLUGIN(obj) NM_IS_VPN_PLUGIN_UI_INTERFACE(obj) +#define NM_VPN_EDITOR_PLUGIN_GET_INTERFACE(obj) NM_VPN_PLUGIN_UI_INTERFACE_GET_INTERFACE(obj) + +#define NMVpnEditorPluginCapability NMVpnPluginUiCapability +#define NM_VPN_EDITOR_PLUGIN_CAPABILITY_NONE NM_VPN_PLUGIN_UI_CAPABILITY_NONE +#define NM_VPN_EDITOR_PLUGIN_CAPABILITY_IMPORT NM_VPN_PLUGIN_UI_CAPABILITY_IMPORT +#define NM_VPN_EDITOR_PLUGIN_CAPABILITY_EXPORT NM_VPN_PLUGIN_UI_CAPABILITY_EXPORT +#define NM_VPN_EDITOR_PLUGIN_CAPABILITY_IPV6 NM_VPN_PLUGIN_UI_CAPABILITY_IPV6 + +#define NM_VPN_EDITOR_PLUGIN_NAME NM_VPN_PLUGIN_UI_INTERFACE_NAME +#define NM_VPN_EDITOR_PLUGIN_DESCRIPTION NM_VPN_PLUGIN_UI_INTERFACE_DESC +#define NM_VPN_EDITOR_PLUGIN_SERVICE NM_VPN_PLUGIN_UI_INTERFACE_SERVICE + +#define NMVpnEditorPlugin NMVpnPluginUiInterface +#define NMVpnEditorPluginInterface NMVpnPluginUiInterface + +#define get_editor ui_factory +#define get_suggested_filename get_suggested_name + +#define nm_vpn_editor_plugin_get_type nm_vpn_plugin_ui_interface_get_type +#define nm_vpn_editor_plugin_get_editor nm_vpn_plugin_ui_interface_ui_factory +#define nm_vpn_editor_plugin_get_capabilities nm_vpn_plugin_ui_interface_get_capabilities +#define nm_vpn_editor_plugin_import nm_vpn_plugin_ui_interface_import +#define nm_vpn_editor_plugin_export nm_vpn_plugin_ui_interface_export +#define nm_vpn_editor_plugin_get_suggested_filename nm_vpn_plugin_ui_interface_get_suggested_name + +#define NM_TYPE_VPN_EDITOR NM_TYPE_VPN_PLUGIN_UI_WIDGET_INTERFACE +#define NM_VPN_EDITOR(obj) NM_VPN_PLUGIN_UI_WIDGET_INTERFACE (obj) +#define NM_IS_VPN_EDITOR(obj) NM_IS_VPN_PLUGIN_UI_WIDGET_INTERFACE (obj) +#define NM_VPN_EDITOR_GET_INTERFACE(obj) NM_VPN_PLUGIN_UI_WIDGET_INTERFACE_GET_INTERFACE (obj) + +#define NMVpnEditor NMVpnPluginUiWidgetInterface +#define NMVpnEditorInterface NMVpnPluginUiWidgetInterface + +#define nm_vpn_editor_get_type nm_vpn_plugin_ui_widget_interface_get_type +#define nm_vpn_editor_get_widget nm_vpn_plugin_ui_widget_interface_get_widget +#define nm_vpn_editor_update_connection nm_vpn_plugin_ui_widget_interface_update_connection + +#endif /* NM_VPN_LIBNM_COMPAT */ + G_END_DECLS #endif /* NM_VPN_PLUGIN_UI_INTERFACE_H */ diff --git a/libnm-glib/nm-vpn-plugin.c b/libnm-glib/nm-vpn-plugin.c index 4350e600..d180ec44 100644 --- a/libnm-glib/nm-vpn-plugin.c +++ b/libnm-glib/nm-vpn-plugin.c @@ -22,7 +22,7 @@ #include "config.h" #include -#include "nm-glib-compat.h" +#include "nm-default.h" #include "nm-vpn-plugin.h" #include "nm-vpn-enum-types.h" #include "nm-utils.h" @@ -769,9 +769,9 @@ constructor (GType type, goto err; proxy = dbus_g_proxy_new_for_name (connection, - "org.freedesktop.DBus", - "/org/freedesktop/DBus", - "org.freedesktop.DBus"); + DBUS_SERVICE_DBUS, + DBUS_PATH_DBUS, + DBUS_INTERFACE_DBUS); if (!dbus_g_proxy_call (proxy, "RequestName", &err, G_TYPE_STRING, priv->dbus_service_name, diff --git a/libnm-glib/nm-wimax-nsp.c b/libnm-glib/nm-wimax-nsp.c index 1735ab3e..1c40a217 100644 --- a/libnm-glib/nm-wimax-nsp.c +++ b/libnm-glib/nm-wimax-nsp.c @@ -22,12 +22,11 @@ #include -#include "nm-glib-compat.h" - #include #include #include +#include "nm-default.h" #include "nm-wimax-nsp.h" #include "NetworkManager.h" #include "nm-types-private.h" diff --git a/libnm-glib/tests/Makefile.am b/libnm-glib/tests/Makefile.am index aeaaa6b6..a1b25f62 100644 --- a/libnm-glib/tests/Makefile.am +++ b/libnm-glib/tests/Makefile.am @@ -1,11 +1,12 @@ if ENABLE_TESTS AM_CPPFLAGS = \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ + -I$(top_srcdir)/shared \ + -I$(top_builddir)/shared \ -I$(top_srcdir)/libnm-util \ -I$(top_builddir)/libnm-util \ -I$(top_srcdir)/libnm-glib \ + -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY \ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ -DTEST_NM_SERVICE=\"$(abs_top_srcdir)/tools/test-networkmanager-service.py\" \ $(GLIB_CFLAGS) \ @@ -23,8 +24,8 @@ TESTS = test-nm-client test-remote-settings-client ####### NMClient and non-settings tests ####### test_nm_client_SOURCES = \ - common.c \ - common.h \ + $(top_builddir)/shared/nm-test-utils-impl.c \ + $(top_builddir)/shared/nm-test-libnm-utils.h \ test-nm-client.c test_nm_client_LDADD = \ @@ -36,8 +37,8 @@ test_nm_client_LDADD = \ ####### remote settings client test ####### test_remote_settings_client_SOURCES = \ - common.c \ - common.h \ + $(top_builddir)/shared/nm-test-utils-impl.c \ + $(top_builddir)/shared/nm-test-libnm-utils.h \ test-remote-settings-client.c test_remote_settings_client_LDADD = \ diff --git a/libnm-glib/tests/Makefile.in b/libnm-glib/tests/Makefile.in index ab088a30..8d7e6dea 100644 --- a/libnm-glib/tests/Makefile.in +++ b/libnm-glib/tests/Makefile.in @@ -116,8 +116,11 @@ CONFIG_CLEAN_VPATH_FILES = @ENABLE_TESTS_TRUE@am__EXEEXT_1 = test-nm-client$(EXEEXT) \ @ENABLE_TESTS_TRUE@ test-remote-settings-client$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) -am__test_nm_client_SOURCES_DIST = common.c common.h test-nm-client.c -@ENABLE_TESTS_TRUE@am_test_nm_client_OBJECTS = common.$(OBJEXT) \ +am__test_nm_client_SOURCES_DIST = \ + $(top_builddir)/shared/nm-test-utils-impl.c \ + $(top_builddir)/shared/nm-test-libnm-utils.h test-nm-client.c +@ENABLE_TESTS_TRUE@am_test_nm_client_OBJECTS = \ +@ENABLE_TESTS_TRUE@ nm-test-utils-impl.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ test-nm-client.$(OBJEXT) test_nm_client_OBJECTS = $(am_test_nm_client_OBJECTS) am__DEPENDENCIES_1 = @@ -129,10 +132,12 @@ AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = -am__test_remote_settings_client_SOURCES_DIST = common.c common.h \ +am__test_remote_settings_client_SOURCES_DIST = \ + $(top_builddir)/shared/nm-test-utils-impl.c \ + $(top_builddir)/shared/nm-test-libnm-utils.h \ test-remote-settings-client.c @ENABLE_TESTS_TRUE@am_test_remote_settings_client_OBJECTS = \ -@ENABLE_TESTS_TRUE@ common.$(OBJEXT) \ +@ENABLE_TESTS_TRUE@ nm-test-utils-impl.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ test-remote-settings-client.$(OBJEXT) test_remote_settings_client_OBJECTS = \ $(am_test_remote_settings_client_OBJECTS) @@ -424,7 +429,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -436,8 +440,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -447,6 +449,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -501,16 +504,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -547,6 +547,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -575,7 +577,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -590,6 +591,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -650,6 +653,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -657,6 +661,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -673,11 +678,12 @@ with_netconfig = @with_netconfig@ with_resolvconf = @with_resolvconf@ with_valgrind = @with_valgrind@ @ENABLE_TESTS_TRUE@AM_CPPFLAGS = \ -@ENABLE_TESTS_TRUE@ -I$(top_srcdir)/include \ -@ENABLE_TESTS_TRUE@ -I$(top_builddir)/include \ +@ENABLE_TESTS_TRUE@ -I$(top_srcdir)/shared \ +@ENABLE_TESTS_TRUE@ -I$(top_builddir)/shared \ @ENABLE_TESTS_TRUE@ -I$(top_srcdir)/libnm-util \ @ENABLE_TESTS_TRUE@ -I$(top_builddir)/libnm-util \ @ENABLE_TESTS_TRUE@ -I$(top_srcdir)/libnm-glib \ +@ENABLE_TESTS_TRUE@ -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY \ @ENABLE_TESTS_TRUE@ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ @ENABLE_TESTS_TRUE@ -DTEST_NM_SERVICE=\"$(abs_top_srcdir)/tools/test-networkmanager-service.py\" \ @ENABLE_TESTS_TRUE@ $(GLIB_CFLAGS) \ @@ -687,8 +693,8 @@ with_valgrind = @with_valgrind@ ####### NMClient and non-settings tests ####### @ENABLE_TESTS_TRUE@test_nm_client_SOURCES = \ -@ENABLE_TESTS_TRUE@ common.c \ -@ENABLE_TESTS_TRUE@ common.h \ +@ENABLE_TESTS_TRUE@ $(top_builddir)/shared/nm-test-utils-impl.c \ +@ENABLE_TESTS_TRUE@ $(top_builddir)/shared/nm-test-libnm-utils.h \ @ENABLE_TESTS_TRUE@ test-nm-client.c @ENABLE_TESTS_TRUE@test_nm_client_LDADD = \ @@ -700,8 +706,8 @@ with_valgrind = @with_valgrind@ ####### remote settings client test ####### @ENABLE_TESTS_TRUE@test_remote_settings_client_SOURCES = \ -@ENABLE_TESTS_TRUE@ common.c \ -@ENABLE_TESTS_TRUE@ common.h \ +@ENABLE_TESTS_TRUE@ $(top_builddir)/shared/nm-test-utils-impl.c \ +@ENABLE_TESTS_TRUE@ $(top_builddir)/shared/nm-test-libnm-utils.h \ @ENABLE_TESTS_TRUE@ test-remote-settings-client.c @ENABLE_TESTS_TRUE@test_remote_settings_client_LDADD = \ @@ -770,7 +776,7 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-test-utils-impl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-nm-client.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-remote-settings-client.Po@am__quote@ @@ -795,6 +801,20 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +nm-test-utils-impl.o: $(top_builddir)/shared/nm-test-utils-impl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nm-test-utils-impl.o -MD -MP -MF $(DEPDIR)/nm-test-utils-impl.Tpo -c -o nm-test-utils-impl.o `test -f '$(top_builddir)/shared/nm-test-utils-impl.c' || echo '$(srcdir)/'`$(top_builddir)/shared/nm-test-utils-impl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nm-test-utils-impl.Tpo $(DEPDIR)/nm-test-utils-impl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/shared/nm-test-utils-impl.c' object='nm-test-utils-impl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nm-test-utils-impl.o `test -f '$(top_builddir)/shared/nm-test-utils-impl.c' || echo '$(srcdir)/'`$(top_builddir)/shared/nm-test-utils-impl.c + +nm-test-utils-impl.obj: $(top_builddir)/shared/nm-test-utils-impl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nm-test-utils-impl.obj -MD -MP -MF $(DEPDIR)/nm-test-utils-impl.Tpo -c -o nm-test-utils-impl.obj `if test -f '$(top_builddir)/shared/nm-test-utils-impl.c'; then $(CYGPATH_W) '$(top_builddir)/shared/nm-test-utils-impl.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/shared/nm-test-utils-impl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nm-test-utils-impl.Tpo $(DEPDIR)/nm-test-utils-impl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/shared/nm-test-utils-impl.c' object='nm-test-utils-impl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nm-test-utils-impl.obj `if test -f '$(top_builddir)/shared/nm-test-utils-impl.c'; then $(CYGPATH_W) '$(top_builddir)/shared/nm-test-utils-impl.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/shared/nm-test-utils-impl.c'; fi` + mostlyclean-libtool: -rm -f *.lo diff --git a/libnm-glib/tests/common.c b/libnm-glib/tests/common.c deleted file mode 100644 index f071fb5b..00000000 --- a/libnm-glib/tests/common.c +++ /dev/null @@ -1,121 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* - * 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, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Copyright 2010 - 2014 Red Hat, Inc. - * - */ - -#include "config.h" - -#include -#include -#include - -#include "NetworkManager.h" - -#include "common.h" - -static gboolean -name_exists (GDBusConnection *c, const char *name) -{ - GVariant *reply; - gboolean exists = FALSE; - - reply = g_dbus_connection_call_sync (c, - DBUS_SERVICE_DBUS, - DBUS_PATH_DBUS, - DBUS_INTERFACE_DBUS, - "GetNameOwner", - g_variant_new ("(s)", name), - NULL, - G_DBUS_CALL_FLAGS_NO_AUTO_START, - -1, - NULL, - NULL); - if (reply != NULL) { - exists = TRUE; - g_variant_unref (reply); - } - - return exists; -} - -NMTestServiceInfo * -nm_test_service_init (void) -{ - NMTestServiceInfo *info; - const char *args[2] = { TEST_NM_SERVICE, NULL }; - GError *error = NULL; - int i; - - info = g_malloc0 (sizeof (*info)); - - info->bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error); - g_assert_no_error (error); - - /* Spawn the test service. info->keepalive_fd will be a pipe to the service's - * stdin; if it closes, the service will exit immediately. We use this to - * make sure the service exits if the test program crashes. - */ - g_spawn_async_with_pipes (NULL, (char **) args, NULL, 0, NULL, NULL, - &info->pid, &info->keepalive_fd, NULL, NULL, &error); - g_assert_no_error (error); - - /* Wait until the service is registered on the bus */ - for (i = 1000; i > 0; i--) { - if (name_exists (info->bus, "org.freedesktop.NetworkManager")) - break; - g_usleep (G_USEC_PER_SEC / 50); - } - g_assert (i > 0); - - /* Grab a proxy to our fake NM service to trigger tests */ - info->proxy = g_dbus_proxy_new_sync (info->bus, - G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES | - G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS | - G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, - NULL, - NM_DBUS_SERVICE, - NM_DBUS_PATH, - "org.freedesktop.NetworkManager.LibnmGlibTest", - NULL, &error); - g_assert_no_error (error); - - return info; -} - -void -nm_test_service_cleanup (NMTestServiceInfo *info) -{ - int i; - - g_object_unref (info->proxy); - kill (info->pid, SIGTERM); - - /* Wait until the bus notices the service is gone */ - for (i = 100; i > 0; i--) { - if (!name_exists (info->bus, "org.freedesktop.NetworkManager")) - break; - g_usleep (G_USEC_PER_SEC / 50); - } - g_assert (i > 0); - - g_object_unref (info->bus); - close (info->keepalive_fd); - - memset (info, 0, sizeof (*info)); - g_free (info); -} diff --git a/libnm-glib/tests/common.h b/libnm-glib/tests/common.h deleted file mode 100644 index 7c49d253..00000000 --- a/libnm-glib/tests/common.h +++ /dev/null @@ -1,31 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA. - * - * Copyright 2014 Red Hat, Inc. - */ - -#include - -typedef struct { - GDBusConnection *bus; - GDBusProxy *proxy; - GPid pid; - int keepalive_fd; -} NMTestServiceInfo; - -NMTestServiceInfo *nm_test_service_init (void); -void nm_test_service_cleanup (NMTestServiceInfo *info); diff --git a/libnm-glib/tests/test-nm-client.c b/libnm-glib/tests/test-nm-client.c index af3722eb..f528bc26 100644 --- a/libnm-glib/tests/test-nm-client.c +++ b/libnm-glib/tests/test-nm-client.c @@ -23,50 +23,22 @@ #include #include #include -#include #include #include #include -#include +#include "nm-default.h" #include "nm-client.h" #include "nm-device-wifi.h" #include "nm-device-ethernet.h" #include "nm-device-wimax.h" -#include "nm-glib-compat.h" +#include "nm-connection.h" +#include "nm-setting.h" -#include "common.h" +#include "nm-test-libnm-utils.h" static GMainLoop *loop = NULL; -static NMTestServiceInfo *sinfo; - -/*******************************************************************/ - -static NMClient * -test_client_new (void) -{ - NMClient *client; - DBusGConnection *bus; - GError *error = NULL; - gboolean success; - - bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error); - g_assert_no_error (error); - - client = g_object_new (NM_TYPE_CLIENT, - NM_OBJECT_DBUS_CONNECTION, bus, - NM_OBJECT_DBUS_PATH, NM_DBUS_PATH, - NULL); - g_assert (client != NULL); - - dbus_g_connection_unref (bus); - - success = g_initable_init (G_INITABLE (client), NULL, &error); - g_assert_no_error (error); - g_assert (success == TRUE); - - return client; -} +static NMTstcServiceInfo *sinfo; /*******************************************************************/ @@ -99,6 +71,29 @@ add_device (const char *method, const char *ifname, char **out_path) return TRUE; } +static gboolean +add_wired_device (const char *method, const char *ifname, char **out_path) +{ + const char *empty[] = { NULL }; + GError *error = NULL; + GVariant *ret; + + ret = g_dbus_proxy_call_sync (sinfo->proxy, + method, + g_variant_new ("(ss^as)", ifname, "/", empty), + G_DBUS_CALL_FLAGS_NO_AUTO_START, + 3000, + NULL, + &error); + g_assert_no_error (error); + g_assert (ret); + g_assert_cmpstr (g_variant_get_type_string (ret), ==, "(o)"); + if (out_path) + g_variant_get (ret, "(o)", out_path); + g_variant_unref (ret); + return TRUE; +} + /*******************************************************************/ typedef struct { @@ -160,14 +155,14 @@ test_device_added (void) NMDevice *device; DeviceAddedInfo info = { loop, FALSE, FALSE, 0, 0 }; - sinfo = nm_test_service_init (); - client = test_client_new (); + sinfo = nmtstc_service_init (); + client = nmtstc_nm_client_new (); devices = nm_client_get_devices (client); g_assert (devices == NULL); /* Tell the test service to add a new device */ - add_device ("AddWiredDevice", "eth0", NULL); + add_wired_device ("AddWiredDevice", "eth0", NULL); g_signal_connect (client, "device-added", @@ -200,7 +195,7 @@ test_device_added (void) g_assert_cmpstr (nm_device_get_iface (device), ==, "eth0"); g_object_unref (client); - g_clear_pointer (&sinfo, nm_test_service_cleanup); + g_clear_pointer (&sinfo, nmtstc_service_cleanup); } /*******************************************************************/ @@ -317,8 +312,8 @@ test_wifi_ap_added_removed (void) GError *error = NULL; char *expected_path = NULL; - sinfo = nm_test_service_init (); - client = test_client_new (); + sinfo = nmtstc_service_init (); + client = nmtstc_nm_client_new (); /*************************************/ /* Add the wifi device */ @@ -423,7 +418,7 @@ test_wifi_ap_added_removed (void) g_free (expected_path); g_object_unref (client); - g_clear_pointer (&sinfo, nm_test_service_cleanup); + g_clear_pointer (&sinfo, nmtstc_service_cleanup); } /*******************************************************************/ @@ -540,8 +535,8 @@ test_wimax_nsp_added_removed (void) GError *error = NULL; char *expected_path = NULL; - sinfo = nm_test_service_init (); - client = test_client_new (); + sinfo = nmtstc_service_init (); + client = nmtstc_nm_client_new (); /*************************************/ /* Add the wimax device */ @@ -646,7 +641,7 @@ test_wimax_nsp_added_removed (void) g_free (expected_path); g_object_unref (client); - g_clear_pointer (&sinfo, nm_test_service_cleanup); + g_clear_pointer (&sinfo, nmtstc_service_cleanup); } /*******************************************************************/ @@ -662,6 +657,7 @@ typedef struct { static void da_check_quit (DaInfo *info) { + g_assert (info->quit_count > 0); info->quit_count--; if (info->quit_count == 0) { g_source_remove (info->quit_id); @@ -724,14 +720,14 @@ test_devices_array (void) GError *error = NULL; GVariant *ret; - sinfo = nm_test_service_init (); - client = test_client_new (); + sinfo = nmtstc_service_init (); + client = nmtstc_nm_client_new (); /*************************************/ /* Add some devices */ add_device ("AddWifiDevice", "wlan0", &paths[0]); - add_device ("AddWiredDevice", "eth0", &paths[1]); - add_device ("AddWiredDevice", "eth1", &paths[2]); + add_wired_device ("AddWiredDevice", "eth0", &paths[1]); + add_wired_device ("AddWiredDevice", "eth1", &paths[2]); info.quit_count = 3; g_signal_connect (client, @@ -808,7 +804,7 @@ test_devices_array (void) g_free (paths[2]); g_object_unref (client); - g_clear_pointer (&sinfo, nm_test_service_cleanup); + g_clear_pointer (&sinfo, nmtstc_service_cleanup); } static void @@ -830,7 +826,7 @@ test_client_manager_running (void) int running_changed = 0; GError *error = NULL; - client1 = test_client_new (); + client1 = nmtstc_nm_client_new (); g_assert (!nm_client_get_manager_running (client1)); g_assert_cmpstr (nm_client_get_version (client1), ==, NULL); @@ -846,8 +842,8 @@ test_client_manager_running (void) g_clear_error (&error); /* Now start the test service. */ - sinfo = nm_test_service_init (); - client2 = test_client_new (); + sinfo = nmtstc_service_init (); + client2 = nmtstc_nm_client_new (); /* client2 should know that NM is running, but the previously-created * client1 hasn't gotten the news yet. @@ -864,7 +860,7 @@ test_client_manager_running (void) g_source_remove (quit_id); /* And kill it */ - g_clear_pointer (&sinfo, nm_test_service_cleanup); + g_clear_pointer (&sinfo, nmtstc_service_cleanup); g_assert (nm_client_get_manager_running (client1)); @@ -880,14 +876,269 @@ test_client_manager_running (void) /*******************************************************************/ +static GPtrArray * +_slist_to_array (GPtrArray **connections, GSList *list) +{ + GPtrArray *array; + const GSList *iter; + + if (!*connections) + *connections = array = g_ptr_array_new (); + else { + array = *connections; + g_ptr_array_set_size (array, 0); + } + for (iter = list; iter; iter = iter->next) + g_ptr_array_add (array, iter->data); + g_slist_free (list); + return array; +} + +static gboolean +_test_connection_invalid_find_connections (gpointer element, gpointer needle, gpointer user_data) +{ + NMRemoteConnection *con = NM_REMOTE_CONNECTION (element); + const char *path = needle; + + g_assert (NM_IS_REMOTE_CONNECTION (con)); + g_assert (path && *path); + + return strcmp (path, nm_connection_get_path ((NMConnection *) con)) == 0; +} + +#define ASSERT_IDX(i) \ + g_assert_cmpint (idx[i], >=, 0); \ + g_assert (path##i && *path##i); \ + g_assert (NM_IS_REMOTE_CONNECTION (connections->pdata[idx[i]])); \ + g_assert_cmpstr (nm_connection_get_path (connections->pdata[idx[i]]), ==, path##i); + +static void +test_connection_invalid (void) +{ + NMTSTC_SERVICE_INFO_SETUP (my_sinfo) + gs_unref_object NMConnection *connection = NULL; + NMSettingConnection *s_con; + gs_unref_object NMRemoteSettings *settings = NULL; + gs_unref_ptrarray GPtrArray *connections = NULL; + gs_free char *path0 = NULL; + gs_free char *path1 = NULL; + gs_free char *path2 = NULL; + gs_free char *uuid2 = NULL; + gsize n_found; + gssize idx[3]; + + /************************************************************************** + * Add two connection before starting libnm. One valid, one invalid. + *************************************************************************/ + + connection = nmtst_create_minimal_connection ("test-connection-invalid-0", NULL, NM_SETTING_WIRED_SETTING_NAME, &s_con); + nmtst_connection_normalize (connection); + g_object_set (s_con, + NM_SETTING_CONNECTION_UUID, nmtst_uuid_generate (), + NULL); + nmtstc_service_add_connection (my_sinfo, + connection, + TRUE, + &path0); + + nm_connection_remove_setting (connection, NM_TYPE_SETTING_WIRED); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "test-connection-invalid-1", + NM_SETTING_CONNECTION_TYPE, "invalid-type-1", + NM_SETTING_CONNECTION_UUID, nmtst_uuid_generate (), + NULL); + nmtstc_service_add_connection (my_sinfo, + connection, + FALSE, + &path1); + + nmtst_main_loop_run (loop, 100); + + settings = nmtstc_nm_remote_settings_new (); + + g_test_expect_message ("libnm-glib", G_LOG_LEVEL_WARNING, "*replace_settings: error updating connection*"); + + nmtst_main_loop_run (loop, 100); + + g_test_assert_expected_messages (); + + _slist_to_array (&connections, nm_remote_settings_list_connections (settings)); + + g_assert_cmpint (connections->len, ==, 2); + n_found = nmtst_find_all_indexes (connections->pdata, + connections->len, + (gpointer *) ((const char *[]) { path0, path1 }), + 2, + _test_connection_invalid_find_connections, + NULL, + idx); + g_assert_cmpint (n_found, ==, 2); + ASSERT_IDX (0); + ASSERT_IDX (1); + nmtst_assert_connection_verifies_without_normalization (connections->pdata[idx[0]]); + nmtst_assert_connection_unnormalizable (connections->pdata[idx[1]], 0, 0); + + /************************************************************************** + * After having the client up and running, add another invalid connection + *************************************************************************/ + + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "test-connection-invalid-2", + NM_SETTING_CONNECTION_TYPE, "invalid-type-2", + NM_SETTING_CONNECTION_UUID, (uuid2 = g_strdup (nmtst_uuid_generate ())), + NULL); + nmtstc_service_add_connection (my_sinfo, + connection, + FALSE, + &path2); + + g_test_expect_message ("libnm-glib", G_LOG_LEVEL_WARNING, "*replace_settings: error updating connection*"); + + nmtst_main_loop_run (loop, 100); + + g_test_assert_expected_messages (); + + _slist_to_array (&connections, nm_remote_settings_list_connections (settings)); + + g_assert_cmpint (connections->len, ==, 3); + n_found = nmtst_find_all_indexes (connections->pdata, + connections->len, + (gpointer *) ((const char *[]) { path0, path1, path2 }), + 3, + _test_connection_invalid_find_connections, + NULL, + idx); + g_assert_cmpint (n_found, ==, 3); + ASSERT_IDX (0); + ASSERT_IDX (1); + ASSERT_IDX (2); + nmtst_assert_connection_verifies_without_normalization (connections->pdata[idx[0]]); + nmtst_assert_connection_unnormalizable (connections->pdata[idx[1]], 0, 0); + nmtst_assert_connection_unnormalizable (connections->pdata[idx[2]], 0, 0); + + /************************************************************************** + * Modify the invalid connection. Connection disappears + *************************************************************************/ + + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "test-connection-invalid-2x", + NULL); + nmtstc_service_update_connection (my_sinfo, + path2, + connection, + FALSE); + + g_test_expect_message ("libnm-glib", G_LOG_LEVEL_WARNING, "*replace_settings: error updating connection*"); + + nmtst_main_loop_run (loop, 100); + + g_test_assert_expected_messages (); + + _slist_to_array (&connections, nm_remote_settings_list_connections (settings)); + + g_assert_cmpint (connections->len, ==, 2); + n_found = nmtst_find_all_indexes (connections->pdata, + connections->len, + (gpointer *) ((const char *[]) { path0, path1, path2 }), + 3, + _test_connection_invalid_find_connections, + NULL, + idx); + g_assert_cmpint (n_found, ==, 2); + ASSERT_IDX (0); + ASSERT_IDX (1); + g_assert_cmpint (idx[2], ==, -1); + nmtst_assert_connection_verifies_without_normalization (connections->pdata[idx[0]]); + nmtst_assert_connection_unnormalizable (connections->pdata[idx[1]], 0, 0); + + /************************************************************************** + * Modify the invalid connection again. Note that the connection stays + * invisible (although it exists, and is valid). + *************************************************************************/ + + g_clear_object (&connection); + connection = nmtst_create_minimal_connection ("test-connection-invalid-2", NULL, NM_SETTING_WIRED_SETTING_NAME, &s_con); + nmtst_connection_normalize (connection); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "test-connection-invalid-2z", + NM_SETTING_CONNECTION_TYPE, "802-3-ethernet", + NM_SETTING_CONNECTION_UUID, uuid2, + NULL); + + nmtstc_service_update_connection (my_sinfo, + path2, + connection, + FALSE); + + nmtst_main_loop_run (loop, 100); + + _slist_to_array (&connections, nm_remote_settings_list_connections (settings)); + + g_assert_cmpint (connections->len, ==, 2); + n_found = nmtst_find_all_indexes (connections->pdata, + connections->len, + (gpointer *) ((const char *[]) { path0, path1, path2 }), + 3, + _test_connection_invalid_find_connections, + NULL, + idx); + g_assert_cmpint (n_found, ==, 2); + ASSERT_IDX (0); + ASSERT_IDX (1); + g_assert_cmpint (idx[2], ==, -1); + nmtst_assert_connection_verifies_without_normalization (connections->pdata[idx[0]]); + nmtst_assert_connection_unnormalizable (connections->pdata[idx[1]], 0, 0); + + + /************************************************************************** + * Modify the invalid connection and make it valid + *************************************************************************/ + + g_clear_object (&connection); + connection = nmtst_create_minimal_connection ("test-connection-invalid-1", NULL, NM_SETTING_WIRED_SETTING_NAME, &s_con); + nmtst_connection_normalize (connection); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "test-connection-invalid-1x", + NM_SETTING_CONNECTION_TYPE, "802-3-ethernet", + NM_SETTING_CONNECTION_UUID, nm_connection_get_uuid (connections->pdata[idx[1]]), + NULL); + + nmtstc_service_update_connection (my_sinfo, + path1, + connection, + FALSE); + + nmtst_main_loop_run (loop, 100); + + _slist_to_array (&connections, nm_remote_settings_list_connections (settings)); + + g_assert_cmpint (connections->len, ==, 2); + n_found = nmtst_find_all_indexes (connections->pdata, + connections->len, + (gpointer *) ((const char *[]) { path0, path1, path2 }), + 3, + _test_connection_invalid_find_connections, + NULL, + idx); + g_assert_cmpint (n_found, ==, 2); + ASSERT_IDX (0); + ASSERT_IDX (1); + g_assert_cmpint (idx[2], ==, -1); + nmtst_assert_connection_verifies_without_normalization (connections->pdata[idx[0]]); + nmtst_assert_connection_verifies_without_normalization (connections->pdata[idx[1]]); + g_assert_cmpstr ("test-connection-invalid-1x", ==, nm_connection_get_id (connections->pdata[idx[1]])); + +#undef ASSERT_IDX +} + +/*******************************************************************/ + +NMTST_DEFINE (); + int main (int argc, char **argv) { -#if !GLIB_CHECK_VERSION (2, 35, 0) - g_type_init (); -#endif - - g_test_init (&argc, &argv, NULL); + nmtst_init (&argc, &argv, TRUE); loop = g_main_loop_new (NULL, FALSE); @@ -896,6 +1147,7 @@ main (int argc, char **argv) g_test_add_func ("/libnm-glib/wimax-nsp-added-removed", test_wimax_nsp_added_removed); g_test_add_func ("/libnm-glib/devices-array", test_devices_array); g_test_add_func ("/libnm-glib/client-manager-running", test_client_manager_running); + g_test_add_func ("/libnm/connection/invalid", test_connection_invalid); return g_test_run (); } diff --git a/libnm-glib/tests/test-remote-settings-client.c b/libnm-glib/tests/test-remote-settings-client.c index a109f8df..83227d4b 100644 --- a/libnm-glib/tests/test-remote-settings-client.c +++ b/libnm-glib/tests/test-remote-settings-client.c @@ -23,22 +23,22 @@ #include #include #include -#include #include #include #include -#include +#include "NetworkManager.h" -#include -#include -#include +#include "nm-setting-connection.h" +#include "nm-setting-wired.h" +#include "nm-utils.h" +#include "nm-default.h" #include "nm-remote-settings.h" -#include "common.h" -#include "gsystem-local-alloc.h" -static NMTestServiceInfo *sinfo; +#include "nm-test-libnm-utils.h" + +static NMTstcServiceInfo *sinfo; static NMRemoteSettings *settings = NULL; DBusGConnection *bus = NULL; NMRemoteConnection *remote = NULL; @@ -376,7 +376,7 @@ test_service_running (void) g_assert (running == TRUE); /* Now kill the test service. */ - nm_test_service_cleanup (sinfo); + nmtstc_service_cleanup (sinfo); settings2 = nm_remote_settings_new (bus); @@ -405,7 +405,7 @@ test_service_running (void) g_assert (running == FALSE); /* Now restart it */ - sinfo = nm_test_service_init (); + sinfo = nmtstc_service_init (); quit_id = g_timeout_add_seconds (5, loop_quit, loop); g_main_loop_run (loop); @@ -422,25 +422,22 @@ test_service_running (void) /*******************************************************************/ +NMTST_DEFINE (); + int main (int argc, char **argv) { int ret; GError *error = NULL; -#if !GLIB_CHECK_VERSION (2, 35, 0) - g_type_init (); -#endif - - g_test_init (&argc, &argv, NULL); + nmtst_init (&argc, &argv, TRUE); bus = dbus_g_bus_get (DBUS_BUS_SESSION, &error); g_assert_no_error (error); - sinfo = nm_test_service_init (); + sinfo = nmtstc_service_init (); - settings = nm_remote_settings_new (bus); - g_assert (settings != NULL); + settings = nmtstc_nm_remote_settings_new (); /* FIXME: these tests assume that they get run in order, but g_test_run() * does not actually guarantee that! @@ -453,7 +450,7 @@ main (int argc, char **argv) ret = g_test_run (); - nm_test_service_cleanup (sinfo); + nmtstc_service_cleanup (sinfo); g_object_unref (settings); dbus_g_connection_unref (bus); diff --git a/libnm-util/Makefile.am b/libnm-util/Makefile.am index f83780dc..6e637908 100644 --- a/libnm-util/Makefile.am +++ b/libnm-util/Makefile.am @@ -4,17 +4,18 @@ SUBDIRS = . tests AM_CPPFLAGS = \ -I${top_srcdir} \ - -I${top_srcdir}/include \ - -I$(top_builddir)/include \ + -I${top_srcdir}/shared \ + -I$(top_builddir)/shared \ -DG_LOG_DOMAIN=\""libnm-util"\" \ -DLOCALEDIR=\"$(datadir)/locale\" \ + -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY \ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) \ $(UUID_CFLAGS) if WITH_GNUTLS -AM_CPPFLAGS += $(LIBGCRYPT_CFLAGS) $(GNUTLS_CFLAGS) +AM_CPPFLAGS += $(GNUTLS_CFLAGS) endif if WITH_NSS @@ -24,7 +25,7 @@ endif lib_LTLIBRARIES=libnm-util.la libnm_util_include_HEADERS = \ - $(top_builddir)/include/nm-version-macros.h \ + $(top_builddir)/shared/nm-version-macros.h \ NetworkManager.h \ NetworkManagerVPN.h \ nm-connection.h \ @@ -63,9 +64,11 @@ nodist_libnm_util_include_HEADERS = \ libnm_util_la_private_headers = \ crypto.h \ + nm-dbus-glib-types.h \ + nm-gvaluearray-compat.h \ nm-param-spec-specialized.h \ - nm-utils-private.h \ - nm-setting-private.h + nm-setting-private.h \ + nm-utils-private.h libnm_util_la_csources = \ crypto.c \ @@ -121,7 +124,7 @@ libnm_util_la_LDFLAGS = -Wl,--version-script=$(SYMBOL_VIS_FILE) \ if WITH_GNUTLS libnm_util_la_SOURCES += crypto_gnutls.c -libnm_util_la_LIBADD += $(LIBGCRYPT_LIBS) $(GNUTLS_LIBS) +libnm_util_la_LIBADD += $(GNUTLS_LIBS) endif if WITH_NSS @@ -145,7 +148,7 @@ libtest_crypto_la_LIBADD = \ if WITH_GNUTLS libtest_crypto_la_SOURCES += crypto_gnutls.c -libtest_crypto_la_LIBADD += $(LIBGCRYPT_LIBS) $(GNUTLS_LIBS) +libtest_crypto_la_LIBADD += $(GNUTLS_LIBS) endif if WITH_NSS diff --git a/libnm-util/Makefile.in b/libnm-util/Makefile.in index 03f0eb24..d6085cca 100644 --- a/libnm-util/Makefile.in +++ b/libnm-util/Makefile.in @@ -90,14 +90,14 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@WITH_GNUTLS_TRUE@am__append_1 = $(LIBGCRYPT_CFLAGS) $(GNUTLS_CFLAGS) +@WITH_GNUTLS_TRUE@am__append_1 = $(GNUTLS_CFLAGS) @WITH_NSS_TRUE@am__append_2 = $(NSS_CFLAGS) @WITH_GNUTLS_TRUE@am__append_3 = crypto_gnutls.c -@WITH_GNUTLS_TRUE@am__append_4 = $(LIBGCRYPT_LIBS) $(GNUTLS_LIBS) +@WITH_GNUTLS_TRUE@am__append_4 = $(GNUTLS_LIBS) @WITH_NSS_TRUE@am__append_5 = crypto_nss.c @WITH_NSS_TRUE@am__append_6 = $(NSS_LIBS) @WITH_GNUTLS_TRUE@am__append_7 = crypto_gnutls.c -@WITH_GNUTLS_TRUE@am__append_8 = $(LIBGCRYPT_LIBS) $(GNUTLS_LIBS) +@WITH_GNUTLS_TRUE@am__append_8 = $(GNUTLS_LIBS) @WITH_NSS_TRUE@am__append_9 = crypto_nss.c @WITH_NSS_TRUE@am__append_10 = $(NSS_LIBS) @HAVE_INTROSPECTION_TRUE@am__append_11 = NetworkManager-1.0.gir @@ -157,8 +157,7 @@ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(girdir)" \ "$(DESTDIR)$(libnm_util_includedir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = -@WITH_GNUTLS_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) \ -@WITH_GNUTLS_TRUE@ $(am__DEPENDENCIES_1) +@WITH_GNUTLS_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) @WITH_NSS_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) libnm_util_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ @@ -176,8 +175,9 @@ am__libnm_util_la_SOURCES_DIST = crypto.c nm-connection.c \ nm-setting-wired.c nm-setting-wireless.c \ nm-setting-wireless-security.c nm-setting-vpn.c \ nm-utils-enum-types.c nm-utils.c nm-value-transforms.c \ - crypto.h nm-param-spec-specialized.h nm-utils-private.h \ - nm-setting-private.h crypto_gnutls.c crypto_nss.c + crypto.h nm-dbus-glib-types.h nm-gvaluearray-compat.h \ + nm-param-spec-specialized.h nm-setting-private.h \ + nm-utils-private.h crypto_gnutls.c crypto_nss.c am__objects_1 = crypto.lo nm-connection.lo \ nm-param-spec-specialized.lo nm-setting.lo nm-setting-8021x.lo \ nm-setting-adsl.lo nm-setting-bluetooth.lo nm-setting-bond.lo \ @@ -335,7 +335,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -347,8 +346,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -358,6 +355,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -412,16 +410,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -458,6 +453,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -486,7 +483,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -501,6 +497,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -561,6 +559,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -568,6 +567,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -584,14 +584,15 @@ with_netconfig = @with_netconfig@ with_resolvconf = @with_resolvconf@ with_valgrind = @with_valgrind@ SUBDIRS = . tests -AM_CPPFLAGS = -I${top_srcdir} -I${top_srcdir}/include \ - -I$(top_builddir)/include -DG_LOG_DOMAIN=\""libnm-util"\" \ +AM_CPPFLAGS = -I${top_srcdir} -I${top_srcdir}/shared \ + -I$(top_builddir)/shared -DG_LOG_DOMAIN=\""libnm-util"\" \ -DLOCALEDIR=\"$(datadir)/locale\" \ + -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY \ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) $(UUID_CFLAGS) $(am__append_1) $(am__append_2) lib_LTLIBRARIES = libnm-util.la libnm_util_include_HEADERS = \ - $(top_builddir)/include/nm-version-macros.h \ + $(top_builddir)/shared/nm-version-macros.h \ NetworkManager.h \ NetworkManagerVPN.h \ nm-connection.h \ @@ -630,9 +631,11 @@ nodist_libnm_util_include_HEADERS = \ libnm_util_la_private_headers = \ crypto.h \ + nm-dbus-glib-types.h \ + nm-gvaluearray-compat.h \ nm-param-spec-specialized.h \ - nm-utils-private.h \ - nm-setting-private.h + nm-setting-private.h \ + nm-utils-private.h libnm_util_la_csources = \ crypto.c \ diff --git a/libnm-util/NetworkManager.h b/libnm-util/NetworkManager.h index d83e4ab5..8101082b 100644 --- a/libnm-util/NetworkManager.h +++ b/libnm-util/NetworkManager.h @@ -151,6 +151,8 @@ typedef enum { * @NM_DEVICE_TYPE_ADSL: ADSL modem * @NM_DEVICE_TYPE_BRIDGE: a bridge master interface * @NM_DEVICE_TYPE_TEAM: a team master interface + * @NM_DEVICE_TYPE_TUN: a TUN/TAP interface + * @NM_DEVICE_TYPE_IP_TUNNEL: an IP tunnel interface * * #NMDeviceType values indicate the type of hardware represented by * an #NMDevice. @@ -174,6 +176,8 @@ typedef enum { NM_DEVICE_TYPE_BRIDGE = 13, NM_DEVICE_TYPE_GENERIC = 14, NM_DEVICE_TYPE_TEAM = 15, + NM_DEVICE_TYPE_TUN = 16, + NM_DEVICE_TYPE_IP_TUNNEL = 17, } NMDeviceType; /** diff --git a/libnm-util/crypto.c b/libnm-util/crypto.c index 8a10af94..757fdbe0 100644 --- a/libnm-util/crypto.c +++ b/libnm-util/crypto.c @@ -23,13 +23,12 @@ #include "config.h" -#include #include #include #include #include -#include +#include "nm-default.h" #include "crypto.h" GQuark diff --git a/libnm-util/crypto.h b/libnm-util/crypto.h index 315d8fec..74d1adbf 100644 --- a/libnm-util/crypto.h +++ b/libnm-util/crypto.h @@ -24,7 +24,7 @@ #ifndef __CRYPTO_H__ #define __CRYPTO_H__ -#include +#include "nm-default.h" #define MD5_HASH_LEN 20 #define CIPHER_DES_EDE3_CBC "DES-EDE3-CBC" diff --git a/libnm-util/crypto_gnutls.c b/libnm-util/crypto_gnutls.c index 3bec24ad..4e3e4e7c 100644 --- a/libnm-util/crypto_gnutls.c +++ b/libnm-util/crypto_gnutls.c @@ -18,19 +18,17 @@ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA. * - * Copyright 2007 - 2009 Red Hat, Inc. + * Copyright 2007 - 2015 Red Hat, Inc. */ #include "config.h" -#include -#include - -#include #include +#include #include #include +#include "nm-default.h" #include "crypto.h" #define SALT_LEN 8 @@ -65,8 +63,8 @@ crypto_md5_hash (const char *salt, gsize buflen, GError **error) { - gcry_md_hd_t ctx; - gcry_error_t err; + gnutls_hash_hd_t ctx; + int err; int nkey = buflen; const gsize digest_len = 16; int count = 0; @@ -81,26 +79,27 @@ crypto_md5_hash (const char *salt, g_return_val_if_fail (buffer != NULL, FALSE); g_return_val_if_fail (buflen > 0, FALSE); - err = gcry_md_open (&ctx, GCRY_MD_MD5, 0); - if (err) { + if (gnutls_hash_get_len (GNUTLS_DIG_MD5) > MD5_HASH_LEN) { g_set_error (error, NM_CRYPTO_ERROR, NM_CRYPTO_ERR_MD5_INIT_FAILED, - _("Failed to initialize the MD5 engine: %s / %s."), - gcry_strsource (err), gcry_strerror (err)); + _("Hash length too long (%d > %d)."), + gnutls_hash_get_len (GNUTLS_DIG_MD5), MD5_HASH_LEN); return FALSE; } while (nkey > 0) { int i = 0; + err = gnutls_hash_init (&ctx, GNUTLS_DIG_MD5); + if (err < 0) + goto error; + if (count++) - gcry_md_write (ctx, digest, digest_len); - gcry_md_write (ctx, password, password_len); + gnutls_hash (ctx, digest, digest_len); + gnutls_hash (ctx, password, password_len); if (salt) - gcry_md_write (ctx, salt, SALT_LEN); /* Only use 8 bytes of salt */ - gcry_md_final (ctx); - memcpy (digest, gcry_md_read (ctx, 0), digest_len); - gcry_md_reset (ctx); + gnutls_hash (ctx, salt, SALT_LEN); /* Only use 8 bytes of salt */ + gnutls_hash_deinit (ctx, digest); while (nkey && (i < digest_len)) { *(p++) = digest[i++]; @@ -109,8 +108,14 @@ crypto_md5_hash (const char *salt, } memset (digest, 0, sizeof (digest)); - gcry_md_close (ctx); return TRUE; +error: + memset (digest, 0, sizeof (digest)); + g_set_error (error, NM_CRYPTO_ERROR, + NM_CRYPTO_ERR_MD5_INIT_FAILED, + _("Failed to initialize the MD5 engine: %s (%s)"), + gnutls_strerror_name (err), gnutls_strerror (err)); + return FALSE; } char * @@ -124,21 +129,22 @@ crypto_decrypt (const char *cipher, gsize *out_len, GError **error) { - gcry_cipher_hd_t ctx; - gcry_error_t err; + gnutls_cipher_hd_t ctx; + gnutls_datum_t key_dt, iv_dt; + int err; int cipher_mech, i; char *output = NULL; gboolean success = FALSE; gsize pad_len, real_iv_len; if (!strcmp (cipher, CIPHER_DES_EDE3_CBC)) { - cipher_mech = GCRY_CIPHER_3DES; + cipher_mech = GNUTLS_CIPHER_3DES_CBC; real_iv_len = SALT_LEN; } else if (!strcmp (cipher, CIPHER_DES_CBC)) { - cipher_mech = GCRY_CIPHER_DES; + cipher_mech = GNUTLS_CIPHER_DES_CBC; real_iv_len = SALT_LEN; } else if (!strcmp (cipher, CIPHER_AES_CBC)) { - cipher_mech = GCRY_CIPHER_AES; + cipher_mech = GNUTLS_CIPHER_AES_128_CBC; real_iv_len = 16; } else { g_set_error (error, NM_CRYPTO_ERROR, @@ -158,39 +164,26 @@ crypto_decrypt (const char *cipher, output = g_malloc0 (data->len); - err = gcry_cipher_open (&ctx, cipher_mech, GCRY_CIPHER_MODE_CBC, 0); - if (err) { - g_set_error (error, NM_CRYPTO_ERROR, - NM_CRYPTO_ERR_CIPHER_INIT_FAILED, - _("Failed to initialize the decryption cipher context: %s / %s."), - gcry_strsource (err), gcry_strerror (err)); - goto out; - } + key_dt.data = (unsigned char *) key; + key_dt.size = key_len; + iv_dt.data = (unsigned char *) iv; + iv_dt.size = iv_len; - err = gcry_cipher_setkey (ctx, key, key_len); - if (err) { - g_set_error (error, NM_CRYPTO_ERROR, - NM_CRYPTO_ERR_CIPHER_SET_KEY_FAILED, - _("Failed to set symmetric key for decryption: %s / %s."), - gcry_strsource (err), gcry_strerror (err)); - goto out; - } - - err = gcry_cipher_setiv (ctx, iv, iv_len); - if (err) { + err = gnutls_cipher_init (&ctx, cipher_mech, &key_dt, &iv_dt); + if (err < 0) { g_set_error (error, NM_CRYPTO_ERROR, - NM_CRYPTO_ERR_CIPHER_SET_IV_FAILED, - _("Failed to set IV for decryption: %s / %s."), - gcry_strsource (err), gcry_strerror (err)); + NM_CRYPTO_ERR_CIPHER_INIT_FAILED, + _("Failed to initialize the decryption cipher context: %s (%s)"), + gnutls_strerror_name (err), gnutls_strerror (err)); goto out; } - err = gcry_cipher_decrypt (ctx, output, data->len, data->data, data->len); - if (err) { + err = gnutls_cipher_decrypt2 (ctx, data->data, data->len, output, data->len); + if (err < 0) { g_set_error (error, NM_CRYPTO_ERROR, NM_CRYPTO_ERR_CIPHER_DECRYPT_FAILED, - _("Failed to decrypt the private key: %s / %s."), - gcry_strsource (err), gcry_strerror (err)); + _("Failed to decrypt the private key: %s (%s)"), + gnutls_strerror_name (err), gnutls_strerror (err)); goto out; } pad_len = output[data->len - 1]; @@ -227,7 +220,7 @@ out: output = NULL; } } - gcry_cipher_close (ctx); + gnutls_cipher_deinit (ctx); return output; } @@ -241,8 +234,9 @@ crypto_encrypt (const char *cipher, gsize *out_len, GError **error) { - gcry_cipher_hd_t ctx; - gcry_error_t err; + gnutls_cipher_hd_t ctx; + gnutls_datum_t key_dt, iv_dt; + int err; int cipher_mech; char *output = NULL; gboolean success = FALSE; @@ -252,10 +246,10 @@ crypto_encrypt (const char *cipher, gsize salt_len; if (!strcmp (cipher, CIPHER_DES_EDE3_CBC)) { - cipher_mech = GCRY_CIPHER_3DES; + cipher_mech = GNUTLS_CIPHER_3DES_CBC; salt_len = SALT_LEN; } else if (!strcmp (cipher, CIPHER_AES_CBC)) { - cipher_mech = GCRY_CIPHER_AES; + cipher_mech = GNUTLS_CIPHER_AES_128_CBC; salt_len = iv_len; } else { g_set_error (error, NM_CRYPTO_ERROR, @@ -278,40 +272,26 @@ crypto_encrypt (const char *cipher, output = g_malloc0 (output_len); - err = gcry_cipher_open (&ctx, cipher_mech, GCRY_CIPHER_MODE_CBC, 0); - if (err) { - g_set_error (error, NM_CRYPTO_ERROR, - NM_CRYPTO_ERR_CIPHER_INIT_FAILED, - _("Failed to initialize the encryption cipher context: %s / %s."), - gcry_strsource (err), gcry_strerror (err)); - goto out; - } - - err = gcry_cipher_setkey (ctx, key, key_len); - if (err) { - g_set_error (error, NM_CRYPTO_ERROR, - NM_CRYPTO_ERR_CIPHER_SET_KEY_FAILED, - _("Failed to set symmetric key for encryption: %s / %s."), - gcry_strsource (err), gcry_strerror (err)); - goto out; - } + key_dt.data = (unsigned char *) key; + key_dt.size = key_len; + iv_dt.data = (unsigned char *) iv; + iv_dt.size = iv_len; - /* gcrypt only wants 8 bytes of the IV (same as the DES block length) */ - err = gcry_cipher_setiv (ctx, iv, salt_len); - if (err) { + err = gnutls_cipher_init (&ctx, cipher_mech, &key_dt, &iv_dt); + if (err < 0) { g_set_error (error, NM_CRYPTO_ERROR, - NM_CRYPTO_ERR_CIPHER_SET_IV_FAILED, - _("Failed to set IV for encryption: %s / %s."), - gcry_strsource (err), gcry_strerror (err)); + NM_CRYPTO_ERR_CIPHER_INIT_FAILED, + _("Failed to initialize the encryption cipher context: %s (%s)"), + gnutls_strerror_name (err), gnutls_strerror (err)); goto out; } - err = gcry_cipher_encrypt (ctx, output, output_len, padded_buf, padded_buf_len); - if (err) { + err = gnutls_cipher_encrypt2 (ctx, padded_buf, padded_buf_len, output, output_len); + if (err < 0) { g_set_error (error, NM_CRYPTO_ERROR, NM_CRYPTO_ERR_CIPHER_DECRYPT_FAILED, - _("Failed to encrypt the data: %s / %s."), - gcry_strsource (err), gcry_strerror (err)); + _("Failed to encrypt the data: %s (%s)"), + gnutls_strerror_name (err), gnutls_strerror (err)); goto out; } @@ -333,7 +313,7 @@ out: output = NULL; } } - gcry_cipher_close (ctx); + gnutls_cipher_deinit (ctx); return output; } @@ -484,6 +464,6 @@ crypto_verify_pkcs8 (const GByteArray *data, gboolean crypto_randomize (void *buffer, gsize buffer_len, GError **error) { - gcry_randomize (buffer, buffer_len, GCRY_STRONG_RANDOM); + gnutls_rnd (GNUTLS_RND_RANDOM, buffer, buffer_len); return TRUE; } diff --git a/libnm-util/crypto_nss.c b/libnm-util/crypto_nss.c index edd19b54..b71806dd 100644 --- a/libnm-util/crypto_nss.c +++ b/libnm-util/crypto_nss.c @@ -23,9 +23,6 @@ #include "config.h" -#include -#include - #include #include #include @@ -36,6 +33,7 @@ #include #include +#include "nm-default.h" #include "crypto.h" static gboolean initialized = FALSE; diff --git a/libnm-util/libnm-util.ver b/libnm-util/libnm-util.ver index 9d78e502..1ad853f5 100644 --- a/libnm-util/libnm-util.ver +++ b/libnm-util/libnm-util.ver @@ -355,6 +355,7 @@ global: nm_setting_ip4_config_get_dhcp_client_id; nm_setting_ip4_config_get_dhcp_hostname; nm_setting_ip4_config_get_dhcp_send_hostname; + nm_setting_ip4_config_get_dhcp_timeout; nm_setting_ip4_config_get_dns; nm_setting_ip4_config_get_dns_search; nm_setting_ip4_config_get_ignore_auto_dns; @@ -562,6 +563,7 @@ global: nm_setting_wireless_get_mtu; nm_setting_wireless_get_num_mac_blacklist_items; nm_setting_wireless_get_num_seen_bssids; + nm_setting_wireless_get_powersave; nm_setting_wireless_get_rate; nm_setting_wireless_get_security; nm_setting_wireless_get_seen_bssid; diff --git a/libnm-util/nm-connection.c b/libnm-util/nm-connection.c index e952835d..ea1492b7 100644 --- a/libnm-util/nm-connection.c +++ b/libnm-util/nm-connection.c @@ -22,10 +22,9 @@ #include "config.h" -#include -#include #include #include +#include "nm-default.h" #include "nm-connection.h" #include "nm-utils.h" #include "nm-dbus-glib-types.h" diff --git a/libnm-util/nm-dbus-glib-types.h b/libnm-util/nm-dbus-glib-types.h new file mode 100644 index 00000000..ad11ab68 --- /dev/null +++ b/libnm-util/nm-dbus-glib-types.h @@ -0,0 +1,45 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright 2008 Red Hat, Inc. + */ + +#ifndef __NM_DBUS_GLIB_TYPES_H__ +#define __NM_DBUS_GLIB_TYPES_H__ + +#include + +#define DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH)) +#define DBUS_TYPE_G_ARRAY_OF_STRING (dbus_g_type_get_collection ("GPtrArray", G_TYPE_STRING)) +#define DBUS_TYPE_G_ARRAY_OF_UINT (dbus_g_type_get_collection ("GArray", G_TYPE_UINT)) +#define DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UCHAR (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_UCHAR_ARRAY)) +#define DBUS_TYPE_G_ARRAY_OF_ARRAY_OF_UINT (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_ARRAY_OF_UINT)) +#define DBUS_TYPE_G_MAP_OF_VARIANT (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE)) +#define DBUS_TYPE_G_MAP_OF_MAP_OF_VARIANT (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, DBUS_TYPE_G_MAP_OF_VARIANT)) +#define DBUS_TYPE_G_MAP_OF_STRING (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING)) +#define DBUS_TYPE_G_LIST_OF_STRING (dbus_g_type_get_collection ("GSList", G_TYPE_STRING)) + +#define DBUS_TYPE_G_IP6_ADDRESS (dbus_g_type_get_struct ("GValueArray", DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_UINT, DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_INVALID)) +#define DBUS_TYPE_G_ARRAY_OF_IP6_ADDRESS (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_IP6_ADDRESS)) +#define DBUS_TYPE_G_IP6_ROUTE (dbus_g_type_get_struct ("GValueArray", DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_UINT, DBUS_TYPE_G_UCHAR_ARRAY, G_TYPE_UINT, G_TYPE_INVALID)) +#define DBUS_TYPE_G_ARRAY_OF_IP6_ROUTE (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_IP6_ROUTE)) + +#define DBUS_TYPE_NM_IP_ADDRESS DBUS_TYPE_G_MAP_OF_VARIANT +#define DBUS_TYPE_NM_IP_ADDRESSES (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_NM_IP_ADDRESS)) +#define DBUS_TYPE_NM_IP_ROUTE DBUS_TYPE_G_MAP_OF_VARIANT +#define DBUS_TYPE_NM_IP_ROUTES (dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_NM_IP_ROUTE)) + +#endif /* __NM_DBUS_GLIB_TYPES_H__ */ diff --git a/libnm-util/nm-gvaluearray-compat.h b/libnm-util/nm-gvaluearray-compat.h new file mode 100644 index 00000000..424e6be7 --- /dev/null +++ b/libnm-util/nm-gvaluearray-compat.h @@ -0,0 +1,104 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright 2013 Red Hat, Inc. + */ + +#ifndef __NM_GVALUEARRAY_COMPAT_H__ +#define __NM_GVALUEARRAY_COMPAT_H__ + +#define g_value_array_get_type() \ + G_GNUC_EXTENSION ({ \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + g_value_array_get_type (); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + }) + +#define g_value_array_get_nth(value_array, index_) \ + G_GNUC_EXTENSION ({ \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + g_value_array_get_nth (value_array, index_); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + }) + +#define g_value_array_new(n_prealloced) \ + G_GNUC_EXTENSION ({ \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + g_value_array_new (n_prealloced); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + }) + +static inline void +__g_value_array_free (GValueArray *value_array) +{ + G_GNUC_EXTENSION ({ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS + g_value_array_free (value_array); + G_GNUC_END_IGNORE_DEPRECATIONS + }); +} +#define g_value_array_free __g_value_array_free + +#define g_value_array_copy(value_array) \ + G_GNUC_EXTENSION ({ \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + g_value_array_copy (value_array); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + }) + +#define g_value_array_prepend(value_array, value) \ + G_GNUC_EXTENSION ({ \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + g_value_array_prepend (value_array, value); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + }) + +#define g_value_array_append(value_array, value) \ + G_GNUC_EXTENSION ({ \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + g_value_array_append (value_array, value); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + }) + +#define g_value_array_insert(value_array, index_, value) \ + G_GNUC_EXTENSION ({ \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + g_value_array_insert (value_array, index_, value); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + }) + +#define g_value_array_remove(value_array, index_) \ + G_GNUC_EXTENSION ({ \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + g_value_array_remove (value_array, index_); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + }) + +#define g_value_array_sort(value_array, compare_func) \ + G_GNUC_EXTENSION ({ \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + g_value_array_sort (value_array, compare_func); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + }) + +#define g_value_array_sort_with_data(value_array, compare_func, user_data) \ + G_GNUC_EXTENSION ({ \ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ + g_value_array_sort_with_data (value_array, compare_func, user_data); \ + G_GNUC_END_IGNORE_DEPRECATIONS \ + }) + +#endif /* __NM_GVALUEARRAY_COMPAT_H__ */ diff --git a/libnm-util/nm-param-spec-specialized.c b/libnm-util/nm-param-spec-specialized.c index acb8aec3..7f242acf 100644 --- a/libnm-util/nm-param-spec-specialized.c +++ b/libnm-util/nm-param-spec-specialized.c @@ -22,8 +22,9 @@ #include "config.h" +#include "nm-default.h" +#include "nm-gvaluearray-compat.h" #include "nm-param-spec-specialized.h" -#include "nm-glib-compat.h" struct _NMParamSpecSpecialized { GParamSpec parent; @@ -953,9 +954,7 @@ main (int argc, char *argv[]) { DBusGConnection *bus; -#if !GLIB_CHECK_VERSION (2, 35, 0) - g_type_init (); -#endif + nm_g_type_init (); bus = dbus_g_bus_get (DBUS_BUS_SESSION, NULL); diff --git a/libnm-util/nm-param-spec-specialized.h b/libnm-util/nm-param-spec-specialized.h index 7803e919..0f1228f6 100644 --- a/libnm-util/nm-param-spec-specialized.h +++ b/libnm-util/nm-param-spec-specialized.h @@ -23,7 +23,7 @@ #ifndef NM_PARAM_SPEC_SPECIALIZED_H #define NM_PARAM_SPEC_SPECIALIZED_H -#include +#include "nm-default.h" typedef struct _NMParamSpecSpecialized NMParamSpecSpecialized; diff --git a/libnm-util/nm-setting-8021x.c b/libnm-util/nm-setting-8021x.c index 678d70ab..30febf9c 100644 --- a/libnm-util/nm-setting-8021x.c +++ b/libnm-util/nm-setting-8021x.c @@ -24,7 +24,6 @@ #include #include -#include #include "nm-setting-8021x.h" #include "nm-param-spec-specialized.h" diff --git a/libnm-util/nm-setting-adsl.c b/libnm-util/nm-setting-adsl.c index 51560a78..55d04ce1 100644 --- a/libnm-util/nm-setting-adsl.c +++ b/libnm-util/nm-setting-adsl.c @@ -22,7 +22,6 @@ #include "config.h" #include -#include #include "nm-setting-adsl.h" #include "nm-setting-ppp.h" diff --git a/libnm-util/nm-setting-bluetooth.c b/libnm-util/nm-setting-bluetooth.c index 2867d73b..76bf2831 100644 --- a/libnm-util/nm-setting-bluetooth.c +++ b/libnm-util/nm-setting-bluetooth.c @@ -24,7 +24,6 @@ #include #include -#include #include "nm-param-spec-specialized.h" #include "nm-dbus-glib-types.h" diff --git a/libnm-util/nm-setting-bond.c b/libnm-util/nm-setting-bond.c index fa12cf0e..c6e860bd 100644 --- a/libnm-util/nm-setting-bond.c +++ b/libnm-util/nm-setting-bond.c @@ -27,7 +27,6 @@ #include #include #include -#include #include "nm-setting-bond.h" #include "nm-param-spec-specialized.h" diff --git a/libnm-util/nm-setting-bridge-port.c b/libnm-util/nm-setting-bridge-port.c index b3afa500..9da21925 100644 --- a/libnm-util/nm-setting-bridge-port.c +++ b/libnm-util/nm-setting-bridge-port.c @@ -25,7 +25,6 @@ #include #include #include -#include #include "nm-setting-bridge-port.h" #include "nm-utils.h" diff --git a/libnm-util/nm-setting-bridge.c b/libnm-util/nm-setting-bridge.c index bdaa75f9..1e475d30 100644 --- a/libnm-util/nm-setting-bridge.c +++ b/libnm-util/nm-setting-bridge.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include "nm-setting-bridge.h" diff --git a/libnm-util/nm-setting-cdma.c b/libnm-util/nm-setting-cdma.c index 94b10b1f..10981652 100644 --- a/libnm-util/nm-setting-cdma.c +++ b/libnm-util/nm-setting-cdma.c @@ -22,7 +22,6 @@ #include "config.h" #include -#include #include "nm-setting-cdma.h" #include "nm-utils.h" diff --git a/libnm-util/nm-setting-connection.c b/libnm-util/nm-setting-connection.c index bda89d63..abbe99ba 100644 --- a/libnm-util/nm-setting-connection.c +++ b/libnm-util/nm-setting-connection.c @@ -23,7 +23,6 @@ #include "config.h" #include -#include #include "nm-utils.h" #include "nm-dbus-glib-types.h" diff --git a/libnm-util/nm-setting-dcb.c b/libnm-util/nm-setting-dcb.c index 89ee3878..da3febaa 100644 --- a/libnm-util/nm-setting-dcb.c +++ b/libnm-util/nm-setting-dcb.c @@ -23,7 +23,6 @@ #include #include -#include #include "nm-setting-dcb.h" #include "nm-param-spec-specialized.h" diff --git a/libnm-util/nm-setting-gsm.c b/libnm-util/nm-setting-gsm.c index e422c92e..bc9f31bc 100644 --- a/libnm-util/nm-setting-gsm.c +++ b/libnm-util/nm-setting-gsm.c @@ -23,7 +23,6 @@ #include "config.h" #include -#include #include "nm-setting-gsm.h" #include "nm-utils.h" diff --git a/libnm-util/nm-setting-infiniband.c b/libnm-util/nm-setting-infiniband.c index 1036702f..95fa0c69 100644 --- a/libnm-util/nm-setting-infiniband.c +++ b/libnm-util/nm-setting-infiniband.c @@ -24,7 +24,6 @@ #include #include #include -#include #include "nm-setting-infiniband.h" #include "nm-param-spec-specialized.h" diff --git a/libnm-util/nm-setting-ip4-config.c b/libnm-util/nm-setting-ip4-config.c index 4db43cbc..efc226b3 100644 --- a/libnm-util/nm-setting-ip4-config.c +++ b/libnm-util/nm-setting-ip4-config.c @@ -24,16 +24,14 @@ #include #include -#include +#include "nm-default.h" #include "nm-setting-ip4-config.h" #include "nm-param-spec-specialized.h" #include "nm-utils.h" #include "nm-dbus-glib-types.h" -#include "nm-glib-compat.h" #include "nm-setting-private.h" - /** * SECTION:nm-setting-ip4-config * @short_description: Describes IPv4 addressing, routing, and name service properties @@ -84,6 +82,7 @@ typedef struct { char *dhcp_client_id; gboolean dhcp_send_hostname; char *dhcp_hostname; + int dhcp_timeout; gboolean never_default; gboolean may_fail; } NMSettingIP4ConfigPrivate; @@ -99,6 +98,7 @@ enum { PROP_IGNORE_AUTO_ROUTES, PROP_IGNORE_AUTO_DNS, PROP_DHCP_CLIENT_ID, + PROP_DHCP_TIMEOUT, PROP_DHCP_SEND_HOSTNAME, PROP_DHCP_HOSTNAME, PROP_NEVER_DEFAULT, @@ -802,6 +802,24 @@ nm_setting_ip4_config_get_dhcp_hostname (NMSettingIP4Config *setting) return NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting)->dhcp_hostname; } +/** + * nm_setting_ip4_config_get_dhcp_timeout: + * @setting: the #NMSettingIP4Config + * + * Returns the value contained in the #NMSettingIP4Config:dhcp-timeout + * property. + * + * Returns: The number of seconds after which unfinished DHCP transaction + * fails or zero for "default". + **/ +int +nm_setting_ip4_config_get_dhcp_timeout (NMSettingIP4Config *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_IP4_CONFIG (setting), 0); + + return NM_SETTING_IP4_CONFIG_GET_PRIVATE (setting)->dhcp_timeout; +} + /** * nm_setting_ip4_config_get_never_default: * @setting: the #NMSettingIP4Config @@ -1052,6 +1070,9 @@ set_property (GObject *object, guint prop_id, g_free (priv->dhcp_hostname); priv->dhcp_hostname = g_value_dup_string (value); break; + case PROP_DHCP_TIMEOUT: + priv->dhcp_timeout = g_value_get_uint (value); + break; case PROP_NEVER_DEFAULT: priv->never_default = g_value_get_boolean (value); break; @@ -1105,6 +1126,9 @@ get_property (GObject *object, guint prop_id, case PROP_DHCP_HOSTNAME: g_value_set_string (value, nm_setting_ip4_config_get_dhcp_hostname (setting)); break; + case PROP_DHCP_TIMEOUT: + g_value_set_uint (value, nm_setting_ip4_config_get_dhcp_timeout (setting)); + break; case PROP_NEVER_DEFAULT: g_value_set_boolean (value, priv->never_default); break; @@ -1327,6 +1351,19 @@ nm_setting_ip4_config_class_init (NMSettingIP4ConfigClass *setting_class) NM_SETTING_PARAM_INFERRABLE | G_PARAM_STATIC_STRINGS)); + /** + * NMSettingIP4Config:dhcp-timeout: + * + * Number of seconds after which the unfinished DHCP transaction fails + * or zero for default. + **/ + g_object_class_install_property + (object_class, PROP_DHCP_TIMEOUT, + g_param_spec_uint (NM_SETTING_IP4_CONFIG_DHCP_TIMEOUT, "", "", + 0, G_MAXUINT32, 0, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + /** * NMSettingIP4Config:never-default: * diff --git a/libnm-util/nm-setting-ip4-config.h b/libnm-util/nm-setting-ip4-config.h index 6e9a9a22..1365de29 100644 --- a/libnm-util/nm-setting-ip4-config.h +++ b/libnm-util/nm-setting-ip4-config.h @@ -66,6 +66,7 @@ GQuark nm_setting_ip4_config_error_quark (void); #define NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID "dhcp-client-id" #define NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME "dhcp-send-hostname" #define NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME "dhcp-hostname" +#define NM_SETTING_IP4_CONFIG_DHCP_TIMEOUT "dhcp-timeout" #define NM_SETTING_IP4_CONFIG_NEVER_DEFAULT "never-default" #define NM_SETTING_IP4_CONFIG_MAY_FAIL "may-fail" @@ -223,6 +224,8 @@ gboolean nm_setting_ip4_config_get_ignore_auto_dns (NMSettingIP4Config * const char * nm_setting_ip4_config_get_dhcp_client_id (NMSettingIP4Config *setting); gboolean nm_setting_ip4_config_get_dhcp_send_hostname (NMSettingIP4Config *setting); const char * nm_setting_ip4_config_get_dhcp_hostname (NMSettingIP4Config *setting); +NM_AVAILABLE_IN_1_2 +int nm_setting_ip4_config_get_dhcp_timeout (NMSettingIP4Config *setting); gboolean nm_setting_ip4_config_get_never_default (NMSettingIP4Config *setting); diff --git a/libnm-util/nm-setting-ip6-config.c b/libnm-util/nm-setting-ip6-config.c index b929ebac..2ddce6c1 100644 --- a/libnm-util/nm-setting-ip6-config.c +++ b/libnm-util/nm-setting-ip6-config.c @@ -23,13 +23,12 @@ #include #include -#include +#include "nm-default.h" #include "nm-setting-ip6-config.h" #include "nm-param-spec-specialized.h" #include "nm-utils.h" #include "nm-dbus-glib-types.h" -#include "nm-glib-compat.h" #include "nm-setting-private.h" /** diff --git a/libnm-util/nm-setting-olpc-mesh.c b/libnm-util/nm-setting-olpc-mesh.c index e4b6dae5..8d812869 100644 --- a/libnm-util/nm-setting-olpc-mesh.c +++ b/libnm-util/nm-setting-olpc-mesh.c @@ -25,7 +25,6 @@ #include #include #include -#include #include "NetworkManager.h" #include "nm-setting-olpc-mesh.h" diff --git a/libnm-util/nm-setting-ppp.c b/libnm-util/nm-setting-ppp.c index a01d3e10..06f220fe 100644 --- a/libnm-util/nm-setting-ppp.c +++ b/libnm-util/nm-setting-ppp.c @@ -22,8 +22,6 @@ #include "config.h" -#include - #include "nm-setting-ppp.h" #include "nm-setting-private.h" diff --git a/libnm-util/nm-setting-pppoe.c b/libnm-util/nm-setting-pppoe.c index deaeb2e8..5747d306 100644 --- a/libnm-util/nm-setting-pppoe.c +++ b/libnm-util/nm-setting-pppoe.c @@ -23,7 +23,6 @@ #include "config.h" #include -#include #include "nm-setting-pppoe.h" #include "nm-setting-ppp.h" diff --git a/libnm-util/nm-setting-private.h b/libnm-util/nm-setting-private.h index 1b271d0c..6956463c 100644 --- a/libnm-util/nm-setting-private.h +++ b/libnm-util/nm-setting-private.h @@ -21,7 +21,7 @@ #ifndef NM_SETTING_PRIVATE_H #define NM_SETTING_PRIVATE_H -#include "nm-glib-compat.h" +#include "nm-default.h" #define NM_SETTING_SECRET_FLAGS_ALL \ (NM_SETTING_SECRET_FLAG_NONE | \ @@ -101,7 +101,7 @@ gboolean _nm_setting_clear_secrets_with_flags (NMSetting *setting, /* Ensure the setting's GType is registered at library load time */ #define NM_SETTING_REGISTER_TYPE(x) \ static void __attribute__((constructor)) register_setting (void) \ -{ g_type_init (); g_type_ensure (x); } +{ nm_g_type_init (); g_type_ensure (x); } NMSetting *nm_setting_find_in_list (GSList *settings_list, const char *setting_name); diff --git a/libnm-util/nm-setting-serial.c b/libnm-util/nm-setting-serial.c index 24f2c898..c60cffb2 100644 --- a/libnm-util/nm-setting-serial.c +++ b/libnm-util/nm-setting-serial.c @@ -24,8 +24,8 @@ #include +#include "nm-default.h" #include "nm-setting-serial.h" -#include "nm-glib-compat.h" #include "nm-setting-private.h" /** diff --git a/libnm-util/nm-setting-team-port.c b/libnm-util/nm-setting-team-port.c index 9992f58a..7e17d5e3 100644 --- a/libnm-util/nm-setting-team-port.c +++ b/libnm-util/nm-setting-team-port.c @@ -24,7 +24,6 @@ #include #include #include -#include #include "nm-setting-team-port.h" #include "nm-utils.h" diff --git a/libnm-util/nm-setting-team.c b/libnm-util/nm-setting-team.c index 19bc9596..07531503 100644 --- a/libnm-util/nm-setting-team.c +++ b/libnm-util/nm-setting-team.c @@ -23,7 +23,6 @@ #include #include #include -#include #include "nm-setting-team.h" #include "nm-param-spec-specialized.h" diff --git a/libnm-util/nm-setting-vlan.c b/libnm-util/nm-setting-vlan.c index d3bc0a37..310a7da8 100644 --- a/libnm-util/nm-setting-vlan.c +++ b/libnm-util/nm-setting-vlan.c @@ -24,7 +24,6 @@ #include #include #include -#include #include "nm-setting-vlan.h" #include "nm-param-spec-specialized.h" @@ -585,9 +584,7 @@ verify (NMSetting *setting, GSList *all_settings, GError **error) } } - if (priv->flags & ~(NM_VLAN_FLAG_REORDER_HEADERS | - NM_VLAN_FLAG_GVRP | - NM_VLAN_FLAG_LOOSE_BINDING)) { + if (priv->flags & ~NM_VLAN_FLAGS_ALL) { g_set_error_literal (error, NM_SETTING_VLAN_ERROR, NM_SETTING_VLAN_ERROR_INVALID_PROPERTY, @@ -801,12 +798,13 @@ nm_setting_vlan_class_init (NMSettingVlanClass *setting_class) * interface. Flags include %NM_VLAN_FLAG_REORDER_HEADERS (reordering of * output packet headers), %NM_VLAN_FLAG_GVRP (use of the GVRP protocol), * and %NM_VLAN_FLAG_LOOSE_BINDING (loose binding of the interface to its - * master device's operating state). + * master device's operating state), %NM_VLAN_FLAG_MVRP (use of the MVRP + * protocol). **/ g_object_class_install_property (object_class, PROP_FLAGS, g_param_spec_uint (NM_SETTING_VLAN_FLAGS, "", "", - 0, G_MAXUINT32, NM_VLAN_FLAG_REORDER_HEADERS, + 0, G_MAXUINT32, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | NM_SETTING_PARAM_INFERRABLE | diff --git a/libnm-util/nm-setting-vlan.h b/libnm-util/nm-setting-vlan.h index 3e209480..ce42dd41 100644 --- a/libnm-util/nm-setting-vlan.h +++ b/libnm-util/nm-setting-vlan.h @@ -98,6 +98,8 @@ typedef enum { * @NM_VLAN_FLAG_LOOSE_BINDING: indicates that this interface's operating * state is tied to the underlying network interface but other details * (like routing) are not. + * @NM_VLAN_FLAG_MVRP: indicates that this interface should use MVRP to register + * itself with it's switch * * #NMVlanFlags values control the behavior of the VLAN interface. **/ @@ -105,10 +107,16 @@ typedef enum { NM_VLAN_FLAG_REORDER_HEADERS = 0x1, NM_VLAN_FLAG_GVRP = 0x2, NM_VLAN_FLAG_LOOSE_BINDING = 0x4, + NM_VLAN_FLAG_MVRP = 0x8, /* NOTE: if adding flags update nm-setting-vlan.c::verify() */ } NMVlanFlags; +#define NM_VLAN_FLAGS_ALL (NM_VLAN_FLAG_REORDER_HEADERS | \ + NM_VLAN_FLAG_GVRP | \ + NM_VLAN_FLAG_LOOSE_BINDING | \ + NM_VLAN_FLAG_MVRP) + GType nm_setting_vlan_get_type (void); NMSetting *nm_setting_vlan_new (void); diff --git a/libnm-util/nm-setting-vpn.c b/libnm-util/nm-setting-vpn.c index 1feeb588..95f08adf 100644 --- a/libnm-util/nm-setting-vpn.c +++ b/libnm-util/nm-setting-vpn.c @@ -25,7 +25,6 @@ #include #include #include -#include #include "nm-setting-vpn.h" #include "nm-param-spec-specialized.h" diff --git a/libnm-util/nm-setting-vpn.h b/libnm-util/nm-setting-vpn.h index fbc9fe34..acce6e63 100644 --- a/libnm-util/nm-setting-vpn.h +++ b/libnm-util/nm-setting-vpn.h @@ -112,6 +112,10 @@ void nm_setting_vpn_foreach_secret (NMSettingVPN *setting, NMVPNIterFunc func, gpointer user_data); +#ifdef NM_VPN_LIBNM_COMPAT +#define NMSettingVpn NMSettingVPN +#endif + G_END_DECLS #endif /* NM_SETTING_VPN_H */ diff --git a/libnm-util/nm-setting-wimax.c b/libnm-util/nm-setting-wimax.c index acb00f5e..7581f2f2 100644 --- a/libnm-util/nm-setting-wimax.c +++ b/libnm-util/nm-setting-wimax.c @@ -25,7 +25,6 @@ #include #include #include -#include #include "nm-setting-wimax.h" #include "nm-param-spec-specialized.h" @@ -38,6 +37,10 @@ * * The #NMSettingWimax object is a #NMSetting subclass that describes properties * necessary for connection to 802.16e Mobile WiMAX networks. + * + * NetworkManager no longer supports WiMAX; while this API remains available for + * backward-compatibility reasons, it serves no real purpose, since WiMAX + * connections cannot be activated. **/ /** @@ -46,6 +49,8 @@ * Registers an error quark for #NMSettingWimax if necessary. * * Returns: the error quark used for #NMSettingWimax errors. + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ GQuark nm_setting_wimax_error_quark (void) @@ -86,6 +91,8 @@ enum { * Creates a new #NMSettingWimax object with default values. * * Returns: the new empty #NMSettingWimax object + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ NMSetting * nm_setting_wimax_new (void) @@ -101,6 +108,8 @@ nm_setting_wimax_new (void) * specific WiMAX network this setting describes a connection to. * * Returns: the WiMAX NSP name + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ const char * nm_setting_wimax_get_network_name (NMSettingWimax *setting) @@ -118,6 +127,8 @@ nm_setting_wimax_get_network_name (NMSettingWimax *setting) * to. * * Returns: the MAC address + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ const GByteArray * nm_setting_wimax_get_mac_address (NMSettingWimax *setting) @@ -240,6 +251,8 @@ nm_setting_wimax_class_init (NMSettingWimaxClass *setting_class) * * Network Service Provider (NSP) name of the WiMAX network this connection * should use. + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ g_object_class_install_property (object_class, PROP_NETWORK_NAME, @@ -254,6 +267,8 @@ nm_setting_wimax_class_init (NMSettingWimaxClass *setting_class) * If specified, this connection will only apply to the WiMAX device whose * MAC address matches. This property does not change the MAC address of the * device (known as MAC spoofing). + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ g_object_class_install_property (object_class, PROP_MAC_ADDRESS, diff --git a/libnm-util/nm-setting-wimax.h b/libnm-util/nm-setting-wimax.h index 781d717c..9d7a07af 100644 --- a/libnm-util/nm-setting-wimax.h +++ b/libnm-util/nm-setting-wimax.h @@ -49,6 +49,7 @@ typedef enum { } NMSettingWimaxError; #define NM_SETTING_WIMAX_ERROR nm_setting_wimax_error_quark () +NM_DEPRECATED_IN_1_2 GQuark nm_setting_wimax_error_quark (void); #define NM_SETTING_WIMAX_NETWORK_NAME "network-name" @@ -62,10 +63,14 @@ typedef struct { NMSettingClass parent; } NMSettingWimaxClass; +NM_DEPRECATED_IN_1_2 GType nm_setting_wimax_get_type (void); +NM_DEPRECATED_IN_1_2 NMSetting *nm_setting_wimax_new (void); +NM_DEPRECATED_IN_1_2 const char *nm_setting_wimax_get_network_name (NMSettingWimax *setting); +NM_DEPRECATED_IN_1_2 const GByteArray *nm_setting_wimax_get_mac_address (NMSettingWimax *setting); G_END_DECLS diff --git a/libnm-util/nm-setting-wired.c b/libnm-util/nm-setting-wired.c index aba5fb98..5233fc53 100644 --- a/libnm-util/nm-setting-wired.c +++ b/libnm-util/nm-setting-wired.c @@ -26,7 +26,6 @@ #include #include #include -#include #include "nm-setting-wired.h" #include "nm-param-spec-specialized.h" diff --git a/libnm-util/nm-setting-wireless-security.c b/libnm-util/nm-setting-wireless-security.c index 574ff3bd..719dfaa6 100644 --- a/libnm-util/nm-setting-wireless-security.c +++ b/libnm-util/nm-setting-wireless-security.c @@ -24,7 +24,6 @@ #include #include -#include #include "nm-setting-wireless-security.h" #include "nm-setting-8021x.h" diff --git a/libnm-util/nm-setting-wireless.c b/libnm-util/nm-setting-wireless.c index 99f4c9b1..2720f4af 100644 --- a/libnm-util/nm-setting-wireless.c +++ b/libnm-util/nm-setting-wireless.c @@ -26,7 +26,6 @@ #include #include #include -#include #include "NetworkManager.h" #include "nm-setting-wireless.h" @@ -87,6 +86,7 @@ typedef struct { GSList *seen_bssids; char *security; gboolean hidden; + guint32 powersave; } NMSettingWirelessPrivate; enum { @@ -105,6 +105,7 @@ enum { PROP_SEEN_BSSIDS, PROP_SEC, PROP_HIDDEN, + PROP_POWERSAVE, LAST_PROP }; @@ -661,6 +662,22 @@ nm_setting_wireless_get_hidden (NMSettingWireless *setting) return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->hidden; } +/** + * nm_setting_wireless_get_powersave: + * @setting: the #NMSettingWireless + * + * Returns: the #NMSettingWireless:powersave property of the setting + * + * Since: 1.2 + **/ +guint32 +nm_setting_wireless_get_powersave (NMSettingWireless *setting) +{ + g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), 0); + + return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->powersave; +} + /** * nm_setting_wireless_add_seen_bssid: * @setting: the #NMSettingWireless @@ -953,6 +970,9 @@ set_property (GObject *object, guint prop_id, case PROP_HIDDEN: priv->hidden = g_value_get_boolean (value); break; + case PROP_POWERSAVE: + priv->powersave = g_value_get_uint (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -1008,6 +1028,9 @@ get_property (GObject *object, guint prop_id, case PROP_HIDDEN: g_value_set_boolean (value, nm_setting_wireless_get_hidden (setting)); break; + case PROP_POWERSAVE: + g_value_set_uint (value, nm_setting_wireless_get_powersave (setting)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -1244,4 +1267,21 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class) FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + /** + * NMSettingWireless:powersave: + * + * If set to %FALSE, Wi-Fi power saving behavior is disabled. If set to + * %TRUE, Wi-Fi power saving behavior is enabled. All other values are + * reserved. Note that even though only boolean values are allowed, the + * property type is an unsigned integer to allow for future expansion. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_POWERSAVE, + g_param_spec_uint (NM_SETTING_WIRELESS_POWERSAVE, "", "", + 0, G_MAXUINT32, 0, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); } diff --git a/libnm-util/nm-setting-wireless.h b/libnm-util/nm-setting-wireless.h index 18f78cff..77eff73e 100644 --- a/libnm-util/nm-setting-wireless.h +++ b/libnm-util/nm-setting-wireless.h @@ -73,6 +73,7 @@ GQuark nm_setting_wireless_error_quark (void); #define NM_SETTING_WIRELESS_MTU "mtu" #define NM_SETTING_WIRELESS_SEEN_BSSIDS "seen-bssids" #define NM_SETTING_WIRELESS_HIDDEN "hidden" +#define NM_SETTING_WIRELESS_POWERSAVE "powersave" /* Deprecated */ #define NM_SETTING_WIRELESS_SEC "security" @@ -150,6 +151,8 @@ void nm_setting_wireless_clear_mac_blacklist_items (NMSettingWire guint32 nm_setting_wireless_get_mtu (NMSettingWireless *setting); gboolean nm_setting_wireless_get_hidden (NMSettingWireless *setting); +NM_AVAILABLE_IN_1_2 +guint32 nm_setting_wireless_get_powersave (NMSettingWireless *setting); gboolean nm_setting_wireless_add_seen_bssid (NMSettingWireless *setting, const char *bssid); diff --git a/libnm-util/nm-setting.c b/libnm-util/nm-setting.c index 35ae01da..372b06b5 100644 --- a/libnm-util/nm-setting.c +++ b/libnm-util/nm-setting.c @@ -23,7 +23,6 @@ #include "config.h" #include -#include #include "nm-setting.h" #include "nm-setting-private.h" @@ -103,9 +102,7 @@ static void _ensure_registered (void) { if (G_UNLIKELY (registered_settings == NULL)) { -#if !GLIB_CHECK_VERSION (2, 35, 0) - g_type_init (); -#endif + nm_g_type_init (); _nm_value_transforms_register (); registered_settings = g_hash_table_new (g_str_hash, g_str_equal); registered_settings_by_type = g_hash_table_new (_nm_gtype_hash, _nm_gtype_equal); diff --git a/libnm-util/nm-utils-enum-types.c b/libnm-util/nm-utils-enum-types.c index e5dde28e..8c2c1bbf 100644 --- a/libnm-util/nm-utils-enum-types.c +++ b/libnm-util/nm-utils-enum-types.c @@ -3,6 +3,8 @@ /* Generated by glib-mkenums. Do not edit */ +#include "config.h" + #include "nm-utils-enum-types.h" #include "nm-version-macros.h" @@ -527,6 +529,7 @@ nm_vlan_flags_get_type (void) { NM_VLAN_FLAG_REORDER_HEADERS, "NM_VLAN_FLAG_REORDER_HEADERS", "reorder-headers" }, { NM_VLAN_FLAG_GVRP, "NM_VLAN_FLAG_GVRP", "gvrp" }, { NM_VLAN_FLAG_LOOSE_BINDING, "NM_VLAN_FLAG_LOOSE_BINDING", "loose-binding" }, + { NM_VLAN_FLAG_MVRP, "NM_VLAN_FLAG_MVRP", "mvrp" }, { 0, NULL, NULL } }; GType g_define_type_id = diff --git a/libnm-util/nm-utils.c b/libnm-util/nm-utils.c index 143063e7..1659a1a3 100644 --- a/libnm-util/nm-utils.c +++ b/libnm-util/nm-utils.c @@ -28,12 +28,11 @@ #include #include #include -#include -#include +#include "nm-default.h" +#include "nm-gvaluearray-compat.h" #include "nm-utils.h" #include "nm-utils-private.h" -#include "nm-glib-compat.h" #include "nm-dbus-glib-types.h" #include "nm-setting-private.h" #include "crypto.h" diff --git a/libnm-util/nm-value-transforms.c b/libnm-util/nm-value-transforms.c index 00e7e775..fd4aaf60 100644 --- a/libnm-util/nm-value-transforms.c +++ b/libnm-util/nm-value-transforms.c @@ -23,10 +23,11 @@ #include +#include "nm-default.h" +#include "nm-gvaluearray-compat.h" #include "nm-utils.h" #include "nm-utils-private.h" #include "nm-dbus-glib-types.h" -#include "nm-glib-compat.h" static void _nm_utils_convert_op_to_string (const GValue *src_value, GValue *dest_value) diff --git a/libnm-util/nm-version.h b/libnm-util/nm-version.h index 63895dda..fd94e210 100644 --- a/libnm-util/nm-version.h +++ b/libnm-util/nm-version.h @@ -76,16 +76,18 @@ # define NM_AVAILABLE_IN_1_0 #endif -#if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_0_4 -# define NM_AVAILABLE_IN_1_0_4 G_UNAVAILABLE(1,0.4) +#if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_2 +# define NM_DEPRECATED_IN_1_2 G_DEPRECATED +# define NM_DEPRECATED_IN_1_2_FOR(f) G_DEPRECATED_FOR(f) #else -# define NM_AVAILABLE_IN_1_0_4 +# define NM_DEPRECATED_IN_1_2 +# define NM_DEPRECATED_IN_1_2_FOR(f) #endif -#if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_0_6 -# define NM_AVAILABLE_IN_1_0_6 G_UNAVAILABLE(1,0.6) +#if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_2 +# define NM_AVAILABLE_IN_1_2 G_UNAVAILABLE(1,2) #else -# define NM_AVAILABLE_IN_1_0_6 +# define NM_AVAILABLE_IN_1_2 #endif #endif /* NM_VERSION_H */ diff --git a/libnm-util/tests/Makefile.am b/libnm-util/tests/Makefile.am index e580a134..eda212ed 100644 --- a/libnm-util/tests/Makefile.am +++ b/libnm-util/tests/Makefile.am @@ -1,8 +1,8 @@ if ENABLE_TESTS AM_CPPFLAGS = \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ + -I$(top_srcdir)/shared \ + -I$(top_builddir)/shared \ -I$(top_srcdir)/libnm-util \ -I$(top_builddir)/libnm-util \ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ diff --git a/libnm-util/tests/Makefile.in b/libnm-util/tests/Makefile.in index df7ab974..8d5cd984 100644 --- a/libnm-util/tests/Makefile.in +++ b/libnm-util/tests/Makefile.in @@ -463,7 +463,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -475,8 +474,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -486,6 +483,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -540,16 +538,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -586,6 +581,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -614,7 +611,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -629,6 +625,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -689,6 +687,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -696,6 +695,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -712,8 +712,8 @@ with_netconfig = @with_netconfig@ with_resolvconf = @with_resolvconf@ with_valgrind = @with_valgrind@ @ENABLE_TESTS_TRUE@AM_CPPFLAGS = \ -@ENABLE_TESTS_TRUE@ -I$(top_srcdir)/include \ -@ENABLE_TESTS_TRUE@ -I$(top_builddir)/include \ +@ENABLE_TESTS_TRUE@ -I$(top_srcdir)/shared \ +@ENABLE_TESTS_TRUE@ -I$(top_builddir)/shared \ @ENABLE_TESTS_TRUE@ -I$(top_srcdir)/libnm-util \ @ENABLE_TESTS_TRUE@ -I$(top_builddir)/libnm-util \ @ENABLE_TESTS_TRUE@ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ diff --git a/libnm-util/tests/test-crypto.c b/libnm-util/tests/test-crypto.c index 8055facf..5a8c4eb0 100644 --- a/libnm-util/tests/test-crypto.c +++ b/libnm-util/tests/test-crypto.c @@ -23,13 +23,12 @@ #include "config.h" -#include #include #include -#include #include #include +#include "nm-default.h" #include "crypto.h" #include "nm-utils.h" diff --git a/libnm-util/tests/test-general.c b/libnm-util/tests/test-general.c index f365dc04..f35819e7 100644 --- a/libnm-util/tests/test-general.c +++ b/libnm-util/tests/test-general.c @@ -21,7 +21,6 @@ #include "config.h" -#include #include #include #include @@ -30,7 +29,8 @@ #include #include -#include "gsystem-local-alloc.h" +#include "nm-default.h" +#include "nm-gvaluearray-compat.h" #include "nm-setting-private.h" #include "nm-setting-connection.h" @@ -1283,6 +1283,7 @@ test_connection_diff_a_only (void) { NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_IP4_CONFIG_DHCP_CLIENT_ID, NM_SETTING_DIFF_RESULT_IN_A }, + { NM_SETTING_IP4_CONFIG_DHCP_TIMEOUT, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_IP4_CONFIG_DHCP_SEND_HOSTNAME, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, NM_SETTING_DIFF_RESULT_IN_A }, { NM_SETTING_IP4_CONFIG_NEVER_DEFAULT, NM_SETTING_DIFF_RESULT_IN_A }, diff --git a/libnm-util/tests/test-libnm-linking.c b/libnm-util/tests/test-libnm-linking.c index 9738d44d..a24498f8 100644 --- a/libnm-util/tests/test-libnm-linking.c +++ b/libnm-util/tests/test-libnm-linking.c @@ -21,10 +21,9 @@ #include "config.h" -#include #include -#include "nm-glib-compat.h" +#include "nm-default.h" extern GType nm_state_get_type (void); diff --git a/libnm-util/tests/test-secrets.c b/libnm-util/tests/test-secrets.c index adf3a94a..f5423d10 100644 --- a/libnm-util/tests/test-secrets.c +++ b/libnm-util/tests/test-secrets.c @@ -21,11 +21,11 @@ #include "config.h" -#include #include #include +#include "nm-default.h" #include "nm-setting-connection.h" #include "nm-setting-wired.h" #include "nm-setting-8021x.h" diff --git a/libnm-util/tests/test-setting-8021x.c b/libnm-util/tests/test-setting-8021x.c index dfc07a80..ad48ac61 100644 --- a/libnm-util/tests/test-setting-8021x.c +++ b/libnm-util/tests/test-setting-8021x.c @@ -21,11 +21,11 @@ #include "config.h" -#include #include #include +#include "nm-default.h" #include "nm-setting-connection.h" #include "nm-setting-8021x.h" diff --git a/libnm-util/tests/test-setting-dcb.c b/libnm-util/tests/test-setting-dcb.c index 36192cd3..59eac3c5 100644 --- a/libnm-util/tests/test-setting-dcb.c +++ b/libnm-util/tests/test-setting-dcb.c @@ -21,12 +21,12 @@ #include "config.h" -#include #include #include -#include +#include "nm-default.h" #include "nm-setting-dcb.h" -#include "gsystem-local-alloc.h" + +#include "nm-test-utils.h" #define DCB_FLAGS_ALL (NM_SETTING_DCB_FLAG_ENABLE | \ NM_SETTING_DCB_FLAG_ADVERTISE | \ @@ -301,24 +301,11 @@ test_dcb_bandwidth_sums (void) #define TPATH "/libnm-util/settings/dcb/" +NMTST_DEFINE (); + int main (int argc, char **argv) { - GError *error = NULL; - gboolean success; - - g_test_init (&argc, &argv, NULL); - -#if !GLIB_CHECK_VERSION (2, 35, 0) - g_type_init (); -#endif - - success = nm_utils_init (&error); - g_assert_no_error (error); - g_assert (success); - -#if !GLIB_CHECK_VERSION(2,34,0) - g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL); -#endif + nmtst_init (&argc, &argv, TRUE); g_test_add_func (TPATH "flags-valid", test_dcb_flags_valid); g_test_add_func (TPATH "flags-invalid", test_dcb_flags_invalid); diff --git a/libnm-util/tests/test-settings-defaults.c b/libnm-util/tests/test-settings-defaults.c index 70a743cb..09f112cf 100644 --- a/libnm-util/tests/test-settings-defaults.c +++ b/libnm-util/tests/test-settings-defaults.c @@ -21,11 +21,11 @@ #include "config.h" -#include #include #include +#include "nm-default.h" #include "nm-setting-8021x.h" #include "nm-setting-cdma.h" #include "nm-setting-connection.h" diff --git a/libnm/Makefile.am b/libnm/Makefile.am index fec008a0..80cdccb0 100644 --- a/libnm/Makefile.am +++ b/libnm/Makefile.am @@ -3,15 +3,15 @@ include $(GLIB_MAKEFILE) SUBDIRS = . tests AM_CPPFLAGS = \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ + -I$(top_srcdir)/shared \ + -I$(top_builddir)/shared \ -I$(top_builddir)/introspection \ -I$(top_srcdir)/libnm-core \ -I$(top_builddir)/libnm-core \ -I$(top_srcdir)/libnm \ -I$(top_builddir)/libnm \ -DG_LOG_DOMAIN=\""libnm"\" \ - -DNETWORKMANAGER_COMPILATION \ + -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB \ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ $(GLIB_CFLAGS) \ $(GUDEV_CFLAGS) \ @@ -26,7 +26,7 @@ lib_LTLIBRARIES = libnm.la libnmincludedir = $(includedir)/libnm libnminclude_hfiles = \ - $(top_builddir)/include/nm-version-macros.h \ + $(top_builddir)/shared/nm-version-macros.h \ NetworkManager.h \ nm-access-point.h \ nm-active-connection.h \ @@ -38,10 +38,14 @@ libnminclude_hfiles = \ nm-device-ethernet.h \ nm-device-generic.h \ nm-device-infiniband.h \ + nm-device-ip-tunnel.h \ + nm-device-macvlan.h \ nm-device-modem.h \ nm-device-olpc-mesh.h \ nm-device-team.h \ + nm-device-tun.h \ nm-device-vlan.h \ + nm-device-vxlan.h \ nm-device-wifi.h \ nm-device-wimax.h \ nm-device.h \ @@ -52,12 +56,13 @@ libnminclude_hfiles = \ nm-remote-connection.h \ nm-types.h \ nm-vpn-connection.h \ - nm-vpn-editor-plugin.h \ + nm-vpn-editor.h \ nm-wimax-nsp.h libnminclude_nointrospect_hfiles = \ nm-secret-agent-old.h \ - nm-vpn-plugin-old.h + nm-vpn-plugin-old.h \ + nm-vpn-service-plugin.h libnminclude_HEADERS = \ $(libnminclude_hfiles) \ @@ -88,10 +93,14 @@ libnm_la_csources = \ nm-device-ethernet.c \ nm-device-generic.c \ nm-device-infiniband.c \ + nm-device-ip-tunnel.c \ + nm-device-macvlan.c \ nm-device-modem.c \ nm-device-olpc-mesh.c \ nm-device-team.c \ + nm-device-tun.c \ nm-device-vlan.c \ + nm-device-vxlan.c \ nm-device-wifi.c \ nm-device-wimax.c \ nm-device.c \ @@ -110,7 +119,8 @@ libnm_la_csources = \ nm-secret-agent-old.c \ nm-vpn-connection.c \ nm-vpn-plugin-old.c \ - nm-vpn-editor-plugin.c \ + nm-vpn-editor.c \ + nm-vpn-service-plugin.c \ nm-wimax-nsp.c libnm_la_SOURCES = \ @@ -132,7 +142,7 @@ libnm_la_LIBADD = \ SYMBOL_VIS_FILE=$(srcdir)/libnm.ver libnm_la_LDFLAGS = -Wl,--version-script=$(SYMBOL_VIS_FILE) \ - -version-info "0:0:0" + -version-info "1:0:1" ### diff --git a/libnm/Makefile.in b/libnm/Makefile.in index fe710af7..6e7fcd42 100644 --- a/libnm/Makefile.in +++ b/libnm/Makefile.in @@ -161,15 +161,17 @@ am__objects_1 = nm-access-point.lo nm-active-connection.lo \ nm-client.lo nm-dbus-helpers.lo nm-device-adsl.lo \ nm-device-bond.lo nm-device-bridge.lo nm-device-bt.lo \ nm-device-ethernet.lo nm-device-generic.lo \ - nm-device-infiniband.lo nm-device-modem.lo \ - nm-device-olpc-mesh.lo nm-device-team.lo nm-device-vlan.lo \ - nm-device-wifi.lo nm-device-wimax.lo nm-device.lo \ - nm-dhcp-config.lo nm-dhcp4-config.lo nm-dhcp6-config.lo \ - nm-enum-types.lo nm-ip-config.lo nm-ip4-config.lo \ - nm-ip6-config.lo nm-manager.lo nm-object-cache.lo nm-object.lo \ - nm-remote-connection.lo nm-remote-settings.lo \ - nm-secret-agent-old.lo nm-vpn-connection.lo \ - nm-vpn-plugin-old.lo nm-vpn-editor-plugin.lo nm-wimax-nsp.lo + nm-device-infiniband.lo nm-device-ip-tunnel.lo \ + nm-device-macvlan.lo nm-device-modem.lo nm-device-olpc-mesh.lo \ + nm-device-team.lo nm-device-tun.lo nm-device-vlan.lo \ + nm-device-vxlan.lo nm-device-wifi.lo nm-device-wimax.lo \ + nm-device.lo nm-dhcp-config.lo nm-dhcp4-config.lo \ + nm-dhcp6-config.lo nm-enum-types.lo nm-ip-config.lo \ + nm-ip4-config.lo nm-ip6-config.lo nm-manager.lo \ + nm-object-cache.lo nm-object.lo nm-remote-connection.lo \ + nm-remote-settings.lo nm-secret-agent-old.lo \ + nm-vpn-connection.lo nm-vpn-plugin-old.lo nm-vpn-editor.lo \ + nm-vpn-service-plugin.lo nm-wimax-nsp.lo am__objects_2 = am_libnm_la_OBJECTS = $(am__objects_1) $(am__objects_2) libnm_la_OBJECTS = $(am_libnm_la_OBJECTS) @@ -303,7 +305,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -315,8 +316,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -326,6 +325,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -380,16 +380,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -426,6 +423,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -454,7 +453,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -469,6 +467,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -529,6 +529,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -536,6 +537,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -553,15 +555,15 @@ with_resolvconf = @with_resolvconf@ with_valgrind = @with_valgrind@ SUBDIRS = . tests AM_CPPFLAGS = \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ + -I$(top_srcdir)/shared \ + -I$(top_builddir)/shared \ -I$(top_builddir)/introspection \ -I$(top_srcdir)/libnm-core \ -I$(top_builddir)/libnm-core \ -I$(top_srcdir)/libnm \ -I$(top_builddir)/libnm \ -DG_LOG_DOMAIN=\""libnm"\" \ - -DNETWORKMANAGER_COMPILATION \ + -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB \ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ $(GLIB_CFLAGS) \ $(GUDEV_CFLAGS) \ @@ -570,7 +572,7 @@ AM_CPPFLAGS = \ core = $(top_srcdir)/libnm-core core_build = $(top_builddir)/libnm-core libnm_core_headers = \ - $(top_builddir)/include/nm-version-macros.h \ + $(top_builddir)/shared/nm-version-macros.h \ $(core_build)/nm-core-enum-types.h \ $(core)/nm-connection.h \ $(core)/nm-core-types.h \ @@ -589,16 +591,20 @@ libnm_core_headers = \ $(core)/nm-setting-gsm.h \ $(core)/nm-setting-infiniband.h \ $(core)/nm-setting-ip-config.h \ + $(core)/nm-setting-ip-tunnel.h \ $(core)/nm-setting-ip4-config.h \ $(core)/nm-setting-ip6-config.h \ + $(core)/nm-setting-macvlan.h \ $(core)/nm-setting-olpc-mesh.h \ $(core)/nm-setting-ppp.h \ $(core)/nm-setting-pppoe.h \ $(core)/nm-setting-serial.h \ $(core)/nm-setting-team-port.h \ $(core)/nm-setting-team.h \ + $(core)/nm-setting-tun.h \ $(core)/nm-setting-vlan.h \ $(core)/nm-setting-vpn.h \ + $(core)/nm-setting-vxlan.h \ $(core)/nm-setting-wimax.h \ $(core)/nm-setting-wired.h \ $(core)/nm-setting-wireless-security.h \ @@ -607,12 +613,15 @@ libnm_core_headers = \ $(core)/nm-simple-connection.h \ $(core)/nm-utils.h \ $(core)/nm-version.h \ - $(core)/nm-vpn-dbus-interface.h + $(core)/nm-vpn-dbus-interface.h \ + $(core)/nm-vpn-editor-plugin.h \ + $(core)/nm-vpn-plugin-info.h libnm_core_private_headers = \ $(core)/crypto.h \ $(core)/nm-connection-private.h \ $(core)/nm-core-internal.h \ + $(core)/nm-core-types-internal.h \ $(core)/nm-keyfile-internal.h \ $(core)/nm-keyfile-utils.h \ $(core)/nm-property-compare.h \ @@ -623,6 +632,7 @@ libnm_core_sources = \ $(core_build)/nm-core-enum-types.c \ $(core)/crypto.c \ $(core)/nm-connection.c \ + $(core)/nm-dbus-utils.c \ $(core)/nm-errors.c \ $(core)/nm-keyfile-reader.c \ $(core)/nm-keyfile-utils.c \ @@ -641,30 +651,36 @@ libnm_core_sources = \ $(core)/nm-setting-gsm.c \ $(core)/nm-setting-infiniband.c \ $(core)/nm-setting-ip-config.c \ + $(core)/nm-setting-ip-tunnel.c \ $(core)/nm-setting-ip4-config.c \ $(core)/nm-setting-ip6-config.c \ + $(core)/nm-setting-macvlan.c \ $(core)/nm-setting-olpc-mesh.c \ $(core)/nm-setting-ppp.c \ $(core)/nm-setting-pppoe.c \ $(core)/nm-setting-serial.c \ $(core)/nm-setting-team-port.c \ $(core)/nm-setting-team.c \ + $(core)/nm-setting-tun.c \ $(core)/nm-setting-vlan.c \ $(core)/nm-setting-vpn.c \ + $(core)/nm-setting-vxlan.c \ $(core)/nm-setting-wimax.c \ $(core)/nm-setting-wired.c \ $(core)/nm-setting-wireless-security.c \ $(core)/nm-setting-wireless.c \ $(core)/nm-setting.c \ $(core)/nm-simple-connection.c \ - $(core)/nm-utils.c + $(core)/nm-utils.c \ + $(core)/nm-vpn-editor-plugin.c \ + $(core)/nm-vpn-plugin-info.c # libnm lib_LTLIBRARIES = libnm.la libnmincludedir = $(includedir)/libnm libnminclude_hfiles = \ - $(top_builddir)/include/nm-version-macros.h \ + $(top_builddir)/shared/nm-version-macros.h \ NetworkManager.h \ nm-access-point.h \ nm-active-connection.h \ @@ -676,10 +692,14 @@ libnminclude_hfiles = \ nm-device-ethernet.h \ nm-device-generic.h \ nm-device-infiniband.h \ + nm-device-ip-tunnel.h \ + nm-device-macvlan.h \ nm-device-modem.h \ nm-device-olpc-mesh.h \ nm-device-team.h \ + nm-device-tun.h \ nm-device-vlan.h \ + nm-device-vxlan.h \ nm-device-wifi.h \ nm-device-wimax.h \ nm-device.h \ @@ -690,12 +710,13 @@ libnminclude_hfiles = \ nm-remote-connection.h \ nm-types.h \ nm-vpn-connection.h \ - nm-vpn-editor-plugin.h \ + nm-vpn-editor.h \ nm-wimax-nsp.h libnminclude_nointrospect_hfiles = \ nm-secret-agent-old.h \ - nm-vpn-plugin-old.h + nm-vpn-plugin-old.h \ + nm-vpn-service-plugin.h libnminclude_HEADERS = \ $(libnminclude_hfiles) \ @@ -726,10 +747,14 @@ libnm_la_csources = \ nm-device-ethernet.c \ nm-device-generic.c \ nm-device-infiniband.c \ + nm-device-ip-tunnel.c \ + nm-device-macvlan.c \ nm-device-modem.c \ nm-device-olpc-mesh.c \ nm-device-team.c \ + nm-device-tun.c \ nm-device-vlan.c \ + nm-device-vxlan.c \ nm-device-wifi.c \ nm-device-wimax.c \ nm-device.c \ @@ -748,7 +773,8 @@ libnm_la_csources = \ nm-secret-agent-old.c \ nm-vpn-connection.c \ nm-vpn-plugin-old.c \ - nm-vpn-editor-plugin.c \ + nm-vpn-editor.c \ + nm-vpn-service-plugin.c \ nm-wimax-nsp.c libnm_la_SOURCES = \ @@ -768,7 +794,7 @@ libnm_la_LIBADD = \ SYMBOL_VIS_FILE = $(srcdir)/libnm.ver libnm_la_LDFLAGS = -Wl,--version-script=$(SYMBOL_VIS_FILE) \ - -version-info "0:0:0" + -version-info "1:0:1" ### @@ -904,10 +930,14 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-device-ethernet.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-device-generic.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-device-infiniband.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-device-ip-tunnel.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-device-macvlan.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-device-modem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-device-olpc-mesh.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-device-team.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-device-tun.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-device-vlan.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-device-vxlan.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-device-wifi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-device-wimax.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-device.Plo@am__quote@ @@ -925,8 +955,9 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-remote-settings.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-secret-agent-old.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-vpn-connection.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-vpn-editor-plugin.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-vpn-editor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-vpn-plugin-old.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-vpn-service-plugin.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-wimax-nsp.Plo@am__quote@ .c.o: diff --git a/libnm/NetworkManager.h b/libnm/NetworkManager.h index 251a0422..35cd07ae 100644 --- a/libnm/NetworkManager.h +++ b/libnm/NetworkManager.h @@ -61,16 +61,20 @@ #include #include #include +#include #include #include +#include #include #include #include #include #include #include +#include #include #include +#include #include #include #include @@ -81,7 +85,9 @@ #include #include #include +#include #include +#include #include #undef __NETWORKMANAGER_H_INSIDE__ diff --git a/libnm/libnm.pc.in b/libnm/libnm.pc.in index 5fe26b6a..afc5e4d9 100644 --- a/libnm/libnm.pc.in +++ b/libnm/libnm.pc.in @@ -2,6 +2,7 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ +vpnservicedir=@nmlibdir@/VPN Name: libnm Description: Convenience library for clients of NetworkManager diff --git a/libnm/libnm.ver b/libnm/libnm.ver index 90c5de04..ed008eee 100644 --- a/libnm/libnm.ver +++ b/libnm/libnm.ver @@ -821,17 +821,6 @@ global: nm_vpn_plugin_error_get_type; nm_vpn_plugin_error_quark; nm_vpn_plugin_failure_get_type; - nm_vpn_plugin_old_disconnect; - nm_vpn_plugin_old_failure; - nm_vpn_plugin_old_get_connection; - nm_vpn_plugin_old_get_secret_flags; - nm_vpn_plugin_old_get_state; - nm_vpn_plugin_old_get_type; - nm_vpn_plugin_old_read_vpn_details; - nm_vpn_plugin_old_secrets_required; - nm_vpn_plugin_old_set_ip4_config; - nm_vpn_plugin_old_set_login_banner; - nm_vpn_plugin_old_set_state; nm_vpn_service_state_get_type; nm_wep_key_type_get_type; nm_wimax_nsp_connection_valid; @@ -846,24 +835,209 @@ local: }; libnm_1_0_4 { -global: - nm_setting_connection_autoconnect_slaves_get_type; - nm_setting_connection_get_autoconnect_slaves; + #nm_setting_connection_autoconnect_slaves_get_type@libnm_1_0_4; + #nm_setting_connection_get_autoconnect_slaves@libnm_1_0_4; } libnm_1_0_0; libnm_1_0_6 { + #nm_access_point_get_last_seen@libnm_1_0_6; + #nm_device_get_metered@libnm_1_0_6; + #nm_device_wifi_request_scan_options@libnm_1_0_6; + #nm_device_wifi_request_scan_options_async@libnm_1_0_6; + #nm_metered_get_type@libnm_1_0_6; + #nm_setting_connection_get_metered@libnm_1_0_6; + #nm_setting_wired_get_wake_on_lan@libnm_1_0_6; + #nm_setting_wired_get_wake_on_lan_password@libnm_1_0_6; + #nm_setting_wired_wake_on_lan_get_type@libnm_1_0_6; + #nm_utils_enum_from_str@libnm_1_0_6; + #nm_utils_enum_to_str@libnm_1_0_6; + #nm_utils_wifi_2ghz_freqs@libnm_1_0_6; + #nm_utils_wifi_5ghz_freqs@libnm_1_0_6; +} libnm_1_0_4; + +libnm_1_2_0 { global: nm_access_point_get_last_seen; + nm_client_get_all_devices; + nm_connection_get_setting_ip_tunnel; + nm_connection_get_setting_macvlan; + nm_connection_get_setting_vxlan; + nm_connection_verify_secrets; + nm_device_ethernet_get_s390_subchannels; + nm_device_get_lldp_neighbors; nm_device_get_metered; + nm_device_get_nm_plugin_missing; + nm_device_ip_tunnel_get_encapsulation_limit; + nm_device_ip_tunnel_get_flow_label; + nm_device_ip_tunnel_get_input_key; + nm_device_ip_tunnel_get_local; + nm_device_ip_tunnel_get_mode; + nm_device_ip_tunnel_get_output_key; + nm_device_ip_tunnel_get_parent; + nm_device_ip_tunnel_get_path_mtu_discovery; + nm_device_ip_tunnel_get_remote; + nm_device_ip_tunnel_get_tos; + nm_device_ip_tunnel_get_ttl; + nm_device_ip_tunnel_get_type; + nm_device_is_real; + nm_device_macvlan_get_hw_address; + nm_device_macvlan_get_mode; + nm_device_macvlan_get_no_promisc; + nm_device_macvlan_get_parent; + nm_device_macvlan_get_tap; + nm_device_macvlan_get_type; + nm_device_reapply; + nm_device_reapply_async; + nm_device_reapply_finish; + nm_device_set_managed; + nm_device_tun_get_group; + nm_device_tun_get_hw_address; + nm_device_tun_get_mode; + nm_device_tun_get_multi_queue; + nm_device_tun_get_owner; + nm_device_tun_get_no_pi; + nm_device_tun_get_type; + nm_device_tun_get_vnet_hdr; + nm_device_vxlan_get_ageing; + nm_device_vxlan_get_dst_port; + nm_device_vxlan_get_group; + nm_device_vxlan_get_hw_address; + nm_device_vxlan_get_id; + nm_device_vxlan_get_l2miss; + nm_device_vxlan_get_l3miss; + nm_device_vxlan_get_learning; + nm_device_vxlan_get_limit; + nm_device_vxlan_get_local; + nm_device_vxlan_get_parent; + nm_device_vxlan_get_proxy; + nm_device_vxlan_get_src_port_max; + nm_device_vxlan_get_src_port_min; + nm_device_vxlan_get_tos; + nm_device_vxlan_get_ttl; + nm_device_vxlan_get_type; nm_device_wifi_request_scan_options; nm_device_wifi_request_scan_options_async; + nm_ip_tunnel_mode_get_type; + nm_lldp_neighbor_get_attr_names; + nm_lldp_neighbor_get_attr_string_value; + nm_lldp_neighbor_get_attr_type; + nm_lldp_neighbor_get_attr_uint_value; + nm_lldp_neighbor_get_type; + nm_lldp_neighbor_new; + nm_lldp_neighbor_ref; + nm_lldp_neighbor_unref; + nm_manager_get_all_devices; nm_metered_get_type; + nm_setting_802_1x_check_cert_scheme; + nm_setting_bridge_get_multicast_snooping; + nm_setting_connection_autoconnect_slaves_get_type; + nm_setting_connection_get_autoconnect_slaves; + nm_setting_connection_get_lldp; nm_setting_connection_get_metered; + nm_setting_connection_lldp_get_type; + nm_setting_gsm_get_device_id; + nm_setting_gsm_get_sim_id; + nm_setting_gsm_get_sim_operator_id; + nm_setting_ip4_config_get_dhcp_fqdn; + nm_setting_ip4_config_get_dhcp_timeout; + nm_setting_ip6_config_addr_gen_mode_get_type; + nm_setting_ip6_config_get_addr_gen_mode; + nm_setting_ip_config_add_dns_option; + nm_setting_ip_config_clear_dns_options; + nm_setting_ip_config_get_dns_option; + nm_setting_ip_config_get_num_dns_options; + nm_setting_ip_config_has_dns_options; + nm_setting_ip_config_remove_dns_option; + nm_setting_ip_config_remove_dns_option_by_value; + nm_setting_ip_tunnel_get_input_key; + nm_setting_ip_tunnel_get_local; + nm_setting_ip_tunnel_get_mode; + nm_setting_ip_tunnel_get_mtu; + nm_setting_ip_tunnel_get_output_key; + nm_setting_ip_tunnel_get_parent; + nm_setting_ip_tunnel_get_path_mtu_discovery; + nm_setting_ip_tunnel_get_remote; + nm_setting_ip_tunnel_get_tos; + nm_setting_ip_tunnel_get_type; + nm_setting_ip_tunnel_get_ttl; + nm_setting_ip_tunnel_new; + nm_setting_mac_randomization_get_type; + nm_setting_tun_get_group; + nm_setting_tun_get_mode; + nm_setting_tun_get_multi_queue; + nm_setting_tun_get_owner; + nm_setting_tun_get_pi; + nm_setting_tun_get_type; + nm_setting_tun_get_vnet_hdr; + nm_setting_tun_mode_get_type; + nm_setting_tun_new; + nm_setting_verify_secrets; + nm_setting_vpn_get_timeout; + nm_setting_macvlan_get_mode; + nm_setting_macvlan_get_parent; + nm_setting_macvlan_get_promiscuous; + nm_setting_macvlan_get_tap; + nm_setting_macvlan_get_type; + nm_setting_macvlan_mode_get_type; + nm_setting_macvlan_new; + nm_setting_vxlan_get_ageing; + nm_setting_vxlan_get_destination_port; + nm_setting_vxlan_get_id; + nm_setting_vxlan_get_l2_miss; + nm_setting_vxlan_get_l3_miss; + nm_setting_vxlan_get_learning; + nm_setting_vxlan_get_limit; + nm_setting_vxlan_get_local; + nm_setting_vxlan_get_parent; + nm_setting_vxlan_get_proxy; + nm_setting_vxlan_get_remote; + nm_setting_vxlan_get_rsc; + nm_setting_vxlan_get_source_port_max; + nm_setting_vxlan_get_source_port_min; + nm_setting_vxlan_get_tos; + nm_setting_vxlan_get_ttl; + nm_setting_vxlan_get_type; + nm_setting_vxlan_new; nm_setting_wired_get_wake_on_lan; nm_setting_wired_get_wake_on_lan_password; nm_setting_wired_wake_on_lan_get_type; + nm_setting_wireless_get_powersave; + nm_setting_wireless_get_mac_address_randomization; + nm_utils_bond_mode_int_to_string; + nm_utils_bond_mode_string_to_int; nm_utils_enum_from_str; nm_utils_enum_to_str; + nm_utils_enum_get_values; nm_utils_wifi_2ghz_freqs; nm_utils_wifi_5ghz_freqs; -} libnm_1_0_4; + nm_vpn_editor_plugin_load_from_file; + nm_vpn_plugin_info_get_filename; + nm_vpn_plugin_info_get_editor_plugin; + nm_vpn_plugin_info_get_name; + nm_vpn_plugin_info_get_plugin; + nm_vpn_plugin_info_get_program; + nm_vpn_plugin_info_get_type; + nm_vpn_plugin_info_load_editor_plugin; + nm_vpn_plugin_info_lookup_property; + nm_vpn_plugin_info_new_from_file; + nm_vpn_plugin_info_new_with_data; + nm_vpn_plugin_info_set_editor_plugin; + nm_vpn_plugin_info_validate_filename; + nm_vpn_plugin_info_list_add; + nm_vpn_plugin_info_list_find_by_filename; + nm_vpn_plugin_info_list_find_by_name; + nm_vpn_plugin_info_list_find_by_service; + nm_vpn_plugin_info_list_load; + nm_vpn_plugin_info_list_remove; + nm_vpn_service_plugin_disconnect; + nm_vpn_service_plugin_failure; + nm_vpn_service_plugin_get_connection; + nm_vpn_service_plugin_get_secret_flags; + nm_vpn_service_plugin_get_type; + nm_vpn_service_plugin_read_vpn_details; + nm_vpn_service_plugin_secrets_required; + nm_vpn_service_plugin_set_config; + nm_vpn_service_plugin_set_ip4_config; + nm_vpn_service_plugin_set_ip6_config; + nm_vpn_service_plugin_set_login_banner; +} libnm_1_0_0; diff --git a/libnm/nm-access-point.c b/libnm/nm-access-point.c index c071a927..852b2808 100644 --- a/libnm/nm-access-point.c +++ b/libnm/nm-access-point.c @@ -23,17 +23,17 @@ #include -#include "nm-glib-compat.h" - #include #include #include #include #include +#include "nm-default.h" #include "nm-access-point.h" #include "nm-dbus-interface.h" #include "nm-object-private.h" +#include "nm-macros-internal.h" G_DEFINE_TYPE (NMAccessPoint, nm_access_point, NM_TYPE_OBJECT) @@ -49,7 +49,7 @@ typedef struct { NM80211Mode mode; guint32 max_bitrate; guint8 strength; - gint32 last_seen; + gint last_seen; } NMAccessPointPrivate; enum { @@ -232,15 +232,16 @@ nm_access_point_get_strength (NMAccessPoint *ap) * * Returns: the last seen time in seconds * - * Since: 1.0.6 + * Since: 1.2 **/ -gint32 +gint nm_access_point_get_last_seen (NMAccessPoint *ap) { g_return_val_if_fail (NM_IS_ACCESS_POINT (ap), -1); return NM_ACCESS_POINT_GET_PRIVATE (ap)->last_seen; } +NM_BACKPORT_SYMBOL (libnm_1_0_6, gint, nm_access_point_get_last_seen, (NMAccessPoint *ap), (ap)); /** * nm_access_point_connection_valid: @@ -630,7 +631,7 @@ nm_access_point_class_init (NMAccessPointClass *ap_class) * access point was found in scan results. A value of -1 means the * access point has not been found in a scan. * - * Since: 1.0.6 + * Since: 1.2 **/ g_object_class_install_property (object_class, PROP_LAST_SEEN, diff --git a/libnm/nm-access-point.h b/libnm/nm-access-point.h index 24208fa8..f1e26548 100644 --- a/libnm/nm-access-point.h +++ b/libnm/nm-access-point.h @@ -74,7 +74,7 @@ guint32 nm_access_point_get_frequency (NMAccessPoint *ap); NM80211Mode nm_access_point_get_mode (NMAccessPoint *ap); guint32 nm_access_point_get_max_bitrate (NMAccessPoint *ap); guint8 nm_access_point_get_strength (NMAccessPoint *ap); -NM_AVAILABLE_IN_1_0_6 +NM_AVAILABLE_IN_1_2 gint nm_access_point_get_last_seen (NMAccessPoint *ap); GPtrArray * nm_access_point_filter_connections (NMAccessPoint *ap, diff --git a/libnm/nm-active-connection.c b/libnm/nm-active-connection.c index 31f51328..b1608027 100644 --- a/libnm/nm-active-connection.c +++ b/libnm/nm-active-connection.c @@ -23,6 +23,7 @@ #include +#include "nm-default.h" #include "nm-dbus-interface.h" #include "nm-active-connection.h" #include "nm-object-private.h" @@ -31,7 +32,6 @@ #include "nm-device-private.h" #include "nm-connection.h" #include "nm-vpn-connection.h" -#include "nm-glib-compat.h" #include "nm-dbus-helpers.h" #include "nm-dhcp4-config.h" #include "nm-dhcp6-config.h" diff --git a/libnm/nm-client.c b/libnm/nm-client.c index 982717ce..dc6db0aa 100644 --- a/libnm/nm-client.c +++ b/libnm/nm-client.c @@ -24,6 +24,7 @@ #include #include +#include "nm-default.h" #include "nm-client.h" #include "nm-manager.h" #include "nm-remote-settings.h" @@ -35,7 +36,6 @@ #include "nm-vpn-connection.h" #include "nm-remote-connection.h" #include "nm-object-cache.h" -#include "nm-glib-compat.h" #include "nm-dbus-helpers.h" void _nm_device_wifi_set_wireless_enabled (NMDeviceWifi *device, gboolean enabled); @@ -73,6 +73,7 @@ enum { PROP_PRIMARY_CONNECTION, PROP_ACTIVATING_CONNECTION, PROP_DEVICES, + PROP_ALL_DEVICES, PROP_CONNECTIONS, PROP_HOSTNAME, PROP_CAN_MODIFY, @@ -84,6 +85,8 @@ enum { enum { DEVICE_ADDED, DEVICE_REMOVED, + ANY_DEVICE_ADDED, + ANY_DEVICE_REMOVED, PERMISSION_CHANGED, CONNECTION_ADDED, CONNECTION_REMOVED, @@ -719,6 +722,34 @@ nm_client_get_devices (NMClient *client) return nm_manager_get_devices (NM_CLIENT_GET_PRIVATE (client)->manager); } +/** + * nm_client_get_all_devices: + * @client: a #NMClient + * + * Gets both real devices and device placeholders (eg, software devices which + * do not currently exist, but could be created automatically by NetworkManager + * if one of their NMDevice::ActivatableConnections was activated). Use + * nm_device_is_real() to determine whether each device is a real device or + * a placeholder. + * + * Use nm_device_get_type() or the NM_IS_DEVICE_XXXX() functions to determine + * what kind of device each member of the returned array is, and then you may + * use device-specific methods such as nm_device_ethernet_get_hw_address(). + * + * Returns: (transfer none) (element-type NMDevice): a #GPtrArray + * containing all the #NMDevices. The returned array is owned by the + * #NMClient object and should not be modified. + * + * Since: 1.2 + **/ +const GPtrArray * +nm_client_get_all_devices (NMClient *client) +{ + g_return_val_if_fail (NM_IS_CLIENT (client), NULL); + + return nm_manager_get_all_devices (NM_CLIENT_GET_PRIVATE (client)->manager); +} + /** * nm_client_get_device_by_path: * @client: a #NMClient @@ -1660,6 +1691,7 @@ manager_device_added (NMManager *manager, { g_signal_emit (client, signals[DEVICE_ADDED], 0, device); } + static void manager_device_removed (NMManager *manager, NMDevice *device, @@ -1668,6 +1700,22 @@ manager_device_removed (NMManager *manager, g_signal_emit (client, signals[DEVICE_REMOVED], 0, device); } +static void +manager_any_device_added (NMManager *manager, + NMDevice *device, + gpointer client) +{ + g_signal_emit (client, signals[ANY_DEVICE_ADDED], 0, device); +} + +static void +manager_any_device_removed (NMManager *manager, + NMDevice *device, + gpointer client) +{ + g_signal_emit (client, signals[ANY_DEVICE_REMOVED], 0, device); +} + static void manager_permission_changed (NMManager *manager, NMClientPermission permission, @@ -1707,6 +1755,10 @@ constructed (GObject *object) G_CALLBACK (manager_device_added), client); g_signal_connect (priv->manager, "device-removed", G_CALLBACK (manager_device_removed), client); + g_signal_connect (priv->manager, "any-device-added", + G_CALLBACK (manager_any_device_added), client); + g_signal_connect (priv->manager, "any-device-removed", + G_CALLBACK (manager_any_device_removed), client); g_signal_connect (priv->manager, "permission-changed", G_CALLBACK (manager_permission_changed), client); @@ -1873,6 +1925,7 @@ get_property (GObject *object, guint prop_id, case PROP_ACTIVATING_CONNECTION: case PROP_DEVICES: case PROP_METERED: + case PROP_ALL_DEVICES: g_object_get_property (G_OBJECT (NM_CLIENT_GET_PRIVATE (object)->manager), pspec->name, value); break; @@ -2092,7 +2145,7 @@ nm_client_class_init (NMClientClass *client_class) /** * NMClient:devices: * - * List of known network devices. + * List of real network devices. Does not include placeholder devices. * * Element-type: NMDevice **/ @@ -2103,6 +2156,21 @@ nm_client_class_init (NMClientClass *client_class) G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + /** + * NMClient:all-devices: + * + * List of both real devices and device placeholders. + * + * Element-type: NMDevice + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_ALL_DEVICES, + g_param_spec_boxed (NM_CLIENT_ALL_DEVICES, "", "", + G_TYPE_PTR_ARRAY, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + /** * NMClient:connections: * @@ -2150,7 +2218,7 @@ nm_client_class_init (NMClientClass *client_class) * * Whether the connectivity is metered. * - * Since: 1.0.6 + * Since: 1.2 **/ g_object_class_install_property (object_class, PROP_METERED, @@ -2166,7 +2234,8 @@ nm_client_class_init (NMClientClass *client_class) * @client: the client that received the signal * @device: (type NMDevice): the new device * - * Notifies that a #NMDevice is added. + * Notifies that a #NMDevice is added. This signal is not emitted for + * placeholder devices. **/ signals[DEVICE_ADDED] = g_signal_new (NM_CLIENT_DEVICE_ADDED, @@ -2182,7 +2251,8 @@ nm_client_class_init (NMClientClass *client_class) * @client: the client that received the signal * @device: (type NMDevice): the removed device * - * Notifies that a #NMDevice is removed. + * Notifies that a #NMDevice is removed. This signal is not emitted for + * placeholder devices. **/ signals[DEVICE_REMOVED] = g_signal_new (NM_CLIENT_DEVICE_REMOVED, @@ -2193,6 +2263,40 @@ nm_client_class_init (NMClientClass *client_class) G_TYPE_NONE, 1, G_TYPE_OBJECT); + /** + * NMClient::any-device-added: + * @client: the client that received the signal + * @device: (type NMDevice): the new device + * + * Notifies that a #NMDevice is added. This signal is emitted for both + * regular devices and placeholder devices. + **/ + signals[ANY_DEVICE_ADDED] = + g_signal_new (NM_CLIENT_ANY_DEVICE_ADDED, + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMClientClass, any_device_added), + NULL, NULL, NULL, + G_TYPE_NONE, 1, + G_TYPE_OBJECT); + + /** + * NMClient::any-device-removed: + * @client: the client that received the signal + * @device: (type NMDevice): the removed device + * + * Notifies that a #NMDevice is removed. This signal is emitted for both + * regular devices and placeholder devices. + **/ + signals[ANY_DEVICE_REMOVED] = + g_signal_new (NM_CLIENT_ANY_DEVICE_REMOVED, + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMClientClass, any_device_removed), + NULL, NULL, NULL, + G_TYPE_NONE, 1, + G_TYPE_OBJECT); + /** * NMClient::permission-changed: * @client: the client that received the signal diff --git a/libnm/nm-client.h b/libnm/nm-client.h index fc309fa1..54d6deee 100644 --- a/libnm/nm-client.h +++ b/libnm/nm-client.h @@ -53,6 +53,7 @@ G_BEGIN_DECLS #define NM_CLIENT_PRIMARY_CONNECTION "primary-connection" #define NM_CLIENT_ACTIVATING_CONNECTION "activating-connection" #define NM_CLIENT_DEVICES "devices" +#define NM_CLIENT_ALL_DEVICES "all-devices" #define NM_CLIENT_CONNECTIONS "connections" #define NM_CLIENT_HOSTNAME "hostname" #define NM_CLIENT_CAN_MODIFY "can-modify" @@ -60,6 +61,8 @@ G_BEGIN_DECLS #define NM_CLIENT_DEVICE_ADDED "device-added" #define NM_CLIENT_DEVICE_REMOVED "device-removed" +#define NM_CLIENT_ANY_DEVICE_ADDED "any-device-added" +#define NM_CLIENT_ANY_DEVICE_REMOVED "any-device-removed" #define NM_CLIENT_PERMISSION_CHANGED "permission-changed" #define NM_CLIENT_CONNECTION_ADDED "connection-added" #define NM_CLIENT_CONNECTION_REMOVED "connection-removed" @@ -164,6 +167,8 @@ typedef struct { /* Signals */ void (*device_added) (NMClient *client, NMDevice *device); void (*device_removed) (NMClient *client, NMDevice *device); + void (*any_device_added) (NMClient *client, NMDevice *device); + void (*any_device_removed) (NMClient *client, NMDevice *device); void (*permission_changed) (NMClient *client, NMClientPermission permission, NMClientPermissionResult result); @@ -171,7 +176,7 @@ typedef struct { void (*connection_removed) (NMClient *client, NMRemoteConnection *connection); /*< private >*/ - gpointer padding[8]; + gpointer padding[6]; } NMClientClass; GType nm_client_get_type (void); @@ -248,6 +253,8 @@ gboolean nm_client_save_hostname_finish (NMClient *client, /* Devices */ const GPtrArray *nm_client_get_devices (NMClient *client); +NM_AVAILABLE_IN_1_2 +const GPtrArray *nm_client_get_all_devices(NMClient *client); NMDevice *nm_client_get_device_by_path (NMClient *client, const char *object_path); NMDevice *nm_client_get_device_by_iface (NMClient *client, const char *iface); diff --git a/libnm/nm-dbus-helpers.c b/libnm/nm-dbus-helpers.c index 45e09442..3c039375 100644 --- a/libnm/nm-dbus-helpers.c +++ b/libnm/nm-dbus-helpers.c @@ -21,11 +21,11 @@ #include "config.h" #include -#include -#include "nm-glib-compat.h" +#include "nm-default.h" #include "nm-dbus-helpers.h" #include "nm-dbus-interface.h" +#include "nm-macros-internal.h" static GBusType nm_bus = G_BUS_TYPE_SYSTEM; @@ -44,79 +44,9 @@ _nm_dbus_bus_type (void) return nm_bus; } -static struct { - GMutex mutex; - GWeakRef weak_ref; -} private_connection; - -static void -_private_dbus_connection_closed_cb (GDBusConnection *connection, - gboolean remote_peer_vanished, - GError *error, - gpointer user_data) -{ - GDBusConnection *p; - - g_mutex_lock (&private_connection.mutex); - p = g_weak_ref_get (&private_connection.weak_ref); - if (connection == p) { - g_signal_handlers_disconnect_by_func (G_OBJECT (connection), G_CALLBACK (_private_dbus_connection_closed_cb), NULL); - g_weak_ref_set (&private_connection.weak_ref, NULL); - } - if (p) - g_object_unref (p); - g_mutex_unlock (&private_connection.mutex); -} - -static GDBusConnection * -_private_dbus_connection_internalize (GDBusConnection *connection) -{ - GDBusConnection *p; - - g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL); - g_return_val_if_fail (!g_dbus_connection_is_closed (connection), NULL); - - g_mutex_lock (&private_connection.mutex); - p = g_weak_ref_get (&private_connection.weak_ref); - if (p) { - g_object_unref (connection); - connection = p; - } else { - g_weak_ref_set (&private_connection.weak_ref, connection); - g_signal_connect (connection, "closed", G_CALLBACK (_private_dbus_connection_closed_cb), NULL); - } - g_mutex_unlock (&private_connection.mutex); - return connection; -} - GDBusConnection * _nm_dbus_new_connection (GCancellable *cancellable, GError **error) { - GDBusConnection *connection = NULL; - - /* If running as root try the private bus first */ - if (0 == geteuid () && !g_test_initialized ()) { - - GError *local = NULL; - GDBusConnection *p; - - p = g_weak_ref_get (&private_connection.weak_ref); - if (p) - return p; - - connection = g_dbus_connection_new_for_address_sync ("unix:path=" NMRUNDIR "/private", - G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT, - NULL, cancellable, &local); - if (connection) - return _private_dbus_connection_internalize (connection); - - if (g_error_matches (local, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { - g_propagate_error (error, local); - return NULL; - } - g_error_free (local); - } - return g_bus_get_sync (_nm_dbus_bus_type (), cancellable, error); } @@ -137,65 +67,6 @@ new_connection_async_got_system (GObject *source, GAsyncResult *result, gpointer g_object_unref (simple); } -static void -new_connection_async_got_private (GObject *source, GAsyncResult *result, gpointer user_data) -{ - GSimpleAsyncResult *simple = user_data; - GDBusConnection *connection; - GError *error = NULL; - - connection = g_dbus_connection_new_for_address_finish (result, &error); - if (connection) { - connection = _private_dbus_connection_internalize (connection); - g_simple_async_result_set_op_res_gpointer (simple, connection, g_object_unref); - g_simple_async_result_complete (simple); - g_object_unref (simple); - return; - } - - if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { - g_simple_async_result_take_error (simple, error); - g_simple_async_result_complete (simple); - g_object_unref (simple); - return; - } - - g_clear_error (&error); - g_bus_get (_nm_dbus_bus_type (), - g_object_get_data (G_OBJECT (simple), "cancellable"), - new_connection_async_got_system, simple); -} - -static void -_nm_dbus_new_connection_async_do (GSimpleAsyncResult *simple, GCancellable *cancellable) -{ - g_dbus_connection_new_for_address ("unix:path=" NMRUNDIR "/private", - G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT, - NULL, - cancellable, - new_connection_async_got_private, simple); -} - -static gboolean -_nm_dbus_new_connection_async_get_private (gpointer user_data) -{ - GSimpleAsyncResult *simple = user_data; - GDBusConnection *p; - - p = g_weak_ref_get (&private_connection.weak_ref); - if (!p) { - /* The connection is gone. Create a new one async... */ - _nm_dbus_new_connection_async_do (simple, - g_object_get_data (G_OBJECT (simple), "cancellable")); - } else { - g_simple_async_result_set_op_res_gpointer (simple, p, g_object_unref); - g_simple_async_result_complete (simple); - g_object_unref (simple); - } - - return G_SOURCE_REMOVE; -} - void _nm_dbus_new_connection_async (GCancellable *cancellable, GAsyncReadyCallback callback, @@ -205,25 +76,9 @@ _nm_dbus_new_connection_async (GCancellable *cancellable, simple = g_simple_async_result_new (NULL, callback, user_data, _nm_dbus_new_connection_async); - /* If running as root try the private bus first */ - if (0 == geteuid () && !g_test_initialized ()) { - GDBusConnection *p; - - if (cancellable) { - g_object_set_data_full (G_OBJECT (simple), "cancellable", - g_object_ref (cancellable), g_object_unref); - } - p = g_weak_ref_get (&private_connection.weak_ref); - if (p) { - g_object_unref (p); - g_idle_add (_nm_dbus_new_connection_async_get_private, simple); - } else - _nm_dbus_new_connection_async_do (simple, cancellable); - } else { - g_bus_get (_nm_dbus_bus_type (), - cancellable, - new_connection_async_got_system, simple); - } + g_bus_get (_nm_dbus_bus_type (), + cancellable, + new_connection_async_got_system, simple); } GDBusConnection * @@ -262,6 +117,67 @@ _nm_dbus_register_proxy_type (const char *interface, #define NM_DBUS_PROXY_FLAGS (G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES | \ G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START) +/* D-Bus has an upper limit on number of Match rules and it's rather easy + * to hit as the proxy likes to add one for each object. Let's remove the Match + * rule the proxy added and ensure a less granular rule is present instead. + * + * Also, don't do this immediately since it has a performance penalty. + * Still better than loosing the signals altogether. + * + * Ideally, we should be able to tell glib not to hook its rules: + * https://bugzilla.gnome.org/show_bug.cgi?id=758749 + */ +static void +_nm_dbus_proxy_replace_match (GDBusProxy *proxy) +{ + GDBusConnection *connection = g_dbus_proxy_get_connection (proxy); + static unsigned match_counter = 1024; + gchar *match; + + nm_assert (!g_strcmp0 (g_dbus_proxy_get_name (proxy), NM_DBUS_SERVICE)); + + if (match_counter == 1) { + /* If we hit the low matches watermark, install a + * less granular one. */ + g_dbus_connection_call (connection, + "org.freedesktop.DBus", + "/org/freedesktop/DBus", + "org.freedesktop.DBus", + "AddMatch", + g_variant_new ("(s)", "type='signal',sender='" NM_DBUS_SERVICE "'"), + NULL, + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + NULL, + NULL); + } + + if (match_counter) + match_counter--; + if (match_counter) + return; + + /* Remove what this proxy added. */ + match = g_strdup_printf ("type='signal',sender='" NM_DBUS_SERVICE "'," + "interface='%s',path='%s'", + g_dbus_proxy_get_interface_name (proxy), + g_dbus_proxy_get_object_path (proxy)); + g_dbus_connection_call (connection, + "org.freedesktop.DBus", + "/org/freedesktop/DBus", + "org.freedesktop.DBus", + "RemoveMatch", + g_variant_new ("(s)", match), + NULL, + G_DBUS_CALL_FLAGS_NONE, + -1, + NULL, + NULL, + NULL); + g_free (match); +} + GDBusProxy * _nm_dbus_new_proxy_for_connection (GDBusConnection *connection, const char *path, @@ -269,6 +185,7 @@ _nm_dbus_new_proxy_for_connection (GDBusConnection *connection, GCancellable *cancellable, GError **error) { + GDBusProxy *proxy; GType proxy_type; const char *name; @@ -281,13 +198,16 @@ _nm_dbus_new_proxy_for_connection (GDBusConnection *connection, else name = NM_DBUS_SERVICE; - return g_initable_new (proxy_type, cancellable, error, - "g-connection", connection, - "g-flags", NM_DBUS_PROXY_FLAGS, - "g-name", name, - "g-object-path", path, - "g-interface-name", interface, - NULL); + proxy = g_initable_new (proxy_type, cancellable, error, + "g-connection", connection, + "g-flags", NM_DBUS_PROXY_FLAGS, + "g-name", name, + "g-object-path", path, + "g-interface-name", interface, + NULL); + _nm_dbus_proxy_replace_match (proxy); + + return proxy; } void @@ -324,13 +244,15 @@ GDBusProxy * _nm_dbus_new_proxy_for_connection_finish (GAsyncResult *result, GError **error) { - GObject *source, *proxy; + GObject *source; + GDBusProxy *proxy; source = g_async_result_get_source_object (result); - proxy = g_async_initable_new_finish (G_ASYNC_INITABLE (source), result, error); + proxy = G_DBUS_PROXY (g_async_initable_new_finish (G_ASYNC_INITABLE (source), result, error)); g_object_unref (source); + _nm_dbus_proxy_replace_match (proxy); - return G_DBUS_PROXY (proxy); + return proxy; } /* Binds the properties on a generated server-side GDBus object to the diff --git a/libnm/nm-dbus-helpers.h b/libnm/nm-dbus-helpers.h index ca779d3a..497739f0 100644 --- a/libnm/nm-dbus-helpers.h +++ b/libnm/nm-dbus-helpers.h @@ -21,18 +21,9 @@ #ifndef __NM_DBUS_HELPERS_PRIVATE_H__ #define __NM_DBUS_HELPERS_PRIVATE_H__ -#include - -/* Copied from dbus/dbus-shared.h */ -#define DBUS_SERVICE_DBUS "org.freedesktop.DBus" -#define DBUS_PATH_DBUS "/org/freedesktop/DBus" -#define DBUS_PATH_LOCAL "/org/freedesktop/DBus/Local" - -#define DBUS_INTERFACE_DBUS "org.freedesktop.DBus" -#define DBUS_INTERFACE_INTROSPECTABLE "org.freedesktop.DBus.Introspectable" -#define DBUS_INTERFACE_PROPERTIES "org.freedesktop.DBus.Properties" -#define DBUS_INTERFACE_PEER "org.freedesktop.DBus.Peer" +#include "nm-default.h" +#include "nm-dbus-compat.h" GBusType _nm_dbus_bus_type (void); diff --git a/libnm/nm-device-adsl.c b/libnm/nm-device-adsl.c index 99771548..b9d609da 100644 --- a/libnm/nm-device-adsl.c +++ b/libnm/nm-device-adsl.c @@ -29,7 +29,6 @@ #include "nm-setting-connection.h" #include -#include G_DEFINE_TYPE (NMDeviceAdsl, nm_device_adsl, NM_TYPE_DEVICE) diff --git a/libnm/nm-device-bond.c b/libnm/nm-device-bond.c index 6bb67323..3bfcb94c 100644 --- a/libnm/nm-device-bond.c +++ b/libnm/nm-device-bond.c @@ -21,14 +21,12 @@ #include "config.h" #include -#include - -#include "nm-glib-compat.h" #include #include #include +#include "nm-default.h" #include "nm-device-bond.h" #include "nm-device-private.h" #include "nm-object-private.h" diff --git a/libnm/nm-device-bridge.c b/libnm/nm-device-bridge.c index ce28f2c2..5afc46e3 100644 --- a/libnm/nm-device-bridge.c +++ b/libnm/nm-device-bridge.c @@ -21,14 +21,12 @@ #include "config.h" #include -#include - -#include "nm-glib-compat.h" #include #include #include +#include "nm-default.h" #include "nm-device-bridge.h" #include "nm-device-private.h" #include "nm-object-private.h" diff --git a/libnm/nm-device-bt.c b/libnm/nm-device-bt.c index 77526464..f89be172 100644 --- a/libnm/nm-device-bt.c +++ b/libnm/nm-device-bt.c @@ -22,14 +22,12 @@ #include "config.h" #include -#include - -#include "nm-glib-compat.h" #include #include #include +#include "nm-default.h" #include "nm-device-bt.h" #include "nm-device-private.h" #include "nm-object-private.h" diff --git a/libnm/nm-device-ethernet.c b/libnm/nm-device-ethernet.c index be2cb4dc..537a6f4c 100644 --- a/libnm/nm-device-ethernet.c +++ b/libnm/nm-device-ethernet.c @@ -22,15 +22,13 @@ #include "config.h" #include -#include - -#include "nm-glib-compat.h" #include #include #include #include +#include "nm-default.h" #include "nm-device-ethernet.h" #include "nm-device-private.h" #include "nm-object-private.h" @@ -44,6 +42,7 @@ typedef struct { char *perm_hw_address; guint32 speed; gboolean carrier; + char **s390_subchannels; } NMDeviceEthernetPrivate; enum { @@ -52,6 +51,7 @@ enum { PROP_PERM_HW_ADDRESS, PROP_SPEED, PROP_CARRIER, + PROP_S390_SUBCHANNELS, LAST_PROP }; @@ -122,18 +122,88 @@ nm_device_ethernet_get_carrier (NMDeviceEthernet *device) return NM_DEVICE_ETHERNET_GET_PRIVATE (device)->carrier; } +/** + * nm_device_ethernet_get_s390_subchannels: + * @device: a #NMDeviceEthernet + * + * Return the list of s390 subchannels if the device supports them. + * + * Returns: (transfer none) (element-type utf8): array of strings, each specifying + * one subchannel the s390 device uses to communicate to the host. + * + * Since: 1.2 + **/ +const char * const * +nm_device_ethernet_get_s390_subchannels (NMDeviceEthernet *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_ETHERNET (device), NULL); + + return (const char * const *) NM_DEVICE_ETHERNET_GET_PRIVATE (device)->s390_subchannels; +} + +static guint32 +_subchannels_count_num (const char * const *array) +{ + int i; + + if (!array) + return 0; + for (i = 0; array[i]; i++) + /* NOP */; + return i; +} + +static gboolean +match_subchans (NMDeviceEthernet *self, NMSettingWired *s_wired, gboolean *try_mac) +{ + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self); + const char * const *subchans; + guint32 num1, num2; + int i, j; + + *try_mac = TRUE; + + subchans = nm_setting_wired_get_s390_subchannels (s_wired); + num1 = _subchannels_count_num (subchans); + num2 = _subchannels_count_num ((const char * const *) priv->s390_subchannels); + /* connection has no subchannels */ + if (num1 == 0) + return TRUE; + /* connection requires subchannels but the device has none */ + if (num2 == 0) + return FALSE; + /* number of subchannels differ */ + if (num1 != num2) + return FALSE; + + /* Make sure each subchannel in the connection is a subchannel of this device */ + for (i = 0; subchans[i]; i++) { + const char *candidate = subchans[i]; + gboolean found = FALSE; + + for (j = 0; priv->s390_subchannels[j]; j++) { + if (!g_strcmp0 (priv->s390_subchannels[j], candidate)) + found = TRUE; + } + if (!found) + return FALSE; /* a subchannel was not found */ + } + + *try_mac = FALSE; + return TRUE; +} + static gboolean connection_compatible (NMDevice *device, NMConnection *connection, GError **error) { NMSettingWired *s_wired; - gboolean is_pppoe = FALSE; if (!NM_DEVICE_CLASS (nm_device_ethernet_parent_class)->connection_compatible (device, connection, error)) return FALSE; - if (nm_connection_is_type (connection, NM_SETTING_PPPOE_SETTING_NAME)) - is_pppoe = TRUE; - else if (!nm_connection_is_type (connection, NM_SETTING_WIRED_SETTING_NAME)) { + if (nm_connection_is_type (connection, NM_SETTING_PPPOE_SETTING_NAME)) { + /* NOP */ + } else if (!nm_connection_is_type (connection, NM_SETTING_WIRED_SETTING_NAME)) { g_set_error_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION, _("The connection was not an Ethernet or PPPoE connection.")); return FALSE; @@ -142,24 +212,49 @@ connection_compatible (NMDevice *device, NMConnection *connection, GError **erro s_wired = nm_connection_get_setting_wired (connection); /* Wired setting optional for PPPoE */ if (s_wired) { - const char *perm_addr, *setting_addr; - - /* FIXME: filter using s390 subchannels when they are exported over the bus */ + const char *perm_addr, *s_mac; + gboolean try_mac = TRUE; + const char * const *mac_blacklist; + int i; + + /* Check s390 subchannels */ + if (!match_subchans (NM_DEVICE_ETHERNET (device), s_wired, &try_mac)) { + g_set_error_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION, + _("The connection and device differ in S390 subchannels.")); + return FALSE; + } /* Check MAC address */ perm_addr = nm_device_ethernet_get_permanent_hw_address (NM_DEVICE_ETHERNET (device)); + s_mac = nm_setting_wired_get_mac_address (s_wired); if (perm_addr) { if (!nm_utils_hwaddr_valid (perm_addr, ETH_ALEN)) { g_set_error_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED, _("Invalid device MAC address.")); return FALSE; } - setting_addr = nm_setting_wired_get_mac_address (s_wired); - if (setting_addr && !nm_utils_hwaddr_matches (setting_addr, -1, perm_addr, -1)) { + if (try_mac && s_mac && !nm_utils_hwaddr_matches (s_mac, -1, perm_addr, -1)) { g_set_error_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION, - _("The MACs of the device and the connection didn't match.")); + _("The MACs of the device and the connection do not match.")); return FALSE; } + + /* Check for MAC address blacklist */ + mac_blacklist = nm_setting_wired_get_mac_address_blacklist (s_wired); + for (i = 0; mac_blacklist[i]; i++) { + if (!nm_utils_hwaddr_valid (mac_blacklist[i], ETH_ALEN)) { + g_warn_if_reached (); + g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION, + _("Invalid MAC in the blacklist: %s."), mac_blacklist[i]); + return FALSE; + } + + if (nm_utils_hwaddr_matches (mac_blacklist[i], -1, perm_addr, -1)) { + g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION, + _("Device MAC (%s) is blacklisted by the connection."), perm_addr); + return FALSE; + } + } } } @@ -195,6 +290,7 @@ init_dbus (NMObject *object) { NM_DEVICE_ETHERNET_PERMANENT_HW_ADDRESS, &priv->perm_hw_address }, { NM_DEVICE_ETHERNET_SPEED, &priv->speed }, { NM_DEVICE_ETHERNET_CARRIER, &priv->carrier }, + { NM_DEVICE_ETHERNET_S390_SUBCHANNELS, &priv->s390_subchannels }, { NULL }, }; @@ -212,6 +308,7 @@ finalize (GObject *object) g_free (priv->hw_address); g_free (priv->perm_hw_address); + g_strfreev (priv->s390_subchannels); G_OBJECT_CLASS (nm_device_ethernet_parent_class)->finalize (object); } @@ -223,6 +320,7 @@ get_property (GObject *object, GParamSpec *pspec) { NMDeviceEthernet *device = NM_DEVICE_ETHERNET (object); + NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (device); switch (prop_id) { case PROP_HW_ADDRESS: @@ -237,6 +335,9 @@ get_property (GObject *object, case PROP_CARRIER: g_value_set_boolean (value, nm_device_ethernet_get_carrier (device)); break; + case PROP_S390_SUBCHANNELS: + g_value_set_boxed (value, priv->s390_subchannels); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -314,4 +415,18 @@ nm_device_ethernet_class_init (NMDeviceEthernetClass *eth_class) G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + /** + * NMDeviceEthernet:s390-subchannels: + * + * Identifies subchannels of this network device used for + * communication with z/VM or s390 host. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_S390_SUBCHANNELS, + g_param_spec_boxed (NM_DEVICE_ETHERNET_S390_SUBCHANNELS, "", "", + G_TYPE_STRV, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); } diff --git a/libnm/nm-device-ethernet.h b/libnm/nm-device-ethernet.h index 09286e73..07cf4c4d 100644 --- a/libnm/nm-device-ethernet.h +++ b/libnm/nm-device-ethernet.h @@ -41,6 +41,7 @@ G_BEGIN_DECLS #define NM_DEVICE_ETHERNET_PERMANENT_HW_ADDRESS "perm-hw-address" #define NM_DEVICE_ETHERNET_SPEED "speed" #define NM_DEVICE_ETHERNET_CARRIER "carrier" +#define NM_DEVICE_ETHERNET_S390_SUBCHANNELS "s390-subchannels" struct _NMDeviceEthernet { NMDevice parent; @@ -59,6 +60,8 @@ const char * nm_device_ethernet_get_hw_address (NMDeviceEthernet *device); const char * nm_device_ethernet_get_permanent_hw_address (NMDeviceEthernet *device); guint32 nm_device_ethernet_get_speed (NMDeviceEthernet *device); gboolean nm_device_ethernet_get_carrier (NMDeviceEthernet *device); +NM_AVAILABLE_IN_1_2 +const char * const *nm_device_ethernet_get_s390_subchannels (NMDeviceEthernet *device); G_END_DECLS diff --git a/libnm/nm-device-generic.c b/libnm/nm-device-generic.c index 3ed0fa7e..9aeb9bfa 100644 --- a/libnm/nm-device-generic.c +++ b/libnm/nm-device-generic.c @@ -21,7 +21,6 @@ #include "config.h" #include -#include #include "nm-device-generic.h" #include "nm-device-private.h" diff --git a/libnm/nm-device-infiniband.c b/libnm/nm-device-infiniband.c index bce8a87a..ab3a0bb7 100644 --- a/libnm/nm-device-infiniband.c +++ b/libnm/nm-device-infiniband.c @@ -21,14 +21,12 @@ #include "config.h" #include -#include - -#include "nm-glib-compat.h" #include #include #include +#include "nm-default.h" #include "nm-device-infiniband.h" #include "nm-device-private.h" #include "nm-object-private.h" diff --git a/libnm/nm-device-ip-tunnel.c b/libnm/nm-device-ip-tunnel.c new file mode 100644 index 00000000..b43b0412 --- /dev/null +++ b/libnm/nm-device-ip-tunnel.c @@ -0,0 +1,544 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2015 Red Hat, Inc. + */ + +#include "config.h" + +#include + +#include +#include +#include + +#include "nm-default.h" +#include "nm-device-ip-tunnel.h" +#include "nm-device-private.h" +#include "nm-object-private.h" +#include "nm-core-internal.h" + +G_DEFINE_TYPE (NMDeviceIPTunnel, nm_device_ip_tunnel, NM_TYPE_DEVICE) + +#define NM_DEVICE_IP_TUNNEL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_IP_TUNNEL, NMDeviceIPTunnelPrivate)) + +typedef struct { + NMIPTunnelMode mode; + NMDevice *parent; + char *local; + char *remote; + guint8 ttl; + guint8 tos; + gboolean path_mtu_discovery; + char *input_key; + char *output_key; + guint8 encap_limit; + guint32 flow_label; +} NMDeviceIPTunnelPrivate; + +enum { + PROP_0, + PROP_MODE, + PROP_PARENT, + PROP_LOCAL, + PROP_REMOTE, + PROP_TTL, + PROP_TOS, + PROP_PATH_MTU_DISCOVERY, + PROP_INPUT_KEY, + PROP_OUTPUT_KEY, + PROP_ENCAPSULATION_LIMIT, + PROP_FLOW_LABEL, + + LAST_PROP +}; + +/** + * nm_device_ip_tunnel_get_mode: + * @device: a #NMDeviceIPTunnel + * + * Returns: the tunneling mode + * + * Since: 1.2 + **/ +NMIPTunnelMode +nm_device_ip_tunnel_get_mode (NMDeviceIPTunnel *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_IP_TUNNEL (device), 0); + + return NM_DEVICE_IP_TUNNEL_GET_PRIVATE (device)->mode; +} + +/** + * nm_device_ip_tunnel_get_parent: + * @device: a #NMDeviceIPTunnel + * + * Returns: (transfer none): the device's parent device + * + * Since: 1.2 + **/ +NMDevice * +nm_device_ip_tunnel_get_parent (NMDeviceIPTunnel *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_IP_TUNNEL (device), NULL); + + return NM_DEVICE_IP_TUNNEL_GET_PRIVATE (device)->parent; +} + +/** + * nm_device_ip_tunnel_get_local: + * @device: a #NMDeviceIPTunnel + * + * Returns: the local endpoint of the tunnel + * + * Since: 1.2 + **/ +const char * +nm_device_ip_tunnel_get_local (NMDeviceIPTunnel *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_IP_TUNNEL (device), NULL); + + return NM_DEVICE_IP_TUNNEL_GET_PRIVATE (device)->local; +} + +/** + * nm_device_ip_tunnel_get_remote: + * @device: a #NMDeviceIPTunnel + * + * Returns: the remote endpoint of the tunnel + * + * Since: 1.2 + **/ +const char * +nm_device_ip_tunnel_get_remote (NMDeviceIPTunnel *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_IP_TUNNEL (device), NULL); + + return NM_DEVICE_IP_TUNNEL_GET_PRIVATE (device)->remote; +} + +/** + * nm_device_ip_tunnel_get_ttl: + * @device: a #NMDeviceIPTunnel + * + * Returns: the TTL assigned to tunneled packets + * + * Since: 1.2 + **/ +guint8 +nm_device_ip_tunnel_get_ttl (NMDeviceIPTunnel *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_IP_TUNNEL (device), 0); + + return NM_DEVICE_IP_TUNNEL_GET_PRIVATE (device)->ttl; +} + +/** + * nm_device_ip_tunnel_get_tos: + * @device: a #NMDeviceIPTunnel + * + * Returns: type of service (IPv4) or traffic class (IPv6) assigned + * to tunneled packets. + * + * Since: 1.2 + **/ +guint8 +nm_device_ip_tunnel_get_tos (NMDeviceIPTunnel *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_IP_TUNNEL (device), 0); + + return NM_DEVICE_IP_TUNNEL_GET_PRIVATE (device)->tos; +} + +/** + * nm_device_ip_tunnel_get_path_mtu_discovery: + * @device: a #NMDeviceIPTunnel + * + * Returns: whether path MTU discovery is enabled + * + * Since: 1.2 + **/ +gboolean +nm_device_ip_tunnel_get_path_mtu_discovery (NMDeviceIPTunnel *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_IP_TUNNEL (device), TRUE); + + return NM_DEVICE_IP_TUNNEL_GET_PRIVATE (device)->path_mtu_discovery; +} + +/** + * nm_device_ip_tunnel_get_input_key: + * @device: a #NMDeviceIPTunnel + * + * Returns: the key used for incoming packets + * + * Since: 1.2 + **/ +const char * +nm_device_ip_tunnel_get_input_key (NMDeviceIPTunnel *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_IP_TUNNEL (device), NULL); + + return NM_DEVICE_IP_TUNNEL_GET_PRIVATE (device)->input_key; +} + +/** + * nm_device_ip_tunnel_get_output_key: + * @device: a #NMDeviceIPTunnel + * + * Returns: the key used for outgoing packets + * + * Since: 1.2 + **/ +const char * +nm_device_ip_tunnel_get_output_key (NMDeviceIPTunnel *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_IP_TUNNEL (device), NULL); + + return NM_DEVICE_IP_TUNNEL_GET_PRIVATE (device)->output_key; +} + +/** + * nm_device_ip_tunnel_get_encapsulation_limit: + * @device: a #NMDeviceIPTunnel + * + * Returns: the maximum permitted encapsulation level + * + * Since: 1.2 + **/ +guint8 +nm_device_ip_tunnel_get_encapsulation_limit (NMDeviceIPTunnel *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_IP_TUNNEL (device), 0); + + return NM_DEVICE_IP_TUNNEL_GET_PRIVATE (device)->encap_limit; +} + +/** + * nm_device_ip_tunnel_get_flow_label: + * @device: a #NMDeviceIPTunnel + * + * Returns: the flow label assigned to tunnel packets + * + * Since: 1.2 + **/ +guint +nm_device_ip_tunnel_get_flow_label (NMDeviceIPTunnel *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_IP_TUNNEL (device), 0); + + return NM_DEVICE_IP_TUNNEL_GET_PRIVATE (device)->flow_label; +} + +static gboolean +connection_compatible (NMDevice *device, NMConnection *connection, GError **error) +{ + if (!NM_DEVICE_CLASS (nm_device_ip_tunnel_parent_class)->connection_compatible (device, connection, error)) + return FALSE; + + if (!nm_connection_is_type (connection, NM_SETTING_IP_TUNNEL_SETTING_NAME)) { + g_set_error_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION, + _("The connection was not an IP tunnel connection.")); + return FALSE; + } + + return TRUE; +} + +static GType +get_setting_type (NMDevice *device) +{ + return NM_TYPE_SETTING_IP_TUNNEL; +} + +/***********************************************************/ + +static void +nm_device_ip_tunnel_init (NMDeviceIPTunnel *device) +{ + _nm_device_set_device_type (NM_DEVICE (device), NM_DEVICE_TYPE_IP_TUNNEL); +} + +static void +init_dbus (NMObject *object) +{ + NMDeviceIPTunnelPrivate *priv = NM_DEVICE_IP_TUNNEL_GET_PRIVATE (object); + const NMPropertiesInfo property_info[] = { + { NM_DEVICE_IP_TUNNEL_PARENT, &priv->parent, NULL, NM_TYPE_DEVICE }, + { NM_DEVICE_IP_TUNNEL_MODE, &priv->mode }, + { NM_DEVICE_IP_TUNNEL_LOCAL, &priv->local }, + { NM_DEVICE_IP_TUNNEL_REMOTE, &priv->remote }, + { NM_DEVICE_IP_TUNNEL_TTL, &priv->ttl }, + { NM_DEVICE_IP_TUNNEL_TOS, &priv->tos }, + { NM_DEVICE_IP_TUNNEL_PATH_MTU_DISCOVERY, &priv->path_mtu_discovery }, + { NM_DEVICE_IP_TUNNEL_INPUT_KEY, &priv->input_key }, + { NM_DEVICE_IP_TUNNEL_OUTPUT_KEY, &priv->output_key }, + { NM_DEVICE_IP_TUNNEL_ENCAPSULATION_LIMIT, &priv->encap_limit }, + { NM_DEVICE_IP_TUNNEL_FLOW_LABEL, &priv->flow_label }, + { NULL }, + }; + + NM_OBJECT_CLASS (nm_device_ip_tunnel_parent_class)->init_dbus (object); + + _nm_object_register_properties (object, + NM_DBUS_INTERFACE_DEVICE_IP_TUNNEL, + property_info); +} + +static void +finalize (GObject *object) +{ + NMDeviceIPTunnelPrivate *priv = NM_DEVICE_IP_TUNNEL_GET_PRIVATE (object); + + g_free (priv->local); + g_free (priv->remote); + g_free (priv->input_key); + g_free (priv->output_key); + g_clear_object (&priv->parent); + + G_OBJECT_CLASS (nm_device_ip_tunnel_parent_class)->finalize (object); +} + +static void +get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + NMDeviceIPTunnel *device = NM_DEVICE_IP_TUNNEL (object); + + switch (prop_id) { + case PROP_PARENT: + g_value_set_object (value, nm_device_ip_tunnel_get_parent (device)); + break; + case PROP_MODE: + g_value_set_uint (value, nm_device_ip_tunnel_get_mode (device)); + break; + case PROP_LOCAL: + g_value_set_string (value, nm_device_ip_tunnel_get_local (device)); + break; + case PROP_REMOTE: + g_value_set_string (value, nm_device_ip_tunnel_get_remote (device)); + break; + case PROP_TTL: + g_value_set_uint (value, nm_device_ip_tunnel_get_ttl (device)); + break; + case PROP_TOS: + g_value_set_uint (value, nm_device_ip_tunnel_get_tos (device)); + break; + case PROP_PATH_MTU_DISCOVERY: + g_value_set_boolean (value, nm_device_ip_tunnel_get_path_mtu_discovery (device)); + break; + case PROP_INPUT_KEY: + g_value_set_string (value, nm_device_ip_tunnel_get_input_key (device)); + break; + case PROP_OUTPUT_KEY: + g_value_set_string (value, nm_device_ip_tunnel_get_output_key (device)); + break; + case PROP_ENCAPSULATION_LIMIT: + g_value_set_uint (value, nm_device_ip_tunnel_get_encapsulation_limit (device)); + break; + case PROP_FLOW_LABEL: + g_value_set_uint (value, nm_device_ip_tunnel_get_flow_label (device)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_device_ip_tunnel_class_init (NMDeviceIPTunnelClass *bond_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (bond_class); + NMObjectClass *nm_object_class = NM_OBJECT_CLASS (bond_class); + NMDeviceClass *device_class = NM_DEVICE_CLASS (bond_class); + + g_type_class_add_private (bond_class, sizeof (NMDeviceIPTunnelPrivate)); + + _nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_DEVICE_IP_TUNNEL); + + /* virtual methods */ + object_class->finalize = finalize; + object_class->get_property = get_property; + + nm_object_class->init_dbus = init_dbus; + + device_class->connection_compatible = connection_compatible; + device_class->get_setting_type = get_setting_type; + + /* properties */ + + /** + * NMDeviceIPTunnel:mode: + * + * The tunneling mode of the device. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_MODE, + g_param_spec_uint (NM_DEVICE_IP_TUNNEL_MODE, "", "", + 0, G_MAXUINT, 0, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceIPTunnel:parent: + * + * The devices's parent device. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_PARENT, + g_param_spec_object (NM_DEVICE_IP_TUNNEL_PARENT, "", "", + NM_TYPE_DEVICE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceIPTunnel:local: + * + * The local endpoint of the tunnel. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_LOCAL, + g_param_spec_string (NM_DEVICE_IP_TUNNEL_LOCAL, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceIPTunnel:remote: + * + * The remote endpoint of the tunnel. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_REMOTE, + g_param_spec_string (NM_DEVICE_IP_TUNNEL_REMOTE, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceIPTunnel:ttl: + * + * The TTL assigned to tunneled packets. 0 is a special value + * meaning that packets inherit the TTL value + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_TTL, + g_param_spec_uchar (NM_DEVICE_IP_TUNNEL_TTL, "", "", + 0, 255, 0, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceIPTunnel:tos: + * + * The type of service (IPv4) or traffic class (IPv6) assigned to + * tunneled packets. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_TOS, + g_param_spec_uchar (NM_DEVICE_IP_TUNNEL_TOS, "", "", + 0, 255, 0, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceIPTunnel:path-mtu-discovery: + * + * Whether path MTU discovery is enabled on this tunnel. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_PATH_MTU_DISCOVERY, + g_param_spec_boolean (NM_DEVICE_IP_TUNNEL_PATH_MTU_DISCOVERY, "", "", + FALSE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceIPTunnel:input-key: + * + * The key used for tunneled input packets, if applicable. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_INPUT_KEY, + g_param_spec_string (NM_DEVICE_IP_TUNNEL_INPUT_KEY, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceIPTunnel:output-key: + * + * The key used for tunneled output packets, if applicable. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_OUTPUT_KEY, + g_param_spec_string (NM_DEVICE_IP_TUNNEL_OUTPUT_KEY, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceIPTunnel:encapsulation-limit: + * + * How many additional levels of encapsulation are permitted to + * be prepended to packets. This property applies only to IPv6 + * tunnels. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_ENCAPSULATION_LIMIT, + g_param_spec_uchar (NM_DEVICE_IP_TUNNEL_ENCAPSULATION_LIMIT, "", "", + 0, 255, 0, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceIPTunnel:flow-label: + * + * The flow label to assign to tunnel packets. This property + * applies only to IPv6 tunnels. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_FLOW_LABEL, + g_param_spec_uint (NM_DEVICE_IP_TUNNEL_FLOW_LABEL, "", "", + 0, (1 << 20) - 1, 0, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); +} diff --git a/libnm/nm-device-ip-tunnel.h b/libnm/nm-device-ip-tunnel.h new file mode 100644 index 00000000..820eab16 --- /dev/null +++ b/libnm/nm-device-ip-tunnel.h @@ -0,0 +1,90 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2015 Red Hat, Inc. + */ + +#ifndef __NM_DEVICE_IP_TUNNEL_H__ +#define __NM_DEVICE_IP_TUNNEL_H__ + +#if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION) +#error "Only can be included directly." +#endif + +#include + +G_BEGIN_DECLS + +#define NM_TYPE_DEVICE_IP_TUNNEL (nm_device_ip_tunnel_get_type ()) +#define NM_DEVICE_IP_TUNNEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_IP_TUNNEL, NMDeviceIPTunnel)) +#define NM_DEVICE_IP_TUNNEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_IP_TUNNEL, NMDeviceIPTunnelClass)) +#define NM_IS_DEVICE_IP_TUNNEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_IP_TUNNEL)) +#define NM_IS_DEVICE_IP_TUNNEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_IP_TUNNEL)) +#define NM_DEVICE_IP_TUNNEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_IP_TUNNEL, NMDeviceIPTunnelClass)) + +#define NM_DEVICE_IP_TUNNEL_MODE "mode" +#define NM_DEVICE_IP_TUNNEL_PARENT "parent" +#define NM_DEVICE_IP_TUNNEL_LOCAL "local" +#define NM_DEVICE_IP_TUNNEL_REMOTE "remote" +#define NM_DEVICE_IP_TUNNEL_TTL "ttl" +#define NM_DEVICE_IP_TUNNEL_TOS "tos" +#define NM_DEVICE_IP_TUNNEL_PATH_MTU_DISCOVERY "path-mtu-discovery" +#define NM_DEVICE_IP_TUNNEL_INPUT_KEY "input-key" +#define NM_DEVICE_IP_TUNNEL_OUTPUT_KEY "output-key" +#define NM_DEVICE_IP_TUNNEL_ENCAPSULATION_LIMIT "encapsulation-limit" +#define NM_DEVICE_IP_TUNNEL_FLOW_LABEL "flow-label" + +struct _NMDeviceIPTunnel { + NMDevice parent; +}; + +typedef struct { + NMDeviceClass parent; + + /*< private >*/ + gpointer padding[4]; +} NMDeviceIPTunnelClass; + +NM_AVAILABLE_IN_1_2 +GType nm_device_ip_tunnel_get_type (void); + +NM_AVAILABLE_IN_1_2 +NMDevice * nm_device_ip_tunnel_get_parent (NMDeviceIPTunnel *device); +NM_AVAILABLE_IN_1_2 +NMIPTunnelMode nm_device_ip_tunnel_get_mode (NMDeviceIPTunnel *device); +NM_AVAILABLE_IN_1_2 +const char * nm_device_ip_tunnel_get_local (NMDeviceIPTunnel *device); +NM_AVAILABLE_IN_1_2 +const char * nm_device_ip_tunnel_get_remote (NMDeviceIPTunnel *device); +NM_AVAILABLE_IN_1_2 +guint8 nm_device_ip_tunnel_get_ttl (NMDeviceIPTunnel *device); +NM_AVAILABLE_IN_1_2 +guint8 nm_device_ip_tunnel_get_tos (NMDeviceIPTunnel *device); +NM_AVAILABLE_IN_1_2 +gboolean nm_device_ip_tunnel_get_path_mtu_discovery (NMDeviceIPTunnel *device); +NM_AVAILABLE_IN_1_2 +const char * nm_device_ip_tunnel_get_input_key (NMDeviceIPTunnel *device); +NM_AVAILABLE_IN_1_2 +const char * nm_device_ip_tunnel_get_output_key (NMDeviceIPTunnel *device); +NM_AVAILABLE_IN_1_2 +guint8 nm_device_ip_tunnel_get_encapsulation_limit (NMDeviceIPTunnel *device); +NM_AVAILABLE_IN_1_2 +guint nm_device_ip_tunnel_get_flow_label (NMDeviceIPTunnel *device); + +G_END_DECLS + +#endif /* __NM_DEVICE_IP_TUNNEL_H__ */ diff --git a/libnm/nm-device-macvlan.c b/libnm/nm-device-macvlan.c new file mode 100644 index 00000000..3b4bfd35 --- /dev/null +++ b/libnm/nm-device-macvlan.c @@ -0,0 +1,347 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2015 Red Hat, Inc. + */ + +#include "config.h" + +#include + +#include +#include +#include +#include + +#include "nm-default.h" +#include "nm-device-macvlan.h" +#include "nm-device-private.h" +#include "nm-object-private.h" + +G_DEFINE_TYPE (NMDeviceMacvlan, nm_device_macvlan, NM_TYPE_DEVICE) + +#define NM_DEVICE_MACVLAN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_MACVLAN, NMDeviceMacvlanPrivate)) + +typedef struct { + NMDevice *parent; + char *mode; + gboolean no_promisc; + gboolean tap; + char *hw_address; +} NMDeviceMacvlanPrivate; + +enum { + PROP_0, + PROP_PARENT, + PROP_MODE, + PROP_NO_PROMISC, + PROP_TAP, + PROP_HW_ADDRESS, + + LAST_PROP +}; + +/** + * nm_device_macvlan_get_parent: + * @device: a #NMDeviceMacvlan + * + * Returns: (transfer none): the device's parent device + * + * Since: 1.2 + **/ +NMDevice * +nm_device_macvlan_get_parent (NMDeviceMacvlan *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_MACVLAN (device), FALSE); + + return NM_DEVICE_MACVLAN_GET_PRIVATE (device)->parent; +} + +/** + * nm_device_macvlan_get_mode: + * @device: a #NMDeviceMacvlan + * + * Gets the MACVLAN mode of the device. + * + * Returns: the MACVLAN mode. This is the internal string used by the + * device, and must not be modified. + * + * Since: 1.2 + **/ +const char * +nm_device_macvlan_get_mode (NMDeviceMacvlan *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_MACVLAN (device), NULL); + + return NM_DEVICE_MACVLAN_GET_PRIVATE (device)->mode; +} + +/** + * nm_device_macvlan_get_no_promisc + * @device: a #NMDeviceMacvlan + * + * Gets the no-promiscuous flag of the device. + * + * Returns: the no-promiscuous flag of the device. + * + * Since: 1.2 + **/ +gboolean +nm_device_macvlan_get_no_promisc (NMDeviceMacvlan *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_MACVLAN (device), FALSE); + + return NM_DEVICE_MACVLAN_GET_PRIVATE (device)->no_promisc; +} + +/** + * nm_device_macvlan_get_tap: + * @device: a #NMDeviceMacvlan + * + * Gets the device type (MACVLAN or MACVTAP). + * + * Returns: %TRUE if the device is a MACVTAP, %FALSE if it is a MACVLAN. + * + * Since: 1.2 + **/ +gboolean +nm_device_macvlan_get_tap (NMDeviceMacvlan *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_MACVLAN (device), FALSE); + + return NM_DEVICE_MACVLAN_GET_PRIVATE (device)->tap; +} + +/** + * nm_device_macvlan_get_hw_address: + * @device: a #NMDeviceMacvlan + * + * Gets the hardware (MAC) address of the #NMDeviceMacvlan + * + * Returns: the hardware address. This is the internal string used by the + * device, and must not be modified. + * + * Since: 1.2 + **/ +const char * +nm_device_macvlan_get_hw_address (NMDeviceMacvlan *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_MACVLAN (device), NULL); + + return NM_DEVICE_MACVLAN_GET_PRIVATE (device)->hw_address; +} + + +static gboolean +connection_compatible (NMDevice *device, NMConnection *connection, GError **error) +{ + NMDeviceMacvlanPrivate *priv = NM_DEVICE_MACVLAN_GET_PRIVATE (device); + NMSettingMacvlan *s_macvlan; + + if (!NM_DEVICE_CLASS (nm_device_macvlan_parent_class)->connection_compatible (device, connection, error)) + return FALSE; + + if (!nm_connection_is_type (connection, NM_SETTING_MACVLAN_SETTING_NAME)) { + g_set_error_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION, + _("The connection was not a MAC-VLAN connection.")); + return FALSE; + } + + s_macvlan = nm_connection_get_setting_macvlan (connection); + if (s_macvlan) { + if (nm_setting_macvlan_get_tap (s_macvlan) != priv->tap) + return FALSE; + } + + return TRUE; +} + +static const char * +get_hw_address (NMDevice *device) +{ + return nm_device_macvlan_get_hw_address (NM_DEVICE_MACVLAN (device)); +} + +static GType +get_setting_type (NMDevice *device) +{ + return NM_TYPE_SETTING_MACVLAN; +} + +/***********************************************************/ + +static void +nm_device_macvlan_init (NMDeviceMacvlan *device) +{ + _nm_device_set_device_type (NM_DEVICE (device), NM_DEVICE_TYPE_MACVLAN); +} + +static void +init_dbus (NMObject *object) +{ + NMDeviceMacvlanPrivate *priv = NM_DEVICE_MACVLAN_GET_PRIVATE (object); + const NMPropertiesInfo property_info[] = { + { NM_DEVICE_MACVLAN_PARENT, &priv->parent, NULL, NM_TYPE_DEVICE }, + { NM_DEVICE_MACVLAN_MODE, &priv->mode }, + { NM_DEVICE_MACVLAN_NO_PROMISC, &priv->no_promisc }, + { NM_DEVICE_MACVLAN_TAP, &priv->tap }, + { NM_DEVICE_MACVLAN_HW_ADDRESS, &priv->hw_address }, + { NULL }, + }; + + NM_OBJECT_CLASS (nm_device_macvlan_parent_class)->init_dbus (object); + + _nm_object_register_properties (object, + NM_DBUS_INTERFACE_DEVICE_MACVLAN, + property_info); +} + +static void +finalize (GObject *object) +{ + NMDeviceMacvlanPrivate *priv = NM_DEVICE_MACVLAN_GET_PRIVATE (object); + + g_free (priv->mode); + g_free (priv->hw_address); + g_clear_object (&priv->parent); + + G_OBJECT_CLASS (nm_device_macvlan_parent_class)->finalize (object); +} + +static void +get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + NMDeviceMacvlan *device = NM_DEVICE_MACVLAN (object); + + switch (prop_id) { + case PROP_PARENT: + g_value_set_object (value, nm_device_macvlan_get_parent (device)); + break; + case PROP_MODE: + g_value_set_string (value, nm_device_macvlan_get_mode (device)); + break; + case PROP_NO_PROMISC: + g_value_set_boolean (value, nm_device_macvlan_get_no_promisc (device)); + break; + case PROP_TAP: + g_value_set_boolean (value, nm_device_macvlan_get_tap (device)); + break; + case PROP_HW_ADDRESS: + g_value_set_string (value, nm_device_macvlan_get_hw_address (device)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_device_macvlan_class_init (NMDeviceMacvlanClass *gre_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (gre_class); + NMObjectClass *nm_object_class = NM_OBJECT_CLASS (gre_class); + NMDeviceClass *device_class = NM_DEVICE_CLASS (gre_class); + + g_type_class_add_private (gre_class, sizeof (NMDeviceMacvlanPrivate)); + + _nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_DEVICE_MACVLAN); + + /* virtual methods */ + object_class->finalize = finalize; + object_class->get_property = get_property; + + nm_object_class->init_dbus = init_dbus; + + device_class->connection_compatible = connection_compatible; + device_class->get_setting_type = get_setting_type; + device_class->get_hw_address = get_hw_address; + + /* properties */ + + /** + * NMDeviceMacvlan:parent: + * + * The devices's parent device. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_PARENT, + g_param_spec_object (NM_DEVICE_MACVLAN_PARENT, "", "", + NM_TYPE_DEVICE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceMacvlan:mode: + * + * The MACVLAN mode. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_MODE, + g_param_spec_string (NM_DEVICE_MACVLAN_MODE, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceMacvlan:no-promisc: + * + * Whether the device has the no-promiscuos flag. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_NO_PROMISC, + g_param_spec_boolean (NM_DEVICE_MACVLAN_NO_PROMISC, "", "", + FALSE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceMacvlan:tap: + * + * Whether the device is a MACVTAP. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_TAP, + g_param_spec_boolean (NM_DEVICE_MACVLAN_TAP, "", "", + FALSE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceMacvlan:hw-address: + * + * The hardware (MAC) address of the device. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_HW_ADDRESS, + g_param_spec_string (NM_DEVICE_MACVLAN_HW_ADDRESS, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); +} diff --git a/libnm/nm-device-macvlan.h b/libnm/nm-device-macvlan.h new file mode 100644 index 00000000..7ffb80c1 --- /dev/null +++ b/libnm/nm-device-macvlan.h @@ -0,0 +1,72 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2015 Red Hat, Inc. + */ + +#ifndef __NM_DEVICE_MACVLAN_H__ +#define __NM_DEVICE_MACVLAN_H__ + +#if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) +#error "Only can be included directly." +#endif + +#include + +G_BEGIN_DECLS + +#define NM_TYPE_DEVICE_MACVLAN (nm_device_macvlan_get_type ()) +#define NM_DEVICE_MACVLAN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_MACVLAN, NMDeviceMacvlan)) +#define NM_DEVICE_MACVLAN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_MACVLAN, NMDeviceMacvlanClass)) +#define NM_IS_DEVICE_MACVLAN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_MACVLAN)) +#define NM_IS_DEVICE_MACVLAN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_MACVLAN)) +#define NM_DEVICE_MACVLAN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_MACVLAN, NMDeviceMacvlanClass)) + +#define NM_DEVICE_MACVLAN_PARENT "parent" +#define NM_DEVICE_MACVLAN_MODE "mode" +#define NM_DEVICE_MACVLAN_NO_PROMISC "no-promisc" +#define NM_DEVICE_MACVLAN_TAP "tap" +#define NM_DEVICE_MACVLAN_HW_ADDRESS "hw-address" + +struct _NMDeviceMacvlan { + NMDevice parent; +}; + +typedef struct { + NMDeviceClass parent; + + /*< private >*/ + gpointer padding[4]; +} NMDeviceMacvlanClass; + +NM_AVAILABLE_IN_1_2 +GType nm_device_macvlan_get_type (void); + +NM_AVAILABLE_IN_1_2 +NMDevice * nm_device_macvlan_get_parent (NMDeviceMacvlan *device); +NM_AVAILABLE_IN_1_2 +const char * nm_device_macvlan_get_mode (NMDeviceMacvlan *device); +NM_AVAILABLE_IN_1_2 +gboolean nm_device_macvlan_get_no_promisc (NMDeviceMacvlan *device); +NM_AVAILABLE_IN_1_2 +gboolean nm_device_macvlan_get_tap (NMDeviceMacvlan *device); +NM_AVAILABLE_IN_1_2 +const char * nm_device_macvlan_get_hw_address (NMDeviceMacvlan *device); + +G_END_DECLS + +#endif /* __NM_DEVICE_MACVLAN_H__ */ diff --git a/libnm/nm-device-modem.c b/libnm/nm-device-modem.c index dcbb447a..9fe5acb6 100644 --- a/libnm/nm-device-modem.c +++ b/libnm/nm-device-modem.c @@ -22,14 +22,12 @@ #include "config.h" #include -#include - -#include "nm-glib-compat.h" #include #include #include +#include "nm-default.h" #include "nm-device-modem.h" #include "nm-device-private.h" #include "nm-object-private.h" diff --git a/libnm/nm-device-olpc-mesh.c b/libnm/nm-device-olpc-mesh.c index 108e5339..8e6cb1ab 100644 --- a/libnm/nm-device-olpc-mesh.c +++ b/libnm/nm-device-olpc-mesh.c @@ -21,13 +21,11 @@ #include "config.h" #include -#include - -#include "nm-glib-compat.h" #include #include +#include "nm-default.h" #include "nm-device-olpc-mesh.h" #include "nm-device-private.h" #include "nm-object-private.h" diff --git a/libnm/nm-device-team.c b/libnm/nm-device-team.c index cff1d718..c38c58c1 100644 --- a/libnm/nm-device-team.c +++ b/libnm/nm-device-team.c @@ -21,14 +21,12 @@ #include "config.h" #include -#include - -#include "nm-glib-compat.h" #include #include #include +#include "nm-default.h" #include "nm-device-team.h" #include "nm-device-private.h" #include "nm-object-private.h" diff --git a/libnm/nm-device-tun.c b/libnm/nm-device-tun.c new file mode 100644 index 00000000..ce2558f0 --- /dev/null +++ b/libnm/nm-device-tun.c @@ -0,0 +1,439 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2015 Red Hat, Inc. + */ + +#include "config.h" + +#include +#include + +#include +#include +#include + +#include "nm-default.h" +#include "nm-device-tun.h" +#include "nm-device-private.h" +#include "nm-object-private.h" + +G_DEFINE_TYPE (NMDeviceTun, nm_device_tun, NM_TYPE_DEVICE) + +#define NM_DEVICE_TUN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_TUN, NMDeviceTunPrivate)) + +typedef struct { + char *hw_address; + char *mode; + gint64 owner; + gint64 group; + gboolean no_pi; + gboolean vnet_hdr; + gboolean multi_queue; +} NMDeviceTunPrivate; + +enum { + PROP_0, + PROP_HW_ADDRESS, + PROP_MODE, + PROP_OWNER, + PROP_GROUP, + PROP_NO_PI, + PROP_VNET_HDR, + PROP_MULTI_QUEUE, + + LAST_PROP +}; + +/** + * nm_device_tun_get_hw_address: + * @device: a #NMDeviceTun + * + * Gets the hardware (MAC) address of the #NMDeviceTun + * + * Returns: the hardware address. This is the internal string used by the + * device, and must not be modified. + * + * Since: 1.2 + **/ +const char * +nm_device_tun_get_hw_address (NMDeviceTun *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_TUN (device), NULL); + + return NM_DEVICE_TUN_GET_PRIVATE (device)->hw_address; +} + +/** + * nm_device_tun_get_mode: + * @device: a #NMDeviceTun + * + * Returns the TUN/TAP mode for the device. + * + * Returns: 'tun' or 'tap' + * + * Since: 1.2 + **/ +const char * +nm_device_tun_get_mode (NMDeviceTun *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_TUN (device), NULL); + + return NM_DEVICE_TUN_GET_PRIVATE (device)->mode; +} + +/** + * nm_device_tun_get_owner: + * @device: a #NMDeviceTun + * + * Gets the tunnel owner. + * + * Returns: the uid of the tunnel owner, or -1 if it has no owner. + * + * Since: 1.2 + **/ +gint64 +nm_device_tun_get_owner (NMDeviceTun *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_TUN (device), -1); + + return NM_DEVICE_TUN_GET_PRIVATE (device)->owner; +} + +/** + * nm_device_tun_get_group: + * @device: a #NMDeviceTun + * + * Gets the tunnel group. + * + * Returns: the gid of the tunnel group, or -1 if it has no owner. + * + * Since: 1.2 + **/ +gint64 +nm_device_tun_get_group (NMDeviceTun *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_TUN (device), -1); + + return NM_DEVICE_TUN_GET_PRIVATE (device)->group; +} + +/** + * nm_device_tun_get_pi: + * @device: a #NMDeviceTun + * + * Returns whether the #NMDeviceTun has the IFF_NO_PI flag. + * + * Returns: %TRUE if the device has the flag, %FALSE otherwise + * + * Since: 1.2 + **/ +gboolean +nm_device_tun_get_no_pi (NMDeviceTun *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_TUN (device), FALSE); + + return NM_DEVICE_TUN_GET_PRIVATE (device)->no_pi; +} + +/** + * nm_device_tun_get_vnet_hdr: + * @device: a #NMDeviceTun + * + * Returns whether the #NMDeviceTun has the IFF_VNET_HDR flag. + * + * Returns: %TRUE if the device has the flag, %FALSE otherwise + * + * Since: 1.2 + **/ +gboolean +nm_device_tun_get_vnet_hdr (NMDeviceTun *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_TUN (device), FALSE); + + return NM_DEVICE_TUN_GET_PRIVATE (device)->vnet_hdr; +} + +/** + * nm_device_tun_get_multi_queue: + * @device: a #NMDeviceTun + * + * Returns whether the #NMDeviceTun has the IFF_MULTI_QUEUE flag. + * + * Returns: %TRUE if the device doesn't have the flag, %FALSE otherwise + * + * Since: 1.2 + **/ +gboolean +nm_device_tun_get_multi_queue (NMDeviceTun *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_TUN (device), FALSE); + + return NM_DEVICE_TUN_GET_PRIVATE (device)->multi_queue; +} + +static int +tun_mode_from_string (const char *string) +{ + if (!g_strcmp0 (string, "tap")) + return NM_SETTING_TUN_MODE_TAP; + else + return NM_SETTING_TUN_MODE_TUN; +} + +static gboolean +connection_compatible (NMDevice *device, NMConnection *connection, GError **error) +{ + NMDeviceTunPrivate *priv = NM_DEVICE_TUN_GET_PRIVATE (device); + NMSettingTunMode mode; + NMSettingTun *s_tun; + + if (!NM_DEVICE_CLASS (nm_device_tun_parent_class)->connection_compatible (device, connection, error)) + return FALSE; + + if (!nm_connection_is_type (connection, NM_SETTING_TUN_SETTING_NAME)) { + g_set_error_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION, + _("The connection was not a tun connection.")); + return FALSE; + } + + s_tun = nm_connection_get_setting_tun (connection); + + mode = tun_mode_from_string (priv->mode); + if (s_tun && mode != nm_setting_tun_get_mode (s_tun)) { + g_set_error_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION, + _("The mode of the device and the connection didn't match")); + return FALSE; + } + + return TRUE; +} + +static GType +get_setting_type (NMDevice *device) +{ + return NM_TYPE_SETTING_TUN; +} + +static const char * +get_hw_address (NMDevice *device) +{ + return nm_device_tun_get_hw_address (NM_DEVICE_TUN (device)); +} + +/***********************************************************/ + +static void +nm_device_tun_init (NMDeviceTun *device) +{ + _nm_device_set_device_type (NM_DEVICE (device), NM_DEVICE_TYPE_TUN); +} + +static void +init_dbus (NMObject *object) +{ + NMDeviceTunPrivate *priv = NM_DEVICE_TUN_GET_PRIVATE (object); + const NMPropertiesInfo property_info[] = { + { NM_DEVICE_TUN_HW_ADDRESS, &priv->hw_address }, + { NM_DEVICE_TUN_MODE, &priv->mode }, + { NM_DEVICE_TUN_OWNER, &priv->owner }, + { NM_DEVICE_TUN_GROUP, &priv->group }, + { NM_DEVICE_TUN_NO_PI, &priv->no_pi }, + { NM_DEVICE_TUN_VNET_HDR, &priv->vnet_hdr }, + { NM_DEVICE_TUN_MULTI_QUEUE, &priv->multi_queue }, + { NULL }, + }; + + NM_OBJECT_CLASS (nm_device_tun_parent_class)->init_dbus (object); + + _nm_object_register_properties (object, + NM_DBUS_INTERFACE_DEVICE_TUN, + property_info); +} + +static void +finalize (GObject *object) +{ + NMDeviceTunPrivate *priv = NM_DEVICE_TUN_GET_PRIVATE (object); + + g_free (priv->mode); + + G_OBJECT_CLASS (nm_device_tun_parent_class)->finalize (object); +} + +static void +get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + NMDeviceTun *device = NM_DEVICE_TUN (object); + + switch (prop_id) { + case PROP_HW_ADDRESS: + g_value_set_string (value, nm_device_tun_get_hw_address (device)); + break; + case PROP_MODE: + g_value_set_string (value, nm_device_tun_get_mode (device)); + break; + case PROP_OWNER: + g_value_set_int64 (value, nm_device_tun_get_owner (device)); + break; + case PROP_GROUP: + g_value_set_int64 (value, nm_device_tun_get_group (device)); + break; + case PROP_NO_PI: + g_value_set_boolean (value, nm_device_tun_get_no_pi (device)); + break; + case PROP_VNET_HDR: + g_value_set_boolean (value, nm_device_tun_get_vnet_hdr (device)); + break; + case PROP_MULTI_QUEUE: + g_value_set_boolean (value, nm_device_tun_get_multi_queue (device)); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_device_tun_class_init (NMDeviceTunClass *gre_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (gre_class); + NMObjectClass *nm_object_class = NM_OBJECT_CLASS (gre_class); + NMDeviceClass *device_class = NM_DEVICE_CLASS (gre_class); + + g_type_class_add_private (gre_class, sizeof (NMDeviceTunPrivate)); + + _nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_DEVICE_TUN); + + /* virtual methods */ + object_class->finalize = finalize; + object_class->get_property = get_property; + + nm_object_class->init_dbus = init_dbus; + + device_class->connection_compatible = connection_compatible; + device_class->get_setting_type = get_setting_type; + device_class->get_hw_address = get_hw_address; + + /* properties */ + + /** + * NMDeviceTun:hw-address: + * + * The hardware (MAC) address of the device. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_HW_ADDRESS, + g_param_spec_string (NM_DEVICE_TUN_HW_ADDRESS, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceTun:mode: + * + * The tunnel mode, either "tun" or "tap". + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_MODE, + g_param_spec_string (NM_DEVICE_TUN_MODE, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceTun:owner: + * + * The uid of the tunnel owner, or -1 if it has no owner. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_OWNER, + g_param_spec_int64 (NM_DEVICE_TUN_OWNER, "", "", + -1, G_MAXUINT32, -1, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceTun:group: + * + * The gid of the tunnel group, or -1 if it has no owner. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_GROUP, + g_param_spec_int64 (NM_DEVICE_TUN_GROUP, "", "", + -1, G_MAXUINT32, -1, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceTun:no-pi: + * + * The tunnel's "TUN_NO_PI" flag; true if no protocol info is + * prepended to the tunnel packets. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_NO_PI, + g_param_spec_boolean (NM_DEVICE_TUN_NO_PI, "", "", + FALSE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceTun:vnet-hdr: + * + * The tunnel's "TUN_VNET_HDR" flag; true if the tunnel packets + * include a virtio network header. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_VNET_HDR, + g_param_spec_boolean (NM_DEVICE_TUN_VNET_HDR, "", "", + FALSE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceTun:multi-queue: + * + * The tunnel's "TUN_TAP_MQ" flag; true if callers can connect to + * the tap device multiple times, for multiple send/receive + * queues. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_MULTI_QUEUE, + g_param_spec_boolean (NM_DEVICE_TUN_MULTI_QUEUE, "", "", + FALSE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); +} diff --git a/libnm/nm-device-tun.h b/libnm/nm-device-tun.h new file mode 100644 index 00000000..b83e2b3f --- /dev/null +++ b/libnm/nm-device-tun.h @@ -0,0 +1,78 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2015 Red Hat, Inc. + */ + +#ifndef __NM_DEVICE_TUN_H__ +#define __NM_DEVICE_TUN_H__ + +#if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) +#error "Only can be included directly." +#endif + +#include + +G_BEGIN_DECLS + +#define NM_TYPE_DEVICE_TUN (nm_device_tun_get_type ()) +#define NM_DEVICE_TUN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_TUN, NMDeviceTun)) +#define NM_DEVICE_TUN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_TUN, NMDeviceTunClass)) +#define NM_IS_DEVICE_TUN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_TUN)) +#define NM_IS_DEVICE_TUN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_TUN)) +#define NM_DEVICE_TUN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_TUN, NMDeviceTunClass)) + +#define NM_DEVICE_TUN_HW_ADDRESS "hw-address" +#define NM_DEVICE_TUN_OWNER "owner" +#define NM_DEVICE_TUN_GROUP "group" +#define NM_DEVICE_TUN_MODE "mode" +#define NM_DEVICE_TUN_NO_PI "no-pi" +#define NM_DEVICE_TUN_VNET_HDR "vnet-hdr" +#define NM_DEVICE_TUN_MULTI_QUEUE "multi-queue" + +struct _NMDeviceTun { + NMDevice parent; +}; + +typedef struct { + NMDeviceClass parent; + + /*< private >*/ + gpointer padding[4]; +} NMDeviceTunClass; + +NM_AVAILABLE_IN_1_2 +GType nm_device_tun_get_type (void); + +NM_AVAILABLE_IN_1_2 +const char * nm_device_tun_get_hw_address (NMDeviceTun *device); +NM_AVAILABLE_IN_1_2 +const char * nm_device_tun_get_mode (NMDeviceTun *device); +NM_AVAILABLE_IN_1_2 +gint64 nm_device_tun_get_owner (NMDeviceTun *device); +NM_AVAILABLE_IN_1_2 +gint64 nm_device_tun_get_group (NMDeviceTun *device); +NM_AVAILABLE_IN_1_2 +gboolean nm_device_tun_get_no_pi (NMDeviceTun *device); +NM_AVAILABLE_IN_1_2 +gboolean nm_device_tun_get_vnet_hdr (NMDeviceTun *device); +NM_AVAILABLE_IN_1_2 +gboolean nm_device_tun_get_multi_queue (NMDeviceTun *device); + +G_END_DECLS + +#endif /* __NM_DEVICE_TUN_H__ */ diff --git a/libnm/nm-device-vlan.c b/libnm/nm-device-vlan.c index fb6e3bd7..b285eea9 100644 --- a/libnm/nm-device-vlan.c +++ b/libnm/nm-device-vlan.c @@ -21,15 +21,13 @@ #include "config.h" #include -#include - -#include "nm-glib-compat.h" #include #include #include #include +#include "nm-default.h" #include "nm-device-vlan.h" #include "nm-device-private.h" #include "nm-object-private.h" diff --git a/libnm/nm-device-vxlan.c b/libnm/nm-device-vxlan.c new file mode 100644 index 00000000..4718080e --- /dev/null +++ b/libnm/nm-device-vxlan.c @@ -0,0 +1,815 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2015 Red Hat, Inc. + */ + +#include "config.h" + +#include + +#include +#include +#include + +#include "nm-default.h" +#include "nm-device-vxlan.h" +#include "nm-device-private.h" +#include "nm-object-private.h" + +G_DEFINE_TYPE (NMDeviceVxlan, nm_device_vxlan, NM_TYPE_DEVICE) + +#define NM_DEVICE_VXLAN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_VXLAN, NMDeviceVxlanPrivate)) + +typedef struct { + NMDevice *parent; + char *hw_address; + gboolean carrier; + guint id; + char *group; + char *local; + guint src_port_min; + guint src_port_max; + guint dst_port; + guint tos; + guint ttl; + guint limit; + gboolean learning; + guint ageing; + gboolean proxy; + gboolean rsc; + gboolean l2miss; + gboolean l3miss; +} NMDeviceVxlanPrivate; + +enum { + PROP_0, + PROP_HW_ADDRESS, + PROP_CARRIER, + PROP_PARENT, + PROP_ID, + PROP_GROUP, + PROP_LOCAL, + PROP_TOS, + PROP_TTL, + PROP_LIMIT, + PROP_LEARNING, + PROP_AGEING, + PROP_DST_PORT, + PROP_SRC_PORT_MIN, + PROP_SRC_PORT_MAX, + PROP_PROXY, + PROP_RSC, + PROP_L2MISS, + PROP_L3MISS, + + LAST_PROP +}; + +/** + * nm_device_vxlan_get_hw_address: + * @device: a #NMDeviceVxlan + * + * Gets the hardware (MAC) address of the #NMDeviceVxlan + * + * Returns: the hardware address. This is the internal string used by the + * device, and must not be modified. + * + * Since: 1.2 + **/ +const char * +nm_device_vxlan_get_hw_address (NMDeviceVxlan *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), NULL); + + return NM_DEVICE_VXLAN_GET_PRIVATE (device)->hw_address; +} + +/** + * nm_device_vxlan_get_carrier: + * @device: a #NMDeviceVxlan + * + * Whether the device has carrier. + * + * Returns: %TRUE if the device has carrier. + * + * Since: 1.2 + **/ +gboolean +nm_device_vxlan_get_carrier (NMDeviceVxlan *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), FALSE); + + return NM_DEVICE_VXLAN_GET_PRIVATE (device)->carrier; +} + +/** + * nm_device_vxlan_get_parent: + * @device: a #NMDeviceVxlan + * + * Returns: (transfer none): the device's parent device + * + * Since: 1.2 + **/ +NMDevice * +nm_device_vxlan_get_parent (NMDeviceVxlan *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), NULL); + + return NM_DEVICE_VXLAN_GET_PRIVATE (device)->parent; +} + +/** + * nm_device_vxlan_get_id: + * @device: a #NMDeviceVxlan + * + * Returns: the device's VXLAN ID. + * + * Since: 1.2 + **/ +guint +nm_device_vxlan_get_id (NMDeviceVxlan *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), 0); + + return NM_DEVICE_VXLAN_GET_PRIVATE (device)->id; +} + +/** + * nm_device_vxlan_get_group: + * @device: a #NMDeviceVxlan + * + * Returns: The unicast destination IP address or the multicast + * IP address joined + * + * Since: 1.2 + **/ +const char * +nm_device_vxlan_get_group (NMDeviceVxlan *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), NULL); + + return NM_DEVICE_VXLAN_GET_PRIVATE (device)->group; +} + +/** + * nm_device_vxlan_get_local: + * @device: a #NMDeviceVxlan + * + * Returns: the source IP address to use in outgoing packets + * + * Since: 1.2 + **/ +const char * +nm_device_vxlan_get_local (NMDeviceVxlan *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), NULL); + + return NM_DEVICE_VXLAN_GET_PRIVATE (device)->local; +} + +/** + * nm_device_vxlan_get_src_port_min: + * @device: a #NMDeviceVxlan + * + * Returns: the minimum UDP source port + * + * Since: 1.2 + **/ +guint +nm_device_vxlan_get_src_port_min (NMDeviceVxlan *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), 0); + + return NM_DEVICE_VXLAN_GET_PRIVATE (device)->src_port_min; +} + +/** + * nm_device_vxlan_get_src_port_max: + * @device: a #NMDeviceVxlan + * + * Returns: the maximum UDP source port + * + * Since: 1.2 + **/ +guint +nm_device_vxlan_get_src_port_max (NMDeviceVxlan *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), 0); + + return NM_DEVICE_VXLAN_GET_PRIVATE (device)->src_port_max; +} + +/** + * nm_device_vxlan_get_dst_port: + * @device: a #NMDeviceVxlan + * + * Returns: the UDP destination port + * + * Since: 1.2 + **/ +guint +nm_device_vxlan_get_dst_port (NMDeviceVxlan *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), 0); + + return NM_DEVICE_VXLAN_GET_PRIVATE (device)->dst_port; +} + +/** + * nm_device_vxlan_get_learning: + * @device: a #NMDeviceVxlan + * + * Returns: whether address learning is enabled + * + * Since: 1.2 + **/ +gboolean +nm_device_vxlan_get_learning (NMDeviceVxlan *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), FALSE); + + return NM_DEVICE_VXLAN_GET_PRIVATE (device)->learning; +} + +/** + * nm_device_vxlan_get_ageing: + * @device: a #NMDeviceVxlan + * + * Returns: the lifetime in seconds of FDB entries learnt by the kernel + * + * Since: 1.2 + **/ +guint +nm_device_vxlan_get_ageing (NMDeviceVxlan *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), 0); + + return NM_DEVICE_VXLAN_GET_PRIVATE (device)->ageing; +} + +/** + * nm_device_vxlan_get_tos: + * @device: a #NMDeviceVxlan + * + * Returns: the TOS value to use in outgoing packets + * + * Since: 1.2 + **/ +guint +nm_device_vxlan_get_tos (NMDeviceVxlan *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), 0); + + return NM_DEVICE_VXLAN_GET_PRIVATE (device)->tos; +} + +/** + * nm_device_vxlan_get_ttl: + * @device: a #NMDeviceVxlan + * + * Returns: the time-to-live value to use in outgoing packets + * + * Since: 1.2 + **/ +guint +nm_device_vxlan_get_ttl (NMDeviceVxlan *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), 0); + + return NM_DEVICE_VXLAN_GET_PRIVATE (device)->ttl; +} + +/** + * nm_device_vxlan_get_limit: + * @device: a #NMDeviceVxlan + * + * Returns: the maximum number of entries that can be added to the + * forwarding table + * + * Since: 1.2 + **/ +guint +nm_device_vxlan_get_limit (NMDeviceVxlan *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), 0); + + return NM_DEVICE_VXLAN_GET_PRIVATE (device)->limit; +} + +/** + * nm_device_vxlan_get_proxy: + * @device: a #NMDeviceVxlan + * + * Returns: whether ARP proxy is turned on + * + * Since: 1.2 + **/ +gboolean +nm_device_vxlan_get_proxy (NMDeviceVxlan *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), FALSE); + + return NM_DEVICE_VXLAN_GET_PRIVATE (device)->proxy; +} + +/** + * nm_device_vxlan_get_rsc: + * @device: a #NMDeviceVxlan + * + * Returns: whether route short circuit is turned on + * + * Since: 1.2 + **/ +gboolean +nm_device_vxlan_get_rsc (NMDeviceVxlan *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), FALSE); + + return NM_DEVICE_VXLAN_GET_PRIVATE (device)->rsc; +} + +/** + * nm_device_vxlan_get_l2miss: + * @device: a #NMDeviceVxlan + * + * Returns: whether netlink LL ADDR miss notifications are generated + * + * Since: 1.2 + **/ +gboolean +nm_device_vxlan_get_l2miss (NMDeviceVxlan *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), FALSE); + + return NM_DEVICE_VXLAN_GET_PRIVATE (device)->l2miss; +} + +/** + * nm_device_vxlan_get_l3miss: + * @device: a #NMDeviceVxlan + * + * Returns: wether netlink IP ADDR miss notifications are generated + * + * Since: 1.2 + **/ +gboolean +nm_device_vxlan_get_l3miss (NMDeviceVxlan *device) +{ + g_return_val_if_fail (NM_IS_DEVICE_VXLAN (device), FALSE); + + return NM_DEVICE_VXLAN_GET_PRIVATE (device)->l3miss; +} + +static gboolean +connection_compatible (NMDevice *device, NMConnection *connection, GError **error) +{ + NMSettingVxlan *s_vxlan; + + if (!NM_DEVICE_CLASS (nm_device_vxlan_parent_class)->connection_compatible (device, connection, error)) + return FALSE; + + if (!nm_connection_is_type (connection, NM_SETTING_VXLAN_SETTING_NAME)) { + g_set_error_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION, + _("The connection was not a VXLAN connection.")); + return FALSE; + } + + s_vxlan = nm_connection_get_setting_vxlan (connection); + if (nm_setting_vxlan_get_id (s_vxlan) != nm_device_vxlan_get_id (NM_DEVICE_VXLAN (device))) { + g_set_error_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION, + _("The VXLAN identifiers of the device and the connection didn't match.")); + return FALSE; + } + + return TRUE; +} + +static GType +get_setting_type (NMDevice *device) +{ + return NM_TYPE_SETTING_VXLAN; +} + +static const char * +get_hw_address (NMDevice *device) +{ + return nm_device_vxlan_get_hw_address (NM_DEVICE_VXLAN (device)); +} + +/***********************************************************/ + +static void +nm_device_vxlan_init (NMDeviceVxlan *device) +{ + _nm_device_set_device_type (NM_DEVICE (device), NM_DEVICE_TYPE_VXLAN); +} + +static void +init_dbus (NMObject *object) +{ + NMDeviceVxlanPrivate *priv = NM_DEVICE_VXLAN_GET_PRIVATE (object); + const NMPropertiesInfo property_info[] = { + { NM_DEVICE_VXLAN_HW_ADDRESS, &priv->hw_address }, + { NM_DEVICE_VXLAN_CARRIER, &priv->carrier }, + { NM_DEVICE_VXLAN_PARENT, &priv->parent, NULL, NM_TYPE_DEVICE }, + { NM_DEVICE_VXLAN_ID, &priv->id }, + { NM_DEVICE_VXLAN_GROUP, &priv->group }, + { NM_DEVICE_VXLAN_LOCAL, &priv->local }, + { NM_DEVICE_VXLAN_SRC_PORT_MIN, &priv->src_port_min }, + { NM_DEVICE_VXLAN_SRC_PORT_MAX, &priv->src_port_max }, + { NM_DEVICE_VXLAN_DST_PORT, &priv->dst_port }, + { NM_DEVICE_VXLAN_TOS, &priv->tos }, + { NM_DEVICE_VXLAN_TTL, &priv->ttl }, + { NM_DEVICE_VXLAN_LIMIT, &priv->limit }, + { NM_DEVICE_VXLAN_LEARNING, &priv->learning }, + { NM_DEVICE_VXLAN_AGEING, &priv->ageing }, + { NM_DEVICE_VXLAN_PROXY, &priv->proxy }, + { NM_DEVICE_VXLAN_RSC, &priv->rsc }, + { NM_DEVICE_VXLAN_L2MISS, &priv->l2miss }, + { NM_DEVICE_VXLAN_L3MISS, &priv->l3miss }, + { NULL }, + }; + + NM_OBJECT_CLASS (nm_device_vxlan_parent_class)->init_dbus (object); + + _nm_object_register_properties (object, + NM_DBUS_INTERFACE_DEVICE_VXLAN, + property_info); +} + +static void +finalize (GObject *object) +{ + NMDeviceVxlanPrivate *priv = NM_DEVICE_VXLAN_GET_PRIVATE (object); + + g_free (priv->hw_address); + g_clear_object (&priv->parent); + + G_OBJECT_CLASS (nm_device_vxlan_parent_class)->finalize (object); +} + +static void +get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + NMDeviceVxlan *device = NM_DEVICE_VXLAN (object); + + switch (prop_id) { + case PROP_HW_ADDRESS: + g_value_set_string (value, nm_device_vxlan_get_hw_address (device)); + break; + case PROP_CARRIER: + g_value_set_boolean (value, nm_device_vxlan_get_carrier (device)); + break; + case PROP_PARENT: + g_value_set_object (value, nm_device_vxlan_get_parent (device)); + break; + case PROP_ID: + g_value_set_uint (value, nm_device_vxlan_get_id (device)); + break; + case PROP_GROUP: + g_value_set_string (value, nm_device_vxlan_get_group (device)); + break; + case PROP_LOCAL: + g_value_set_string (value, nm_device_vxlan_get_local (device)); + break; + case PROP_TOS: + g_value_set_uint (value, nm_device_vxlan_get_tos (device)); + break; + case PROP_TTL: + g_value_set_uint (value, nm_device_vxlan_get_ttl (device)); + break; + case PROP_LIMIT: + g_value_set_uint (value, nm_device_vxlan_get_limit (device)); + break; + case PROP_LEARNING: + g_value_set_boolean (value, nm_device_vxlan_get_learning (device)); + break; + case PROP_AGEING: + g_value_set_uint (value, nm_device_vxlan_get_ageing (device)); + break; + case PROP_DST_PORT: + g_value_set_uint (value, nm_device_vxlan_get_dst_port (device)); + break; + case PROP_SRC_PORT_MIN: + g_value_set_uint (value, nm_device_vxlan_get_src_port_min (device)); + break; + case PROP_SRC_PORT_MAX: + g_value_set_uint (value, nm_device_vxlan_get_src_port_max (device)); + break; + case PROP_PROXY: + g_value_set_boolean (value, nm_device_vxlan_get_proxy (device)); + break; + case PROP_RSC: + g_value_set_boolean (value, nm_device_vxlan_get_rsc (device)); + break; + case PROP_L2MISS: + g_value_set_boolean (value, nm_device_vxlan_get_l2miss (device)); + break; + case PROP_L3MISS: + g_value_set_boolean (value, nm_device_vxlan_get_l3miss (device)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +nm_device_vxlan_class_init (NMDeviceVxlanClass *vxlan_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (vxlan_class); + NMObjectClass *nm_object_class = NM_OBJECT_CLASS (vxlan_class); + NMDeviceClass *device_class = NM_DEVICE_CLASS (vxlan_class); + + g_type_class_add_private (vxlan_class, sizeof (NMDeviceVxlanPrivate)); + + _nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_DEVICE_VXLAN); + + /* virtual methods */ + object_class->finalize = finalize; + object_class->get_property = get_property; + + nm_object_class->init_dbus = init_dbus; + + device_class->connection_compatible = connection_compatible; + device_class->get_setting_type = get_setting_type; + device_class->get_hw_address = get_hw_address; + + /* properties */ + + /** + * NMDeviceVxlan:hw-address: + * + * The hardware (MAC) address of the device. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_HW_ADDRESS, + g_param_spec_string (NM_DEVICE_VXLAN_HW_ADDRESS, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceVxlan:carrier: + * + * Whether the device has carrier. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_CARRIER, + g_param_spec_boolean (NM_DEVICE_VXLAN_CARRIER, "", "", + FALSE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceVxlan:parent: + * + * The devices's parent device. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_PARENT, + g_param_spec_object (NM_DEVICE_VXLAN_PARENT, "", "", + NM_TYPE_DEVICE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceVxlan:id: + * + * The device's VXLAN ID. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_ID, + g_param_spec_uint (NM_DEVICE_VXLAN_ID, "", "", + 0, (1 << 24) - 1, 0, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceVxlan:group: + * + * The unicast destination IP address used in outgoing packets when the + * destination link layer address is not known in the VXLAN device + * forwarding database or the multicast IP address joined. + * + * Since: 1.2 + */ + g_object_class_install_property + (object_class, PROP_GROUP, + g_param_spec_string (NM_DEVICE_VXLAN_GROUP, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceVxlan:local: + * + * The source IP address to use in outgoing packets. + * + * Since: 1.2 + */ + g_object_class_install_property + (object_class, PROP_LOCAL, + g_param_spec_string (NM_DEVICE_VXLAN_LOCAL, "", "", + NULL, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceVxlan:tos: + * + * The TOS value to use in outgoing packets. + * + * Since: 1.2 + */ + g_object_class_install_property + (object_class, PROP_TOS, + g_param_spec_uchar (NM_DEVICE_VXLAN_TOS, "", "", + 0, 255, 0, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceVxlan:ttl: + * + * The time-to-live value to use in outgoing packets. + * + * Since: 1.2 + */ + g_object_class_install_property + (object_class, PROP_TTL, + g_param_spec_uchar (NM_DEVICE_VXLAN_TTL, "", "", + 0, 255, 0, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceVxlan:learning: + * + * Whether unknown source link layer addresses and IP addresses are entered + * into the VXLAN device forwarding database. + * + * Since: 1.2 + */ + g_object_class_install_property + (object_class, PROP_LEARNING, + g_param_spec_boolean (NM_DEVICE_VXLAN_LEARNING, "", "", + TRUE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceVxlan:ageing: + * + * The lifetime in seconds of FDB entries learnt by the kernel. + * + * Since: 1.2 + */ + g_object_class_install_property + (object_class, PROP_AGEING, + g_param_spec_uint (NM_DEVICE_VXLAN_AGEING, "", "", + 0, G_MAXUINT32, 0, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceVxlan:limit: + * + * The maximum number of entries that can be added to the forwarding table. + * + * Since: 1.2 + */ + g_object_class_install_property + (object_class, PROP_LIMIT, + g_param_spec_uint (NM_DEVICE_VXLAN_LIMIT, "", "", + 0, G_MAXUINT32, 0, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceVxlan:dst-port: + * + * The UDP destination port used to communicate with the remote VXLAN tunnel + * endpoint. + * + * Since: 1.2 + */ + g_object_class_install_property + (object_class, PROP_DST_PORT, + g_param_spec_uint (NM_DEVICE_VXLAN_DST_PORT, "", "", + 0, 65535, 0, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceVxlan:src-port-min: + * + * The minimum UDP source port used to communicate with the remote VXLAN + * tunnel endpoint. + * + * Since: 1.2 + */ + g_object_class_install_property + (object_class, PROP_SRC_PORT_MIN, + g_param_spec_uint (NM_DEVICE_VXLAN_SRC_PORT_MIN, "", "", + 0, 65535, 0, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceVxlan:src-port-max: + * + * The maximum UDP source port used to communicate with the remote VXLAN + * tunnel endpoint. + * + * Since: 1.2 + */ + g_object_class_install_property + (object_class, PROP_SRC_PORT_MAX, + g_param_spec_uint (NM_DEVICE_VXLAN_SRC_PORT_MAX, "", "", + 0, 65535, 0, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceVxlan:proxy: + * + * Whether ARP proxy is turned on. + * + * Since: 1.2 + */ + g_object_class_install_property + (object_class, PROP_PROXY, + g_param_spec_boolean (NM_DEVICE_VXLAN_PROXY, "", "", + FALSE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceVxlan:rsc: + * + * Whether route short circuit is turned on. + * + * Since: 1.2 + */ + g_object_class_install_property + (object_class, PROP_RSC, + g_param_spec_boolean (NM_DEVICE_VXLAN_RSC, "", "", + FALSE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceVxlan:l2miss: + * + * Whether netlink LL ADDR miss notifications are generated. + * + * Since: 1.2 + */ + g_object_class_install_property + (object_class, PROP_L2MISS, + g_param_spec_boolean (NM_DEVICE_VXLAN_L2MISS, "", "", + FALSE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + + /** + * NMDeviceVxlan:l3miss: + * + * Whether netlink IP ADDR miss notifications are generated. + * + * Since: 1.2 + */ + g_object_class_install_property + (object_class, PROP_L3MISS, + g_param_spec_boolean (NM_DEVICE_VXLAN_L3MISS, "", "", + FALSE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); +} diff --git a/libnm/nm-device-vxlan.h b/libnm/nm-device-vxlan.h new file mode 100644 index 00000000..1fb63597 --- /dev/null +++ b/libnm/nm-device-vxlan.h @@ -0,0 +1,110 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2015 Red Hat, Inc. + */ + +#ifndef __NM_DEVICE_VXLAN_H__ +#define __NM_DEVICE_VXLAN_H__ + +#if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION) +#error "Only can be included directly." +#endif + +#include + +G_BEGIN_DECLS + +#define NM_TYPE_DEVICE_VXLAN (nm_device_vxlan_get_type ()) +#define NM_DEVICE_VXLAN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE_VXLAN, NMDeviceVxlan)) +#define NM_DEVICE_VXLAN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DEVICE_VXLAN, NMDeviceVxlanClass)) +#define NM_IS_DEVICE_VXLAN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE_VXLAN)) +#define NM_IS_DEVICE_VXLAN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_VXLAN)) +#define NM_DEVICE_VXLAN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_VXLAN, NMDeviceVxlanClass)) + +#define NM_DEVICE_VXLAN_HW_ADDRESS "hw-address" +#define NM_DEVICE_VXLAN_CARRIER "carrier" +#define NM_DEVICE_VXLAN_PARENT "parent" +#define NM_DEVICE_VXLAN_ID "id" +#define NM_DEVICE_VXLAN_GROUP "group" +#define NM_DEVICE_VXLAN_LOCAL "local" +#define NM_DEVICE_VXLAN_SRC_PORT_MIN "src-port-min" +#define NM_DEVICE_VXLAN_SRC_PORT_MAX "src-port-max" +#define NM_DEVICE_VXLAN_LEARNING "learning" +#define NM_DEVICE_VXLAN_AGEING "ageing" +#define NM_DEVICE_VXLAN_TOS "tos" +#define NM_DEVICE_VXLAN_TTL "ttl" +#define NM_DEVICE_VXLAN_LIMIT "limit" +#define NM_DEVICE_VXLAN_PROXY "proxy" +#define NM_DEVICE_VXLAN_RSC "rsc" +#define NM_DEVICE_VXLAN_L2MISS "l2miss" +#define NM_DEVICE_VXLAN_L3MISS "l3miss" +#define NM_DEVICE_VXLAN_DST_PORT "dst-port" + +struct _NMDeviceVxlan { + NMDevice parent; +}; + +typedef struct { + NMDeviceClass parent; + + /*< private >*/ + gpointer padding[4]; +} NMDeviceVxlanClass; + +NM_AVAILABLE_IN_1_2 +GType nm_device_vxlan_get_type (void); +NM_AVAILABLE_IN_1_2 +const char * nm_device_vxlan_get_hw_address (NMDeviceVxlan *device); +NM_AVAILABLE_IN_1_2 +gboolean nm_device_vxlan_get_carrier (NMDeviceVxlan *device); +NM_AVAILABLE_IN_1_2 +NMDevice * nm_device_vxlan_get_parent (NMDeviceVxlan *device); +NM_AVAILABLE_IN_1_2 +guint nm_device_vxlan_get_id (NMDeviceVxlan *device); +NM_AVAILABLE_IN_1_2 +const char * nm_device_vxlan_get_group (NMDeviceVxlan *device); +NM_AVAILABLE_IN_1_2 +const char * nm_device_vxlan_get_local (NMDeviceVxlan *device); +NM_AVAILABLE_IN_1_2 +guint nm_device_vxlan_get_src_port_min (NMDeviceVxlan *device); +NM_AVAILABLE_IN_1_2 +guint nm_device_vxlan_get_src_port_max (NMDeviceVxlan *device); +NM_AVAILABLE_IN_1_2 +guint nm_device_vxlan_get_dst_port (NMDeviceVxlan *device); +NM_AVAILABLE_IN_1_2 +gboolean nm_device_vxlan_get_learning (NMDeviceVxlan *device); +NM_AVAILABLE_IN_1_2 +guint nm_device_vxlan_get_ageing (NMDeviceVxlan *device); +NM_AVAILABLE_IN_1_2 +guint nm_device_vxlan_get_tos (NMDeviceVxlan *device); +NM_AVAILABLE_IN_1_2 +guint nm_device_vxlan_get_ttl (NMDeviceVxlan *device); +NM_AVAILABLE_IN_1_2 +guint nm_device_vxlan_get_limit (NMDeviceVxlan *device); +NM_AVAILABLE_IN_1_2 +gboolean nm_device_vxlan_get_proxy (NMDeviceVxlan *device); +NM_AVAILABLE_IN_1_2 +gboolean nm_device_vxlan_get_rsc (NMDeviceVxlan *device); +NM_AVAILABLE_IN_1_2 +gboolean nm_device_vxlan_get_l2miss (NMDeviceVxlan *device); +NM_AVAILABLE_IN_1_2 +gboolean nm_device_vxlan_get_l3miss (NMDeviceVxlan *device); + +G_END_DECLS + +#endif /* __NM_DEVICE_VXLAN_H__ */ diff --git a/libnm/nm-device-wifi.c b/libnm/nm-device-wifi.c index 536f3082..9019e038 100644 --- a/libnm/nm-device-wifi.c +++ b/libnm/nm-device-wifi.c @@ -22,15 +22,13 @@ #include "config.h" #include -#include - -#include "nm-glib-compat.h" #include #include #include #include +#include "nm-default.h" #include "nm-device-wifi.h" #include "nm-access-point.h" #include "nm-device-private.h" @@ -38,6 +36,7 @@ #include "nm-object-cache.h" #include "nm-core-internal.h" #include "nm-dbus-helpers.h" +#include "nm-macros-internal.h" #include "nmdbus-device-wifi.h" @@ -356,7 +355,7 @@ nm_device_wifi_request_scan (NMDeviceWifi *device, * Returns: %TRUE on success, %FALSE on error, in which case @error will be * set. * - * Since: 1.0.6 + * Since: 1.2 **/ gboolean nm_device_wifi_request_scan_options (NMDeviceWifi *device, @@ -367,6 +366,10 @@ nm_device_wifi_request_scan_options (NMDeviceWifi *device, return _device_wifi_request_scan (device, options, cancellable, error); } +NM_BACKPORT_SYMBOL (libnm_1_0_6, gboolean, nm_device_wifi_request_scan_options, + (NMDeviceWifi *device, GVariant *options, GCancellable *cancellable, GError **error), + (device, options, cancellable, error)); + static void request_scan_cb (GObject *source, GAsyncResult *result, @@ -464,7 +467,7 @@ nm_device_wifi_request_scan_async (NMDeviceWifi *device, * D-Bus call. Valid otions inside the dictionary are: * 'ssids' => array of SSIDs (saay) * - * Since: 1.0.6 + * Since: 1.2 **/ void nm_device_wifi_request_scan_options_async (NMDeviceWifi *device, @@ -476,6 +479,10 @@ nm_device_wifi_request_scan_options_async (NMDeviceWifi *device, _device_wifi_request_scan_async (device, options, cancellable, callback, user_data); } +NM_BACKPORT_SYMBOL (libnm_1_0_6, void, nm_device_wifi_request_scan_options_async, + (NMDeviceWifi *device, GVariant *options, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data), + (device, options, cancellable, callback, user_data)); + /** * nm_device_wifi_request_scan_finish: * @device: a #NMDeviceWifi diff --git a/libnm/nm-device-wifi.h b/libnm/nm-device-wifi.h index b5a56980..b5974ba2 100644 --- a/libnm/nm-device-wifi.h +++ b/libnm/nm-device-wifi.h @@ -77,7 +77,7 @@ const GPtrArray * nm_device_wifi_get_access_points (NMDeviceWifi * gboolean nm_device_wifi_request_scan (NMDeviceWifi *device, GCancellable *cancellable, GError **error); -NM_AVAILABLE_IN_1_0_6 +NM_AVAILABLE_IN_1_2 gboolean nm_device_wifi_request_scan_options (NMDeviceWifi *device, GVariant *options, GCancellable *cancellable, @@ -86,7 +86,7 @@ void nm_device_wifi_request_scan_async (NMDeviceWifi * GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); -NM_AVAILABLE_IN_1_0_6 +NM_AVAILABLE_IN_1_2 void nm_device_wifi_request_scan_options_async (NMDeviceWifi *device, GVariant *options, GCancellable *cancellable, diff --git a/libnm/nm-device-wimax.c b/libnm/nm-device-wimax.c index f199b669..55658a59 100644 --- a/libnm/nm-device-wimax.c +++ b/libnm/nm-device-wimax.c @@ -22,14 +22,12 @@ #include "config.h" #include -#include - -#include "nm-glib-compat.h" #include #include #include +#include "nm-default.h" #include "nm-device-wimax.h" #include "nm-wimax-nsp.h" #include "nm-object-private.h" @@ -86,6 +84,8 @@ static guint signals[LAST_SIGNAL] = { 0 }; * * Returns: the hardware address. This is the internal string used by the * device, and must not be modified. + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ const char * nm_device_wimax_get_hw_address (NMDeviceWimax *wimax) @@ -102,6 +102,8 @@ nm_device_wimax_get_hw_address (NMDeviceWimax *wimax) * Gets the active #NMWimaxNsp. * * Returns: (transfer full): the access point or %NULL if none is active + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ NMWimaxNsp * nm_device_wimax_get_active_nsp (NMDeviceWimax *wimax) @@ -138,6 +140,8 @@ nm_device_wimax_get_active_nsp (NMDeviceWimax *wimax) * Returns: (element-type NMWimaxNsp): a #GPtrArray containing * all the scanned #NMWimaxNsps. * The returned array is owned by the client and should not be modified. + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ const GPtrArray * nm_device_wimax_get_nsps (NMDeviceWimax *wimax) @@ -155,6 +159,8 @@ nm_device_wimax_get_nsps (NMDeviceWimax *wimax) * Gets a #NMWimaxNsp by path. * * Returns: (transfer none): the access point or %NULL if none is found. + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ NMWimaxNsp * nm_device_wimax_get_nsp_by_path (NMDeviceWimax *wimax, @@ -208,6 +214,8 @@ clean_up_nsps (NMDeviceWimax *self) * device is not connected. * * Returns: the center frequency in KHz, or 0 + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ guint nm_device_wimax_get_center_frequency (NMDeviceWimax *self) @@ -227,6 +235,8 @@ nm_device_wimax_get_center_frequency (NMDeviceWimax *self) * device is not connected. * * Returns: the RSSI in dBm, or 0 + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ gint nm_device_wimax_get_rssi (NMDeviceWimax *self) @@ -245,6 +255,8 @@ nm_device_wimax_get_rssi (NMDeviceWimax *self) * meaning when the device is not connected. * * Returns: the CINR in dB, or 0 + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ gint nm_device_wimax_get_cinr (NMDeviceWimax *self) @@ -263,6 +275,8 @@ nm_device_wimax_get_cinr (NMDeviceWimax *self) * -5.5 dBm. Has no meaning when the device is not connected. * * Returns: the TX power in dBm, or 0 + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ gint nm_device_wimax_get_tx_power (NMDeviceWimax *self) @@ -279,6 +293,8 @@ nm_device_wimax_get_tx_power (NMDeviceWimax *self) * Gets the ID of the serving Base Station when the device is connected. * * Returns: the ID of the serving Base Station, or %NULL + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ const char * nm_device_wimax_get_bsid (NMDeviceWimax *self) @@ -536,6 +552,8 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class) * NMDeviceWimax:hw-address: * * The hardware (MAC) address of the device. + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ g_object_class_install_property (object_class, PROP_HW_ADDRESS, @@ -548,6 +566,8 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class) * NMDeviceWimax:active-nsp: * * The active #NMWimaxNsp of the device. + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ g_object_class_install_property (object_class, PROP_ACTIVE_NSP, @@ -562,6 +582,8 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class) * The center frequency (in KHz) of the radio channel the device is using to * communicate with the network when connected. Has no meaning when the * device is not connected. + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ g_object_class_install_property (object_class, PROP_CENTER_FREQ, @@ -577,6 +599,8 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class) * the raw received RF signal from the base station is, but does not * indicate the overall quality of the radio link. Has no meaning when the * device is not connected. + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ g_object_class_install_property (object_class, PROP_RSSI, @@ -591,6 +615,8 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class) * CINR (Carrier to Interference + Noise Ratio) of the current radio link * in dB. CINR is a more accurate measure of radio link quality. Has no * meaning when the device is not connected. + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ g_object_class_install_property (object_class, PROP_CINR, @@ -605,6 +631,8 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class) * Average power of the last burst transmitted by the device, in units of * 0.5 dBm. i.e. a TxPower of -11 represents an actual device TX power of * -5.5 dBm. Has no meaning when the device is not connected. + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ g_object_class_install_property (object_class, PROP_TX_POWER, @@ -618,6 +646,8 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class) * * The ID of the serving base station as received from the network. Has * no meaning when the device is not connected. + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ g_object_class_install_property (object_class, PROP_BSID, @@ -648,6 +678,8 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class) * @nsp: the new NSP * * Notifies that a #NMWimaxNsp is added to the wimax device. + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ signals[NSP_ADDED] = g_signal_new ("nsp-added", @@ -665,6 +697,8 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class) * @nsp: the removed NSP * * Notifies that a #NMWimaxNsp is removed from the wimax device. + * + * Deprecated: 1.2: WiMAX is no longer supported. **/ signals[NSP_REMOVED] = g_signal_new ("nsp-removed", diff --git a/libnm/nm-device-wimax.h b/libnm/nm-device-wimax.h index 60910984..cdd6ba56 100644 --- a/libnm/nm-device-wimax.h +++ b/libnm/nm-device-wimax.h @@ -61,19 +61,29 @@ typedef struct { gpointer padding[4]; } NMDeviceWimaxClass; +NM_DEPRECATED_IN_1_2 GType nm_device_wimax_get_type (void); +NM_DEPRECATED_IN_1_2 const char *nm_device_wimax_get_hw_address (NMDeviceWimax *wimax); +NM_DEPRECATED_IN_1_2 NMWimaxNsp *nm_device_wimax_get_active_nsp (NMDeviceWimax *wimax); +NM_DEPRECATED_IN_1_2 NMWimaxNsp *nm_device_wimax_get_nsp_by_path (NMDeviceWimax *wimax, const char *path); +NM_DEPRECATED_IN_1_2 const GPtrArray *nm_device_wimax_get_nsps (NMDeviceWimax *wimax); +NM_DEPRECATED_IN_1_2 guint nm_device_wimax_get_center_frequency (NMDeviceWimax *self); +NM_DEPRECATED_IN_1_2 gint nm_device_wimax_get_rssi (NMDeviceWimax *self); +NM_DEPRECATED_IN_1_2 gint nm_device_wimax_get_cinr (NMDeviceWimax *self); +NM_DEPRECATED_IN_1_2 gint nm_device_wimax_get_tx_power (NMDeviceWimax *self); +NM_DEPRECATED_IN_1_2 const char * nm_device_wimax_get_bsid (NMDeviceWimax *self); G_END_DECLS diff --git a/libnm/nm-device.c b/libnm/nm-device.c index d3ac705c..7d57b526 100644 --- a/libnm/nm-device.c +++ b/libnm/nm-device.c @@ -23,9 +23,9 @@ #include -#include #include +#include "nm-default.h" #include "nm-dbus-interface.h" #include "nm-active-connection.h" #include "nm-device-ethernet.h" @@ -40,7 +40,10 @@ #include "nm-device-team.h" #include "nm-device-bridge.h" #include "nm-device-vlan.h" +#include "nm-device-vxlan.h" #include "nm-device-generic.h" +#include "nm-device-ip-tunnel.h" +#include "nm-device-macvlan.h" #include "nm-device.h" #include "nm-device-private.h" #include "nm-dhcp4-config.h" @@ -51,15 +54,17 @@ #include "nm-object-cache.h" #include "nm-remote-connection.h" #include "nm-core-internal.h" -#include "nm-glib-compat.h" #include "nm-utils.h" #include "nm-dbus-helpers.h" +#include "nm-device-tun.h" #include "nm-setting-connection.h" +#include "nm-macros-internal.h" #include "nmdbus-device.h" static GType _nm_device_decide_type (GVariant *value); gboolean connection_compatible (NMDevice *device, NMConnection *connection, GError **error); +static NMLldpNeighbor *nm_lldp_neighbor_dup (NMLldpNeighbor *neighbor); G_DEFINE_TYPE_WITH_CODE (NMDevice, nm_device, NM_TYPE_OBJECT, _nm_object_register_type_func (g_define_type_id, @@ -83,8 +88,10 @@ typedef struct { char *type_description; NMMetered metered; NMDeviceCapabilities capabilities; + gboolean real; gboolean managed; gboolean firmware_missing; + gboolean nm_plugin_missing; gboolean autoconnect; NMIPConfig *ip4_config; NMDhcpConfig *dhcp4_config; @@ -104,6 +111,7 @@ typedef struct { char *physical_port_id; guint32 mtu; + GPtrArray *lldp_neighbors; } NMDevicePrivate; enum { @@ -114,9 +122,11 @@ enum { PROP_DRIVER_VERSION, PROP_FIRMWARE_VERSION, PROP_CAPABILITIES, + PROP_REAL, PROP_MANAGED, PROP_AUTOCONNECT, PROP_FIRMWARE_MISSING, + PROP_NM_PLUGIN_MISSING, PROP_IP4_CONFIG, PROP_DHCP4_CONFIG, PROP_IP6_CONFIG, @@ -132,6 +142,7 @@ enum { PROP_PHYSICAL_PORT_ID, PROP_MTU, PROP_METERED, + PROP_LLDP_NEIGHBORS, LAST_PROP }; @@ -144,6 +155,13 @@ enum { static guint signals[LAST_SIGNAL] = { 0 }; +struct _NMLldpNeighbor { + guint refcount; + GHashTable *attrs; +}; + +G_DEFINE_BOXED_TYPE (NMLldpNeighbor, nm_lldp_neighbor, nm_lldp_neighbor_dup, nm_lldp_neighbor_unref) + static void nm_device_init (NMDevice *device) { @@ -151,6 +169,7 @@ nm_device_init (NMDevice *device) priv->state = NM_DEVICE_STATE_UNKNOWN; priv->reason = NM_DEVICE_STATE_REASON_NONE; + priv->lldp_neighbors = g_ptr_array_new (); } static gboolean @@ -163,6 +182,38 @@ demarshal_state_reason (NMObject *object, GParamSpec *pspec, GVariant *value, gp return TRUE; } +static gboolean +demarshal_lldp_neighbors (NMObject *object, GParamSpec *pspec, GVariant *value, gpointer field) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (object); + GVariantIter iter, attrs_iter; + GVariant *variant, *attr_variant; + const char *attr_name; + + g_return_val_if_fail (g_variant_is_of_type (value, G_VARIANT_TYPE ("aa{sv}")), FALSE); + + g_ptr_array_unref (priv->lldp_neighbors); + priv->lldp_neighbors = g_ptr_array_new_with_free_func ((GDestroyNotify) nm_lldp_neighbor_unref); + g_variant_iter_init (&iter, value); + + while (g_variant_iter_next (&iter, "@a{sv}", &variant)) { + NMLldpNeighbor *neigh; + + neigh = nm_lldp_neighbor_new (); + g_variant_iter_init (&attrs_iter, variant); + + while (g_variant_iter_next (&attrs_iter, "{&sv}", &attr_name, &attr_variant)) + g_hash_table_insert (neigh->attrs, g_strdup (attr_name), attr_variant); + + g_variant_unref (variant); + g_ptr_array_add (priv->lldp_neighbors, neigh); + } + + _nm_object_queue_notify (object, NM_DEVICE_LLDP_NEIGHBORS); + + return TRUE; +} + static void device_state_changed (NMDBusDevice *proxy, guint new_state, @@ -182,9 +233,11 @@ init_dbus (NMObject *object) { NM_DEVICE_DRIVER_VERSION, &priv->driver_version }, { NM_DEVICE_FIRMWARE_VERSION, &priv->firmware_version }, { NM_DEVICE_CAPABILITIES, &priv->capabilities }, + { NM_DEVICE_REAL, &priv->real }, { NM_DEVICE_MANAGED, &priv->managed }, { NM_DEVICE_AUTOCONNECT, &priv->autoconnect }, { NM_DEVICE_FIRMWARE_MISSING, &priv->firmware_missing }, + { NM_DEVICE_NM_PLUGIN_MISSING, &priv->nm_plugin_missing }, { NM_DEVICE_IP4_CONFIG, &priv->ip4_config, NULL, NM_TYPE_IP4_CONFIG }, { NM_DEVICE_DHCP4_CONFIG, &priv->dhcp4_config, NULL, NM_TYPE_DHCP4_CONFIG }, { NM_DEVICE_IP6_CONFIG, &priv->ip6_config, NULL, NM_TYPE_IP6_CONFIG }, @@ -196,6 +249,7 @@ init_dbus (NMObject *object) { NM_DEVICE_PHYSICAL_PORT_ID, &priv->physical_port_id }, { NM_DEVICE_MTU, &priv->mtu }, { NM_DEVICE_METERED, &priv->metered }, + { NM_DEVICE_LLDP_NEIGHBORS, &priv->lldp_neighbors, demarshal_lldp_neighbors }, /* Properties that exist in D-Bus but that we don't track */ { "ip4-address", NULL }, @@ -315,6 +369,14 @@ _nm_device_gtype_from_dtype (NMDeviceType dtype) return NM_TYPE_DEVICE_VLAN; case NM_DEVICE_TYPE_GENERIC: return NM_TYPE_DEVICE_GENERIC; + case NM_DEVICE_TYPE_TUN: + return NM_TYPE_DEVICE_TUN; + case NM_DEVICE_TYPE_IP_TUNNEL: + return NM_TYPE_DEVICE_IP_TUNNEL; + case NM_DEVICE_TYPE_MACVLAN: + return NM_TYPE_DEVICE_MACVLAN; + case NM_DEVICE_TYPE_VXLAN: + return NM_TYPE_DEVICE_VXLAN; default: g_warning ("Unknown device type %d", dtype); return G_TYPE_INVALID; @@ -347,6 +409,7 @@ dispose (GObject *object) g_clear_object (&priv->active_connection); g_clear_pointer (&priv->available_connections, g_ptr_array_unref); + g_clear_pointer (&priv->lldp_neighbors, g_ptr_array_unref); G_OBJECT_CLASS (nm_device_parent_class)->dispose (object); } @@ -407,6 +470,9 @@ get_property (GObject *object, case PROP_CAPABILITIES: g_value_set_flags (value, nm_device_get_capabilities (device)); break; + case PROP_REAL: + g_value_set_boolean (value, nm_device_is_real (device)); + break; case PROP_MANAGED: g_value_set_boolean (value, nm_device_get_managed (device)); break; @@ -416,6 +482,9 @@ get_property (GObject *object, case PROP_FIRMWARE_MISSING: g_value_set_boolean (value, nm_device_get_firmware_missing (device)); break; + case PROP_NM_PLUGIN_MISSING: + g_value_set_boolean (value, nm_device_get_nm_plugin_missing (device)); + break; case PROP_IP4_CONFIG: g_value_set_object (value, nm_device_get_ip4_config (device)); break; @@ -455,6 +524,9 @@ get_property (GObject *object, case PROP_METERED: g_value_set_uint (value, nm_device_get_metered (device)); break; + case PROP_LLDP_NEIGHBORS: + g_value_set_boxed (value, nm_device_get_lldp_neighbors (device)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -476,6 +548,11 @@ set_property (GObject *object, /* Construct only */ priv->device_type = g_value_get_enum (value); break; + case PROP_MANAGED: + b = g_value_get_boolean (value); + if (priv->managed != b) + nm_device_set_managed (NM_DEVICE (object), b); + break; case PROP_AUTOCONNECT: b = g_value_get_boolean (value); if (priv->autoconnect != b) @@ -614,6 +691,22 @@ nm_device_class_init (NMDeviceClass *device_class) G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + /** + * NMDevice:real: + * + * Whether the device is real or is a placeholder device that could + * be created automatically by NetworkManager if one of its + * #NMDevice:available-connections was activated. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_REAL, + g_param_spec_boolean (NM_DEVICE_REAL, "", "", + FALSE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + /** * NMDevice:managed: * @@ -651,6 +744,21 @@ nm_device_class_init (NMDeviceClass *device_class) G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + /** + * NMDevice:nm-plugin-missing: + * + * When %TRUE indicates that the NetworkManager plugin for the device + * is not installed. + * + * Since: 1.2 + **/ + g_object_class_install_property + (object_class, PROP_NM_PLUGIN_MISSING, + g_param_spec_boolean (NM_DEVICE_NM_PLUGIN_MISSING, "", "", + FALSE, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + /** * NMDevice:ip4-config: * @@ -804,7 +912,7 @@ nm_device_class_init (NMDeviceClass *device_class) * * Whether the device is metered. * - * Since: 1.0.6 + * Since: 1.2 **/ g_object_class_install_property (object_class, PROP_METERED, @@ -813,6 +921,18 @@ nm_device_class_init (NMDeviceClass *device_class) G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + /** + * NMDevice:lldp-neighbors: + * + * The LLDP neighbors. + **/ + g_object_class_install_property + (object_class, PROP_LLDP_NEIGHBORS, + g_param_spec_boxed (NM_DEVICE_LLDP_NEIGHBORS, "", "", + G_TYPE_PTR_ARRAY, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + /* signals */ /** @@ -1073,6 +1193,30 @@ nm_device_get_managed (NMDevice *device) return NM_DEVICE_GET_PRIVATE (device)->managed; } +/** + * nm_device_set_managed: + * @device: a #NMDevice + * @managed: %TRUE to make the device managed by NetworkManager. + * + * Enables or disables management of #NMDevice by NetworkManager. + * + * Since: 1.2 + **/ +void +nm_device_set_managed (NMDevice *device, gboolean managed) +{ + g_return_if_fail (NM_IS_DEVICE (device)); + + managed = !!managed; + + NM_DEVICE_GET_PRIVATE (device)->managed = managed; + + _nm_object_set_property (NM_OBJECT (device), + NM_DBUS_INTERFACE_DEVICE, + "Managed", + "b", managed); +} + /** * nm_device_get_autoconnect: * @device: a #NMDevice @@ -1127,6 +1271,24 @@ nm_device_get_firmware_missing (NMDevice *device) return NM_DEVICE_GET_PRIVATE (device)->firmware_missing; } +/** + * nm_device_get_nm_plugin_missing: + * @device: a #NMDevice + * + * Indicates that the NetworkManager plugin for the device is not installed. + * + * Returns: %TRUE if the device plugin not installed. + * + * Since: 1.2 + **/ +gboolean +nm_device_get_nm_plugin_missing (NMDevice *device) +{ + g_return_val_if_fail (NM_IS_DEVICE (device), FALSE); + + return NM_DEVICE_GET_PRIVATE (device)->nm_plugin_missing; +} + /** * nm_device_get_ip4_config: * @device: a #NMDevice @@ -1406,14 +1568,16 @@ nm_device_get_product (NMDevice *device) g_return_val_if_fail (NM_IS_DEVICE (device), NULL); priv = NM_DEVICE_GET_PRIVATE (device); - if (!priv->product) { + if (!priv->product) priv->product = _get_udev_property (device, "ID_MODEL_ENC", "ID_MODEL_FROM_DATABASE"); - if (!priv->product) { - /* Sometimes ID_PRODUCT_FROM_DATABASE is used? */ - priv->product = _get_udev_property (device, "ID_MODEL_ENC", "ID_PRODUCT_FROM_DATABASE"); - } - _nm_object_queue_notify (NM_OBJECT (device), NM_DEVICE_PRODUCT); - } + + /* Sometimes ID_PRODUCT_FROM_DATABASE is used? */ + if (!priv->product) + priv->product = _get_udev_property (device, "ID_MODEL_ENC", "ID_PRODUCT_FROM_DATABASE"); + + if (!priv->product) + priv->product = g_strdup (""); + return priv->product; } @@ -1434,10 +1598,13 @@ nm_device_get_vendor (NMDevice *device) g_return_val_if_fail (NM_IS_DEVICE (device), NULL); priv = NM_DEVICE_GET_PRIVATE (device); - if (!priv->vendor) { + + if (!priv->vendor) priv->vendor = _get_udev_property (device, "ID_VENDOR_ENC", "ID_VENDOR_FROM_DATABASE"); - _nm_object_queue_notify (NM_OBJECT (device), NM_DEVICE_VENDOR); - } + + if (!priv->vendor) + priv->vendor = g_strdup (""); + return priv->vendor; } @@ -1836,6 +2003,25 @@ nm_device_disambiguate_names (NMDevice **devices, if (!find_duplicates (names, duplicates, num_devices)) goto done; + /* If dealing with Bluetooth devices, try to distinguish them by + * device name. + */ + for (i = 0; i < num_devices; i++) { + if (duplicates[i] && NM_IS_DEVICE_BT (devices[i])) { + const char *devname = nm_device_bt_get_name (NM_DEVICE_BT (devices[i])); + + if (!devname) + continue; + + g_free (names[i]); + names[i] = g_strdup_printf ("%s (%s)", + get_device_type_name_with_iface (devices[i]), + devname); + } + } + if (!find_duplicates (names, duplicates, num_devices)) + goto done; + /* We have multiple identical network cards, so we have to differentiate * them by interface name. */ @@ -1911,7 +2097,7 @@ nm_device_get_mtu (NMDevice *device) * * Returns: the metered setting. * - * Since: 1.0.6 + * Since: 1.2 **/ NMMetered nm_device_get_metered (NMDevice *device) @@ -1921,6 +2107,47 @@ nm_device_get_metered (NMDevice *device) return NM_DEVICE_GET_PRIVATE (device)->metered; } +NM_BACKPORT_SYMBOL (libnm_1_0_6, NMMetered, nm_device_get_metered, (NMDevice *device), (device)); + +/** + * nm_device_get_lldp_neighbors: + * @device: a #NMDevice + * + * Gets the list of neighbors discovered through LLDP. + * + * Returns: (element-type NMLldpNeighbor) (transfer none): the #GPtrArray + * containing #NMLldpNeighbors. This is the internal copy used by the + * device and must not be modified. The library never modifies the returned + * array and thus it is safe for callers to reference and keep using it. + * + * Since: 1.2 + **/ +GPtrArray * +nm_device_get_lldp_neighbors (NMDevice *device) +{ + g_return_val_if_fail (NM_IS_DEVICE (device), NULL); + + return NM_DEVICE_GET_PRIVATE (device)->lldp_neighbors; +} + +/** + * nm_device_is_real: + * @device: a #NMDevice + * + * Returns: %TRUE if the device exists, or %FALSE if it is a placeholder device + * that could be automatically created by NetworkManager if one of its + * #NMDevice:available-connections was activated. + * + * Since: 1.2 + **/ +gboolean +nm_device_is_real (NMDevice *device) +{ + g_return_val_if_fail (NM_IS_DEVICE (device), FALSE); + + return NM_DEVICE_GET_PRIVATE (device)->real; +} + /** * nm_device_is_software: * @device: a #NMDevice @@ -1937,6 +2164,134 @@ nm_device_is_software (NMDevice *device) return !!(NM_DEVICE_GET_PRIVATE (device)->capabilities & NM_DEVICE_CAP_IS_SOFTWARE); } +/** + * nm_device_reapply: + * @device: a #NMDevice + * @connection: the #NMConnection to replace the applied settings with or %NULL to reuse existing + * @flags: always set this to zero + * @cancellable: a #GCancellable, or %NULL + * @error: location for a #GError, or %NULL + * + * Attempts to update device with changes to the currently active connection + * made since it was last applied. + * + * Returns: %TRUE on success, %FALSE on error, in which case @error will be set. + * + * Since: 1.2 + **/ +gboolean +nm_device_reapply (NMDevice *device, + NMConnection *connection, + guint flags, + GCancellable *cancellable, + GError **error) +{ + GVariant *dict = NULL; + gboolean ret; + + g_return_val_if_fail (NM_IS_DEVICE (device), FALSE); + + if (connection) + dict = nm_connection_to_dbus (connection, NM_CONNECTION_SERIALIZE_ALL); + if (!dict) + dict = g_variant_new_array (G_VARIANT_TYPE ("{sa{sv}}"), NULL, 0); + + + ret = nmdbus_device_call_reapply_sync (NM_DEVICE_GET_PRIVATE (device)->proxy, + dict, flags, cancellable, error); + if (error && *error) + g_dbus_error_strip_remote_error (*error); + return ret; +} + +static void +device_reapply_cb (GObject *proxy, + GAsyncResult *result, + gpointer user_data) +{ + GSimpleAsyncResult *simple = user_data; + GError *error = NULL; + + if (nmdbus_device_call_reapply_finish (NMDBUS_DEVICE (proxy), result, &error)) + g_simple_async_result_set_op_res_gboolean (simple, TRUE); + else { + g_dbus_error_strip_remote_error (error); + g_simple_async_result_take_error (simple, error); + } + + g_simple_async_result_complete (simple); + g_object_unref (simple); +} + +/** + * nm_device_reapply_async: + * @device: a #NMDevice + * @connection: the #NMConnection to replace the applied settings with or %NULL to reuse existing + * @flags: always set this to zero + * @cancellable: a #GCancellable, or %NULL + * @callback: callback to be called when the reapply operation completes + * @user_data: caller-specific data passed to @callback + * + * Asynchronously begins an attempt to update device with changes to the + * currently active connection made since it was last applied. + * + * Since: 1.2 + **/ +void +nm_device_reapply_async (NMDevice *device, + NMConnection *connection, + guint flags, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GVariant *dict = NULL; + GSimpleAsyncResult *simple; + + g_return_if_fail (NM_IS_DEVICE (device)); + + if (connection) + dict = nm_connection_to_dbus (connection, NM_CONNECTION_SERIALIZE_ALL); + if (!dict) + dict = g_variant_new_array (G_VARIANT_TYPE ("{sa{sv}}"), NULL, 0); + + simple = g_simple_async_result_new (G_OBJECT (device), callback, user_data, + nm_device_reapply_async); + + nmdbus_device_call_reapply (NM_DEVICE_GET_PRIVATE (device)->proxy, + dict, flags, cancellable, + device_reapply_cb, simple); +} + +/** + * nm_device_reapply_finish: + * @device: a #NMDevice + * @result: the result passed to the #GAsyncReadyCallback + * @error: location for a #GError, or %NULL + * + * Gets the result of a call to nm_device_reapply_async(). + * + * Returns: %TRUE on success, %FALSE on error, in which case @error + * will be set. + * + * Since: 1.2 + **/ +gboolean +nm_device_reapply_finish (NMDevice *device, + GAsyncResult *result, + GError **error) +{ + GSimpleAsyncResult *simple; + + g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (device), nm_device_reapply_async), FALSE); + + simple = G_SIMPLE_ASYNC_RESULT (result); + if (g_simple_async_result_propagate_error (simple, error)) + return FALSE; + else + return g_simple_async_result_get_op_res_gboolean (simple); +} + /** * nm_device_disconnect: * @device: a #NMDevice @@ -2271,3 +2626,193 @@ nm_device_get_setting_type (NMDevice *device) return NM_DEVICE_GET_CLASS (device)->get_setting_type (device); } + +/** + * nm_lldp_neighbor_new: + * + * Creates a new #NMLldpNeighbor object. + * + * Returns: (transfer full): the new #NMLldpNeighbor object. + * + * Since: 1.2 + **/ +NMLldpNeighbor * +nm_lldp_neighbor_new (void) +{ + NMLldpNeighbor *neigh; + + neigh = g_new0 (NMLldpNeighbor, 1); + neigh->refcount = 1; + neigh->attrs = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, + (GDestroyNotify) g_variant_unref); + + return neigh; +} + +static NMLldpNeighbor * +nm_lldp_neighbor_dup (NMLldpNeighbor *neighbor) +{ + NMLldpNeighbor *copy; + + copy = nm_lldp_neighbor_new (); + copy->attrs = g_hash_table_ref (neighbor->attrs); + + return copy; +} + +/** + * nm_lldp_neighbor_ref: + * @neighbor: the #NMLldpNeighbor + * + * Increases the reference count of the object. + * + * Since: 1.2 + **/ +void +nm_lldp_neighbor_ref (NMLldpNeighbor *neighbor) +{ + g_return_if_fail (neighbor); + g_return_if_fail (neighbor->refcount > 0); + + neighbor->refcount++; +} + +/** + * nm_lldp_neighbor_unref: + * @neighbor: the #NMLldpNeighbor + * + * Decreases the reference count of the object. If the reference count + * reaches zero, the object will be destroyed. + * + * Since: 1.2 + **/ +void +nm_lldp_neighbor_unref (NMLldpNeighbor *neighbor) +{ + g_return_if_fail (neighbor); + g_return_if_fail (neighbor->refcount > 0); + + if (--neighbor->refcount == 0) { + g_return_if_fail (neighbor->attrs); + g_hash_table_unref (neighbor->attrs); + g_free (neighbor); + } +} + +/** + * nm_lldp_neighbor_get_attr_names: + * @neighbor: the #NMLldpNeighbor + * + * Gets an array of attribute names available for @neighbor. + * + * Returns: (transfer full): a %NULL-terminated array of attribute names. + * + * Since: 1.2 + **/ +char ** +nm_lldp_neighbor_get_attr_names (NMLldpNeighbor *neighbor) +{ + GHashTableIter iter; + const char *key; + GPtrArray *names; + + g_return_val_if_fail (neighbor, NULL); + g_return_val_if_fail (neighbor->attrs, NULL); + + names = g_ptr_array_new (); + + g_hash_table_iter_init (&iter, neighbor->attrs); + while (g_hash_table_iter_next (&iter, (gpointer *) &key, NULL)) + g_ptr_array_add (names, g_strdup (key)); + + g_ptr_array_add (names, NULL); + + return (char **) g_ptr_array_free (names, FALSE); +} + +/** + * nm_lldp_neighbor_get_attr_string_value: + * @neighbor: the #NMLldpNeighbor + * @name: the attribute name + * @out_value: (out) (allow-none) (transfer none): on return, the attribute value + * + * Gets the string value of attribute with name @name on @neighbor + * + * Returns: %TRUE if a string attribute with name @name was found, %FALSE otherwise + * + * Since: 1.2 + **/ +gboolean +nm_lldp_neighbor_get_attr_string_value (NMLldpNeighbor *neighbor, char *name, + const char **out_value) +{ + GVariant *variant; + + g_return_val_if_fail (neighbor, FALSE); + g_return_val_if_fail (name && name[0], FALSE); + + variant = g_hash_table_lookup (neighbor->attrs, name); + if (variant && g_variant_is_of_type (variant, G_VARIANT_TYPE_STRING)) { + if (out_value) + *out_value = g_variant_get_string (variant, NULL); + return TRUE; + } else + return FALSE; +} + +/** + * nm_lldp_neighbor_get_attr_uint_value: + * @neighbor: the #NMLldpNeighbor + * @name: the attribute name + * @out_value: (out) (allow-none): on return, the attribute value + * + * Gets the uint value of attribute with name @name on @neighbor + * + * Returns: %TRUE if a uint attribute with name @name was found, %FALSE otherwise + * + * Since: 1.2 + **/ +gboolean +nm_lldp_neighbor_get_attr_uint_value (NMLldpNeighbor *neighbor, char *name, + guint *out_value) +{ + GVariant *variant; + + g_return_val_if_fail (neighbor, FALSE); + g_return_val_if_fail (name && name[0], FALSE); + + variant = g_hash_table_lookup (neighbor->attrs, name); + if (variant && g_variant_is_of_type (variant, G_VARIANT_TYPE_UINT32)) { + if (out_value) + *out_value = g_variant_get_uint32 (variant); + return TRUE; + } else + return FALSE; +} + +/** + * nm_lldp_neighbor_get_attr_type: + * @neighbor: the #NMLldpNeighbor + * @name: the attribute name + * + * Get the type of an attribute. + * + * Returns: the #GVariantType of the attribute with name @name + * + * Since: 1.2 + **/ +const GVariantType * +nm_lldp_neighbor_get_attr_type (NMLldpNeighbor *neighbor, char *name) +{ + GVariant *variant; + + g_return_val_if_fail (neighbor, NULL); + g_return_val_if_fail (name && name[0], NULL); + + variant = g_hash_table_lookup (neighbor->attrs, name); + if (variant) + return g_variant_get_type (variant); + else + return NULL; + +} diff --git a/libnm/nm-device.h b/libnm/nm-device.h index a61dcf32..bf845ceb 100644 --- a/libnm/nm-device.h +++ b/libnm/nm-device.h @@ -45,9 +45,11 @@ G_BEGIN_DECLS #define NM_DEVICE_DRIVER_VERSION "driver-version" #define NM_DEVICE_FIRMWARE_VERSION "firmware-version" #define NM_DEVICE_CAPABILITIES "capabilities" +#define NM_DEVICE_REAL "real" #define NM_DEVICE_MANAGED "managed" #define NM_DEVICE_AUTOCONNECT "autoconnect" #define NM_DEVICE_FIRMWARE_MISSING "firmware-missing" +#define NM_DEVICE_NM_PLUGIN_MISSING "nm-plugin-missing" #define NM_DEVICE_IP4_CONFIG "ip4-config" #define NM_DEVICE_DHCP4_CONFIG "dhcp4-config" #define NM_DEVICE_IP6_CONFIG "ip6-config" @@ -61,6 +63,7 @@ G_BEGIN_DECLS #define NM_DEVICE_PHYSICAL_PORT_ID "physical-port-id" #define NM_DEVICE_MTU "mtu" #define NM_DEVICE_METERED "metered" +#define NM_DEVICE_LLDP_NEIGHBORS "lldp-neighbors" struct _NMDevice { NMObject parent; @@ -89,6 +92,8 @@ typedef struct { gpointer padding[8]; } NMDeviceClass; +typedef struct _NMLldpNeighbor NMLldpNeighbor; + GType nm_device_get_type (void); const char * nm_device_get_iface (NMDevice *device); @@ -102,9 +107,13 @@ const char * nm_device_get_type_description (NMDevice *device); const char * nm_device_get_hw_address (NMDevice *device); NMDeviceCapabilities nm_device_get_capabilities (NMDevice *device); gboolean nm_device_get_managed (NMDevice *device); +NM_AVAILABLE_IN_1_2 +void nm_device_set_managed (NMDevice *device, gboolean managed); gboolean nm_device_get_autoconnect (NMDevice *device); void nm_device_set_autoconnect (NMDevice *device, gboolean autoconnect); gboolean nm_device_get_firmware_missing (NMDevice *device); +NM_AVAILABLE_IN_1_2 +gboolean nm_device_get_nm_plugin_missing (NMDevice *device); NMIPConfig * nm_device_get_ip4_config (NMDevice *device); NMDhcpConfig * nm_device_get_dhcp4_config (NMDevice *device); NMIPConfig * nm_device_get_ip6_config (NMDevice *device); @@ -115,15 +124,36 @@ NMActiveConnection * nm_device_get_active_connection(NMDevice *device); const GPtrArray * nm_device_get_available_connections(NMDevice *device); const char * nm_device_get_physical_port_id (NMDevice *device); guint32 nm_device_get_mtu (NMDevice *device); +NM_AVAILABLE_IN_1_2 +gboolean nm_device_is_real (NMDevice *device); gboolean nm_device_is_software (NMDevice *device); const char * nm_device_get_product (NMDevice *device); const char * nm_device_get_vendor (NMDevice *device); const char * nm_device_get_description (NMDevice *device); -NM_AVAILABLE_IN_1_0_6 +NM_AVAILABLE_IN_1_2 NMMetered nm_device_get_metered (NMDevice *device); +NM_AVAILABLE_IN_1_2 +GPtrArray * nm_device_get_lldp_neighbors (NMDevice *device); char ** nm_device_disambiguate_names (NMDevice **devices, int num_devices); +NM_AVAILABLE_IN_1_2 +gboolean nm_device_reapply (NMDevice *device, + NMConnection *connection, + guint flags, + GCancellable *cancellable, + GError **error); +NM_AVAILABLE_IN_1_2 +void nm_device_reapply_async (NMDevice *device, + NMConnection *connection, + guint flags, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +NM_AVAILABLE_IN_1_2 +gboolean nm_device_reapply_finish (NMDevice *device, + GAsyncResult *result, + GError **error); gboolean nm_device_disconnect (NMDevice *device, GCancellable *cancellable, @@ -159,6 +189,25 @@ gboolean nm_device_connection_compatible (NMDevice *device, GType nm_device_get_setting_type (NMDevice *device); +NM_AVAILABLE_IN_1_2 +GType nm_lldp_neighbor_get_type (void); +NM_AVAILABLE_IN_1_2 +NMLldpNeighbor *nm_lldp_neighbor_new (void); +NM_AVAILABLE_IN_1_2 +void nm_lldp_neighbor_ref (NMLldpNeighbor *neighbor); +NM_AVAILABLE_IN_1_2 +void nm_lldp_neighbor_unref (NMLldpNeighbor *neighbor); +NM_AVAILABLE_IN_1_2 +char **nm_lldp_neighbor_get_attr_names (NMLldpNeighbor *neighbor); +NM_AVAILABLE_IN_1_2 +gboolean nm_lldp_neighbor_get_attr_string_value (NMLldpNeighbor *neighbor, char *name, + const char **out_value); +NM_AVAILABLE_IN_1_2 +gboolean nm_lldp_neighbor_get_attr_uint_value (NMLldpNeighbor *neighbor, char *name, + guint *out_value); +NM_AVAILABLE_IN_1_2 +const GVariantType *nm_lldp_neighbor_get_attr_type (NMLldpNeighbor *neighbor, char *name); + G_END_DECLS #endif /* __NM_DEVICE_H__ */ diff --git a/libnm/nm-enum-types.c b/libnm/nm-enum-types.c index 2f190917..e10e9f78 100644 --- a/libnm/nm-enum-types.c +++ b/libnm/nm-enum-types.c @@ -3,6 +3,8 @@ /* Generated by glib-mkenums. Do not edit */ +#include "config.h" + #include "nm-enum-types.h" #include "nm-version-macros.h" @@ -17,10 +19,14 @@ #include "nm-device-ethernet.h" #include "nm-device-generic.h" #include "nm-device-infiniband.h" +#include "nm-device-ip-tunnel.h" +#include "nm-device-macvlan.h" #include "nm-device-modem.h" #include "nm-device-olpc-mesh.h" #include "nm-device-team.h" +#include "nm-device-tun.h" #include "nm-device-vlan.h" +#include "nm-device-vxlan.h" #include "nm-device-wifi.h" #include "nm-device-wimax.h" #include "nm-device.h" @@ -30,10 +36,11 @@ #include "nm-remote-connection.h" #include "nm-types.h" #include "nm-vpn-connection.h" -#include "nm-vpn-editor-plugin.h" +#include "nm-vpn-editor.h" #include "nm-wimax-nsp.h" #include "nm-secret-agent-old.h" -#include "nm-vpn-plugin-old.h" +#include "nm-vpn-plugin-old.h" +#include "nm-vpn-service-plugin.h" GType nm_client_permission_get_type (void) @@ -107,27 +114,6 @@ nm_client_error_get_type (void) return g_define_type_id__volatile; } GType -nm_vpn_editor_plugin_capability_get_type (void) -{ - static volatile gsize g_define_type_id__volatile = 0; - - if (g_once_init_enter (&g_define_type_id__volatile)) - { - static const GFlagsValue values[] = { - { NM_VPN_EDITOR_PLUGIN_CAPABILITY_NONE, "NM_VPN_EDITOR_PLUGIN_CAPABILITY_NONE", "none" }, - { NM_VPN_EDITOR_PLUGIN_CAPABILITY_IMPORT, "NM_VPN_EDITOR_PLUGIN_CAPABILITY_IMPORT", "import" }, - { NM_VPN_EDITOR_PLUGIN_CAPABILITY_EXPORT, "NM_VPN_EDITOR_PLUGIN_CAPABILITY_EXPORT", "export" }, - { NM_VPN_EDITOR_PLUGIN_CAPABILITY_IPV6, "NM_VPN_EDITOR_PLUGIN_CAPABILITY_IPV6", "ipv6" }, - { 0, NULL, NULL } - }; - GType g_define_type_id = - g_flags_register_static (g_intern_static_string ("NMVpnEditorPluginCapability"), values); - g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); - } - - return g_define_type_id__volatile; -} -GType nm_wimax_nsp_network_type_get_type (void) { static volatile gsize g_define_type_id__volatile = 0; diff --git a/libnm/nm-enum-types.h b/libnm/nm-enum-types.h index 1db04ab8..93d9eb8e 100644 --- a/libnm/nm-enum-types.h +++ b/libnm/nm-enum-types.h @@ -16,8 +16,6 @@ GType nm_client_permission_result_get_type (void) G_GNUC_CONST; #define NM_TYPE_CLIENT_PERMISSION_RESULT (nm_client_permission_result_get_type ()) GType nm_client_error_get_type (void) G_GNUC_CONST; #define NM_TYPE_CLIENT_ERROR (nm_client_error_get_type ()) -GType nm_vpn_editor_plugin_capability_get_type (void) G_GNUC_CONST; -#define NM_TYPE_VPN_EDITOR_PLUGIN_CAPABILITY (nm_vpn_editor_plugin_capability_get_type ()) GType nm_wimax_nsp_network_type_get_type (void) G_GNUC_CONST; #define NM_TYPE_WIMAX_NSP_NETWORK_TYPE (nm_wimax_nsp_network_type_get_type ()) G_END_DECLS diff --git a/libnm/nm-ifcfg-rh-docs.xml b/libnm/nm-ifcfg-rh-docs.xml index 2cea2cb2..56c3c7b9 100644 --- a/libnm/nm-ifcfg-rh-docs.xml +++ b/libnm/nm-ifcfg-rh-docs.xml @@ -62,6 +62,7 @@ MACADDR for bridges is an NM extension."/> + @@ -93,6 +94,7 @@ together with this connection."/> + @@ -132,6 +134,8 @@ When PKEY_ID is specified, PHYSDEV and DEVICE also must be specified."/> + + - + @@ -152,6 +157,9 @@ meaning as 'never-default' property."/> + + If set to -1, a default metric based on the device type is used."/> + + + @@ -190,10 +201,12 @@ IPV6_PRIVACY_PREFER_PUBLIC_IP: yes, no" default="no" example="IPV6_PRIVACY=rfc30 + + - + + + @@ -265,6 +280,8 @@ is listed."/> + + \ No newline at end of file diff --git a/libnm/nm-ip-config.c b/libnm/nm-ip-config.c index d057903e..fc4567c4 100644 --- a/libnm/nm-ip-config.c +++ b/libnm/nm-ip-config.c @@ -406,7 +406,8 @@ nm_ip_config_get_gateway (NMIPConfig *config) * * Returns: (element-type NMIPAddress) (transfer none): the #GPtrArray * containing #NMIPAddresses. This is the internal copy used by the - * configuration and must not be modified. + * configuration and must not be modified. The library never modifies the + * returned array and thus it is safe for callers to reference and keep using it. **/ GPtrArray * nm_ip_config_get_addresses (NMIPConfig *config) @@ -491,7 +492,9 @@ nm_ip_config_get_wins_servers (NMIPConfig *config) * * Returns: (element-type NMIPRoute) (transfer none): the #GPtrArray containing * #NMIPRoutes. This is the internal copy used by the configuration, and must - * not be modified. + * not be modified. The library never modifies the returned array and thus it is + * safe for callers to reference and keep using it. + * **/ GPtrArray * nm_ip_config_get_routes (NMIPConfig *config) diff --git a/libnm/nm-keyfile-docs.xml b/libnm/nm-keyfile-docs.xml index d080a427..663f8a2e 100644 --- a/libnm/nm-keyfile-docs.xml +++ b/libnm/nm-keyfile-docs.xml @@ -34,6 +34,8 @@ or semicolon separated list of 20 decimal bytes (obsolete)"/> + + @@ -47,6 +49,8 @@ route2=7.7.0.0/16" description="List of IP routes."/> + + @@ -62,6 +66,8 @@ versions of NetworkManager stored this as an integer: 69 ('E') for eve + + @@ -70,6 +76,8 @@ under [vpn] section."/> + + diff --git a/libnm/nm-manager.c b/libnm/nm-manager.c index 2a61a010..b4b7e0c7 100644 --- a/libnm/nm-manager.c +++ b/libnm/nm-manager.c @@ -22,9 +22,9 @@ #include "config.h" #include -#include #include +#include "nm-default.h" #include "nm-manager.h" #include "nm-device-ethernet.h" #include "nm-device-wifi.h" @@ -34,8 +34,8 @@ #include "nm-active-connection.h" #include "nm-vpn-connection.h" #include "nm-object-cache.h" -#include "nm-glib-compat.h" #include "nm-dbus-helpers.h" +#include "nm-macros-internal.h" #include "nmdbus-manager.h" @@ -60,6 +60,7 @@ typedef struct { NMState state; gboolean startup; GPtrArray *devices; + GPtrArray *all_devices; GPtrArray *active_connections; NMConnectivityState connectivity; NMActiveConnection *primary_connection; @@ -104,6 +105,7 @@ enum { PROP_ACTIVATING_CONNECTION, PROP_DEVICES, PROP_METERED, + PROP_ALL_DEVICES, LAST_PROP }; @@ -111,6 +113,8 @@ enum { enum { DEVICE_ADDED, DEVICE_REMOVED, + ANY_DEVICE_ADDED, + ANY_DEVICE_REMOVED, ACTIVE_CONNECTION_ADDED, ACTIVE_CONNECTION_REMOVED, PERMISSION_CHANGED, @@ -136,6 +140,7 @@ nm_manager_init (NMManager *manager) priv->permissions = g_hash_table_new (g_direct_hash, g_direct_equal); priv->devices = g_ptr_array_new (); + priv->all_devices = g_ptr_array_new (); priv->active_connections = g_ptr_array_new (); } @@ -145,8 +150,8 @@ poke_wireless_devices_with_rf_status (NMManager *manager) NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); int i; - for (i = 0; i < priv->devices->len; i++) { - NMDevice *device = g_ptr_array_index (priv->devices, i); + for (i = 0; i < priv->all_devices->len; i++) { + NMDevice *device = g_ptr_array_index (priv->all_devices, i); if (NM_IS_DEVICE_WIFI (device)) _nm_device_wifi_set_wireless_enabled (NM_DEVICE_WIFI (device), priv->wireless_enabled); @@ -182,6 +187,7 @@ init_dbus (NMObject *object) { NM_MANAGER_ACTIVATING_CONNECTION, &priv->activating_connection, NULL, NM_TYPE_ACTIVE_CONNECTION }, { NM_MANAGER_DEVICES, &priv->devices, NULL, NM_TYPE_DEVICE, "device" }, { NM_MANAGER_METERED, &priv->metered }, + { NM_MANAGER_ALL_DEVICES, &priv->all_devices, NULL, NM_TYPE_DEVICE, "any-device" }, { NULL }, }; @@ -667,6 +673,14 @@ nm_manager_get_devices (NMManager *manager) return NM_MANAGER_GET_PRIVATE (manager)->devices; } +const GPtrArray * +nm_manager_get_all_devices (NMManager *manager) +{ + g_return_val_if_fail (NM_IS_MANAGER (manager), NULL); + + return NM_MANAGER_GET_PRIVATE (manager)->all_devices; +} + NMDevice * nm_manager_get_device_by_path (NMManager *manager, const char *object_path) { @@ -1180,27 +1194,47 @@ static void free_devices (NMManager *manager, gboolean in_dispose) { NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); - GPtrArray *devices; - NMDevice *device; - int i; + gs_unref_ptrarray GPtrArray *real_devices = NULL; + gs_unref_ptrarray GPtrArray *all_devices = NULL; + GPtrArray *devices = NULL; + guint i, j; - if (!priv->devices) + real_devices = priv->devices; + all_devices = priv->all_devices; + + if (in_dispose) { + priv->devices = NULL; + priv->all_devices = NULL; return; + } - devices = priv->devices; + priv->devices = g_ptr_array_new_with_free_func (g_object_unref); + priv->all_devices = g_ptr_array_new_with_free_func (g_object_unref); - if (in_dispose) - priv->devices = NULL; - else { - priv->devices = g_ptr_array_new (); + if (all_devices && all_devices->len > 0) + devices = all_devices; + else if (devices && devices->len > 0) + devices = real_devices; + + if (real_devices && devices != real_devices) { + for (i = 0; i < real_devices->len; i++) { + NMDevice *d = real_devices->pdata[i]; - for (i = 0; i < devices->len; i++) { - device = devices->pdata[i]; - g_signal_emit (manager, signals[DEVICE_REMOVED], 0, device); + if (all_devices) { + for (j = 0; j < all_devices->len; j++) { + if (d == all_devices->pdata[j]) + goto next; + } + } + g_signal_emit (manager, signals[DEVICE_REMOVED], 0, d); +next: + ; } } - - g_ptr_array_unref (devices); + if (devices) { + for (i = 0; i < devices->len; i++) + g_signal_emit (manager, signals[DEVICE_REMOVED], 0, devices->pdata[i]); + } } static void @@ -1256,7 +1290,7 @@ nm_running_changed_cb (GObject *object, NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); if (!nm_manager_get_nm_running (manager)) { - NM_UTILS_CLEAR_CANCELLABLE (priv->props_cancellable); + nm_clear_g_cancellable (&priv->props_cancellable); priv->state = NM_STATE_UNKNOWN; priv->startup = FALSE; @@ -1282,7 +1316,7 @@ nm_running_changed_cb (GObject *object, } else { _nm_object_suppress_property_updates (NM_OBJECT (manager), FALSE); - NM_UTILS_CLEAR_CANCELLABLE (priv->props_cancellable); + nm_clear_g_cancellable (&priv->props_cancellable); priv->props_cancellable = g_cancellable_new (); _nm_object_reload_properties_async (NM_OBJECT (manager), priv->props_cancellable, updated_properties, manager); @@ -1543,6 +1577,9 @@ get_property (GObject *object, case PROP_METERED: g_value_set_uint (value, priv->metered); break; + case PROP_ALL_DEVICES: + g_value_take_boxed (value, _nm_utils_copy_object_array (nm_manager_get_all_devices (self))); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -1680,7 +1717,7 @@ nm_manager_class_init (NMManagerClass *manager_class) * * Whether the connectivity is metered. * - * Since: 1.0.6 + * Since: 1.2 **/ g_object_class_install_property (object_class, PROP_METERED, @@ -1689,6 +1726,13 @@ nm_manager_class_init (NMManagerClass *manager_class) G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + g_object_class_install_property + (object_class, PROP_ALL_DEVICES, + g_param_spec_boxed (NM_MANAGER_ALL_DEVICES, "", "", + G_TYPE_PTR_ARRAY, + G_PARAM_READABLE | + G_PARAM_STATIC_STRINGS)); + /* signals */ signals[DEVICE_ADDED] = @@ -1707,6 +1751,22 @@ nm_manager_class_init (NMManagerClass *manager_class) NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_OBJECT); + signals[ANY_DEVICE_ADDED] = + g_signal_new ("any-device-added", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + 0, + NULL, NULL, NULL, + G_TYPE_NONE, 1, + G_TYPE_OBJECT); + signals[ANY_DEVICE_REMOVED] = + g_signal_new ("any-device-removed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + 0, + NULL, NULL, NULL, + G_TYPE_NONE, 1, + G_TYPE_OBJECT); signals[ACTIVE_CONNECTION_ADDED] = g_signal_new ("active-connection-added", G_OBJECT_CLASS_TYPE (object_class), diff --git a/libnm/nm-manager.h b/libnm/nm-manager.h index 8d04a060..f9e4cd0e 100644 --- a/libnm/nm-manager.h +++ b/libnm/nm-manager.h @@ -51,6 +51,7 @@ G_BEGIN_DECLS #define NM_MANAGER_ACTIVATING_CONNECTION "activating-connection" #define NM_MANAGER_DEVICES "devices" #define NM_MANAGER_METERED "metered" +#define NM_MANAGER_ALL_DEVICES "all-devices" typedef struct { NMObject parent; @@ -67,6 +68,8 @@ typedef struct { void (*permission_changed) (NMManager *manager, NMClientPermission permission, NMClientPermissionResult result); + + /* Beware: no more slots. Cannot extend struct without breaking ABI. */ } NMManagerClass; GType nm_manager_get_type (void); @@ -121,6 +124,8 @@ NMConnectivityState nm_manager_check_connectivity_finish (NMManager *manager, /* Devices */ const GPtrArray *nm_manager_get_devices (NMManager *manager); +NM_AVAILABLE_IN_1_2 +const GPtrArray *nm_manager_get_all_devices(NMManager *manager); NMDevice *nm_manager_get_device_by_path (NMManager *manager, const char *object_path); NMDevice *nm_manager_get_device_by_iface (NMManager *manager, const char *iface); diff --git a/libnm/nm-object-cache.c b/libnm/nm-object-cache.c index 752c606a..82af1140 100644 --- a/libnm/nm-object-cache.c +++ b/libnm/nm-object-cache.c @@ -21,7 +21,7 @@ #include "config.h" #include -#include +#include "nm-default.h" #include "nm-object-cache.h" #include "nm-object.h" diff --git a/libnm/nm-object-cache.h b/libnm/nm-object-cache.h index ebadbaa8..c0f70f21 100644 --- a/libnm/nm-object-cache.h +++ b/libnm/nm-object-cache.h @@ -21,8 +21,7 @@ #ifndef __NM_OBJECT_CACHE_H__ #define __NM_OBJECT_CACHE_H__ -#include -#include +#include "nm-default.h" #include "nm-object.h" G_BEGIN_DECLS diff --git a/libnm/nm-object-private.h b/libnm/nm-object-private.h index 0b13cbb6..7e8066f4 100644 --- a/libnm/nm-object-private.h +++ b/libnm/nm-object-private.h @@ -21,7 +21,7 @@ #ifndef __NM_OBJECT_PRIVATE_H__ #define __NM_OBJECT_PRIVATE_H__ -#include +#include "nm-default.h" #include "nm-object.h" typedef gboolean (*PropertyMarshalFunc) (NMObject *, GParamSpec *, GVariant *, gpointer); diff --git a/libnm/nm-object.c b/libnm/nm-object.c index fbdbc1f6..143931f1 100644 --- a/libnm/nm-object.c +++ b/libnm/nm-object.c @@ -22,18 +22,18 @@ #include "config.h" #include -#include -#include #include #include #include +#include "nm-default.h" #include "nm-dbus-interface.h" #include "nm-object.h" #include "nm-object-cache.h" #include "nm-object-private.h" -#include "nm-glib-compat.h" #include "nm-dbus-helpers.h" #include "nm-client.h" +#include "nm-core-internal.h" +#include "nm-macros-internal.h" static gboolean debug = FALSE; #define dbgmsg(f,...) if (G_UNLIKELY (debug)) { g_message (f, ## __VA_ARGS__ ); } @@ -85,6 +85,10 @@ typedef struct { NMObject *parent; gboolean suppress_property_updates; + gboolean inited; /* async init finished? */ + GSList *waiters; /* if async init did not finish, users of this object need + * to defer their notifications by adding themselves here. */ + GSList *notify_items; guint32 notify_id; @@ -201,6 +205,24 @@ deferred_notify_cb (gpointer data) if (priv->reload_remaining) return G_SOURCE_REMOVE; + /* If not all added object are finished yet, then defer the deferred + * notification. */ + for (iter = priv->notify_items; iter; iter = g_slist_next (iter)) { + NotifyItem *item = iter->data; + NMObjectPrivate *item_priv; + + if (!item->changed) + continue; + + item_priv = NM_OBJECT_GET_PRIVATE (item->changed); + if (!item_priv->inited) { + if (!g_slist_find (item_priv->waiters, object)) + item_priv->waiters = g_slist_prepend (item_priv->waiters, + g_object_ref (object)); + return G_SOURCE_REMOVE; + } + } + /* Clear priv->notify_items early so that an NMObject subclass that * listens to property changes can queue up other property changes * during the g_object_notify() call separately from the property @@ -426,6 +448,7 @@ _nm_object_create (GType type, GDBusConnection *connection, const char *path) * before any external code sees it. */ _nm_object_cache_add (NM_OBJECT (object)); + NM_OBJECT_GET_PRIVATE (object)->inited = TRUE; if (!g_initable_init (G_INITABLE (object), NULL, &error)) { dbgmsg ("Could not create object for %s: %s", path, error->message); g_error_free (error); @@ -460,6 +483,7 @@ create_async_inited (GObject *object, GAsyncResult *result, gpointer user_data) NMObjectTypeAsyncData *async_data = user_data; GError *error = NULL; + NM_OBJECT_GET_PRIVATE (object)->inited = TRUE; if (!g_async_initable_init_finish (G_ASYNC_INITABLE (object), result, &error)) { dbgmsg ("Could not create object for %s: %s", nm_object_get_path (NM_OBJECT (object)), @@ -469,6 +493,19 @@ create_async_inited (GObject *object, GAsyncResult *result, gpointer user_data) } create_async_complete (object, async_data); + + if (object) { + NMObjectPrivate *priv = NM_OBJECT_GET_PRIVATE (object); + + /* Re-queue notification checks for whoever was waiting for + * this object to initialize. */ + while (priv->waiters) { + NMObject *item = priv->waiters->data; + priv->waiters = g_slist_remove (priv->waiters, item); + _nm_object_defer_notify (item); + g_object_unref (item); + } + } } static void @@ -511,7 +548,8 @@ create_async_got_property (GObject *proxy, GAsyncResult *result, gpointer user_d GError *error = NULL; GType type; - ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), result, &error); + ret = _nm_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), result, + G_VARIANT_TYPE ("(v)"), &error); if (ret) { g_variant_get (ret, "(v)", &value); type = type_data->type_func (value); @@ -519,8 +557,8 @@ create_async_got_property (GObject *proxy, GAsyncResult *result, gpointer user_d g_variant_unref (ret); } else { dbgmsg ("Could not fetch property '%s' of interface '%s' on %s: %s\n", - type_data->property, type_data->interface, async_data->path, - error->message); + type_data->property, type_data->interface, async_data->path, + error->message); g_clear_error (&error); type = G_TYPE_INVALID; } @@ -681,6 +719,8 @@ object_property_complete (ObjectCreatedData *odata) for (i = 0; i < odata->length; i++) add_to_object_array_unique (new, odata->objects[i]); + *((GPtrArray **) pi->field) = new; + if (pi->signal_prefix) { GPtrArray *added = g_ptr_array_sized_new (3); GPtrArray *removed = g_ptr_array_sized_new (3); @@ -691,8 +731,6 @@ object_property_complete (ObjectCreatedData *odata) /* Find objects in 'new' that do not exist in old */ array_diff (new, old, added); - *((GPtrArray **) pi->field) = new; - /* Emit added & removed */ for (i = 0; i < removed->len; i++) { queue_added_removed_signal (self, @@ -715,7 +753,6 @@ object_property_complete (ObjectCreatedData *odata) /* No added/removed signals to send, just replace the property with * the new values. */ - *((GPtrArray **) pi->field) = new; different = TRUE; } @@ -962,27 +999,20 @@ process_properties_changed (NMObject *self, GVariant *properties, gboolean synch } static void -property_proxy_signal (GDBusProxy *proxy, - const char *sender_name, - const char *signal_name, - GVariant *parameters, - gpointer user_data) +properties_changed (GDBusProxy *proxy, + GVariant *properties, + gpointer user_data) { - GVariant *properties; - - if (strcmp (signal_name, "PropertiesChanged") != 0) - return; - - g_variant_get (parameters, "(@a{sv})", &properties); process_properties_changed (NM_OBJECT (user_data), properties, FALSE); - g_variant_unref (properties); } #define HANDLE_TYPE(vtype, ctype, getter) \ G_STMT_START { \ if (g_variant_is_of_type (value, vtype)) { \ ctype *param = (ctype *) field; \ - *param = getter (value); \ + ctype newval = getter (value); \ + different = *param != newval; \ + *param = newval; \ } else { \ success = FALSE; \ goto done; \ @@ -996,20 +1026,29 @@ demarshal_generic (NMObject *object, gpointer field) { gboolean success = TRUE; + gboolean different = FALSE; if (pspec->value_type == G_TYPE_STRING) { if (g_variant_is_of_type (value, G_VARIANT_TYPE_STRING)) { char **param = (char **) field; - g_free (*param); - *param = g_variant_dup_string (value, NULL); + const char *newval = g_variant_get_string (value, NULL); + + different = !!g_strcmp0 (*param, newval); + if (different) { + g_free (*param); + *param = g_strdup (newval); + } } else if (g_variant_is_of_type (value, G_VARIANT_TYPE_OBJECT_PATH)) { char **param = (char **) field; - g_free (*param); - *param = g_variant_dup_string (value, NULL); + const char *newval = g_variant_get_string (value, NULL); + /* Handle "NULL" object paths */ - if (g_strcmp0 (*param, "/") == 0) { + if (g_strcmp0 (newval, "/") == 0) + newval = NULL; + different = !!g_strcmp0 (*param, newval); + if (different) { g_free (*param); - *param = NULL; + *param = g_strdup (newval); } } else { success = FALSE; @@ -1017,50 +1056,78 @@ demarshal_generic (NMObject *object, } } else if (pspec->value_type == G_TYPE_STRV) { char ***param = (char ***)field; - if (*param) - g_strfreev (*param); - *param = g_variant_dup_strv (value, NULL); + const char **newval; + gsize i; + + newval = g_variant_get_strv (value, NULL); + if (!*param) + different = TRUE; + else { + if (!_nm_utils_strv_equal ((char **) newval, *param)) { + different = TRUE; + g_strfreev (*param); + } + } + if (different) { + for (i = 0; newval[i]; i++) + newval[i] = g_strdup (newval[i]); + *param = (char **) newval; + } else + g_free (newval); } else if (pspec->value_type == G_TYPE_BYTES) { GBytes **param = (GBytes **)field; - gconstpointer val; - gsize length; + gconstpointer val, old_val = NULL; + gsize length, old_length = 0; - if (*param) - g_bytes_unref (*param); val = g_variant_get_fixed_array (value, &length, 1); - if (length) - *param = g_bytes_new (val, length); - else - *param = NULL; + + if (*param) + old_val = g_bytes_get_data (*param, &old_length); + different = old_length != length + || ( length > 0 + && memcmp (old_val, val, length) != 0); + if (different) { + if (*param) + g_bytes_unref (*param); + *param = length > 0 ? g_bytes_new (val, length) : NULL; + } } else if (G_IS_PARAM_SPEC_ENUM (pspec)) { int *param = (int *) field; + int newval = 0; if (g_variant_is_of_type (value, G_VARIANT_TYPE_INT32)) - *param = g_variant_get_int32 (value); + newval = g_variant_get_int32 (value); else if (g_variant_is_of_type (value, G_VARIANT_TYPE_UINT32)) - *param = g_variant_get_uint32 (value); + newval = g_variant_get_uint32 (value); else { success = FALSE; goto done; } + different = *param != newval; + *param = newval; } else if (G_IS_PARAM_SPEC_FLAGS (pspec)) { guint *param = (guint *) field; + guint newval = 0; if (g_variant_is_of_type (value, G_VARIANT_TYPE_INT32)) - *param = g_variant_get_int32 (value); + newval = g_variant_get_int32 (value); else if (g_variant_is_of_type (value, G_VARIANT_TYPE_UINT32)) - *param = g_variant_get_uint32 (value); + newval = g_variant_get_uint32 (value); else { success = FALSE; goto done; } + different = *param != newval; + *param = newval; } else if (pspec->value_type == G_TYPE_BOOLEAN) HANDLE_TYPE (G_VARIANT_TYPE_BOOLEAN, gboolean, g_variant_get_boolean); else if (pspec->value_type == G_TYPE_UCHAR) HANDLE_TYPE (G_VARIANT_TYPE_BYTE, guchar, g_variant_get_byte); - else if (pspec->value_type == G_TYPE_DOUBLE) + else if (pspec->value_type == G_TYPE_DOUBLE) { + NM_PRAGMA_WARNING_DISABLE("-Wfloat-equal") HANDLE_TYPE (G_VARIANT_TYPE_DOUBLE, gdouble, g_variant_get_double); - else if (pspec->value_type == G_TYPE_INT) + NM_PRAGMA_WARNING_REENABLE + } else if (pspec->value_type == G_TYPE_INT) HANDLE_TYPE (G_VARIANT_TYPE_INT32, gint, g_variant_get_int32); else if (pspec->value_type == G_TYPE_UINT) HANDLE_TYPE (G_VARIANT_TYPE_UINT32, guint, g_variant_get_uint32); @@ -1083,7 +1150,8 @@ demarshal_generic (NMObject *object, done: if (success) { - _nm_object_queue_notify (object, pspec->name); + if (different) + _nm_object_queue_notify (object, pspec->name); } else { dbgmsg ("%s: %s:%s (type %s) couldn't be set from D-Bus type %s.", __func__, G_OBJECT_TYPE_NAME (object), pspec->name, @@ -1118,8 +1186,8 @@ _nm_object_register_properties (NMObject *object, proxy = _nm_object_get_proxy (object, interface); g_return_if_fail (proxy != NULL); - g_signal_connect (proxy, "g-signal", - G_CALLBACK (property_proxy_signal), object); + _nm_dbus_signal_connect (proxy, "PropertiesChanged", G_VARIANT_TYPE ("(a{sv})"), + G_CALLBACK (properties_changed), object); instance = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); priv->property_tables = g_slist_prepend (priv->property_tables, instance); @@ -1157,11 +1225,12 @@ _nm_object_reload_properties (NMObject *object, GError **error) g_hash_table_iter_init (&iter, priv->proxies); while (g_hash_table_iter_next (&iter, (gpointer *) &interface, (gpointer *) &proxy)) { - ret = g_dbus_proxy_call_sync (priv->properties_proxy, - "GetAll", - g_variant_new ("(s)", interface), - G_DBUS_CALL_FLAGS_NONE, -1, - NULL, error); + ret = _nm_dbus_proxy_call_sync (priv->properties_proxy, + "GetAll", + g_variant_new ("(s)", interface), + G_VARIANT_TYPE ("(a{sv})"), + G_DBUS_CALL_FLAGS_NONE, -1, + NULL, error); if (!ret) { if (error && *error) g_dbus_error_strip_remote_error (*error); @@ -1204,11 +1273,12 @@ _nm_object_reload_property (NMObject *object, if (!NM_OBJECT_GET_PRIVATE (object)->nm_running) return; - ret = g_dbus_proxy_call_sync (NM_OBJECT_GET_PRIVATE (object)->properties_proxy, - "Get", - g_variant_new ("(ss)", interface, prop_name), - G_DBUS_CALL_FLAGS_NONE, 15000, - NULL, &err); + ret = _nm_dbus_proxy_call_sync (NM_OBJECT_GET_PRIVATE (object)->properties_proxy, + "Get", + g_variant_new ("(ss)", interface, prop_name), + G_VARIANT_TYPE ("(v)"), + G_DBUS_CALL_FLAGS_NONE, 15000, + NULL, &err); if (!ret) { dbgmsg ("%s: Error getting '%s' for %s: (%d) %s\n", __func__, @@ -1268,10 +1338,7 @@ reload_complete (NMObject *object, gboolean emit_now) GError *error; if (emit_now) { - if (priv->notify_id) { - g_source_remove (priv->notify_id); - priv->notify_id = 0; - } + nm_clear_g_source (&priv->notify_id); deferred_notify_cb (object); } else _nm_object_defer_notify (object); @@ -1306,7 +1373,9 @@ reload_got_properties (GObject *proxy, GVariant *ret, *props; GError *error = NULL; - ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), result, &error); + ret = _nm_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), result, + G_VARIANT_TYPE ("(a{sv})"), + &error); if (ret) { g_variant_get (ret, "(@a{sv})", &props); process_properties_changed (object, props, FALSE); @@ -1679,14 +1748,12 @@ dispose (GObject *object) { NMObjectPrivate *priv = NM_OBJECT_GET_PRIVATE (object); - if (priv->notify_id) { - g_source_remove (priv->notify_id); - priv->notify_id = 0; - } + nm_clear_g_source (&priv->notify_id); g_slist_free_full (priv->notify_items, (GDestroyNotify) notify_item_free); priv->notify_items = NULL; + g_slist_free_full (priv->waiters, g_object_unref); g_clear_pointer (&priv->proxies, g_hash_table_unref); g_clear_object (&priv->properties_proxy); diff --git a/libnm/nm-property-docs.xml b/libnm/nm-property-docs.xml index abee2d73..c0f57b0b 100644 --- a/libnm/nm-property-docs.xml +++ b/libnm/nm-property-docs.xml @@ -63,6 +63,7 @@ + @@ -87,8 +88,9 @@ + - + @@ -97,7 +99,7 @@ - + @@ -122,6 +124,7 @@ + @@ -130,6 +133,8 @@ + + @@ -143,9 +148,12 @@ - + + + + @@ -158,15 +166,17 @@ + - + + - + @@ -174,6 +184,28 @@ + + + + + + + + + + + + + + + + + + + + + + @@ -224,9 +256,18 @@ + + + + + + + + + - + @@ -238,12 +279,32 @@ + + + + + + + + + + + + + + + + + + + + - + - + @@ -269,9 +330,11 @@ + + diff --git a/libnm/nm-remote-connection.c b/libnm/nm-remote-connection.c index 98924973..e2073784 100644 --- a/libnm/nm-remote-connection.c +++ b/libnm/nm-remote-connection.c @@ -22,16 +22,14 @@ #include "config.h" #include -#include -#include #include #include #include +#include "nm-default.h" #include "nm-remote-connection.h" #include "nm-remote-connection-private.h" #include "nm-object-private.h" -#include "nm-glib-compat.h" #include "nm-dbus-helpers.h" #include "nmdbus-settings-connection.h" diff --git a/libnm/nm-remote-settings.c b/libnm/nm-remote-settings.c index d37e3666..480d7c19 100644 --- a/libnm/nm-remote-settings.c +++ b/libnm/nm-remote-settings.c @@ -22,19 +22,19 @@ #include "config.h" #include -#include #include #include +#include "nm-default.h" #include "nm-remote-settings.h" #include "nm-client.h" #include "nm-remote-connection.h" #include "nm-remote-connection-private.h" #include "nm-object-private.h" #include "nm-dbus-helpers.h" -#include "nm-glib-compat.h" #include "nm-object-private.h" #include "nm-core-internal.h" +#include "nm-macros-internal.h" #include "nmdbus-settings.h" @@ -627,7 +627,7 @@ nm_running_changed (GObject *object, GPtrArray *connections; int i; - NM_UTILS_CLEAR_CANCELLABLE (priv->props_cancellable); + nm_clear_g_cancellable (&priv->props_cancellable); /* Clear connections */ connections = priv->all_connections; @@ -652,7 +652,7 @@ nm_running_changed (GObject *object, } else { _nm_object_suppress_property_updates (NM_OBJECT (self), FALSE); - NM_UTILS_CLEAR_CANCELLABLE (priv->props_cancellable); + nm_clear_g_cancellable (&priv->props_cancellable); priv->props_cancellable = g_cancellable_new (); _nm_object_reload_properties_async (NM_OBJECT (self), priv->props_cancellable, updated_properties, self); } diff --git a/libnm/nm-secret-agent-old.c b/libnm/nm-secret-agent-old.c index 6df54d43..97bb287e 100644 --- a/libnm/nm-secret-agent-old.c +++ b/libnm/nm-secret-agent-old.c @@ -22,7 +22,7 @@ #include -#include "nm-glib-compat.h" +#include "nm-default.h" #include "nm-dbus-interface.h" #include "nm-secret-agent-old.h" #include "nm-enum-types.h" diff --git a/libnm/nm-setting-docs-overrides.xml b/libnm/nm-setting-docs-overrides.xml index 3a52fd7c..2f788db8 100644 --- a/libnm/nm-setting-docs-overrides.xml +++ b/libnm/nm-setting-docs-overrides.xml @@ -35,6 +35,8 @@ bridge's interface name."/> + + @@ -102,6 +104,8 @@ will be used as the metric for the route (otherwise NM will pick a default value appropriate to the device). Additional attributes may also exist on some routes."/> + + @@ -119,6 +123,8 @@ also exist on some routes."/> be used for backward-compatibility with older daemons, to set the team's interface name."/> + + + + diff --git a/libnm/nm-setting-docs.xml b/libnm/nm-setting-docs.xml index 7e865c58..917edaab 100644 --- a/libnm/nm-setting-docs.xml +++ b/libnm/nm-setting-docs.xml @@ -65,6 +65,7 @@ + @@ -89,8 +90,9 @@ + - + @@ -99,7 +101,7 @@ - + @@ -124,6 +126,7 @@ + @@ -132,6 +135,8 @@ + + @@ -146,9 +151,12 @@ - + + + + @@ -162,16 +170,18 @@ + - + + - + @@ -180,6 +190,28 @@ + + + + + + + + + + + + + + + + + + + + + + @@ -231,9 +263,18 @@ + + + + + + + + + - + @@ -246,12 +287,32 @@ + + + + + + + + + + + + + + + + + + + + - + - + @@ -277,9 +338,11 @@ + + diff --git a/libnm/nm-types.h b/libnm/nm-types.h index ee1ed643..be09daaf 100644 --- a/libnm/nm-types.h +++ b/libnm/nm-types.h @@ -37,10 +37,14 @@ typedef struct _NMDeviceBt NMDeviceBt; typedef struct _NMDeviceEthernet NMDeviceEthernet; typedef struct _NMDeviceGeneric NMDeviceGeneric; typedef struct _NMDeviceInfiniband NMDeviceInfiniband; +typedef struct _NMDeviceIPTunnel NMDeviceIPTunnel; +typedef struct _NMDeviceMacvlan NMDeviceMacvlan; typedef struct _NMDeviceModem NMDeviceModem; typedef struct _NMDeviceOlpcMesh NMDeviceOlpcMesh; typedef struct _NMDeviceTeam NMDeviceTeam; +typedef struct _NMDeviceTun NMDeviceTun; typedef struct _NMDeviceVlan NMDeviceVlan; +typedef struct _NMDeviceVxlan NMDeviceVxlan; typedef struct _NMDeviceWifi NMDeviceWifi; typedef struct _NMDeviceWimax NMDeviceWimax; typedef struct _NMDhcpConfig NMDhcpConfig; diff --git a/libnm/nm-vpn-editor-plugin.c b/libnm/nm-vpn-editor-plugin.c deleted file mode 100644 index 904a6be4..00000000 --- a/libnm/nm-vpn-editor-plugin.c +++ /dev/null @@ -1,181 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA. - * - * Copyright 2008 - 2010 Red Hat, Inc. - * Copyright 2008 Novell, Inc. - */ - -#include "config.h" - -#include "nm-vpn-editor-plugin.h" - -static void nm_vpn_editor_plugin_default_init (NMVpnEditorPluginInterface *iface); - -G_DEFINE_INTERFACE (NMVpnEditorPlugin, nm_vpn_editor_plugin, G_TYPE_OBJECT) - -static void -nm_vpn_editor_plugin_default_init (NMVpnEditorPluginInterface *iface) -{ - /* Properties */ - - /** - * NMVpnEditorPlugin:name: - * - * Short display name of the VPN plugin. - */ - g_object_interface_install_property (iface, - g_param_spec_string (NM_VPN_EDITOR_PLUGIN_NAME, "", "", - NULL, - G_PARAM_READABLE | - G_PARAM_STATIC_STRINGS)); - - /** - * NMVpnEditorPlugin:description: - * - * Longer description of the VPN plugin. - */ - g_object_interface_install_property (iface, - g_param_spec_string (NM_VPN_EDITOR_PLUGIN_DESCRIPTION, "", "", - NULL, - G_PARAM_READABLE | - G_PARAM_STATIC_STRINGS)); - - /** - * NMVpnEditorPlugin:service: - * - * D-Bus service name of the plugin's VPN service. - */ - g_object_interface_install_property (iface, - g_param_spec_string (NM_VPN_EDITOR_PLUGIN_SERVICE, "", "", - NULL, - G_PARAM_READABLE | - G_PARAM_STATIC_STRINGS)); -} - -/** - * nm_vpn_editor_plugin_get_editor: - * - * Returns: (transfer full): - */ -NMVpnEditor * -nm_vpn_editor_plugin_get_editor (NMVpnEditorPlugin *plugin, - NMConnection *connection, - GError **error) -{ - g_return_val_if_fail (NM_IS_VPN_EDITOR_PLUGIN (plugin), NULL); - - return NM_VPN_EDITOR_PLUGIN_GET_INTERFACE (plugin)->get_editor (plugin, connection, error); -} - -NMVpnEditorPluginCapability -nm_vpn_editor_plugin_get_capabilities (NMVpnEditorPlugin *plugin) -{ - g_return_val_if_fail (NM_IS_VPN_EDITOR_PLUGIN (plugin), 0); - - return NM_VPN_EDITOR_PLUGIN_GET_INTERFACE (plugin)->get_capabilities (plugin); -} - -/** - * nm_vpn_editor_plugin_import: - * - * Returns: (transfer full): - */ -NMConnection * -nm_vpn_editor_plugin_import (NMVpnEditorPlugin *plugin, - const char *path, - GError **error) -{ - g_return_val_if_fail (NM_IS_VPN_EDITOR_PLUGIN (plugin), NULL); - - if (nm_vpn_editor_plugin_get_capabilities (plugin) & NM_VPN_EDITOR_PLUGIN_CAPABILITY_IMPORT) { - g_return_val_if_fail (NM_VPN_EDITOR_PLUGIN_GET_INTERFACE (plugin)->import_from_file != NULL, NULL); - return NM_VPN_EDITOR_PLUGIN_GET_INTERFACE (plugin)->import_from_file (plugin, path, error); - } - return NULL; -} - -gboolean -nm_vpn_editor_plugin_export (NMVpnEditorPlugin *plugin, - const char *path, - NMConnection *connection, - GError **error) -{ - g_return_val_if_fail (NM_IS_VPN_EDITOR_PLUGIN (plugin), FALSE); - - if (nm_vpn_editor_plugin_get_capabilities (plugin) & NM_VPN_EDITOR_PLUGIN_CAPABILITY_EXPORT) { - g_return_val_if_fail (NM_VPN_EDITOR_PLUGIN_GET_INTERFACE (plugin)->export_to_file != NULL, FALSE); - return NM_VPN_EDITOR_PLUGIN_GET_INTERFACE (plugin)->export_to_file (plugin, path, connection, error); - } - return FALSE; -} - -char * -nm_vpn_editor_plugin_get_suggested_filename (NMVpnEditorPlugin *plugin, - NMConnection *connection) -{ - g_return_val_if_fail (NM_IS_VPN_EDITOR_PLUGIN (plugin), NULL); - - if (NM_VPN_EDITOR_PLUGIN_GET_INTERFACE (plugin)->get_suggested_filename) - return NM_VPN_EDITOR_PLUGIN_GET_INTERFACE (plugin)->get_suggested_filename (plugin, connection); - return NULL; -} - - -static void nm_vpn_editor_default_init (NMVpnEditorInterface *iface); - -G_DEFINE_INTERFACE (NMVpnEditor, nm_vpn_editor, G_TYPE_OBJECT) - -static void -nm_vpn_editor_default_init (NMVpnEditorInterface *iface) -{ - GType iface_type = G_TYPE_FROM_INTERFACE (iface); - - /* Signals */ - g_signal_new ("changed", - iface_type, - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (NMVpnEditorInterface, changed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); -} - -/** - * nm_vpn_editor_get_widget: - * - * Returns: (transfer none): - */ -GObject * -nm_vpn_editor_get_widget (NMVpnEditor *editor) -{ - g_return_val_if_fail (NM_IS_VPN_EDITOR (editor), NULL); - - return NM_VPN_EDITOR_GET_INTERFACE (editor)->get_widget (editor); -} - -gboolean -nm_vpn_editor_update_connection (NMVpnEditor *editor, - NMConnection *connection, - GError **error) -{ - g_return_val_if_fail (NM_IS_VPN_EDITOR (editor), FALSE); - - if (error) - g_return_val_if_fail (*error == NULL, FALSE); - - return NM_VPN_EDITOR_GET_INTERFACE (editor)->update_connection (editor, connection, error); -} diff --git a/libnm/nm-vpn-editor-plugin.h b/libnm/nm-vpn-editor-plugin.h deleted file mode 100644 index 5910aa36..00000000 --- a/libnm/nm-vpn-editor-plugin.h +++ /dev/null @@ -1,189 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA. - * - * Copyright 2008 - 2014 Red Hat, Inc. - * Copyright 2008 Novell, Inc. - */ - -#ifndef __NM_VPN_EDITOR_PLUGIN_H__ -#define __NM_VPN_EDITOR_PLUGIN_H__ - -#if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION) -#error "Only can be included directly." -#endif - -#include -#include -#include - -G_BEGIN_DECLS - -typedef struct _NMVpnEditorPlugin NMVpnEditorPlugin; -typedef struct _NMVpnEditor NMVpnEditor; - -/* Plugin's factory function that returns a GObject that implements - * NMVpnEditorPlugin. - */ -#ifndef __GI_SCANNER__ -typedef NMVpnEditorPlugin * (*NMVpnEditorPluginFactory) (GError **error); -NMVpnEditorPlugin *nm_vpn_editor_plugin_factory (GError **error); -#endif - - -/**************************************************/ -/* Editor plugin interface */ -/**************************************************/ - -#define NM_TYPE_VPN_EDITOR_PLUGIN (nm_vpn_editor_plugin_get_type ()) -#define NM_VPN_EDITOR_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_VPN_EDITOR_PLUGIN, NMVpnEditorPlugin)) -#define NM_IS_VPN_EDITOR_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_VPN_EDITOR_PLUGIN)) -#define NM_VPN_EDITOR_PLUGIN_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_VPN_EDITOR_PLUGIN, NMVpnEditorPluginInterface)) - -/** - * NMVpnEditorPluginCapability: - * @NM_VPN_EDITOR_PLUGIN_CAPABILITY_NONE: unknown or no capability - * @NM_VPN_EDITOR_PLUGIN_CAPABILITY_IMPORT: the plugin can import new connections - * @NM_VPN_EDITOR_PLUGIN_CAPABILITY_EXPORT: the plugin can export connections - * @NM_VPN_EDITOR_PLUGIN_CAPABILITY_IPV6: the plugin supports IPv6 addressing - * - * Flags that indicate certain capabilities of the plugin to editor programs. - **/ -typedef enum /*< flags >*/ { - NM_VPN_EDITOR_PLUGIN_CAPABILITY_NONE = 0x00, - NM_VPN_EDITOR_PLUGIN_CAPABILITY_IMPORT = 0x01, - NM_VPN_EDITOR_PLUGIN_CAPABILITY_EXPORT = 0x02, - NM_VPN_EDITOR_PLUGIN_CAPABILITY_IPV6 = 0x04 -} NMVpnEditorPluginCapability; - -/* Short display name of the VPN plugin */ -#define NM_VPN_EDITOR_PLUGIN_NAME "name" - -/* Longer description of the VPN plugin */ -#define NM_VPN_EDITOR_PLUGIN_DESCRIPTION "description" - -/* D-Bus service name of the plugin's VPN service */ -#define NM_VPN_EDITOR_PLUGIN_SERVICE "service" - -/** - * NMVpnEditorPluginInterface: - * @g_iface: the parent interface - * @get_editor: returns an #NMVpnEditor, pre-filled with values from @connection - * if non-%NULL. - * @get_capabilities: returns a bitmask of capabilities. - * @import_from_file: Try to import a connection from the specified path. On - * success, return a partial #NMConnection object. On error, return %NULL and - * set @error with additional information. Note that @error can be %NULL, in - * which case no additional error information should be provided. - * @export_to_file: Export the given connection to the specified path. Return - * %TRUE on success. On error, return %FALSE and set @error with additional - * error information. Note that @error can be %NULL, in which case no - * additional error information should be provided. - * @get_suggested_filename: For a given connection, return a suggested file - * name. Returned value will be %NULL or a suggested file name to be freed by - * the caller. - * - * Interface for VPN editor plugins. - */ -typedef struct { - GTypeInterface g_iface; - - NMVpnEditor * (*get_editor) (NMVpnEditorPlugin *plugin, - NMConnection *connection, - GError **error); - - NMVpnEditorPluginCapability (*get_capabilities) (NMVpnEditorPlugin *plugin); - - NMConnection * (*import_from_file) (NMVpnEditorPlugin *plugin, - const char *path, - GError **error); - - gboolean (*export_to_file) (NMVpnEditorPlugin *plugin, - const char *path, - NMConnection *connection, - GError **error); - - char * (*get_suggested_filename) (NMVpnEditorPlugin *plugin, NMConnection *connection); -} NMVpnEditorPluginInterface; - -GType nm_vpn_editor_plugin_get_type (void); - -NMVpnEditor *nm_vpn_editor_plugin_get_editor (NMVpnEditorPlugin *plugin, - NMConnection *connection, - GError **error); - -NMVpnEditorPluginCapability nm_vpn_editor_plugin_get_capabilities (NMVpnEditorPlugin *plugin); - -NMConnection *nm_vpn_editor_plugin_import (NMVpnEditorPlugin *plugin, - const char *path, - GError **error); -gboolean nm_vpn_editor_plugin_export (NMVpnEditorPlugin *plugin, - const char *path, - NMConnection *connection, - GError **error); -char *nm_vpn_editor_plugin_get_suggested_filename (NMVpnEditorPlugin *plugin, - NMConnection *connection); - -/**************************************************/ -/* Editor interface */ -/**************************************************/ - -#define NM_TYPE_VPN_EDITOR (nm_vpn_editor_get_type ()) -#define NM_VPN_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_VPN_EDITOR, NMVpnEditor)) -#define NM_IS_VPN_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_VPN_EDITOR)) -#define NM_VPN_EDITOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_VPN_EDITOR, NMVpnEditorInterface)) - -/** - * NMVpnEditorInterface: - * @g_iface: the parent interface - * @get_widget: return the #GtkWidget for the VPN editor's UI - * @placeholder: not currently used - * @update_connection: called to save the user-entered options to the connection - * object. Should return %FALSE and set @error if the current options are - * invalid. @error should contain enough information for the plugin to - * determine which UI widget is invalid at a later point in time. For - * example, creating unique error codes for what error occurred and populating - * the message field of @error with the name of the invalid property. - * @changed: emitted when the value of a UI widget changes. May trigger a - * validity check via @update_connection to write values to the connection. - * - * Interface for editing a specific #NMConnection - */ -typedef struct { - GTypeInterface g_iface; - - GObject * (*get_widget) (NMVpnEditor *editor); - - void (*placeholder) (void); - - gboolean (*update_connection) (NMVpnEditor *editor, - NMConnection *connection, - GError **error); - - void (*changed) (NMVpnEditor *editor); -} NMVpnEditorInterface; - -GType nm_vpn_editor_get_type (void); - -GObject * nm_vpn_editor_get_widget (NMVpnEditor *editor); - -gboolean nm_vpn_editor_update_connection (NMVpnEditor *editor, - NMConnection *connection, - GError **error); - -G_END_DECLS - -#endif /* NM_VPN_EDITOR_PLUGIN_H */ diff --git a/libnm/nm-vpn-editor.c b/libnm/nm-vpn-editor.c new file mode 100644 index 00000000..ba6bd5e0 --- /dev/null +++ b/libnm/nm-vpn-editor.c @@ -0,0 +1,69 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2008 - 2010 Red Hat, Inc. + * Copyright 2008 Novell, Inc. + */ + +#include "config.h" + +#include "nm-vpn-editor.h" + +static void nm_vpn_editor_default_init (NMVpnEditorInterface *iface); + +G_DEFINE_INTERFACE (NMVpnEditor, nm_vpn_editor, G_TYPE_OBJECT) + +static void +nm_vpn_editor_default_init (NMVpnEditorInterface *iface) +{ + GType iface_type = G_TYPE_FROM_INTERFACE (iface); + + /* Signals */ + g_signal_new ("changed", + iface_type, + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMVpnEditorInterface, changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); +} + +/** + * nm_vpn_editor_get_widget: + * + * Returns: (transfer none): + */ +GObject * +nm_vpn_editor_get_widget (NMVpnEditor *editor) +{ + g_return_val_if_fail (NM_IS_VPN_EDITOR (editor), NULL); + + return NM_VPN_EDITOR_GET_INTERFACE (editor)->get_widget (editor); +} + +gboolean +nm_vpn_editor_update_connection (NMVpnEditor *editor, + NMConnection *connection, + GError **error) +{ + g_return_val_if_fail (NM_IS_VPN_EDITOR (editor), FALSE); + + if (error) + g_return_val_if_fail (*error == NULL, FALSE); + + return NM_VPN_EDITOR_GET_INTERFACE (editor)->update_connection (editor, connection, error); +} diff --git a/libnm/nm-vpn-editor.h b/libnm/nm-vpn-editor.h new file mode 100644 index 00000000..a11e9fd1 --- /dev/null +++ b/libnm/nm-vpn-editor.h @@ -0,0 +1,86 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2008 Novell, Inc. + * Copyright 2008 - 2015 Red Hat, Inc. + */ + +#ifndef __NM_VPN_EDITOR_H__ +#define __NM_VPN_EDITOR_H__ + +#if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION) +#error "Only can be included directly." +#endif + +#include +#include +#include + +#include "nm-vpn-editor-plugin.h" + +G_BEGIN_DECLS + +/**************************************************/ +/* Editor interface */ +/**************************************************/ + +#define NM_TYPE_VPN_EDITOR (nm_vpn_editor_get_type ()) +#define NM_VPN_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_VPN_EDITOR, NMVpnEditor)) +#define NM_IS_VPN_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_VPN_EDITOR)) +#define NM_VPN_EDITOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_VPN_EDITOR, NMVpnEditorInterface)) + +/** + * NMVpnEditorInterface: + * @g_iface: the parent interface + * @get_widget: return the #GtkWidget for the VPN editor's UI + * @placeholder: not currently used + * @update_connection: called to save the user-entered options to the connection + * object. Should return %FALSE and set @error if the current options are + * invalid. @error should contain enough information for the plugin to + * determine which UI widget is invalid at a later point in time. For + * example, creating unique error codes for what error occurred and populating + * the message field of @error with the name of the invalid property. + * @changed: emitted when the value of a UI widget changes. May trigger a + * validity check via @update_connection to write values to the connection. + * + * Interface for editing a specific #NMConnection + */ +typedef struct { + GTypeInterface g_iface; + + GObject * (*get_widget) (NMVpnEditor *editor); + + void (*placeholder) (void); + + gboolean (*update_connection) (NMVpnEditor *editor, + NMConnection *connection, + GError **error); + + void (*changed) (NMVpnEditor *editor); +} NMVpnEditorInterface; + +GType nm_vpn_editor_get_type (void); + +GObject * nm_vpn_editor_get_widget (NMVpnEditor *editor); + +gboolean nm_vpn_editor_update_connection (NMVpnEditor *editor, + NMConnection *connection, + GError **error); + +G_END_DECLS + +#endif /* __NM_VPN_EDITOR_H__ */ diff --git a/libnm/nm-vpn-plugin-old.c b/libnm/nm-vpn-plugin-old.c index deaa07dd..cfc8c663 100644 --- a/libnm/nm-vpn-plugin-old.c +++ b/libnm/nm-vpn-plugin-old.c @@ -19,20 +19,13 @@ * Copyright 2007 - 2008 Red Hat, Inc. */ -/* This interface is expected to be deprecated in NM 1.2, at which point there - * will be a new "NMVpnPlugin" class to replace it. - */ - #include "config.h" #include #include #include -#include -#include - -#include "nm-glib-compat.h" +#include "nm-default.h" #include "nm-vpn-plugin-old.h" #include "nm-enum-types.h" #include "nm-utils.h" @@ -71,7 +64,7 @@ typedef struct { gboolean has_ip6, got_ip6; /* Config stuff copied from config to ip4config */ - char *banner, *tundev, *gateway, *mtu; + GVariant *banner, *tundev, *gateway, *mtu; } NMVpnPluginOldPrivate; #define NM_VPN_PLUGIN_OLD_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_VPN_PLUGIN_OLD, NMVpnPluginOldPrivate)) @@ -110,13 +103,16 @@ nm_vpn_plugin_old_set_connection (NMVpnPluginOld *plugin, g_clear_object (&priv->connection); - priv->connection = g_object_ref (connection); + if (connection) + priv->connection = g_object_ref (connection); } /** * nm_vpn_plugin_old_get_connection: * * Returns: (transfer full): + * + * Deprecated: 1.2: replaced by NMVpnServicePlugin */ GDBusConnection * nm_vpn_plugin_old_get_connection (NMVpnPluginOld *plugin) @@ -300,14 +296,22 @@ nm_vpn_plugin_old_set_config (NMVpnPluginOld *plugin, /* Record the items that need to also be inserted into the * ip4config, for compatibility with older daemons. */ - g_clear_pointer (&priv->banner, g_free); - (void) g_variant_lookup (config, NM_VPN_PLUGIN_CONFIG_BANNER, "&s", &priv->banner); - g_clear_pointer (&priv->tundev, g_free); - (void) g_variant_lookup (config, NM_VPN_PLUGIN_CONFIG_TUNDEV, "&s", &priv->tundev); - g_clear_pointer (&priv->gateway, g_free); - (void) g_variant_lookup (config, NM_VPN_PLUGIN_CONFIG_EXT_GATEWAY, "&s", &priv->gateway); - g_clear_pointer (&priv->mtu, g_free); - (void) g_variant_lookup (config, NM_VPN_PLUGIN_CONFIG_MTU, "&s", &priv->mtu); + if (priv->banner) + g_variant_unref (priv->banner); + priv->banner = g_variant_lookup_value (config, NM_VPN_PLUGIN_CONFIG_BANNER, + G_VARIANT_TYPE ("s")); + if (priv->tundev) + g_variant_unref (priv->tundev); + priv->tundev = g_variant_lookup_value (config, NM_VPN_PLUGIN_CONFIG_TUNDEV, + G_VARIANT_TYPE ("s")); + if (priv->gateway) + g_variant_unref (priv->gateway); + priv->gateway = g_variant_lookup_value (config, NM_VPN_PLUGIN_CONFIG_EXT_GATEWAY, + G_VARIANT_TYPE ("u")); + if (priv->mtu) + g_variant_unref (priv->mtu); + priv->mtu = g_variant_lookup_value (config, NM_VPN_PLUGIN_CONFIG_MTU, + G_VARIANT_TYPE ("u")); g_signal_emit (plugin, signals[CONFIG], 0, config); } @@ -320,7 +324,8 @@ nm_vpn_plugin_old_set_ip4_config (NMVpnPluginOld *plugin, GVariant *combined_config; GVariantBuilder builder; GVariantIter iter; - const char *key, *value; + const char *key; + GVariant *value; g_return_if_fail (NM_IS_VPN_PLUGIN_OLD (plugin)); g_return_if_fail (ip4_config != NULL); @@ -340,19 +345,21 @@ nm_vpn_plugin_old_set_ip4_config (NMVpnPluginOld *plugin, * being emitted. So just copy all of that data into the ip4 * config too. */ - g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{ss}")); + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); g_variant_iter_init (&iter, ip4_config); - while (g_variant_iter_next (&iter, "{&s&s}", &key, &value)) - g_variant_builder_add (&builder, "{ss}", key, value); + while (g_variant_iter_next (&iter, "{&sv}", &key, &value)) { + g_variant_builder_add (&builder, "{sv}", key, value); + g_variant_unref (value); + } if (priv->banner) - g_variant_builder_add (&builder, "{ss}", NM_VPN_PLUGIN_IP4_CONFIG_BANNER, &priv->banner); + g_variant_builder_add (&builder, "{sv}", NM_VPN_PLUGIN_IP4_CONFIG_BANNER, &priv->banner); if (priv->tundev) - g_variant_builder_add (&builder, "{ss}", NM_VPN_PLUGIN_IP4_CONFIG_TUNDEV, &priv->tundev); + g_variant_builder_add (&builder, "{sv}", NM_VPN_PLUGIN_IP4_CONFIG_TUNDEV, &priv->tundev); if (priv->gateway) - g_variant_builder_add (&builder, "{ss}", NM_VPN_PLUGIN_IP4_CONFIG_EXT_GATEWAY, &priv->gateway); + g_variant_builder_add (&builder, "{sv}", NM_VPN_PLUGIN_IP4_CONFIG_EXT_GATEWAY, &priv->gateway); if (priv->mtu) - g_variant_builder_add (&builder, "{ss}", NM_VPN_PLUGIN_IP4_CONFIG_MTU, &priv->mtu); + g_variant_builder_add (&builder, "{sv}", NM_VPN_PLUGIN_IP4_CONFIG_MTU, &priv->mtu); combined_config = g_variant_builder_end (&builder); g_variant_ref_sink (combined_config); @@ -373,9 +380,13 @@ nm_vpn_plugin_old_set_ip6_config (NMVpnPluginOld *plugin, g_return_if_fail (NM_IS_VPN_PLUGIN_OLD (plugin)); g_return_if_fail (ip6_config != NULL); + g_variant_ref_sink (ip6_config); + priv->got_ip6 = TRUE; g_signal_emit (plugin, signals[IP6_CONFIG], 0, ip6_config); + g_variant_unref (ip6_config); + if ( priv->has_ip4 == priv->got_ip4 && priv->has_ip6 == priv->got_ip6) nm_vpn_plugin_old_set_state (plugin, NM_VPN_SERVICE_STATE_STARTED); @@ -483,7 +494,7 @@ impl_vpn_plugin_old_need_secrets (NMVpnPluginOld *plugin, gpointer user_data) { NMConnection *connection; - char *setting_name; + const char *setting_name; gboolean needed; GError *error = NULL; @@ -519,7 +530,6 @@ impl_vpn_plugin_old_need_secrets (NMVpnPluginOld *plugin, g_assert (setting_name); g_dbus_method_invocation_return_value (context, g_variant_new ("(s)", setting_name)); - g_free (setting_name); } else { /* No secrets required */ g_dbus_method_invocation_return_value (context, @@ -596,6 +606,8 @@ impl_vpn_plugin_old_new_secrets (NMVpnPluginOld *plugin, * request new secrets when the secrets originally provided by NetworkManager * are insufficient, or the VPN process indicates that it needs additional * information to complete the request. + * + * Deprecated: 1.2: replaced by NMVpnServicePlugin */ void nm_vpn_plugin_old_secrets_required (NMVpnPluginOld *plugin, @@ -648,6 +660,8 @@ free_secret (gpointer data) * an applet when the applet calls the authentication dialog of the VPN plugin. * * Returns: %TRUE if reading values was successful, %FALSE if not + * + * Deprecated: 1.2: replaced by NMVpnServicePlugin **/ gboolean nm_vpn_plugin_old_read_vpn_details (int fd, @@ -749,6 +763,8 @@ nm_vpn_plugin_old_read_vpn_details (int fd, * * Returns: %TRUE if the flag data item was found and successfully converted * to flags, %FALSE if not + * + * Deprecated: 1.2: replaced by NMVpnServicePlugin **/ gboolean nm_vpn_plugin_old_get_secret_flags (GHashTable *data, @@ -910,8 +926,8 @@ init_sync (GInitable *initable, GCancellable *cancellable, GError **error) ret = g_dbus_proxy_call_sync (proxy, "RequestName", - g_variant_new ("(s)", priv->dbus_service_name), - G_DBUS_CALL_FLAGS_NONE, 0, + g_variant_new ("(su)", priv->dbus_service_name, 0), + G_DBUS_CALL_FLAGS_NONE, -1, cancellable, error); g_object_unref (proxy); if (!ret) { @@ -1027,10 +1043,10 @@ finalize (GObject *object) nm_vpn_plugin_old_set_connection (plugin, NULL); g_free (priv->dbus_service_name); - g_clear_pointer (&priv->banner, g_free); - g_clear_pointer (&priv->tundev, g_free); - g_clear_pointer (&priv->gateway, g_free); - g_clear_pointer (&priv->mtu, g_free); + g_clear_pointer (&priv->banner, g_variant_unref); + g_clear_pointer (&priv->tundev, g_variant_unref); + g_clear_pointer (&priv->gateway, g_variant_unref); + g_clear_pointer (&priv->mtu, g_variant_unref); G_OBJECT_CLASS (nm_vpn_plugin_old_parent_class)->finalize (object); } @@ -1078,6 +1094,8 @@ nm_vpn_plugin_old_class_init (NMVpnPluginOldClass *plugin_class) * NMVpnPluginOld:service-name: * * The D-Bus service name of this plugin. + * + * Deprecated: 1.2: replaced by NMVpnServicePlugin */ g_object_class_install_property (object_class, PROP_DBUS_SERVICE_NAME, @@ -1091,6 +1109,8 @@ nm_vpn_plugin_old_class_init (NMVpnPluginOldClass *plugin_class) * NMVpnPluginOld:state: * * The state of the plugin. + * + * Deprecated: 1.2: replaced by NMVpnServicePlugin */ g_object_class_install_property (object_class, PROP_STATE, diff --git a/libnm/nm-vpn-plugin-old.h b/libnm/nm-vpn-plugin-old.h index 7fcc1c1c..59cf4600 100644 --- a/libnm/nm-vpn-plugin-old.h +++ b/libnm/nm-vpn-plugin-old.h @@ -16,7 +16,7 @@ * Boston, MA 02110-1301 USA. * * Copyright 2007 - 2008 Novell, Inc. - * Copyright 2007 - 2013 Red Hat, Inc. + * Copyright 2007 - 2015 Red Hat, Inc. */ #ifndef __NM_VPN_PLUGIN_OLD_H__ @@ -39,94 +39,122 @@ G_BEGIN_DECLS #define NM_VPN_PLUGIN_OLD_STATE "state" typedef struct { + NM_DEPRECATED_IN_1_2 GObject parent; -} NMVpnPluginOld; +} NMVpnPluginOld NM_DEPRECATED_IN_1_2; typedef struct { + NM_DEPRECATED_IN_1_2 GObjectClass parent; /* Signals */ + NM_DEPRECATED_IN_1_2 void (*state_changed) (NMVpnPluginOld *plugin, NMVpnServiceState state); + NM_DEPRECATED_IN_1_2 void (*ip4_config) (NMVpnPluginOld *plugin, GVariant *ip4_config); + NM_DEPRECATED_IN_1_2 void (*login_banner) (NMVpnPluginOld *plugin, const char *banner); + NM_DEPRECATED_IN_1_2 void (*failure) (NMVpnPluginOld *plugin, NMVpnPluginFailure reason); + NM_DEPRECATED_IN_1_2 void (*quit) (NMVpnPluginOld *plugin); + NM_DEPRECATED_IN_1_2 void (*config) (NMVpnPluginOld *plugin, GVariant *config); + NM_DEPRECATED_IN_1_2 void (*ip6_config) (NMVpnPluginOld *plugin, GVariant *config); /* virtual methods */ + NM_DEPRECATED_IN_1_2 gboolean (*connect) (NMVpnPluginOld *plugin, NMConnection *connection, GError **err); + NM_DEPRECATED_IN_1_2 gboolean (*need_secrets) (NMVpnPluginOld *plugin, NMConnection *connection, - char **setting_name, + const char **setting_name, GError **error); + NM_DEPRECATED_IN_1_2 gboolean (*disconnect) (NMVpnPluginOld *plugin, GError **err); + NM_DEPRECATED_IN_1_2 gboolean (*new_secrets) (NMVpnPluginOld *plugin, NMConnection *connection, GError **error); + NM_DEPRECATED_IN_1_2 gboolean (*connect_interactive) (NMVpnPluginOld *plugin, NMConnection *connection, GVariant *details, GError **error); /*< private >*/ + NM_DEPRECATED_IN_1_2 gpointer padding[8]; -} NMVpnPluginOldClass; +} NMVpnPluginOldClass NM_DEPRECATED_IN_1_2; +NM_DEPRECATED_IN_1_2 GType nm_vpn_plugin_old_get_type (void); +NM_DEPRECATED_IN_1_2 GDBusConnection *nm_vpn_plugin_old_get_connection (NMVpnPluginOld *plugin); +NM_DEPRECATED_IN_1_2 NMVpnServiceState nm_vpn_plugin_old_get_state (NMVpnPluginOld *plugin); +NM_DEPRECATED_IN_1_2 void nm_vpn_plugin_old_set_state (NMVpnPluginOld *plugin, NMVpnServiceState state); +NM_DEPRECATED_IN_1_2 void nm_vpn_plugin_old_secrets_required (NMVpnPluginOld *plugin, const char *message, const char **hints); +NM_DEPRECATED_IN_1_2 void nm_vpn_plugin_old_set_login_banner (NMVpnPluginOld *plugin, const char *banner); +NM_DEPRECATED_IN_1_2 void nm_vpn_plugin_old_failure (NMVpnPluginOld *plugin, NMVpnPluginFailure reason); +NM_DEPRECATED_IN_1_2 void nm_vpn_plugin_old_set_config (NMVpnPluginOld *plugin, GVariant *config); +NM_DEPRECATED_IN_1_2 void nm_vpn_plugin_old_set_ip4_config (NMVpnPluginOld *plugin, GVariant *ip4_config); +NM_DEPRECATED_IN_1_2 void nm_vpn_plugin_old_set_ip6_config (NMVpnPluginOld *plugin, GVariant *ip6_config); +NM_DEPRECATED_IN_1_2 gboolean nm_vpn_plugin_old_disconnect (NMVpnPluginOld *plugin, GError **err); /* Utility functions */ +NM_DEPRECATED_IN_1_2 gboolean nm_vpn_plugin_old_read_vpn_details (int fd, GHashTable **out_data, GHashTable **out_secrets); +NM_DEPRECATED_IN_1_2 gboolean nm_vpn_plugin_old_get_secret_flags (GHashTable *data, const char *secret_name, NMSettingSecretFlags *out_flags); diff --git a/libnm/nm-vpn-service-plugin.c b/libnm/nm-vpn-service-plugin.c new file mode 100644 index 00000000..ae5af323 --- /dev/null +++ b/libnm/nm-vpn-service-plugin.c @@ -0,0 +1,1302 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2007 - 2008 Novell, Inc. + * Copyright 2007 - 2015 Red Hat, Inc. + */ + +#include "config.h" + +#include "nm-vpn-service-plugin.h" + +#include +#include +#include + +#include "nm-glib.h" +#include "nm-enum-types.h" +#include "nm-utils.h" +#include "nm-connection.h" +#include "nm-dbus-helpers.h" +#include "nm-core-internal.h" +#include "nm-simple-connection.h" +#include "nm-macros-internal.h" + +#include "nmdbus-vpn-plugin.h" + +#define NM_VPN_SERVICE_PLUGIN_QUIT_TIMER 180 + +static void nm_vpn_service_plugin_initable_iface_init (GInitableIface *iface); + +G_DEFINE_ABSTRACT_TYPE_WITH_CODE (NMVpnServicePlugin, nm_vpn_service_plugin, G_TYPE_OBJECT, + G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, nm_vpn_service_plugin_initable_iface_init); + ) + +typedef struct { + NMVpnServiceState state; + + /* DBUS-y stuff */ + GDBusConnection *connection; + NMDBusVpnPlugin *dbus_vpn_service_plugin; + char *dbus_service_name; + gboolean dbus_watch_peer; + + /* Temporary stuff */ + guint connect_timer; + guint quit_timer; + guint fail_stop_id; + guint peer_watch_id; + gboolean interactive; + + gboolean got_config; + gboolean has_ip4, got_ip4; + gboolean has_ip6, got_ip6; + + /* Config stuff copied from config to ip4config */ + GVariant *banner, *tundev, *gateway, *mtu; +} NMVpnServicePluginPrivate; + +#define NM_VPN_SERVICE_PLUGIN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_VPN_SERVICE_PLUGIN, NMVpnServicePluginPrivate)) + +enum { + STATE_CHANGED, + CONFIG, + IP4_CONFIG, + IP6_CONFIG, + LOGIN_BANNER, + FAILURE, + QUIT, + SECRETS_REQUIRED, + + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +enum { + PROP_0, + PROP_DBUS_SERVICE_NAME, + PROP_DBUS_WATCH_PEER, + PROP_STATE, + + LAST_PROP +}; + +static GSList *active_plugins = NULL; + + +static void +nm_vpn_service_plugin_set_connection (NMVpnServicePlugin *plugin, + GDBusConnection *connection) +{ + NMVpnServicePluginPrivate *priv = NM_VPN_SERVICE_PLUGIN_GET_PRIVATE (plugin); + + g_clear_object (&priv->connection); + + if (connection) + priv->connection = g_object_ref (connection); +} + +/** + * nm_vpn_service_plugin_get_connection: + * + * Returns: (transfer full): + * + * Since: 1.2 + */ +GDBusConnection * +nm_vpn_service_plugin_get_connection (NMVpnServicePlugin *plugin) +{ + GDBusConnection *connection; + + g_return_val_if_fail (NM_IS_VPN_SERVICE_PLUGIN (plugin), NULL); + + connection = NM_VPN_SERVICE_PLUGIN_GET_PRIVATE (plugin)->connection; + + if (connection) + g_object_ref (connection); + + return connection; +} + +static NMVpnServiceState +nm_vpn_service_plugin_get_state (NMVpnServicePlugin *plugin) +{ + g_return_val_if_fail (NM_IS_VPN_SERVICE_PLUGIN (plugin), NM_VPN_SERVICE_STATE_UNKNOWN); + + return NM_VPN_SERVICE_PLUGIN_GET_PRIVATE (plugin)->state; +} + +static void +nm_vpn_service_plugin_set_state (NMVpnServicePlugin *plugin, + NMVpnServiceState state) +{ + NMVpnServicePluginPrivate *priv; + + g_return_if_fail (NM_IS_VPN_SERVICE_PLUGIN (plugin)); + + priv = NM_VPN_SERVICE_PLUGIN_GET_PRIVATE (plugin); + if (priv->state != state) { + priv->state = state; + g_signal_emit (plugin, signals[STATE_CHANGED], 0, state); + nmdbus_vpn_plugin_emit_state_changed (priv->dbus_vpn_service_plugin, state); + } +} + +void +nm_vpn_service_plugin_set_login_banner (NMVpnServicePlugin *plugin, + const char *banner) +{ + NMVpnServicePluginPrivate *priv; + + g_return_if_fail (NM_IS_VPN_SERVICE_PLUGIN (plugin)); + g_return_if_fail (banner != NULL); + + priv = NM_VPN_SERVICE_PLUGIN_GET_PRIVATE (plugin); + g_signal_emit (plugin, signals[LOGIN_BANNER], 0, banner); + nmdbus_vpn_plugin_emit_login_banner (priv->dbus_vpn_service_plugin, banner); +} + +static void +_emit_failure (NMVpnServicePlugin *plugin, + NMVpnPluginFailure reason) +{ + NMVpnServicePluginPrivate *priv = NM_VPN_SERVICE_PLUGIN_GET_PRIVATE (plugin); + + g_signal_emit (plugin, signals[FAILURE], 0, reason); + nmdbus_vpn_plugin_emit_failure (priv->dbus_vpn_service_plugin, reason); +} + +void +nm_vpn_service_plugin_failure (NMVpnServicePlugin *plugin, + NMVpnPluginFailure reason) +{ + g_return_if_fail (NM_IS_VPN_SERVICE_PLUGIN (plugin)); + + _emit_failure (plugin, reason); + nm_vpn_service_plugin_disconnect (plugin, NULL); +} + +gboolean +nm_vpn_service_plugin_disconnect (NMVpnServicePlugin *plugin, GError **err) +{ + NMVpnServicePluginPrivate *priv; + gboolean ret = FALSE; + NMVpnServiceState state; + + g_return_val_if_fail (NM_IS_VPN_SERVICE_PLUGIN (plugin), FALSE); + + priv = NM_VPN_SERVICE_PLUGIN_GET_PRIVATE (plugin); + state = nm_vpn_service_plugin_get_state (plugin); + switch (state) { + case NM_VPN_SERVICE_STATE_STOPPING: + g_set_error (err, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_STOPPING_IN_PROGRESS, + "%s", + "Could not process the request because the VPN connection is already being stopped."); + break; + case NM_VPN_SERVICE_STATE_STOPPED: + g_set_error (err, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_ALREADY_STOPPED, + "%s", + "Could not process the request because no VPN connection was active."); + break; + case NM_VPN_SERVICE_STATE_STARTING: + _emit_failure (plugin, NM_VPN_PLUGIN_FAILURE_CONNECT_FAILED); + /* fallthru */ + case NM_VPN_SERVICE_STATE_STARTED: + nm_vpn_service_plugin_set_state (plugin, NM_VPN_SERVICE_STATE_STOPPING); + ret = NM_VPN_SERVICE_PLUGIN_GET_CLASS (plugin)->disconnect (plugin, err); + nm_vpn_service_plugin_set_state (plugin, NM_VPN_SERVICE_STATE_STOPPED); + break; + case NM_VPN_SERVICE_STATE_INIT: + ret = TRUE; + break; + + default: + g_warning ("Unhandled VPN service state %d", state); + g_assert_not_reached (); + break; + } + + return ret; +} + +static void +nm_vpn_service_plugin_emit_quit (NMVpnServicePlugin *plugin) +{ + g_signal_emit (plugin, signals[QUIT], 0); +} + +static gboolean +connect_timer_expired (gpointer data) +{ + NMVpnServicePlugin *plugin = NM_VPN_SERVICE_PLUGIN (data); + GError *err = NULL; + + NM_VPN_SERVICE_PLUGIN_GET_PRIVATE (plugin)->connect_timer = 0; + g_message ("Connect timer expired, disconnecting."); + nm_vpn_service_plugin_disconnect (plugin, &err); + if (err) { + g_warning ("Disconnect failed: %s", err->message); + g_error_free (err); + } + + return G_SOURCE_REMOVE; +} + +static gboolean +quit_timer_expired (gpointer data) +{ + NMVpnServicePlugin *self = NM_VPN_SERVICE_PLUGIN (data); + + NM_VPN_SERVICE_PLUGIN_GET_PRIVATE (self)->quit_timer = 0; + nm_vpn_service_plugin_emit_quit (self); + return G_SOURCE_REMOVE; +} + +static void +schedule_quit_timer (NMVpnServicePlugin *self) +{ + NMVpnServicePluginPrivate *priv = NM_VPN_SERVICE_PLUGIN_GET_PRIVATE (self); + + nm_clear_g_source (&priv->quit_timer); + priv->quit_timer = g_timeout_add_seconds (NM_VPN_SERVICE_PLUGIN_QUIT_TIMER, + quit_timer_expired, + self); +} + +static gboolean +fail_stop (gpointer data) +{ + NMVpnServicePlugin *self = NM_VPN_SERVICE_PLUGIN (data); + + NM_VPN_SERVICE_PLUGIN_GET_PRIVATE (self)->fail_stop_id = 0; + nm_vpn_service_plugin_set_state (self, NM_VPN_SERVICE_STATE_STOPPED); + return G_SOURCE_REMOVE; +} + +static void +schedule_fail_stop (NMVpnServicePlugin *plugin) +{ + NMVpnServicePluginPrivate *priv = NM_VPN_SERVICE_PLUGIN_GET_PRIVATE (plugin); + + nm_clear_g_source (&priv->fail_stop_id); + priv->fail_stop_id = g_idle_add (fail_stop, plugin); +} + +void +nm_vpn_service_plugin_set_config (NMVpnServicePlugin *plugin, + GVariant *config) +{ + NMVpnServicePluginPrivate *priv = NM_VPN_SERVICE_PLUGIN_GET_PRIVATE (plugin); + + g_return_if_fail (NM_IS_VPN_SERVICE_PLUGIN (plugin)); + g_return_if_fail (config != NULL); + + priv->got_config = TRUE; + + (void) g_variant_lookup (config, NM_VPN_PLUGIN_CONFIG_HAS_IP4, "b", &priv->has_ip4); + (void) g_variant_lookup (config, NM_VPN_PLUGIN_CONFIG_HAS_IP6, "b", &priv->has_ip6); + + g_warn_if_fail (priv->has_ip4 || priv->has_ip6); + + /* Record the items that need to also be inserted into the + * ip4config, for compatibility with older daemons. + */ + if (priv->banner) + g_variant_unref (priv->banner); + priv->banner = g_variant_lookup_value (config, NM_VPN_PLUGIN_CONFIG_BANNER, + G_VARIANT_TYPE ("s")); + if (priv->tundev) + g_variant_unref (priv->tundev); + priv->tundev = g_variant_lookup_value (config, NM_VPN_PLUGIN_CONFIG_TUNDEV, + G_VARIANT_TYPE ("s")); + if (priv->gateway) + g_variant_unref (priv->gateway); + priv->gateway = g_variant_lookup_value (config, NM_VPN_PLUGIN_CONFIG_EXT_GATEWAY, + G_VARIANT_TYPE ("u")); + if (priv->mtu) + g_variant_unref (priv->mtu); + priv->mtu = g_variant_lookup_value (config, NM_VPN_PLUGIN_CONFIG_MTU, + G_VARIANT_TYPE ("u")); + + g_signal_emit (plugin, signals[CONFIG], 0, config); + nmdbus_vpn_plugin_emit_config (priv->dbus_vpn_service_plugin, config); +} + +void +nm_vpn_service_plugin_set_ip4_config (NMVpnServicePlugin *plugin, + GVariant *ip4_config) +{ + NMVpnServicePluginPrivate *priv = NM_VPN_SERVICE_PLUGIN_GET_PRIVATE (plugin); + GVariant *combined_config; + GVariantBuilder builder; + GVariantIter iter; + const char *key; + GVariant *value; + + g_return_if_fail (NM_IS_VPN_SERVICE_PLUGIN (plugin)); + g_return_if_fail (ip4_config != NULL); + + priv->got_ip4 = TRUE; + + /* Old plugins won't send the "config" signal and thus can't send + * NM_VPN_SERVICE_PLUGIN_CONFIG_HAS_IP4 either. But since they don't support IPv6, + * we can safely assume that, if we don't receive a "config" signal but do + * receive an "ip4-config" signal, the old plugin supports IPv4. + */ + if (!priv->got_config) + priv->has_ip4 = TRUE; + + /* Older NetworkManager daemons expect all config info to be in + * the ip4 config, so they won't even notice the "config" signal + * being emitted. So just copy all of that data into the ip4 + * config too. + */ + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); + g_variant_iter_init (&iter, ip4_config); + while (g_variant_iter_next (&iter, "{&sv}", &key, &value)) { + g_variant_builder_add (&builder, "{sv}", key, value); + g_variant_unref (value); + } + + if (priv->banner) + g_variant_builder_add (&builder, "{sv}", NM_VPN_PLUGIN_IP4_CONFIG_BANNER, priv->banner); + if (priv->tundev) + g_variant_builder_add (&builder, "{sv}", NM_VPN_PLUGIN_IP4_CONFIG_TUNDEV, priv->tundev); + if (priv->gateway) + g_variant_builder_add (&builder, "{sv}", NM_VPN_PLUGIN_IP4_CONFIG_EXT_GATEWAY, priv->gateway); + if (priv->mtu) + g_variant_builder_add (&builder, "{sv}", NM_VPN_PLUGIN_IP4_CONFIG_MTU, priv->mtu); + + combined_config = g_variant_builder_end (&builder); + g_variant_ref_sink (combined_config); + g_signal_emit (plugin, signals[IP4_CONFIG], 0, combined_config); + nmdbus_vpn_plugin_emit_ip4_config (priv->dbus_vpn_service_plugin, combined_config); + g_variant_unref (combined_config); + + if ( priv->has_ip4 == priv->got_ip4 + && priv->has_ip6 == priv->got_ip6) + nm_vpn_service_plugin_set_state (plugin, NM_VPN_SERVICE_STATE_STARTED); +} + +void +nm_vpn_service_plugin_set_ip6_config (NMVpnServicePlugin *plugin, + GVariant *ip6_config) +{ + NMVpnServicePluginPrivate *priv = NM_VPN_SERVICE_PLUGIN_GET_PRIVATE (plugin); + + g_return_if_fail (NM_IS_VPN_SERVICE_PLUGIN (plugin)); + g_return_if_fail (ip6_config != NULL); + + g_variant_ref_sink (ip6_config); + + priv->got_ip6 = TRUE; + g_signal_emit (plugin, signals[IP6_CONFIG], 0, ip6_config); + nmdbus_vpn_plugin_emit_ip6_config (priv->dbus_vpn_service_plugin, ip6_config); + + g_variant_unref (ip6_config); + + if ( priv->has_ip4 == priv->got_ip4 + && priv->has_ip6 == priv->got_ip6) + nm_vpn_service_plugin_set_state (plugin, NM_VPN_SERVICE_STATE_STARTED); +} + +static void +connect_timer_start (NMVpnServicePlugin *plugin) +{ + NMVpnServicePluginPrivate *priv = NM_VPN_SERVICE_PLUGIN_GET_PRIVATE (plugin); + + nm_clear_g_source (&priv->connect_timer); + priv->connect_timer = g_timeout_add_seconds (60, connect_timer_expired, plugin); +} + +static void +peer_vanished (GDBusConnection *connection, + const gchar *sender_name, + const gchar *object_path, + const gchar *interface_name, + const gchar *signal_name, + GVariant *parameters, + gpointer user_data) +{ + nm_vpn_service_plugin_disconnect (NM_VPN_SERVICE_PLUGIN (user_data), NULL); +} + +static guint +watch_peer (NMVpnServicePlugin *plugin, + GDBusMethodInvocation *context) +{ + GDBusConnection *connection = g_dbus_method_invocation_get_connection (context); + const gchar *peer = g_dbus_message_get_sender (g_dbus_method_invocation_get_message (context)); + + return g_dbus_connection_signal_subscribe (connection, + "org.freedesktop.DBus", + "org.freedesktop.DBus", + "NameOwnerChanged", + "/org/freedesktop/DBus", + peer, + G_DBUS_SIGNAL_FLAGS_NONE, + peer_vanished, + plugin, + NULL); +} + +static void +_connect_generic (NMVpnServicePlugin *plugin, + GDBusMethodInvocation *context, + GVariant *properties, + GVariant *details) +{ + NMVpnServicePluginPrivate *priv = NM_VPN_SERVICE_PLUGIN_GET_PRIVATE (plugin); + NMVpnServicePluginClass *vpn_class = NM_VPN_SERVICE_PLUGIN_GET_CLASS (plugin); + NMConnection *connection; + gboolean success = FALSE; + GError *error = NULL; + + if (priv->state != NM_VPN_SERVICE_STATE_STOPPED && + priv->state != NM_VPN_SERVICE_STATE_INIT) { + g_dbus_method_invocation_return_error (context, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_WRONG_STATE, + "Could not start connection: wrong plugin state %d", + priv->state); + return; + } + + connection = nm_simple_connection_new_from_dbus (properties, &error); + if (!connection) { + g_dbus_method_invocation_return_error (context, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_BAD_ARGUMENTS, + "Invalid connection: (%d) %s", + error->code, error->message); + g_clear_error (&error); + return; + } + + priv->interactive = FALSE; + if (details && !vpn_class->connect_interactive) { + g_dbus_method_invocation_return_error (context, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_INTERACTIVE_NOT_SUPPORTED, + "Plugin does not implement ConnectInteractive()"); + return; + } + + nm_vpn_service_plugin_set_state (plugin, NM_VPN_SERVICE_STATE_STARTING); + + if (priv->dbus_watch_peer) + priv->peer_watch_id = watch_peer (plugin, context); + + if (details) { + priv->interactive = TRUE; + success = vpn_class->connect_interactive (plugin, connection, details, &error); + } else + success = vpn_class->connect (plugin, connection, &error); + + if (success) { + g_dbus_method_invocation_return_value (context, NULL); + + /* Add a timer to make sure we do not wait indefinitely for the successful connect. */ + connect_timer_start (plugin); + } else { + g_dbus_method_invocation_take_error (context, error); + + /* Stop the plugin from an idle handler so that the Connect + * method return gets sent before the STOP StateChanged signal. + */ + schedule_fail_stop (plugin); + } + + g_object_unref (connection); +} + +static void +impl_vpn_service_plugin_connect (NMVpnServicePlugin *plugin, + GDBusMethodInvocation *context, + GVariant *connection, + gpointer user_data) +{ + _connect_generic (plugin, context, connection, NULL); +} + +static void +impl_vpn_service_plugin_connect_interactive (NMVpnServicePlugin *plugin, + GDBusMethodInvocation *context, + GVariant *connection, + GVariant *details, + gpointer user_data) +{ + _connect_generic (plugin, context, connection, details); +} + +/***************************************************************/ + +static void +impl_vpn_service_plugin_need_secrets (NMVpnServicePlugin *plugin, + GDBusMethodInvocation *context, + GVariant *properties, + gpointer user_data) +{ + NMConnection *connection; + const char *setting_name; + gboolean needed; + GError *error = NULL; + + connection = nm_simple_connection_new_from_dbus (properties, &error); + if (!connection) { + g_dbus_method_invocation_return_error (context, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_INVALID_CONNECTION, + "The connection was invalid: %s", + error->message); + g_error_free (error); + return; + } + + if (!NM_VPN_SERVICE_PLUGIN_GET_CLASS (plugin)->need_secrets) { + g_dbus_method_invocation_return_value (context, + g_variant_new ("(s)", "")); + return; + } + + needed = NM_VPN_SERVICE_PLUGIN_GET_CLASS (plugin)->need_secrets (plugin, connection, &setting_name, &error); + if (error) { + g_dbus_method_invocation_take_error (context, error); + return; + } + + if (needed) { + /* Push back the quit timer so the VPN plugin doesn't quit in the + * middle of asking the user for secrets. + */ + schedule_quit_timer (plugin); + + g_assert (setting_name); + g_dbus_method_invocation_return_value (context, + g_variant_new ("(s)", setting_name)); + } else { + /* No secrets required */ + g_dbus_method_invocation_return_value (context, + g_variant_new ("(s)", "")); + } +} + +static void +impl_vpn_service_plugin_new_secrets (NMVpnServicePlugin *plugin, + GDBusMethodInvocation *context, + GVariant *properties, + gpointer user_data) +{ + NMVpnServicePluginPrivate *priv = NM_VPN_SERVICE_PLUGIN_GET_PRIVATE (plugin); + NMConnection *connection; + GError *error = NULL; + gboolean success; + + if (priv->state != NM_VPN_SERVICE_STATE_STARTING) { + g_dbus_method_invocation_return_error (context, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_WRONG_STATE, + "Could not accept new secrets: wrong plugin state %d", + priv->state); + return; + } + + connection = nm_simple_connection_new_from_dbus (properties, &error); + if (!connection) { + g_dbus_method_invocation_return_error (context, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_BAD_ARGUMENTS, + "Invalid connection: (%d) %s", + error->code, error->message); + g_clear_error (&error); + return; + } + + if (!NM_VPN_SERVICE_PLUGIN_GET_CLASS (plugin)->new_secrets) { + g_dbus_method_invocation_return_error (context, + NM_VPN_PLUGIN_ERROR, + NM_VPN_PLUGIN_ERROR_INTERACTIVE_NOT_SUPPORTED, + "Could not accept new secrets: plugin cannot process interactive secrets"); + g_object_unref (connection); + return; + } + + success = NM_VPN_SERVICE_PLUGIN_GET_CLASS (plugin)->new_secrets (plugin, connection, &error); + if (success) { + g_dbus_method_invocation_return_value (context, NULL); + + /* Add a timer to make sure we do not wait indefinitely for the successful connect. */ + connect_timer_start (plugin); + } else { + g_dbus_method_invocation_take_error (context, error); + + /* Stop the plugin from and idle handler so that the NewSecrets + * method return gets sent before the STOP StateChanged signal. + */ + schedule_fail_stop (plugin); + } + + g_object_unref (connection); +} + +/** + * nm_vpn_service_plugin_secrets_required: + * @plugin: the #NMVpnServicePlugin + * @message: an information message about why secrets are required, if any + * @hints: VPN specific secret names for required new secrets + * + * Called by VPN plugin implementations to signal to NetworkManager that secrets + * are required during the connection process. This signal may be used to + * request new secrets when the secrets originally provided by NetworkManager + * are insufficient, or the VPN process indicates that it needs additional + * information to complete the request. + * + * Since: 1.2 + */ +void +nm_vpn_service_plugin_secrets_required (NMVpnServicePlugin *plugin, + const char *message, + const char **hints) +{ + NMVpnServicePluginPrivate *priv = NM_VPN_SERVICE_PLUGIN_GET_PRIVATE (plugin); + + /* Plugin must be able to accept the new secrets if it calls this method */ + g_return_if_fail (NM_VPN_SERVICE_PLUGIN_GET_CLASS (plugin)->new_secrets); + + /* Plugin cannot call this method if NetworkManager didn't originally call + * ConnectInteractive(). + */ + g_return_if_fail (priv->interactive == TRUE); + + /* Cancel the connect timer since secrets might take a while. It'll + * get restarted when the secrets come back via NewSecrets(). + */ + nm_clear_g_source (&priv->connect_timer); + + g_signal_emit (plugin, signals[SECRETS_REQUIRED], 0, message, hints); + nmdbus_vpn_plugin_emit_secrets_required (priv->dbus_vpn_service_plugin, message, hints); +} + +/***************************************************************/ + +#define DATA_KEY_TAG "DATA_KEY=" +#define DATA_VAL_TAG "DATA_VAL=" +#define SECRET_KEY_TAG "SECRET_KEY=" +#define SECRET_VAL_TAG "SECRET_VAL=" + +static void +free_secret (gpointer data) +{ + char *secret = data; + + memset (secret, 0, strlen (secret)); + g_free (secret); +} + +/** + * nm_vpn_service_plugin_read_vpn_details: + * @fd: file descriptor to read from, usually stdin (0) + * @out_data: (out) (transfer full): on successful return, a hash table + * (mapping char*:char*) containing the key/value pairs of VPN data items + * @out_secrets: (out) (transfer full): on successful return, a hash table + * (mapping char*:char*) containing the key/value pairsof VPN secrets + * + * Parses key/value pairs from a file descriptor (normally stdin) passed by + * an applet when the applet calls the authentication dialog of the VPN plugin. + * + * Returns: %TRUE if reading values was successful, %FALSE if not + * + * Since: 1.2 + **/ +gboolean +nm_vpn_service_plugin_read_vpn_details (int fd, + GHashTable **out_data, + GHashTable **out_secrets) +{ + GHashTable *data, *secrets; + gboolean success = FALSE; + char *key = NULL, *val = NULL; + GString *line; + gchar c; + + if (out_data) + g_return_val_if_fail (*out_data == NULL, FALSE); + if (out_secrets) + g_return_val_if_fail (*out_secrets == NULL, FALSE); + + data = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); + secrets = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, free_secret); + + line = g_string_new (NULL); + + /* Read stdin for data and secret items until we get a DONE */ + while (1) { + ssize_t nr; + GHashTable *hash = NULL; + + errno = 0; + nr = read (fd, &c, 1); + if (nr == -1) { + if (errno == EAGAIN) { + g_usleep (100); + continue; + } + break; + } + + if (c != '\n') { + g_string_append_c (line, c); + continue; + } + + /* Check for the finish marker */ + if (strcmp (line->str, "DONE") == 0) + break; + + /* Otherwise it's a data/secret item */ + if (strncmp (line->str, DATA_KEY_TAG, strlen (DATA_KEY_TAG)) == 0) { + hash = data; + key = g_strdup (line->str + strlen (DATA_KEY_TAG)); + } else if (strncmp (line->str, DATA_VAL_TAG, strlen (DATA_VAL_TAG)) == 0) { + hash = data; + val = g_strdup (line->str + strlen (DATA_VAL_TAG)); + } else if (strncmp (line->str, SECRET_KEY_TAG, strlen (SECRET_KEY_TAG)) == 0) { + hash = secrets; + key = g_strdup (line->str + strlen (SECRET_KEY_TAG)); + } else if (strncmp (line->str, SECRET_VAL_TAG, strlen (SECRET_VAL_TAG)) == 0) { + hash = secrets; + val = g_strdup (line->str + strlen (SECRET_VAL_TAG)); + } + g_string_truncate (line, 0); + + if (key && val && hash) { + g_hash_table_insert (hash, key, val); + key = NULL; + val = NULL; + success = TRUE; /* Got at least one value */ + } + } + + if (success) { + if (out_data) + *out_data = data; + else + g_hash_table_destroy (data); + + if (out_secrets) + *out_secrets = secrets; + else + g_hash_table_destroy (secrets); + } else { + g_hash_table_destroy (data); + g_hash_table_destroy (secrets); + } + + g_string_free (line, TRUE); + return success; +} + +/** + * nm_vpn_service_plugin_get_secret_flags: + * @data: hash table containing VPN key/value pair data items + * @secret_name: VPN secret key name for which to retrieve flags for + * @out_flags: (out): on success, the flags associated with @secret_name + * + * Given a VPN secret key name, attempts to find the corresponding flags data + * item in @data. If found, converts the flags data item to + * #NMSettingSecretFlags and returns it. + * + * Returns: %TRUE if the flag data item was found and successfully converted + * to flags, %FALSE if not + * + * Since: 1.2 + **/ +gboolean +nm_vpn_service_plugin_get_secret_flags (GHashTable *data, + const char *secret_name, + NMSettingSecretFlags *out_flags) +{ + char *flag_name; + const char *val; + unsigned long tmp; + gboolean success = FALSE; + + g_return_val_if_fail (data != NULL, FALSE); + g_return_val_if_fail (secret_name != NULL, FALSE); + g_return_val_if_fail (out_flags != NULL, FALSE); + g_return_val_if_fail (*out_flags == NM_SETTING_SECRET_FLAG_NONE, FALSE); + + flag_name = g_strdup_printf ("%s-flags", secret_name); + + /* Try new flags value first */ + val = g_hash_table_lookup (data, flag_name); + if (val) { + errno = 0; + tmp = strtoul (val, NULL, 10); + if (errno == 0 && tmp <= NM_SETTING_SECRET_FLAGS_ALL) { + *out_flags = (NMSettingSecretFlags) tmp; + success = TRUE; + } + } + + g_free (flag_name); + return success; +} + +/***************************************************************/ + +static void +impl_vpn_service_plugin_disconnect (NMVpnServicePlugin *plugin, + GDBusMethodInvocation *context, + gpointer user_data) +{ + GError *error = NULL; + + if (nm_vpn_service_plugin_disconnect (plugin, &error)) + g_dbus_method_invocation_return_value (context, NULL); + else + g_dbus_method_invocation_take_error (context, error); +} + +static void +impl_vpn_service_plugin_set_config (NMVpnServicePlugin *plugin, + GDBusMethodInvocation *context, + GVariant *config, + gpointer user_data) +{ + nm_vpn_service_plugin_set_config (plugin, config); + g_dbus_method_invocation_return_value (context, NULL); +} + +static void +impl_vpn_service_plugin_set_ip4_config (NMVpnServicePlugin *plugin, + GDBusMethodInvocation *context, + GVariant *config, + gpointer user_data) +{ + nm_vpn_service_plugin_set_ip4_config (plugin, config); + g_dbus_method_invocation_return_value (context, NULL); +} + +static void +impl_vpn_service_plugin_set_ip6_config (NMVpnServicePlugin *plugin, + GDBusMethodInvocation *context, + GVariant *config, + gpointer user_data) +{ + nm_vpn_service_plugin_set_ip6_config (plugin, config); + g_dbus_method_invocation_return_value (context, NULL); +} + +static void +impl_vpn_service_plugin_set_failure (NMVpnServicePlugin *plugin, + GDBusMethodInvocation *context, + char *reason, + gpointer user_data) +{ + nm_vpn_service_plugin_failure (plugin, NM_VPN_PLUGIN_FAILURE_BAD_IP_CONFIG); + g_dbus_method_invocation_return_value (context, NULL); +} + +/*********************************************************************/ + +static void +sigterm_handler (int signum) +{ + g_slist_foreach (active_plugins, (GFunc) nm_vpn_service_plugin_emit_quit, NULL); +} + +static void +setup_unix_signal_handler (void) +{ + struct sigaction action; + sigset_t block_mask; + + action.sa_handler = sigterm_handler; + sigemptyset (&block_mask); + action.sa_mask = block_mask; + action.sa_flags = 0; + sigaction (SIGINT, &action, NULL); + sigaction (SIGTERM, &action, NULL); +} + +/*********************************************************************/ + +static void +one_plugin_destroyed (gpointer data, + GObject *object) +{ + active_plugins = g_slist_remove (active_plugins, object); +} + +static void +nm_vpn_service_plugin_init (NMVpnServicePlugin *plugin) +{ + active_plugins = g_slist_append (active_plugins, plugin); + g_object_weak_ref (G_OBJECT (plugin), + one_plugin_destroyed, + NULL); +} + +static gboolean +init_sync (GInitable *initable, GCancellable *cancellable, GError **error) +{ + NMVpnServicePlugin *plugin = NM_VPN_SERVICE_PLUGIN (initable); + NMVpnServicePluginPrivate *priv = NM_VPN_SERVICE_PLUGIN_GET_PRIVATE (plugin); + GDBusConnection *connection = NULL; + GDBusProxy *proxy; + GVariant *ret; + gboolean success = FALSE; + + if (!priv->dbus_service_name) { + g_set_error_literal (error, NM_VPN_PLUGIN_ERROR, NM_VPN_PLUGIN_ERROR_BAD_ARGUMENTS, + _("No service name specified")); + return FALSE; + } + + connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, error); + if (!connection) + return FALSE; + + proxy = g_dbus_proxy_new_sync (connection, + G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES | + G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS, + NULL, + DBUS_SERVICE_DBUS, + DBUS_PATH_DBUS, + DBUS_INTERFACE_DBUS, + cancellable, error); + if (!proxy) + goto out; + + ret = g_dbus_proxy_call_sync (proxy, + "RequestName", + g_variant_new ("(su)", priv->dbus_service_name, 0), + G_DBUS_CALL_FLAGS_NONE, -1, + cancellable, error); + g_object_unref (proxy); + if (!ret) { + if (error && *error) + g_dbus_error_strip_remote_error (*error); + goto out; + } + g_variant_unref (ret); + + priv->dbus_vpn_service_plugin = nmdbus_vpn_plugin_skeleton_new (); + if (!g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (priv->dbus_vpn_service_plugin), + connection, + NM_VPN_DBUS_PLUGIN_PATH, + error)) + goto out; + + _nm_dbus_bind_properties (plugin, priv->dbus_vpn_service_plugin); + _nm_dbus_bind_methods (plugin, priv->dbus_vpn_service_plugin, + "Connect", impl_vpn_service_plugin_connect, + "ConnectInteractive", impl_vpn_service_plugin_connect_interactive, + "NeedSecrets", impl_vpn_service_plugin_need_secrets, + "NewSecrets", impl_vpn_service_plugin_new_secrets, + "Disconnect", impl_vpn_service_plugin_disconnect, + "SetConfig", impl_vpn_service_plugin_set_config, + "SetIp4Config", impl_vpn_service_plugin_set_ip4_config, + "SetIp6Config", impl_vpn_service_plugin_set_ip6_config, + "SetFailure", impl_vpn_service_plugin_set_failure, + NULL); + + nm_vpn_service_plugin_set_connection (plugin, connection); + nm_vpn_service_plugin_set_state (plugin, NM_VPN_SERVICE_STATE_INIT); + + success = TRUE; + + out: + g_clear_object (&connection); + + return success; +} + +static void +set_property (GObject *object, guint prop_id, + const GValue *value, GParamSpec *pspec) +{ + NMVpnServicePluginPrivate *priv = NM_VPN_SERVICE_PLUGIN_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_DBUS_SERVICE_NAME: + /* Construct-only */ + priv->dbus_service_name = g_value_dup_string (value); + break; + case PROP_DBUS_WATCH_PEER: + /* Construct-only */ + priv->dbus_watch_peer = g_value_get_boolean (value); + break; + case PROP_STATE: + nm_vpn_service_plugin_set_state (NM_VPN_SERVICE_PLUGIN (object), + (NMVpnServiceState) g_value_get_enum (value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +get_property (GObject *object, guint prop_id, + GValue *value, GParamSpec *pspec) +{ + NMVpnServicePluginPrivate *priv = NM_VPN_SERVICE_PLUGIN_GET_PRIVATE (object); + + switch (prop_id) { + case PROP_DBUS_SERVICE_NAME: + g_value_set_string (value, priv->dbus_service_name); + break; + case PROP_DBUS_WATCH_PEER: + g_value_set_boolean (value, priv->dbus_watch_peer); + break; + case PROP_STATE: + g_value_set_enum (value, nm_vpn_service_plugin_get_state (NM_VPN_SERVICE_PLUGIN (object))); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } +} + +static void +dispose (GObject *object) +{ + NMVpnServicePlugin *plugin = NM_VPN_SERVICE_PLUGIN (object); + NMVpnServicePluginPrivate *priv = NM_VPN_SERVICE_PLUGIN_GET_PRIVATE (plugin); + NMVpnServiceState state; + GError *err = NULL; + + nm_clear_g_source (&priv->fail_stop_id); + nm_clear_g_source (&priv->quit_timer); + nm_clear_g_source (&priv->connect_timer); + + state = nm_vpn_service_plugin_get_state (plugin); + + if (state == NM_VPN_SERVICE_STATE_STARTED || + state == NM_VPN_SERVICE_STATE_STARTING) + nm_vpn_service_plugin_disconnect (plugin, &err); + + if (err) { + g_warning ("Error disconnecting VPN connection: %s", err->message); + g_error_free (err); + } + + G_OBJECT_CLASS (nm_vpn_service_plugin_parent_class)->dispose (object); +} + +static void +finalize (GObject *object) +{ + NMVpnServicePlugin *plugin = NM_VPN_SERVICE_PLUGIN (object); + NMVpnServicePluginPrivate *priv = NM_VPN_SERVICE_PLUGIN_GET_PRIVATE (plugin); + + nm_vpn_service_plugin_set_connection (plugin, NULL); + g_free (priv->dbus_service_name); + + g_clear_pointer (&priv->banner, g_variant_unref); + g_clear_pointer (&priv->tundev, g_variant_unref); + g_clear_pointer (&priv->gateway, g_variant_unref); + g_clear_pointer (&priv->mtu, g_variant_unref); + + G_OBJECT_CLASS (nm_vpn_service_plugin_parent_class)->finalize (object); +} + +static void +state_changed (NMVpnServicePlugin *plugin, NMVpnServiceState state) +{ + NMVpnServicePluginPrivate *priv = NM_VPN_SERVICE_PLUGIN_GET_PRIVATE (plugin); + + switch (state) { + case NM_VPN_SERVICE_STATE_STARTING: + nm_clear_g_source (&priv->quit_timer); + nm_clear_g_source (&priv->fail_stop_id); + break; + case NM_VPN_SERVICE_STATE_STOPPED: + if (priv->dbus_watch_peer) + nm_vpn_service_plugin_emit_quit (plugin); + else + schedule_quit_timer (plugin); + if (priv->peer_watch_id) { + g_dbus_connection_signal_unsubscribe (nm_vpn_service_plugin_get_connection (plugin), + priv->peer_watch_id); + priv->peer_watch_id = 0; + } + break; + default: + /* Clean up all timers we might have set up. */ + nm_clear_g_source (&priv->connect_timer); + nm_clear_g_source (&priv->quit_timer); + nm_clear_g_source (&priv->fail_stop_id); + break; + } +} + +static void +nm_vpn_service_plugin_class_init (NMVpnServicePluginClass *plugin_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (plugin_class); + + g_type_class_add_private (object_class, sizeof (NMVpnServicePluginPrivate)); + + /* virtual methods */ + object_class->set_property = set_property; + object_class->get_property = get_property; + object_class->dispose = dispose; + object_class->finalize = finalize; + + plugin_class->state_changed = state_changed; + + /* properties */ + + /** + * NMVpnServicePlugin:service-name: + * + * The D-Bus service name of this plugin. + * + * Since: 1.2 + */ + g_object_class_install_property + (object_class, PROP_DBUS_SERVICE_NAME, + g_param_spec_string (NM_VPN_SERVICE_PLUGIN_DBUS_SERVICE_NAME, "", "", + NULL, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY | + G_PARAM_STATIC_STRINGS)); + + /** + * NMVpnServicePlugin:watch-peer: + * + * Whether to watch for D-Bus peer's changes. + * + * Since: 1.2 + */ + g_object_class_install_property + (object_class, PROP_DBUS_WATCH_PEER, + g_param_spec_boolean (NM_VPN_SERVICE_PLUGIN_DBUS_WATCH_PEER, "", "", + FALSE, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT_ONLY)); + + /** + * NMVpnServicePlugin:state: + * + * The state of the plugin. + * + * Since: 1.2 + */ + g_object_class_install_property + (object_class, PROP_STATE, + g_param_spec_enum (NM_VPN_SERVICE_PLUGIN_STATE, "", "", + NM_TYPE_VPN_SERVICE_STATE, + NM_VPN_SERVICE_STATE_INIT, + G_PARAM_READWRITE | + G_PARAM_STATIC_STRINGS)); + + /* signals */ + signals[STATE_CHANGED] = + g_signal_new ("state-changed", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMVpnServicePluginClass, state_changed), + NULL, NULL, + NULL, + G_TYPE_NONE, 1, + G_TYPE_UINT); + + signals[SECRETS_REQUIRED] = + g_signal_new ("secrets-required", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + 0, NULL, NULL, + NULL, + G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRV); + + signals[CONFIG] = + g_signal_new ("config", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMVpnServicePluginClass, config), + NULL, NULL, + NULL, + G_TYPE_NONE, 1, + G_TYPE_VARIANT); + + signals[IP4_CONFIG] = + g_signal_new ("ip4-config", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMVpnServicePluginClass, ip4_config), + NULL, NULL, + NULL, + G_TYPE_NONE, 1, + G_TYPE_VARIANT); + + signals[IP6_CONFIG] = + g_signal_new ("ip6-config", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMVpnServicePluginClass, ip6_config), + NULL, NULL, + NULL, + G_TYPE_NONE, 1, + G_TYPE_VARIANT); + + signals[LOGIN_BANNER] = + g_signal_new ("login-banner", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMVpnServicePluginClass, login_banner), + NULL, NULL, + NULL, + G_TYPE_NONE, 1, + G_TYPE_STRING); + + signals[FAILURE] = + g_signal_new ("failure", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMVpnServicePluginClass, failure), + NULL, NULL, + NULL, + G_TYPE_NONE, 1, + G_TYPE_UINT); + + signals[QUIT] = + g_signal_new ("quit", + G_OBJECT_CLASS_TYPE (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (NMVpnServicePluginClass, quit), + NULL, NULL, + NULL, + G_TYPE_NONE, 0, + G_TYPE_NONE); + + setup_unix_signal_handler (); +} + +static void +nm_vpn_service_plugin_initable_iface_init (GInitableIface *iface) +{ + iface->init = init_sync; +} diff --git a/libnm/nm-vpn-service-plugin.h b/libnm/nm-vpn-service-plugin.h new file mode 100644 index 00000000..f8b4ff87 --- /dev/null +++ b/libnm/nm-vpn-service-plugin.h @@ -0,0 +1,160 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2007 - 2008 Novell, Inc. + * Copyright 2007 - 2015 Red Hat, Inc. + */ + +#ifndef __NM_VPN_SERVICE_PLUGIN_H__ +#define __NM_VPN_SERVICE_PLUGIN_H__ + +#include +#include +#include + +G_BEGIN_DECLS + +#define NM_TYPE_VPN_SERVICE_PLUGIN (nm_vpn_service_plugin_get_type ()) +#define NM_VPN_SERVICE_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_VPN_SERVICE_PLUGIN, NMVpnServicePlugin)) +#define NM_VPN_SERVICE_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_VPN_SERVICE_PLUGIN, NMVpnServicePluginClass)) +#define NM_IS_VPN_SERVICE_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_VPN_SERVICE_PLUGIN)) +#define NM_IS_VPN_SERVICE_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_VPN_SERVICE_PLUGIN)) +#define NM_VPN_SERVICE_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_VPN_SERVICE_PLUGIN, NMVpnServicePluginClass)) + +#define NM_VPN_SERVICE_PLUGIN_DBUS_SERVICE_NAME "service-name" +#define NM_VPN_SERVICE_PLUGIN_DBUS_WATCH_PEER "watch-peer" +#define NM_VPN_SERVICE_PLUGIN_STATE "state" + +typedef struct { + NM_AVAILABLE_IN_1_2 + GObject parent; +} NMVpnServicePlugin NM_AVAILABLE_IN_1_2; + +typedef struct { + NM_AVAILABLE_IN_1_2 + GObjectClass parent; + + /* Signals */ + NM_AVAILABLE_IN_1_2 + void (*state_changed) (NMVpnServicePlugin *plugin, + NMVpnServiceState state); + + NM_AVAILABLE_IN_1_2 + void (*ip4_config) (NMVpnServicePlugin *plugin, + GVariant *ip4_config); + + NM_AVAILABLE_IN_1_2 + void (*login_banner) (NMVpnServicePlugin *plugin, + const char *banner); + + NM_AVAILABLE_IN_1_2 + void (*failure) (NMVpnServicePlugin *plugin, + NMVpnPluginFailure reason); + + NM_AVAILABLE_IN_1_2 + void (*quit) (NMVpnServicePlugin *plugin); + + NM_AVAILABLE_IN_1_2 + void (*config) (NMVpnServicePlugin *plugin, + GVariant *config); + + NM_AVAILABLE_IN_1_2 + void (*ip6_config) (NMVpnServicePlugin *plugin, + GVariant *config); + + /* virtual methods */ + NM_AVAILABLE_IN_1_2 + gboolean (*connect) (NMVpnServicePlugin *plugin, + NMConnection *connection, + GError **err); + + NM_AVAILABLE_IN_1_2 + gboolean (*need_secrets) (NMVpnServicePlugin *plugin, + NMConnection *connection, + const char **setting_name, + GError **error); + + NM_AVAILABLE_IN_1_2 + gboolean (*disconnect) (NMVpnServicePlugin *plugin, + GError **err); + + NM_AVAILABLE_IN_1_2 + gboolean (*new_secrets) (NMVpnServicePlugin *plugin, + NMConnection *connection, + GError **error); + + NM_AVAILABLE_IN_1_2 + gboolean (*connect_interactive) (NMVpnServicePlugin *plugin, + NMConnection *connection, + GVariant *details, + GError **error); + + /*< private >*/ + NM_AVAILABLE_IN_1_2 + gpointer padding[8]; +} NMVpnServicePluginClass NM_AVAILABLE_IN_1_2; + +NM_AVAILABLE_IN_1_2 +GType nm_vpn_service_plugin_get_type (void); + +NM_AVAILABLE_IN_1_2 +GDBusConnection *nm_vpn_service_plugin_get_connection (NMVpnServicePlugin *plugin); + +NM_AVAILABLE_IN_1_2 +void nm_vpn_service_plugin_secrets_required (NMVpnServicePlugin *plugin, + const char *message, + const char **hints); + +NM_AVAILABLE_IN_1_2 +void nm_vpn_service_plugin_set_login_banner (NMVpnServicePlugin *plugin, + const char *banner); + +NM_AVAILABLE_IN_1_2 +void nm_vpn_service_plugin_failure (NMVpnServicePlugin *plugin, + NMVpnPluginFailure reason); + +NM_AVAILABLE_IN_1_2 +void nm_vpn_service_plugin_set_config (NMVpnServicePlugin *plugin, + GVariant *config); + +NM_AVAILABLE_IN_1_2 +void nm_vpn_service_plugin_set_ip4_config (NMVpnServicePlugin *plugin, + GVariant *ip4_config); + +NM_AVAILABLE_IN_1_2 +void nm_vpn_service_plugin_set_ip6_config (NMVpnServicePlugin *plugin, + GVariant *ip6_config); + +NM_AVAILABLE_IN_1_2 +gboolean nm_vpn_service_plugin_disconnect (NMVpnServicePlugin *plugin, + GError **err); + +/* Utility functions */ + +NM_AVAILABLE_IN_1_2 +gboolean nm_vpn_service_plugin_read_vpn_details (int fd, + GHashTable **out_data, + GHashTable **out_secrets); + +NM_AVAILABLE_IN_1_2 +gboolean nm_vpn_service_plugin_get_secret_flags (GHashTable *data, + const char *secret_name, + NMSettingSecretFlags *out_flags); + +G_END_DECLS + +#endif /* __NM_VPN_SERVICE_PLUGIN_H__ */ diff --git a/libnm/nm-wimax-nsp.c b/libnm/nm-wimax-nsp.c index 0fed1c6e..9fbc6ea1 100644 --- a/libnm/nm-wimax-nsp.c +++ b/libnm/nm-wimax-nsp.c @@ -22,12 +22,11 @@ #include -#include "nm-glib-compat.h" - #include #include #include +#include "nm-default.h" #include "nm-wimax-nsp.h" #include "nm-dbus-interface.h" #include "nm-object-private.h" diff --git a/libnm/tests/Makefile.am b/libnm/tests/Makefile.am index 0acbae8f..ddcf50be 100644 --- a/libnm/tests/Makefile.am +++ b/libnm/tests/Makefile.am @@ -1,13 +1,13 @@ if ENABLE_TESTS AM_CPPFLAGS = \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include \ + -I$(top_srcdir)/shared \ + -I$(top_builddir)/shared \ -I$(top_srcdir)/libnm \ -I$(top_builddir)/libnm \ -I$(top_srcdir)/libnm-core \ -I$(top_builddir)/libnm-core \ - -DNETWORKMANAGER_COMPILATION \ + -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB \ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ -DTEST_NM_SERVICE=\"$(abs_top_srcdir)/tools/test-networkmanager-service.py\" \ $(GLIB_CFLAGS) @@ -26,18 +26,18 @@ endif TESTS = test-nm-client test-remote-settings-client test-secret-agent test_nm_client_SOURCES = \ - common.c \ - common.h \ + $(top_builddir)/shared/nm-test-utils-impl.c \ + $(top_builddir)/shared/nm-test-libnm-utils.h \ test-nm-client.c test_remote_settings_client_SOURCES = \ - common.c \ - common.h \ + $(top_builddir)/shared/nm-test-utils-impl.c \ + $(top_builddir)/shared/nm-test-libnm-utils.h \ test-remote-settings-client.c test_secret_agent_SOURCES = \ - common.c \ - common.h \ + $(top_builddir)/shared/nm-test-utils-impl.c \ + $(top_builddir)/shared/nm-test-libnm-utils.h \ test-secret-agent.c endif diff --git a/libnm/tests/Makefile.in b/libnm/tests/Makefile.in index 0ced3864..0b553a78 100644 --- a/libnm/tests/Makefile.in +++ b/libnm/tests/Makefile.in @@ -118,8 +118,11 @@ CONFIG_CLEAN_VPATH_FILES = @ENABLE_TESTS_TRUE@ test-remote-settings-client$(EXEEXT) \ @ENABLE_TESTS_TRUE@ test-secret-agent$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) -am__test_nm_client_SOURCES_DIST = common.c common.h test-nm-client.c -@ENABLE_TESTS_TRUE@am_test_nm_client_OBJECTS = common.$(OBJEXT) \ +am__test_nm_client_SOURCES_DIST = \ + $(top_builddir)/shared/nm-test-utils-impl.c \ + $(top_builddir)/shared/nm-test-libnm-utils.h test-nm-client.c +@ENABLE_TESTS_TRUE@am_test_nm_client_OBJECTS = \ +@ENABLE_TESTS_TRUE@ nm-test-utils-impl.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ test-nm-client.$(OBJEXT) test_nm_client_OBJECTS = $(am_test_nm_client_OBJECTS) test_nm_client_LDADD = $(LDADD) @@ -131,10 +134,12 @@ AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = -am__test_remote_settings_client_SOURCES_DIST = common.c common.h \ +am__test_remote_settings_client_SOURCES_DIST = \ + $(top_builddir)/shared/nm-test-utils-impl.c \ + $(top_builddir)/shared/nm-test-libnm-utils.h \ test-remote-settings-client.c @ENABLE_TESTS_TRUE@am_test_remote_settings_client_OBJECTS = \ -@ENABLE_TESTS_TRUE@ common.$(OBJEXT) \ +@ENABLE_TESTS_TRUE@ nm-test-utils-impl.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ test-remote-settings-client.$(OBJEXT) test_remote_settings_client_OBJECTS = \ $(am_test_remote_settings_client_OBJECTS) @@ -142,9 +147,12 @@ test_remote_settings_client_LDADD = $(LDADD) @ENABLE_TESTS_TRUE@test_remote_settings_client_DEPENDENCIES = \ @ENABLE_TESTS_TRUE@ $(top_builddir)/libnm/libnm.la \ @ENABLE_TESTS_TRUE@ $(am__DEPENDENCIES_1) -am__test_secret_agent_SOURCES_DIST = common.c common.h \ +am__test_secret_agent_SOURCES_DIST = \ + $(top_builddir)/shared/nm-test-utils-impl.c \ + $(top_builddir)/shared/nm-test-libnm-utils.h \ test-secret-agent.c -@ENABLE_TESTS_TRUE@am_test_secret_agent_OBJECTS = common.$(OBJEXT) \ +@ENABLE_TESTS_TRUE@am_test_secret_agent_OBJECTS = \ +@ENABLE_TESTS_TRUE@ nm-test-utils-impl.$(OBJEXT) \ @ENABLE_TESTS_TRUE@ test-secret-agent.$(OBJEXT) test_secret_agent_OBJECTS = $(am_test_secret_agent_OBJECTS) test_secret_agent_LDADD = $(LDADD) @@ -437,7 +445,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -449,8 +456,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -460,6 +465,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -514,16 +520,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -560,6 +563,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -588,7 +593,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -603,6 +607,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -663,6 +669,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -670,6 +677,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -686,13 +694,13 @@ with_netconfig = @with_netconfig@ with_resolvconf = @with_resolvconf@ with_valgrind = @with_valgrind@ @ENABLE_TESTS_TRUE@AM_CPPFLAGS = \ -@ENABLE_TESTS_TRUE@ -I$(top_srcdir)/include \ -@ENABLE_TESTS_TRUE@ -I$(top_builddir)/include \ +@ENABLE_TESTS_TRUE@ -I$(top_srcdir)/shared \ +@ENABLE_TESTS_TRUE@ -I$(top_builddir)/shared \ @ENABLE_TESTS_TRUE@ -I$(top_srcdir)/libnm \ @ENABLE_TESTS_TRUE@ -I$(top_builddir)/libnm \ @ENABLE_TESTS_TRUE@ -I$(top_srcdir)/libnm-core \ @ENABLE_TESTS_TRUE@ -I$(top_builddir)/libnm-core \ -@ENABLE_TESTS_TRUE@ -DNETWORKMANAGER_COMPILATION \ +@ENABLE_TESTS_TRUE@ -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB \ @ENABLE_TESTS_TRUE@ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ @ENABLE_TESTS_TRUE@ -DTEST_NM_SERVICE=\"$(abs_top_srcdir)/tools/test-networkmanager-service.py\" \ @ENABLE_TESTS_TRUE@ $(GLIB_CFLAGS) @@ -703,18 +711,18 @@ with_valgrind = @with_valgrind@ @ENABLE_TESTS_TRUE@@WITH_VALGRIND_FALSE@LOG_COMPILER = $(srcdir)/libnm-test-launch.sh @ENABLE_TESTS_TRUE@test_nm_client_SOURCES = \ -@ENABLE_TESTS_TRUE@ common.c \ -@ENABLE_TESTS_TRUE@ common.h \ +@ENABLE_TESTS_TRUE@ $(top_builddir)/shared/nm-test-utils-impl.c \ +@ENABLE_TESTS_TRUE@ $(top_builddir)/shared/nm-test-libnm-utils.h \ @ENABLE_TESTS_TRUE@ test-nm-client.c @ENABLE_TESTS_TRUE@test_remote_settings_client_SOURCES = \ -@ENABLE_TESTS_TRUE@ common.c \ -@ENABLE_TESTS_TRUE@ common.h \ +@ENABLE_TESTS_TRUE@ $(top_builddir)/shared/nm-test-utils-impl.c \ +@ENABLE_TESTS_TRUE@ $(top_builddir)/shared/nm-test-libnm-utils.h \ @ENABLE_TESTS_TRUE@ test-remote-settings-client.c @ENABLE_TESTS_TRUE@test_secret_agent_SOURCES = \ -@ENABLE_TESTS_TRUE@ common.c \ -@ENABLE_TESTS_TRUE@ common.h \ +@ENABLE_TESTS_TRUE@ $(top_builddir)/shared/nm-test-utils-impl.c \ +@ENABLE_TESTS_TRUE@ $(top_builddir)/shared/nm-test-libnm-utils.h \ @ENABLE_TESTS_TRUE@ test-secret-agent.c EXTRA_DIST = libnm-test-launch.sh @@ -779,7 +787,7 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nm-test-utils-impl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-nm-client.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-remote-settings-client.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-secret-agent.Po@am__quote@ @@ -805,6 +813,20 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +nm-test-utils-impl.o: $(top_builddir)/shared/nm-test-utils-impl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nm-test-utils-impl.o -MD -MP -MF $(DEPDIR)/nm-test-utils-impl.Tpo -c -o nm-test-utils-impl.o `test -f '$(top_builddir)/shared/nm-test-utils-impl.c' || echo '$(srcdir)/'`$(top_builddir)/shared/nm-test-utils-impl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nm-test-utils-impl.Tpo $(DEPDIR)/nm-test-utils-impl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/shared/nm-test-utils-impl.c' object='nm-test-utils-impl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nm-test-utils-impl.o `test -f '$(top_builddir)/shared/nm-test-utils-impl.c' || echo '$(srcdir)/'`$(top_builddir)/shared/nm-test-utils-impl.c + +nm-test-utils-impl.obj: $(top_builddir)/shared/nm-test-utils-impl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT nm-test-utils-impl.obj -MD -MP -MF $(DEPDIR)/nm-test-utils-impl.Tpo -c -o nm-test-utils-impl.obj `if test -f '$(top_builddir)/shared/nm-test-utils-impl.c'; then $(CYGPATH_W) '$(top_builddir)/shared/nm-test-utils-impl.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/shared/nm-test-utils-impl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/nm-test-utils-impl.Tpo $(DEPDIR)/nm-test-utils-impl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/shared/nm-test-utils-impl.c' object='nm-test-utils-impl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o nm-test-utils-impl.obj `if test -f '$(top_builddir)/shared/nm-test-utils-impl.c'; then $(CYGPATH_W) '$(top_builddir)/shared/nm-test-utils-impl.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/shared/nm-test-utils-impl.c'; fi` + mostlyclean-libtool: -rm -f *.lo diff --git a/libnm/tests/common.c b/libnm/tests/common.c deleted file mode 100644 index 8c1b83a8..00000000 --- a/libnm/tests/common.c +++ /dev/null @@ -1,187 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* - * 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, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Copyright 2010 - 2014 Red Hat, Inc. - * - */ - -#include "config.h" - -#include -#include - -#include "NetworkManager.h" - -#include "common.h" - -static gboolean -name_exists (GDBusConnection *c, const char *name) -{ - GVariant *reply; - gboolean exists = FALSE; - - reply = g_dbus_connection_call_sync (c, - "org.freedesktop.DBus", - "/org/freedesktop/DBus", - "org.freedesktop.DBus", - "GetNameOwner", - g_variant_new ("(s)", name), - NULL, - G_DBUS_CALL_FLAGS_NO_AUTO_START, - -1, - NULL, - NULL); - if (reply != NULL) { - exists = TRUE; - g_variant_unref (reply); - } - - return exists; -} - -NMTestServiceInfo * -nm_test_service_init (void) -{ - NMTestServiceInfo *info; - const char *args[2] = { TEST_NM_SERVICE, NULL }; - GError *error = NULL; - int i; - - info = g_malloc0 (sizeof (*info)); - - info->bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error); - g_assert_no_error (error); - - /* Spawn the test service. info->keepalive_fd will be a pipe to the service's - * stdin; if it closes, the service will exit immediately. We use this to - * make sure the service exits if the test program crashes. - */ - g_spawn_async_with_pipes (NULL, (char **) args, NULL, 0, NULL, NULL, - &info->pid, &info->keepalive_fd, NULL, NULL, &error); - g_assert_no_error (error); - - /* Wait until the service is registered on the bus */ - for (i = 1000; i > 0; i--) { - if (name_exists (info->bus, "org.freedesktop.NetworkManager")) - break; - g_usleep (G_USEC_PER_SEC / 50); - } - g_assert (i > 0); - - /* Grab a proxy to our fake NM service to trigger tests */ - info->proxy = g_dbus_proxy_new_sync (info->bus, - G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES | - G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS | - G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, - NULL, - NM_DBUS_SERVICE, - NM_DBUS_PATH, - "org.freedesktop.NetworkManager.LibnmGlibTest", - NULL, &error); - g_assert_no_error (error); - - return info; -} - -void -nm_test_service_cleanup (NMTestServiceInfo *info) -{ - int i; - - g_object_unref (info->proxy); - kill (info->pid, SIGTERM); - - /* Wait until the bus notices the service is gone */ - for (i = 100; i > 0; i--) { - if (!name_exists (info->bus, "org.freedesktop.NetworkManager")) - break; - g_usleep (G_USEC_PER_SEC / 50); - } - g_assert (i > 0); - - g_object_unref (info->bus); - close (info->keepalive_fd); - - memset (info, 0, sizeof (*info)); - g_free (info); -} - -typedef struct { - GMainLoop *loop; - const char *ifname; - char *path; - NMDevice *device; -} AddDeviceInfo; - -static void -device_added_cb (NMClient *client, - NMDevice *device, - gpointer user_data) -{ - AddDeviceInfo *info = user_data; - - g_assert (device); - g_assert_cmpstr (nm_object_get_path (NM_OBJECT (device)), ==, info->path); - g_assert_cmpstr (nm_device_get_iface (device), ==, info->ifname); - - info->device = device; - g_main_loop_quit (info->loop); -} - -static gboolean -timeout (gpointer user_data) -{ - g_assert_not_reached (); - return G_SOURCE_REMOVE; -} - -NMDevice * -nm_test_service_add_device (NMTestServiceInfo *sinfo, NMClient *client, - const char *method, const char *ifname) -{ - AddDeviceInfo info; - GError *error = NULL; - GVariant *ret; - guint timeout_id; - - ret = g_dbus_proxy_call_sync (sinfo->proxy, - method, - g_variant_new ("(s)", ifname), - G_DBUS_CALL_FLAGS_NO_AUTO_START, - 3000, - NULL, - &error); - g_assert_no_error (error); - g_assert (ret); - g_assert_cmpstr (g_variant_get_type_string (ret), ==, "(o)"); - g_variant_get (ret, "(o)", &info.path); - g_variant_unref (ret); - - /* Wait for libnm to find the device */ - info.ifname = ifname; - info.loop = g_main_loop_new (NULL, FALSE); - g_signal_connect (client, "device-added", - G_CALLBACK (device_added_cb), &info); - timeout_id = g_timeout_add_seconds (5, timeout, NULL); - g_main_loop_run (info.loop); - - g_source_remove (timeout_id); - g_signal_handlers_disconnect_by_func (client, device_added_cb, &info); - g_free (info.path); - g_main_loop_unref (info.loop); - - return info.device; -} diff --git a/libnm/tests/common.h b/libnm/tests/common.h deleted file mode 100644 index aa15167b..00000000 --- a/libnm/tests/common.h +++ /dev/null @@ -1,37 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA. - * - * Copyright 2014 Red Hat, Inc. - */ - -#include -#include - -typedef struct { - GDBusConnection *bus; - GDBusProxy *proxy; - GPid pid; - int keepalive_fd; -} NMTestServiceInfo; - -NMTestServiceInfo *nm_test_service_init (void); -void nm_test_service_cleanup (NMTestServiceInfo *info); - -NMDevice *nm_test_service_add_device (NMTestServiceInfo *info, - NMClient *client, - const char *method, - const char *ifname); diff --git a/libnm/tests/test-nm-client.c b/libnm/tests/test-nm-client.c index 3541c741..5be69142 100644 --- a/libnm/tests/test-nm-client.c +++ b/libnm/tests/test-nm-client.c @@ -20,20 +20,14 @@ #include "config.h" -#include #include #include #include -#include -#include "nm-glib-compat.h" - -#include "common.h" - -#include "nm-test-utils.h" +#include "nm-test-libnm-utils.h" static GMainLoop *loop = NULL; -static NMTestServiceInfo *sinfo; +static NMTstcServiceInfo *sinfo; /*******************************************************************/ @@ -75,7 +69,7 @@ test_device_added (void) gboolean notified = FALSE; GError *error = NULL; - sinfo = nm_test_service_init (); + sinfo = nmtstc_service_init (); client = nm_client_new (NULL, &error); g_assert_no_error (error); @@ -88,7 +82,7 @@ test_device_added (void) ¬ified); /* Tell the test service to add a new device */ - nm_test_service_add_device (sinfo, client, "AddWiredDevice", "eth0"); + nmtstc_service_add_device (sinfo, client, "AddWiredDevice", "eth0"); /* coverity[loop_condition] */ while (!notified) @@ -109,7 +103,7 @@ test_device_added (void) g_assert_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_NOT_SOFTWARE); g_object_unref (client); - g_clear_pointer (&sinfo, nm_test_service_cleanup); + g_clear_pointer (&sinfo, nmtstc_service_cleanup); } /*******************************************************************/ @@ -167,7 +161,7 @@ test_device_added_signal_after_init (void) guint result = 0; GError *error = NULL; - sinfo = nm_test_service_init (); + sinfo = nmtstc_service_init (); client = nm_client_new (NULL, &error); g_assert_no_error (error); @@ -185,7 +179,7 @@ test_device_added_signal_after_init (void) &result); /* Tell the test service to add a new device */ - nm_test_service_add_device (sinfo, client, "AddWiredDevice", "eth0"); + nmtstc_service_add_device (sinfo, client, "AddWiredDevice", "eth0"); /* Ensure the 'device-added' signal doesn't show up before * the 'Devices' property change notification */ @@ -208,7 +202,7 @@ test_device_added_signal_after_init (void) g_assert_cmpstr (nm_device_get_iface (device), ==, "eth0"); g_object_unref (client); - g_clear_pointer (&sinfo, nm_test_service_cleanup); + g_clear_pointer (&sinfo, nmtstc_service_cleanup); } /*******************************************************************/ @@ -315,13 +309,13 @@ test_wifi_ap_added_removed (void) GError *error = NULL; char *expected_path = NULL; - sinfo = nm_test_service_init (); + sinfo = nmtstc_service_init (); client = nm_client_new (NULL, &error); g_assert_no_error (error); /*************************************/ /* Add the wifi device */ - wifi = (NMDeviceWifi *) nm_test_service_add_device (sinfo, client, "AddWifiDevice", "wlan0"); + wifi = (NMDeviceWifi *) nmtstc_service_add_device (sinfo, client, "AddWifiDevice", "wlan0"); g_assert (NM_IS_DEVICE_WIFI (wifi)); /*************************************/ @@ -407,7 +401,7 @@ test_wifi_ap_added_removed (void) g_free (expected_path); g_object_unref (client); - g_clear_pointer (&sinfo, nm_test_service_cleanup); + g_clear_pointer (&sinfo, nmtstc_service_cleanup); } /*******************************************************************/ @@ -514,13 +508,13 @@ test_wimax_nsp_added_removed (void) GError *error = NULL; char *expected_path = NULL; - sinfo = nm_test_service_init (); + sinfo = nmtstc_service_init (); client = nm_client_new (NULL, &error); g_assert_no_error (error); /*************************************/ /* Add the wimax device */ - wimax = (NMDeviceWimax *) nm_test_service_add_device (sinfo, client, "AddWimaxDevice", "wmx0"); + wimax = (NMDeviceWimax *) nmtstc_service_add_device (sinfo, client, "AddWimaxDevice", "wmx0"); g_assert (NM_IS_DEVICE_WIMAX (wimax)); /*************************************/ @@ -606,7 +600,7 @@ test_wimax_nsp_added_removed (void) g_free (expected_path); g_object_unref (client); - g_clear_pointer (&sinfo, nm_test_service_cleanup); + g_clear_pointer (&sinfo, nmtstc_service_cleanup); } /*******************************************************************/ @@ -690,7 +684,7 @@ test_devices_array (void) GError *error = NULL; GVariant *ret; - sinfo = nm_test_service_init (); + sinfo = nmtstc_service_init (); /* Make sure that we test the async codepath in at least one test... */ nm_client_new_async (NULL, new_client_cb, &client); @@ -699,9 +693,9 @@ test_devices_array (void) /*************************************/ /* Add some devices */ - wlan0 = nm_test_service_add_device (sinfo, client,"AddWifiDevice", "wlan0"); - eth0 = nm_test_service_add_device (sinfo, client, "AddWiredDevice", "eth0"); - eth1 = nm_test_service_add_device (sinfo, client, "AddWiredDevice", "eth1"); + wlan0 = nmtstc_service_add_device (sinfo, client,"AddWifiDevice", "wlan0"); + eth0 = nmtstc_service_add_device (sinfo, client, "AddWiredDevice", "eth0"); + eth1 = nmtstc_service_add_device (sinfo, client, "AddWiredDevice", "eth1"); /* Ensure the devices now exist */ devices = nm_client_get_devices (client); @@ -766,7 +760,7 @@ test_devices_array (void) g_assert (device == eth1); g_object_unref (client); - g_clear_pointer (&sinfo, nm_test_service_cleanup); + g_clear_pointer (&sinfo, nmtstc_service_cleanup); } static void @@ -805,7 +799,7 @@ test_client_nm_running (void) g_clear_error (&error); /* Now start the test service. */ - sinfo = nm_test_service_init (); + sinfo = nmtstc_service_init (); client2 = nm_client_new (NULL, &error); g_assert_no_error (error); @@ -824,7 +818,7 @@ test_client_nm_running (void) g_source_remove (quit_id); /* And kill it */ - g_clear_pointer (&sinfo, nm_test_service_cleanup); + g_clear_pointer (&sinfo, nmtstc_service_cleanup); g_assert (nm_client_get_nm_running (client1)); @@ -938,12 +932,12 @@ test_active_connections (void) TestACInfo info = { loop, NULL, 0 }; GError *error = NULL; - sinfo = nm_test_service_init (); + sinfo = nmtstc_service_init (); client = nm_client_new (NULL, &error); g_assert_no_error (error); /* Tell the test service to add a new device */ - device = nm_test_service_add_device (sinfo, client, "AddWiredDevice", "eth0"); + device = nmtstc_service_add_device (sinfo, client, "AddWiredDevice", "eth0"); conn = nmtst_create_minimal_connection ("test-ac", NULL, NM_SETTING_WIRED_SETTING_NAME, NULL); nm_client_add_and_activate_connection_async (client, conn, device, NULL, @@ -980,7 +974,7 @@ test_active_connections (void) assert_ac_and_device (client); g_object_unref (client); - g_clear_pointer (&sinfo, nm_test_service_cleanup); + g_clear_pointer (&sinfo, nmtstc_service_cleanup); } static void @@ -1068,11 +1062,11 @@ test_activate_virtual (void) TestConnectionInfo conn_info = { loop, NULL }; GError *error = NULL; - sinfo = nm_test_service_init (); + sinfo = nmtstc_service_init (); client = nm_client_new (NULL, &error); g_assert_no_error (error); - nm_test_service_add_device (sinfo, client, "AddWiredDevice", "eth0"); + nmtstc_service_add_device (sinfo, client, "AddWiredDevice", "eth0"); conn = nmtst_create_minimal_connection ("test-ac", NULL, NM_SETTING_VLAN_SETTING_NAME, &s_con); g_object_set (s_con, @@ -1113,7 +1107,7 @@ test_activate_virtual (void) g_object_unref (info.ac); g_object_unref (client); - g_clear_pointer (&sinfo, nm_test_service_cleanup); + g_clear_pointer (&sinfo, nmtstc_service_cleanup); } static void @@ -1141,11 +1135,11 @@ test_activate_failed (void) NMConnection *conn; GError *error = NULL; - sinfo = nm_test_service_init (); + sinfo = nmtstc_service_init (); client = nm_client_new (NULL, &error); g_assert_no_error (error); - device = nm_test_service_add_device (sinfo, client, "AddWiredDevice", "eth0"); + device = nmtstc_service_add_device (sinfo, client, "AddWiredDevice", "eth0"); /* Note that test-networkmanager-service.py checks for this exact name */ conn = nmtst_create_minimal_connection ("object-creation-failed-test", NULL, @@ -1158,7 +1152,315 @@ test_activate_failed (void) g_object_unref (conn); g_object_unref (client); - g_clear_pointer (&sinfo, nm_test_service_cleanup); + g_clear_pointer (&sinfo, nmtstc_service_cleanup); +} + +static void +test_device_connection_compatibility (void) +{ + NMClient *client; + NMDevice *device1, *device2; + NMConnection *conn; + NMSettingWired *s_wired; + GError *error = NULL; + const char *subchannels[] = { "0.0.8000", "0.0.8001", "0.0.8002", NULL }; + const char *subchannels_2[] = { "0.0.8000", "0.0.8001", NULL }; + const char *subchannels_x[] = { "0.0.8000", "0.0.8001", "0.0.800X", NULL }; + const char *hw_addr1 = "52:54:00:ab:db:23"; + const char *hw_addr2 = "52:54:00:ab:db:24"; + + sinfo = nmtstc_service_init (); + client = nm_client_new (NULL, &error); + g_assert_no_error (error); + + /* Create two devices */ + device1 = nmtstc_service_add_wired_device (sinfo, client, "eth0", hw_addr1, subchannels); + device2 = nmtstc_service_add_wired_device (sinfo, client, "eth1", hw_addr2, NULL); + + g_assert_cmpstr (nm_device_get_hw_address (device1), ==, hw_addr1); + g_assert_cmpstr (nm_device_get_hw_address (device2), ==, hw_addr2); + + conn = nmtst_create_minimal_connection ("wired-matches", NULL, + NM_SETTING_WIRED_SETTING_NAME, NULL); + s_wired = nm_connection_get_setting_wired (conn); + nm_setting_wired_add_mac_blacklist_item (s_wired, "00:11:22:33:44:55"); + + /* device1 and conn are compatible */ + g_object_set (s_wired, + NM_SETTING_WIRED_MAC_ADDRESS, hw_addr1, + NM_SETTING_WIRED_S390_SUBCHANNELS, subchannels, + NULL); + nm_device_connection_compatible (device1, conn, &error); + g_assert_no_error (error); + + /* device2 and conn differ in subchannels */ + g_object_set (s_wired, NM_SETTING_WIRED_S390_SUBCHANNELS, subchannels_x, NULL); + nm_device_connection_compatible (device2, conn, &error); + g_assert_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION); + g_clear_error (&error); + + /* device1 and conn differ in subchannels - 2 in connection, 3 in device */ + g_object_set (s_wired, NM_SETTING_WIRED_S390_SUBCHANNELS, subchannels_2, NULL); + nm_device_connection_compatible (device1, conn, &error); + g_assert_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION); + g_clear_error (&error); + + g_object_set (s_wired, NM_SETTING_WIRED_S390_SUBCHANNELS, NULL, NULL); + + /* device2 and conn differ in MAC address */ + g_object_set (s_wired, NM_SETTING_WIRED_MAC_ADDRESS, "aa:bb:cc:dd:ee:ee", NULL); + nm_device_connection_compatible (device2, conn, &error); + g_assert_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION); + g_clear_error (&error); + g_object_set (s_wired, NM_SETTING_WIRED_MAC_ADDRESS, NULL, NULL); + + /* device1 is blacklisted in conn */ + nm_setting_wired_add_mac_blacklist_item (s_wired, hw_addr1); + nm_device_connection_compatible (device1, conn, &error); + g_assert_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION); + g_clear_error (&error); + + g_object_unref (conn); + g_object_unref (client); + + g_clear_pointer (&sinfo, nmtstc_service_cleanup); +} + +/*******************************************************************/ + +static gboolean +_test_connection_invalid_find_connections (gpointer element, gpointer needle, gpointer user_data) +{ + NMRemoteConnection *con = NM_REMOTE_CONNECTION (element); + const char *path = needle; + + g_assert (NM_IS_REMOTE_CONNECTION (con)); + g_assert (path && *path); + + return strcmp (path, nm_connection_get_path ((NMConnection *) con)) == 0; +} + +#define ASSERT_IDX(i) \ + g_assert_cmpint (idx[i], >=, 0); \ + g_assert (path##i && *path##i); \ + g_assert (NM_IS_REMOTE_CONNECTION (connections->pdata[idx[i]])); \ + g_assert_cmpstr (nm_connection_get_path (connections->pdata[idx[i]]), ==, path##i); + +static void +test_connection_invalid (void) +{ + NMTSTC_SERVICE_INFO_SETUP (my_sinfo) + gs_unref_object NMConnection *connection = NULL; + NMSettingConnection *s_con; + gs_unref_object NMClient *client = NULL; + const GPtrArray *connections; + gs_free_error GError *error = NULL; + gs_free char *path0 = NULL; + gs_free char *path1 = NULL; + gs_free char *path2 = NULL; + gs_free char *uuid2 = NULL; + gsize n_found; + gssize idx[3]; + + /************************************************************************** + * Add two connection before starting libnm. One valid, one invalid. + *************************************************************************/ + + connection = nmtst_create_minimal_connection ("test-connection-invalid-0", NULL, NM_SETTING_WIRED_SETTING_NAME, &s_con); + nmtst_connection_normalize (connection); + g_object_set (s_con, + NM_SETTING_CONNECTION_UUID, nmtst_uuid_generate (), + NULL); + nmtstc_service_add_connection (my_sinfo, + connection, + TRUE, + &path0); + + nm_connection_remove_setting (connection, NM_TYPE_SETTING_WIRED); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "test-connection-invalid-1", + NM_SETTING_CONNECTION_TYPE, "invalid-type-1", + NM_SETTING_CONNECTION_UUID, nmtst_uuid_generate (), + NULL); + nmtstc_service_add_connection (my_sinfo, + connection, + FALSE, + &path1); + + + client = nm_client_new (NULL, &error); + g_assert_no_error (error); + + connections = nm_client_get_connections (client); + g_assert (connections); + + g_assert_cmpint (connections->len, ==, 2); + n_found = nmtst_find_all_indexes (connections->pdata, + connections->len, + (gpointer *) ((const char *[]) { path0, path1 }), + 2, + _test_connection_invalid_find_connections, + NULL, + idx); + g_assert_cmpint (n_found, ==, 2); + ASSERT_IDX (0); + ASSERT_IDX (1); + nmtst_assert_connection_verifies_without_normalization (connections->pdata[idx[0]]); + nmtst_assert_connection_unnormalizable (connections->pdata[idx[1]], 0, 0); + + /************************************************************************** + * After having the client up and running, add another invalid connection + *************************************************************************/ + + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "test-connection-invalid-2", + NM_SETTING_CONNECTION_TYPE, "invalid-type-2", + NM_SETTING_CONNECTION_UUID, (uuid2 = g_strdup (nmtst_uuid_generate ())), + NULL); + nmtstc_service_add_connection (my_sinfo, + connection, + FALSE, + &path2); + + + nmtst_main_loop_run (loop, 100); + + + connections = nm_client_get_connections (client); + g_assert (connections); + + g_assert_cmpint (connections->len, ==, 3); + n_found = nmtst_find_all_indexes (connections->pdata, + connections->len, + (gpointer *) ((const char *[]) { path0, path1, path2 }), + 3, + _test_connection_invalid_find_connections, + NULL, + idx); + g_assert_cmpint (n_found, ==, 3); + ASSERT_IDX (0); + ASSERT_IDX (1); + ASSERT_IDX (2); + nmtst_assert_connection_verifies_without_normalization (connections->pdata[idx[0]]); + nmtst_assert_connection_unnormalizable (connections->pdata[idx[1]], 0, 0); + nmtst_assert_connection_unnormalizable (connections->pdata[idx[2]], 0, 0); + + /************************************************************************** + * Modify the invalid connection (still invalid) + *************************************************************************/ + + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "test-connection-invalid-2x", + NULL); + nmtstc_service_update_connection (my_sinfo, + path2, + connection, + FALSE); + + nmtst_main_loop_run (loop, 100); + + connections = nm_client_get_connections (client); + g_assert (connections); + + g_assert_cmpint (connections->len, ==, 3); + n_found = nmtst_find_all_indexes (connections->pdata, + connections->len, + (gpointer *) ((const char *[]) { path0, path1, path2 }), + 3, + _test_connection_invalid_find_connections, + NULL, + idx); + g_assert_cmpint (n_found, ==, 3); + ASSERT_IDX (0); + ASSERT_IDX (1); + ASSERT_IDX (2); + nmtst_assert_connection_verifies_without_normalization (connections->pdata[idx[0]]); + nmtst_assert_connection_unnormalizable (connections->pdata[idx[1]], 0, 0); + nmtst_assert_connection_unnormalizable (connections->pdata[idx[2]], 0, 0); + g_assert_cmpstr ("test-connection-invalid-2x", ==, nm_connection_get_id (connections->pdata[idx[2]])); + + /************************************************************************** + * Modify the invalid connection (now becomes valid) + *************************************************************************/ + + g_clear_object (&connection); + connection = nmtst_create_minimal_connection ("test-connection-invalid-2", NULL, NM_SETTING_WIRED_SETTING_NAME, &s_con); + nmtst_connection_normalize (connection); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "test-connection-invalid-2z", + NM_SETTING_CONNECTION_TYPE, "802-3-ethernet", + NM_SETTING_CONNECTION_UUID, uuid2, + NULL); + + nmtstc_service_update_connection (my_sinfo, + path2, + connection, + FALSE); + + nmtst_main_loop_run (loop, 100); + + connections = nm_client_get_connections (client); + g_assert (connections); + + g_assert_cmpint (connections->len, ==, 3); + n_found = nmtst_find_all_indexes (connections->pdata, + connections->len, + (gpointer *) ((const char *[]) { path0, path1, path2 }), + 3, + _test_connection_invalid_find_connections, + NULL, + idx); + g_assert_cmpint (n_found, ==, 3); + ASSERT_IDX (0); + ASSERT_IDX (1); + ASSERT_IDX (2); + nmtst_assert_connection_verifies_without_normalization (connections->pdata[idx[0]]); + nmtst_assert_connection_unnormalizable (connections->pdata[idx[1]], 0, 0); + nmtst_assert_connection_verifies_without_normalization (connections->pdata[idx[2]]); + g_assert_cmpstr ("test-connection-invalid-2z", ==, nm_connection_get_id (connections->pdata[idx[2]])); + + /************************************************************************** + * Modify the invalid connection and make it valid + *************************************************************************/ + + g_clear_object (&connection); + connection = nmtst_create_minimal_connection ("test-connection-invalid-1", NULL, NM_SETTING_WIRED_SETTING_NAME, &s_con); + nmtst_connection_normalize (connection); + g_object_set (s_con, + NM_SETTING_CONNECTION_ID, "test-connection-invalid-1x", + NM_SETTING_CONNECTION_TYPE, "802-3-ethernet", + NM_SETTING_CONNECTION_UUID, nm_connection_get_uuid (connections->pdata[idx[1]]), + NULL); + + nmtstc_service_update_connection (my_sinfo, + path1, + connection, + FALSE); + + nmtst_main_loop_run (loop, 100); + + connections = nm_client_get_connections (client); + g_assert (connections); + + g_assert_cmpint (connections->len, ==, 3); + n_found = nmtst_find_all_indexes (connections->pdata, + connections->len, + (gpointer *) ((const char *[]) { path0, path1, path2 }), + 3, + _test_connection_invalid_find_connections, + NULL, + idx); + g_assert_cmpint (n_found, ==, 3); + ASSERT_IDX (0); + ASSERT_IDX (1); + ASSERT_IDX (2); + nmtst_assert_connection_verifies_without_normalization (connections->pdata[idx[0]]); + nmtst_assert_connection_verifies_without_normalization (connections->pdata[idx[1]]); + nmtst_assert_connection_verifies_without_normalization (connections->pdata[idx[2]]); + g_assert_cmpstr ("test-connection-invalid-1x", ==, nm_connection_get_id (connections->pdata[idx[1]])); + g_assert_cmpstr ("test-connection-invalid-2z", ==, nm_connection_get_id (connections->pdata[idx[2]])); + +#undef ASSERT_IDX } /*******************************************************************/ @@ -1170,10 +1472,6 @@ main (int argc, char **argv) { g_setenv ("LIBNM_USE_SESSION_BUS", "1", TRUE); -#if !GLIB_CHECK_VERSION (2, 35, 0) - g_type_init (); -#endif - nmtst_init (&argc, &argv, TRUE); loop = g_main_loop_new (NULL, FALSE); @@ -1187,6 +1485,8 @@ main (int argc, char **argv) g_test_add_func ("/libnm/active-connections", test_active_connections); g_test_add_func ("/libnm/activate-virtual", test_activate_virtual); g_test_add_func ("/libnm/activate-failed", test_activate_failed); + g_test_add_func ("/libnm/device-connection-compatibility", test_device_connection_compatibility); + g_test_add_func ("/libnm/connection/invalid", test_connection_invalid); return g_test_run (); } diff --git a/libnm/tests/test-remote-settings-client.c b/libnm/tests/test-remote-settings-client.c index 15590fac..1a3c7988 100644 --- a/libnm/tests/test-remote-settings-client.c +++ b/libnm/tests/test-remote-settings-client.c @@ -20,18 +20,13 @@ #include "config.h" -#include #include #include #include -#include +#include "nm-test-libnm-utils.h" -#include "common.h" - -#include "nm-test-utils.h" - -static NMTestServiceInfo *sinfo; +static NMTstcServiceInfo *sinfo; static NMClient *client = NULL; GDBusConnection *bus = NULL; NMRemoteConnection *remote = NULL; @@ -502,6 +497,8 @@ test_save_hostname (void) /*******************************************************************/ +NMTST_DEFINE (); + int main (int argc, char **argv) { @@ -510,16 +507,12 @@ main (int argc, char **argv) g_setenv ("LIBNM_USE_SESSION_BUS", "1", TRUE); -#if !GLIB_CHECK_VERSION (2, 35, 0) - g_type_init (); -#endif - - g_test_init (&argc, &argv, NULL); + nmtst_init (&argc, &argv, TRUE); bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error); g_assert_no_error (error); - sinfo = nm_test_service_init (); + sinfo = nmtstc_service_init (); client = nm_client_new (NULL, &error); g_assert_no_error (error); @@ -538,7 +531,7 @@ main (int argc, char **argv) ret = g_test_run (); - nm_test_service_cleanup (sinfo); + nmtstc_service_cleanup (sinfo); g_object_unref (client); g_object_unref (bus); diff --git a/libnm/tests/test-secret-agent.c b/libnm/tests/test-secret-agent.c index 037b5a81..f8aedd23 100644 --- a/libnm/tests/test-secret-agent.c +++ b/libnm/tests/test-secret-agent.c @@ -20,17 +20,13 @@ #include "config.h" -#include #include #include #include -#include #include -#include "nm-glib-compat.h" -#include "nm-test-utils.h" -#include "common.h" +#include "nm-test-libnm-utils.h" /*******************************************************************/ @@ -183,7 +179,7 @@ test_secret_agent_new (void) /*******************************************************************/ typedef struct { - NMTestServiceInfo *sinfo; + NMTstcServiceInfo *sinfo; NMClient *client; NMSecretAgentOld *agent; @@ -250,7 +246,7 @@ test_setup (TestSecretAgentData *sadata, gconstpointer test_data) NMSetting *s_wsec; GError *error = NULL; - sadata->sinfo = nm_test_service_init (); + sadata->sinfo = nmtstc_service_init (); sadata->client = nm_client_new (NULL, &error); g_assert_no_error (error); @@ -262,8 +258,8 @@ test_setup (TestSecretAgentData *sadata, gconstpointer test_data) counter++; /* Create the device */ - sadata->device = nm_test_service_add_device (sadata->sinfo, sadata->client, - "AddWifiDevice", sadata->ifname); + sadata->device = nmtstc_service_add_device (sadata->sinfo, sadata->client, + "AddWifiDevice", sadata->ifname); /* Create the connection */ connection = nmtst_create_minimal_connection (sadata->con_id, NULL, NM_SETTING_WIRELESS_SETTING_NAME, &s_con); @@ -336,7 +332,7 @@ test_cleanup (TestSecretAgentData *sadata, gconstpointer test_data) g_object_unref (sadata->connection); g_object_unref (sadata->client); - nm_test_service_cleanup (sadata->sinfo); + nmtstc_service_cleanup (sadata->sinfo); g_source_remove (sadata->timeout_id); g_main_loop_unref (sadata->loop); @@ -583,12 +579,12 @@ registered_changed (GObject *object, GParamSpec *pspec, gpointer user_data) static void test_secret_agent_auto_register (void) { - NMTestServiceInfo *sinfo; + NMTstcServiceInfo *sinfo; NMSecretAgentOld *agent; GMainLoop *loop; GError *error = NULL; - sinfo = nm_test_service_init (); + sinfo = nmtstc_service_init (); loop = g_main_loop_new (NULL, FALSE); agent = test_secret_agent_new (); @@ -604,17 +600,17 @@ test_secret_agent_auto_register (void) g_assert (nm_secret_agent_old_get_registered (agent)); /* Shut down test service */ - nm_test_service_cleanup (sinfo); + nmtstc_service_cleanup (sinfo); g_main_loop_run (loop); g_assert (!nm_secret_agent_old_get_registered (agent)); /* Restart test service */ - sinfo = nm_test_service_init (); + sinfo = nmtstc_service_init (); g_main_loop_run (loop); g_assert (nm_secret_agent_old_get_registered (agent)); /* Shut down test service again */ - nm_test_service_cleanup (sinfo); + nmtstc_service_cleanup (sinfo); g_main_loop_run (loop); g_assert (!nm_secret_agent_old_get_registered (agent)); @@ -624,6 +620,8 @@ test_secret_agent_auto_register (void) /*******************************************************************/ +NMTST_DEFINE (); + int main (int argc, char **argv) { @@ -631,11 +629,7 @@ main (int argc, char **argv) g_setenv ("LIBNM_USE_SESSION_BUS", "1", TRUE); -#if !GLIB_CHECK_VERSION (2, 35, 0) - g_type_init (); -#endif - - g_test_init (&argc, &argv, NULL); + nmtst_init (&argc, &argv, TRUE); g_test_add ("/libnm/secret-agent/none", TestSecretAgentData, NULL, test_setup, test_secret_agent_none, test_cleanup); diff --git a/man/Makefile.am b/man/Makefile.am index 4577cb41..85b6f3a9 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -25,6 +25,16 @@ if ENABLE_GTK_DOC endif +CLEANFILES += NetworkManager.conf.xml +EXTRA_DIST += NetworkManager.conf.xml.in +NetworkManager.conf.xml: $(srcdir)/NetworkManager.conf.xml.in + $(AM_V_GEN) sed \ + -e 's|[@]NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT[@]|$(NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT)|g' \ + -e 's|[@]NM_CONFIG_KEYFILE_PATH_DEFAULT[@]|$(nmconfdir)/conf.d|g' \ + -e 's|[@]NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT[@]|$(NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT)|g' \ + -e 's|[@]NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT[@]|$(NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT)|g' \ + $< >$@ + if BUILD_SETTING_DOCS nm-settings.xml: nm-settings.xsl $(top_builddir)/libnm/nm-setting-docs.xml @@ -71,14 +81,14 @@ docbook_autogenerated_man_pages = \ nm-settings-keyfile.5 \ nm-settings-ifcfg-rh.5 -EXTRA_DIST += \ - nm-settings.xml \ - nm-settings.xsl \ - nm-settings-keyfile.xml \ - nm-settings-keyfile.xsl \ - nm-settings-ifcfg-rh.xml \ - nm-settings-ifcfg-rh.xsl \ - $(docbook_generated_man_pages:.%=.xml) \ +EXTRA_DIST += \ + nm-settings.xml \ + nm-settings.xsl \ + nm-settings-keyfile.xml \ + nm-settings-keyfile.xsl \ + nm-settings-ifcfg-rh.xml \ + nm-settings-ifcfg-rh.xsl \ + $(addsuffix .xml,$(basename $(docbook_generated_man_pages))) \ $(docbook_autogenerated_man_pages) man_MANS += $(configure_generated_man_pages) @@ -109,4 +119,3 @@ man_MANS += \ $(docbook_autogenerated_man_pages) endif endif - diff --git a/man/Makefile.in b/man/Makefile.in index 7f421ea9..9e52f66f 100644 --- a/man/Makefile.in +++ b/man/Makefile.in @@ -120,8 +120,8 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = NetworkManager.conf.xml nm-system-settings.conf.5 \ - nm-online.1 nmcli.1 nmtui.1 +CONFIG_CLEAN_FILES = nm-system-settings.conf.5 nm-online.1 nmcli.1 \ + nmtui.1 CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -177,8 +177,7 @@ man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -am__DIST_COMMON = $(srcdir)/Makefile.in \ - $(srcdir)/NetworkManager.conf.xml.in $(srcdir)/nm-online.1.in \ +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/nm-online.1.in \ $(srcdir)/nm-system-settings.conf.5.in $(srcdir)/nmcli.1.in \ $(srcdir)/nmtui.1.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -197,7 +196,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -209,8 +207,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -220,6 +216,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -274,16 +271,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -320,6 +314,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -348,7 +344,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -363,6 +358,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -423,6 +420,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -430,6 +428,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -447,11 +446,13 @@ with_resolvconf = @with_resolvconf@ with_valgrind = @with_valgrind@ man_MANS = $(configure_generated_man_pages) $(am__append_2) \ $(am__append_4) $(am__append_6) -CLEANFILES = $(am__append_1) $(am__append_3) $(am__append_5) -EXTRA_DIST = nm-settings.xml nm-settings.xsl nm-settings-keyfile.xml \ +CLEANFILES = NetworkManager.conf.xml $(am__append_1) $(am__append_3) \ + $(am__append_5) +EXTRA_DIST = NetworkManager.conf.xml.in nm-settings.xml \ + nm-settings.xsl nm-settings-keyfile.xml \ nm-settings-keyfile.xsl nm-settings-ifcfg-rh.xml \ - nm-settings-ifcfg-rh.xsl \ - $(docbook_generated_man_pages:.%=.xml) \ + nm-settings-ifcfg-rh.xsl $(addsuffix .xml,$(basename \ + $(docbook_generated_man_pages))) \ $(docbook_autogenerated_man_pages) XSLTPROC = xsltproc XSLTPROC_FLAGS = --xinclude --nonet @@ -513,8 +514,6 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): -NetworkManager.conf.xml: $(top_builddir)/config.status $(srcdir)/NetworkManager.conf.xml.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ nm-system-settings.conf.5: $(top_builddir)/config.status $(srcdir)/nm-system-settings.conf.5.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ nm-online.1: $(top_builddir)/config.status $(srcdir)/nm-online.1.in @@ -827,6 +826,13 @@ uninstall-man: uninstall-man1 uninstall-man5 uninstall-man8 @ENABLE_GTK_DOC_TRUE@%.5: %.xml @ENABLE_GTK_DOC_TRUE@ $(AM_V_GEN) xsltproc $(XSLTPROC_MAN_FLAGS) $< +NetworkManager.conf.xml: $(srcdir)/NetworkManager.conf.xml.in + $(AM_V_GEN) sed \ + -e 's|[@]NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT[@]|$(NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT)|g' \ + -e 's|[@]NM_CONFIG_KEYFILE_PATH_DEFAULT[@]|$(nmconfdir)/conf.d|g' \ + -e 's|[@]NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT[@]|$(NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT)|g' \ + -e 's|[@]NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT[@]|$(NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT)|g' \ + $< >$@ @BUILD_SETTING_DOCS_TRUE@nm-settings.xml: nm-settings.xsl $(top_builddir)/libnm/nm-setting-docs.xml @BUILD_SETTING_DOCS_TRUE@ $(AM_V_GEN) xsltproc \ diff --git a/man/NetworkManager.8 b/man/NetworkManager.8 deleted file mode 100644 index 58fc9bd8..00000000 --- a/man/NetworkManager.8 +++ /dev/null @@ -1,277 +0,0 @@ -'\" t -.\" Title: NetworkManager -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 12/23/2015 -.\" Manual: Network management daemons -.\" Source: NetworkManager 1.0 -.\" Language: English -.\" -.TH "NETWORKMANAGER" "8" "" "NetworkManager 1\&.0" "Network management daemons" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.SH "NAME" -NetworkManager \- network management daemon -.SH "SYNOPSIS" -.HP \w'\fBNetworkManager\ \fR\fB[OPTIONS...]\fR\ 'u -\fBNetworkManager \fR\fB[OPTIONS...]\fR -.SH "DESCRIPTION" -.PP -The NetworkManager daemon attempts to make networking configuration and operation as painless and automatic as possible by managing the primary network connection and other network interfaces, like Ethernet, WiFi, and Mobile Broadband devices\&. NetworkManager will connect any network device when a connection for that device becomes available, unless that behavior is disabled\&. Information about networking is exported via a D\-Bus interface to any interested application, providing a rich API with which to inspect and control network settings and operation\&. -.SH "DISPATCHER SCRIPTS" -.PP -NetworkManager will execute scripts in the /etc/NetworkManager/dispatcher\&.d directory or subdirectories in alphabetical order in response to network events\&. Each script should be a regular executable file owned by root\&. Furthermore, it must not be writable by group or other, and not setuid\&. -.PP -Each script receives two arguments, the first being the interface name of the device an operation just happened on, and second the action\&. -.PP -The actions are: -.PP -\fIpre\-up\fR -.RS 4 -The interface is connected to the network but is not yet fully activated\&. Scripts acting on this event must be placed or symlinked into the /etc/NetworkManager/dispatcher\&.d/pre\-up\&.d directory, and NetworkManager will wait for script execution to complete before indicating to applications that the interface is fully activated\&. -.RE -.PP -\fIup\fR -.RS 4 -The interface has been activated\&. -.RE -.PP -\fIpre\-down\fR -.RS 4 -The interface will be deactivated but has not yet been disconnected from the network\&. Scripts acting on this event must be placed or symlinked into the /etc/NetworkManager/dispatcher\&.d/pre\-down\&.d directory, and NetworkManager will wait for script execution to complete before disconnecting the interface from its network\&. Note that this event is not emitted for forced disconnections, like when carrier is lost or a wireless signal fades\&. It is only emitted when there is an opportunity to cleanly handle a network disconnection event\&. -.RE -.PP -\fIdown\fR -.RS 4 -The interface has been deactivated\&. -.RE -.PP -\fIvpn\-pre\-up\fR -.RS 4 -The VPN is connected to the network but is not yet fully activated\&. Scripts acting on this event must be placed or symlinked into the /etc/NetworkManager/dispatcher\&.d/pre\-up\&.d directory, and NetworkManager will wait for script execution to complete before indicating to applications that the VPN is fully activated\&. -.RE -.PP -\fIvpn\-up\fR -.RS 4 -A VPN connection has been activated\&. -.RE -.PP -\fIvpn\-pre\-down\fR -.RS 4 -The VPN will be deactivated but has not yet been disconnected from the network\&. Scripts acting on this event must be placed or symlinked into the /etc/NetworkManager/dispatcher\&.d/pre\-down\&.d directory, and NetworkManager will wait for script execution to complete before disconnecting the VPN from its network\&. Note that this event is not emitted for forced disconnections, like when the VPN terminates unexpectedly or general connectivity is lost\&. It is only emitted when there is an opportunity to cleanly handle a VPN disconnection event\&. -.RE -.PP -\fIvpn\-down\fR -.RS 4 -A VPN connection has been deactivated\&. -.RE -.PP -\fIhostname\fR -.RS 4 -The system hostname has been updated\&. Use gethostname(2) to retrieve it\&. The interface name (first argument) is empty and no environment variable is set for this action\&. -.RE -.PP -\fIdhcp4\-change\fR -.RS 4 -The DHCPv4 lease has changed (renewed, rebound, etc)\&. -.RE -.PP -\fIdhcp6\-change\fR -.RS 4 -The DHCPv6 lease has changed (renewed, rebound, etc)\&. -.RE -.PP -The environment contains more information about the interface and the connection\&. The following variables are available for the use in the dispatcher scripts: -.PP -\fICONNECTION_UUID\fR -.RS 4 -The UUID of the connection profile\&. -.RE -.PP -\fICONNECTION_ID\fR -.RS 4 -The name (ID) of the connection profile\&. -.RE -.PP -\fICONNECTION_FILENAME\fR -.RS 4 -The backing file name of the connection profile (if any)\&. -.RE -.PP -\fIDEVICE_IFACE\fR -.RS 4 -The interface name of the device\&. -.RE -.PP -\fIDEVICE_IP_IFACE\fR -.RS 4 -The IP interface name of the device\&. -.RE -.PP -\fIIP4_ADDRESS_N\fR -.RS 4 -The IPv4 address in the format "address/prefix gateway", where N is a number from 0 to (# IPv4 addresses \- 1)\&. gateway item in this variable is deprecated, use IP4_GATEWAY instead\&. -.RE -.PP -\fIIP4_NUM_ADDRESSES\fR -.RS 4 -The variable contains the number of IPv4 addresses the script may expect\&. -.RE -.PP -\fIIP4_GATEWAY\fR -.RS 4 -The gateway IPv4 address in traditional numbers\-and\-dots notation\&. -.RE -.PP -\fIIP4_ROUTE_N\fR -.RS 4 -The IPv4 route in the format "address/prefix next\-hop metric", where N is a number from 0 to (# IPv4 routes \- 1)\&. -.RE -.PP -\fIIP4_NUM_ROUTES\fR -.RS 4 -The variable contains the number of IPv4 routes the script may expect\&. -.RE -.PP -\fIIP4_NAMESERVERS\fR -.RS 4 -The variable contains a space\-separated list of the DNS servers\&. -.RE -.PP -\fIIP4_DOMAINS\fR -.RS 4 -The variable contains a space\-separated list of the search domains\&. -.RE -.PP -\fIDHCP4_\fR -.RS 4 -If the connection used DHCP for address configuration, the received DHCP configuration is passed in the environment using standard DHCP option names, prefixed with "DHCP4_", like "DHCP4_HOST_NAME=foobar"\&. -.RE -.PP -\fIIP6_ and DHCP6_\fR -.RS 4 -The same variables as for IPv4 are available for IPv6, but the prefixes are IP6_ and DHCP6_ instead\&. -.RE -.PP -In case of VPN, VPN_IP_IFACE is set, and IP4_*, IP6_* variables with VPN prefix are exported too, like VPN_IP4_ADDRESS_0, VPN_IP4_NUM_ADDRESSES\&. -.PP -Dispatcher scripts are run one at a time, but asynchronously from the main NetworkManager process, and will be killed if they run for too long\&. If your script might take arbitrarily long to complete, you should spawn a child process and have the parent return immediately\&. Also beware that once a script is queued, it will always be run, even if a later event renders it obsolete\&. (Eg, if an interface goes up, and then back down again quickly, it is possible that one or more "up" scripts will be run after the interface has gone down\&.) -.SH "OPTIONS" -.PP -The following options are understood: -.PP -\fB\-\-version\fR | \fB\-V\fR -.RS 4 -Print the NetworkManager software version and exit\&. -.RE -.PP -\fB\-\-help\fR | \fB\-h\fR -.RS 4 -Print NetworkManager\*(Aqs available options and exit\&. -.RE -.PP -\fB\-\-no\-daemon\fR | \fB\-n\fR -.RS 4 -Do not daemonize\&. -.RE -.PP -\fB\-\-debug\fR | \fB\-d\fR -.RS 4 -Do not daemonize, and direct log output to the controlling terminal in addition to syslog\&. -.RE -.PP -\fB\-\-pid\-file\fR | \fB\-p\fR -.RS 4 -Specify location of a PID file\&. The PID file is used for storing PID of the running proccess and prevents running multiple instances\&. -.RE -.PP -\fB\-\-state\-file\fR -.RS 4 -Specify file for storing state of the NetworkManager persistently\&. If not specified, the default value of /var/lib/NetworkManager/NetworkManager\&.state is used\&. -.RE -.PP -\fB\-\-config\fR -.RS 4 -Specify configuration file to set up various settings for NetworkManager\&. If not specified, the default value of /etc/NetworkManager/NetworkManager\&.conf is used with a fallback to the older \*(Aqnm\-system\-settings\&.conf\*(Aq if located in the same directory\&. See -\fBNetworkManager.conf\fR(5) -for more information on configuration file\&. -.RE -.PP -\fB\-\-plugins\fR -.RS 4 -List plugins used to manage system\-wide connection settings\&. This list has preference over plugins specified in the configuration file\&. Currently supported plugins are: keyfile, -\fBifcfg\-rh\fR, -\fBifcfg\-suse\fR, -\fBifupdown\fR\&. -.RE -.PP -\fB\-\-log\-level\fR -.RS 4 -Sets how much information NetworkManager sends to the log destination (usually syslog\*(Aqs "daemon" facility)\&. By default, only informational, warning, and error messages are logged\&. See the section on -logging -in -\fBNetworkManager.conf\fR(5) -for more information\&. -.RE -.PP -\fB\-\-log\-domains\fR -.RS 4 -A comma\-separated list specifying which operations are logged to the log destination (usually syslog)\&. By default, most domains are logging\-enabled\&. See the section on -logging -in -\fBNetworkManager.conf\fR(5) -for more information\&. -.RE -.PP -\fB\-\-print\-config\fR -.RS 4 -Print the NetworkMangager configuration to stdout and exit\&. -.RE -.SH "UDEV PROPERTIES" -.PP -\fBudev\fR(7) -device manager is used for the network device discovery\&. The following property influences how NetworkManager manages the devices: -.PP -\fINM_UNMANAGED\fR -.RS 4 -No default connection will be created and automatic activation will not be attempted when this property of a device is set to a true value ("1" or "true")\&. You will still be able to attach a connection to the device manually or observe externally added configuration such as addresses or routes\&. -.sp -Create an udev rule that sets this property to prevent NetworkManager from interfering with virtual Ethernet device interfaces that are managed by virtualization tools\&. -.RE -.SH "DEBUGGING" -.PP -The following environment variables are supported to help debugging\&. When used in conjunction with the -\fB\-\-no\-daemon\fR -option (thus echoing PPP and DHCP helper output to stdout) these can quickly help pinpoint the source of connection issues\&. Also see the -\fB\-\-log\-level\fR -and -\fB\-\-log\-domains\fR -to enable debug logging inside NetworkManager itself\&. -.PP -\fBNM_PPP_DEBUG\fR: When set to anything, causes NetworkManager to turn on PPP debugging in pppd, which logs all PPP and PPTP frames and client/server exchanges\&. -.SH "SEE ALSO" -.PP -\fBNetworkManager.conf\fR(5), -\fBnmcli\fR(1), -\fBnmcli-examples\fR(5), -\fBnm-online\fR(1), -\fBnm-settings\fR(5), -\fBnm-applet\fR(1), -\fBnm-connection-editor\fR(1)\fBudev\fR(7) diff --git a/man/NetworkManager.conf.5 b/man/NetworkManager.conf.5 deleted file mode 100644 index e85af1b4..00000000 --- a/man/NetworkManager.conf.5 +++ /dev/null @@ -1,670 +0,0 @@ -'\" t -.\" Title: NetworkManager.conf -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 12/23/2015 -.\" Manual: Configuration -.\" Source: NetworkManager 1.0 -.\" Language: English -.\" -.TH "NETWORKMANAGER\&.CON" "5" "" "NetworkManager 1\&.0" "Configuration" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.SH "NAME" -NetworkManager.conf \- NetworkManager configuration file -.SH "SYNOPSIS" -.PP -/etc/NetworkManager/NetworkManager\&.conf, -/etc/NetworkManager/conf\&.d/\fIname\fR\&.conf -.SH "DESCRIPTION" -.PP -This is a configuration file for NetworkManager\&. It is used to set up various aspects of NetworkManager\*(Aqs behavior\&. The location of the file may be changed through use of the -\fB\-\-config\fR -argument for NetworkManager\&. -.PP -If a default -NetworkManager\&.conf -is provided by your distribution\*(Aqs packages, you should not modify it, since your changes may get overwritten by package updates\&. Instead, you can add additional -\&.conf -files to the -conf\&.d -directory\&. These will be read in order, with later files overriding earlier ones\&. -.SH "FILE FORMAT" -.PP -The configuration file format is so\-called key file (sort of ini\-style format)\&. It consists of sections (groups) of key\-value pairs\&. Lines beginning with a \*(Aq#\*(Aq and blank lines are considered comments\&. Sections are started by a header line containing the section enclosed in \*(Aq[\*(Aq and \*(Aq]\*(Aq, and ended implicitly by the start of the next section or the end of the file\&. Each key\-value pair must be contained in a section\&. -.PP -For keys that take a list of devices as their value, you can specify devices by their MAC addresses or interface names, or "*" to specify all devices\&. See -the section called \(lqDevice List Format\(rq -below\&. -.PP -Minimal system settings configuration file looks like this: -.sp -.if n \{\ -.RS 4 -.\} -.nf - [main] - plugins=keyfile - -.fi -.if n \{\ -.RE -.\} -.PP -As an extension to the normal keyfile format, you can also append a value to a previously\-set list\-valued key by doing: -.sp -.if n \{\ -.RS 4 -.\} -.nf - plugins+=another\-plugin - plugins\-=remove\-me - -.fi -.if n \{\ -.RE -.\} -.sp -.SH "MAIN SECTION" -.PP -\fIplugins\fR -.RS 4 -Lists system settings plugin names separated by \*(Aq,\*(Aq\&. These plugins are used to read and write system\-wide connections\&. When multiple plugins are specified, the connections are read from all listed plugins\&. When writing connections, the plugins will be asked to save the connection in the order listed here; if the first plugin cannot write out that connection type (or can\*(Aqt write out any connections) the next plugin is tried, etc\&. If none of the plugins can save the connection, an error is returned to the user\&. -.sp -If NetworkManager defines a distro\-specific network\-configuration plugin for your system, then that will normally be listed here\&. (See below for the available plugins\&.) Note that the -keyfile -plugin is always appended to the end of this list (if it doesn\*(Aqt already appear earlier in the list), so if there is no distro\-specific plugin for your system then you can leave this key unset and NetworkManager will fall back to using -keyfile\&. -.RE -.PP -\fImonitor\-connection\-files\fR -.RS 4 -Whether the configured settings plugin(s) should set up file monitors and immediately pick up changes made to connection files while NetworkManager is running\&. This is disabled by default; NetworkManager will only read the connection files at startup, and when explicitly requested via the ReloadConnections D\-Bus call\&. If this key is set to \*(Aqtrue\*(Aq, then NetworkManager will reload connection files any time they changed\&. -.RE -.PP -\fIauth\-polkit\fR -.RS 4 -Whether the system uses PolicyKit for authorization\&. If -false, all requests will be allowed\&. If -true, non\-root requests are authorized using PolicyKit\&. The default value is -true\&. -.RE -.PP -\fIdhcp\fR -.RS 4 -This key sets up what DHCP client NetworkManager will use\&. Allowed values are -dhclient, -dhcpcd, and -internal\&. The -dhclient -and -dhcpcd -options require the indicated clients to be installed\&. The -internal -option uses a built\-in DHCP client which is not currently as featureful as the external clients (and in particular, does not yet support DHCPv6)\&. -.sp -If this key is missing, available DHCP clients are looked for in this order: -dhclient, -dhcpcd, -internal\&. -.RE -.PP -\fIno\-auto\-default\fR -.RS 4 -Specify devices for which NetworkManager shouldn\*(Aqt create default wired connection (Auto eth0)\&. By default, NetworkManager creates a temporary wired connection for any Ethernet device that is managed and doesn\*(Aqt have a connection configured\&. List a device in this option to inhibit creating the default connection for the device\&. May have the special value -* -to apply to all devices\&. -.sp -When the default wired connection is deleted or saved to a new persistent connection by a plugin, the device is added to a list in the file -/var/run/NetworkManager/no\-auto\-default\&.state -to prevent creating the default connection for that device again\&. -.sp -See -the section called \(lqDevice List Format\(rq -for the syntax how to specify a device\&. -.sp -Example: -.sp -.if n \{\ -.RS 4 -.\} -.nf -no\-auto\-default=00:22:68:5c:5d:c4,00:1e:65:ff:aa:ee -no\-auto\-default=eth0,eth1 -no\-auto\-default=* - -.fi -.if n \{\ -.RE -.\} -.sp -.RE -.PP -\fIignore\-carrier\fR -.RS 4 -Specify devices for which NetworkManager will (partially) ignore the carrier state\&. Normally, for device types that support carrier\-detect, such as Ethernet and InfiniBand, NetworkManager will only allow a connection to be activated on the device if carrier is present (ie, a cable is plugged in), and it will deactivate the device if carrier drops for more than a few seconds\&. -.sp -Listing a device here will allow activating connections on that device even when it does not have carrier, provided that the connection uses only statically\-configured IP addresses\&. Additionally, it will allow any active connection (whether static or dynamic) to remain active on the device when carrier is lost\&. -.sp -Note that the "carrier" property of NMDevices and device D\-Bus interfaces will still reflect the actual device state; it\*(Aqs just that NetworkManager will not make use of that information\&. -.sp -See -the section called \(lqDevice List Format\(rq -for the syntax how to specify a device\&. -.RE -.PP -\fIassume\-ipv6ll\-only\fR -.RS 4 -Specify devices for which NetworkManager will try to generate a connection based on initial configuration when the device only has an IPv6 link\-local address\&. -.sp -See -the section called \(lqDevice List Format\(rq -for the syntax how to specify a device\&. -.RE -.PP -\fIconfigure\-and\-quit\fR -.RS 4 -When set to \*(Aqtrue\*(Aq, NetworkManager quits after performing initial network configuration but spawns small helpers to preserve DHCP leases and IPv6 addresses\&. This is useful in environments where network setup is more or less static or it is desirable to save process time but still handle some dynamic configurations\&. When this option is -true, network configuration for WiFi, WWAN, Bluetooth, ADSL, and PPPoE interfaces cannot be preserved due to their use of external services, and these devices will be deconfigured when NetworkManager quits even though other interface\*(Aqs configuration may be preserved\&. Also, to preserve DHCP addresses the \*(Aqdhcp\*(Aq option must be set to \*(Aqinternal\*(Aq\&. The default value of the \*(Aqconfigure\-and\-quit\*(Aq option is \*(Aqfalse\*(Aq, meaning that NetworkManager will continue running after initial network configuration and continue responding to system and hardware events, D\-Bus requests, and user commands\&. -.RE -.PP -\fIdns\fR -.RS 4 -Set the DNS (resolv\&.conf) processing mode\&. -.sp -default: The default if the key is not specified\&. NetworkManager will update -resolv\&.conf -to reflect the nameservers provided by currently active connections\&. -.sp -dnsmasq: NetworkManager will run dnsmasq as a local caching nameserver, using a "split DNS" configuration if you are connected to a VPN, and then update -resolv\&.conf -to point to the local nameserver\&. -.sp -unbound: NetworkManager will talk to unbound and dnssec\-triggerd, providing a "split DNS" configuration with DNSSEC support\&. The /etc/resolv\&.conf will be managed by dnssec\-trigger daemon\&. -.sp -none: NetworkManager will not modify resolv\&.conf\&. -.RE -.PP -\fIdebug\fR -.RS 4 -Comma separated list of options to aid debugging\&. This value will be combined with the environment variable -NM_DEBUG\&. Currently the following values are supported: -.sp -RLIMIT_CORE: set ulimit \-c unlimited to write out core dumps\&. Beware, that a core dump can contain sensitive information such as passwords or configuration settings\&. -.sp -fatal\-warnings: set g_log_set_always_fatal() to core dump on warning messages from glib\&. This is equivalent to the \-\-g\-fatal\-warnings command line option\&. -.RE -.SH "KEYFILE SECTION" -.PP -This section contains keyfile\-plugin\-specific options, and is normally only used when you are not using any other distro\-specific plugin\&. -.PP -.PP -\fIhostname\fR -.RS 4 -Set a persistent hostname\&. -.RE -.PP -\fIunmanaged\-devices\fR -.RS 4 -Set devices that should be ignored by NetworkManager\&. -.sp -See -the section called \(lqDevice List Format\(rq -for the syntax how to specify a device\&. -.sp -Example: -.sp -.if n \{\ -.RS 4 -.\} -.nf -unmanaged\-devices=interface\-name:em4 -unmanaged\-devices=mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4;interface\-name:eth2 - -.fi -.if n \{\ -.RE -.\} -.sp -.RE -.SH "IFUPDOWN SECTION" -.PP -This section contains ifupdown\-specific options and thus only has effect when using the -ifupdown -plugin\&. -.PP -.PP -\fImanaged\fR -.RS 4 -If set to -true, then interfaces listed in -/etc/network/interfaces -are managed by NetworkManager\&. If set to -false, then any interface listed in -/etc/network/interfaces -will be ignored by NetworkManager\&. Remember that NetworkManager controls the default route, so because the interface is ignored, NetworkManager may assign the default route to some other interface\&. -.sp -The default value is -false\&. -.RE -.SH "LOGGING SECTION" -.PP -This section controls NetworkManager\*(Aqs logging\&. Any settings here are overridden by the -\fB\-\-log\-level\fR -and -\fB\-\-log\-domains\fR -command\-line options\&. -.PP -.PP -\fIlevel\fR -.RS 4 -The default logging verbosity level\&. One of -ERR, -WARN, -INFO, -DEBUG, -TRACE\&. The ERR level logs only critical errors\&. WARN logs warnings that may reflect operation\&. INFO logs various informational messages that are useful for tracking state and operations\&. DEBUG enables verbose logging for debugging purposes\&. TRACE enables even more verbose logging then DEBUG level\&. Subsequent levels also log all messages from earlier levels; thus setting the log level to INFO also logs error and warning messages\&. -.RE -.PP -\fIdomains\fR -.RS 4 -The following log domains are available: PLATFORM, RFKILL, ETHER, WIFI, BT, MB, DHCP4, DHCP6, PPP, WIFI_SCAN, IP4, IP6, AUTOIP4, DNS, VPN, SHARING, SUPPLICANT, AGENTS, SETTINGS, SUSPEND, CORE, DEVICE, OLPC, WIMAX, INFINIBAND, FIREWALL, ADSL, BOND, VLAN, BRIDGE, DBUS_PROPS, TEAM, CONCHECK, DCB, DISPATCH\&. -.sp -In addition, these special domains can be used: NONE, ALL, DEFAULT, DHCP, IP\&. -.sp -You can specify per\-domain log level overrides by adding a colon and a log level to any domain\&. E\&.g\&., "WIFI:DEBUG"\&. -.RE -.PP -.RS 4 -.PP -Domain descriptions: -.RS 4 -PLATFORM : OS (platform) operations -.RE -.RS 4 -RFKILL : RFKill subsystem operations -.RE -.RS 4 -ETHER : Ethernet device operations -.RE -.RS 4 -WIFI : Wi\-Fi device operations -.RE -.RS 4 -BT : Bluetooth operations -.RE -.RS 4 -MB : Mobile broadband operations -.RE -.RS 4 -DHCP4 : DHCP for IPv4 -.RE -.RS 4 -DHCP6 : DHCP for IPv6 -.RE -.RS 4 -PPP : Point\-to\-point protocol operations -.RE -.RS 4 -WIFI_SCAN : Wi\-Fi scanning operations -.RE -.RS 4 -IP4 : IPv4\-related operations -.RE -.RS 4 -IP6 : IPv6\-related operations -.RE -.RS 4 -AUTOIP4 : AutoIP (avahi) operations -.RE -.RS 4 -DNS : Domain Name System related operations -.RE -.RS 4 -VPN : Virtual Private Network connections and operations -.RE -.RS 4 -SHARING : Connection sharing -.RE -.RS 4 -SUPPLICANT : WPA supplicant related operations -.RE -.RS 4 -AGENTS : Secret agents operations and communication -.RE -.RS 4 -SETTINGS : Settings/config service operations -.RE -.RS 4 -SUSPEND : Suspend/resume -.RE -.RS 4 -CORE : Core daemon and policy operations -.RE -.RS 4 -DEVICE : Activation and general interface operations -.RE -.RS 4 -OLPC : OLPC Mesh device operations -.RE -.RS 4 -WIMAX : WiMAX device operations -.RE -.RS 4 -INFINIBAND : InfiniBand device operations -.RE -.RS 4 -FIREWALL : FirewallD related operations -.RE -.RS 4 -ADSL : ADSL device operations -.RE -.RS 4 -BOND : Bonding operations -.RE -.RS 4 -VLAN : VLAN operations -.RE -.RS 4 -BRIDGE : Bridging operations -.RE -.RS 4 -DBUS_PROPS : D\-Bus property changes -.RE -.RS 4 -TEAM : Teaming operations -.RE -.RS 4 -CONCHECK : Connectivity check -.RE -.RS 4 -DCB : Data Center Bridging (DCB) operations -.RE -.RS 4 -DISPATCH : Dispatcher scripts -.RE -.RS 4 - -.RE -.RS 4 -NONE : when given by itself logging is disabled -.RE -.RS 4 -ALL : all log domains -.RE -.RS 4 -DEFAULT : default log domains -.RE -.RS 4 -DHCP : shortcut for "DHCP4,DHCP6" -.RE -.RS 4 -IP : shortcut for "IP4,IP6" -.RE -.RS 4 - -.RE -.RS 4 -HW : deprecated alias for "PLATFORM" -.RE -.RE -.SH "CONNECTION SECTION" -.PP -This section allows to specify default values for connections\&. Not all properties can be overwritten, only a selected list below\&. You can have multiple -connection -sections, by having different sections with a name that all start with "connection"\&. -.PP -Example: -.sp -.if n \{\ -.RS 4 -.\} -.nf -[connection] -ipv6\&.ip6\-privacy=0 -connection\&.autoconnect\-slaves=1 - -[connection\-wifi\-wlan0] -match\-device=interface\-name:wlan0 -ipv4\&.route\-metric=50 - -[connection\-wifi\-other] -match\-device=type:wifi -ipv4\&.route\-metric=55 -ipv6\&.ip6\-privacy=1 -.fi -.if n \{\ -.RE -.\} -.PP -The sections within one file are considered in order of appearance, with the exception that the -[connection] -section is always considered last\&. In the example above, this order is -[connection\-wifi\-wlan0], -[connection\-wlan\-other], and -[connection]\&. When checking for a default configuration value, the section are searched until the requested value is found\&. In the example above, "ipv4\&.route\-metric" for wlan0 interface is set to 50, and for all other Wi\-Fi typed interfaces to 55\&. Also, Wi\-Fi devices would have IPv6 private addresses enabled by default, but other devices would have it disabled\&. Note that also "wlan0" gets "ipv6\&.ip6\-privacy=1", because although the section "[connection\-wifi\-wlan0]" matches the device, it does not contain that property and the search continues\&. -.PP -When having different sections in multiple files, sections from files that are read later have higher priority\&. So within one file the priority of the sections is top\-to\-bottom\&. Across multiple files later definitions take precedence\&. -.PP -.PP -\fImatch\-device\fR -.RS 4 -An optional device spec that restricts when the section applies\&. See -the section called \(lqDevice List Format\(rq -for the possible values\&. -.RE -.PP -\fIstop\-match\fR -.RS 4 -An optional boolean value which defaults to -no\&. If the section matches (based on -match\-device), further sections will not be considered even if the property in question is not present\&. In the example above, if -[connection\-wifi\-wlan0] -would have -stop\-match -set to -yes, its -ipv6\&.ip6\-privacy -value would be unspecified\&. -.RE -.PP -The following properties are supported to have their default values configured: -.PP -\fIipv4\&.route\-metric\fR -.RS 4 -.RE -.PP -\fIipv6\&.ip6\-privacy\fR -.RS 4 -If -ipv6\&.ip6\-privacy -is unset, use the content of "/proc/sys/net/ipv6/conf/default/use_tempaddr" as last fallback\&. -.RE -.PP -\fIipv6\&.route\-metric\fR -.RS 4 -.RE -.PP -\fIconnection\&.autoconnect\-slaves\fR -.RS 4 -.RE -.PP -\fIethernet\&.wake\-on\-lan\fR -.RS 4 -.RE -.SH "CONNECTIVITY SECTION" -.PP -This section controls NetworkManager\*(Aqs optional connectivity checking functionality\&. This allows NetworkManager to detect whether or not the system can actually access the internet or whether it is behind a captive portal\&. -.PP -.PP -\fIuri\fR -.RS 4 -The URI of a web page to periodically request when connectivity is being checked\&. This page should return the header "X\-NetworkManager\-Status" with a value of "online"\&. Alternatively, it\*(Aqs body content should be set to "NetworkManager is online"\&. The body content check can be controlled by the -response -option\&. If this option is blank or missing, connectivity checking is disabled\&. -.RE -.PP -\fIinterval\fR -.RS 4 -Specified in seconds; controls how often connectivity is checked when a network connection exists\&. If set to 0 connectivity checking is disabled\&. If missing, the default is 300 seconds\&. -.RE -.PP -\fIresponse\fR -.RS 4 -If set controls what body content NetworkManager checks for when requesting the URI for connectivity checking\&. If missing, defaults to "NetworkManager is online" -.RE -.SH "PLUGINS" -.PP -\fIkeyfile\fR -.RS 4 -The -keyfile -plugin is the generic plugin that supports all the connection types and capabilities that NetworkManager has\&. It writes files out in an \&.ini\-style format in /etc/NetworkManager/system\-connections\&. -.sp -The stored connection file may contain passwords and private keys, so it will be made readable only to root, and the plugin will ignore files that are readable or writeable by any user or group other than root\&. -.sp -This plugin is always active, and will automatically be used to store any connections that aren\*(Aqt supported by any other active plugin\&. -.RE -.PP -\fIifcfg\-rh\fR -.RS 4 -This plugin is used on the Fedora and Red Hat Enterprise Linux distributions to read and write configuration from the standard -/etc/sysconfig/network\-scripts/ifcfg\-* -files\&. It currently supports reading Ethernet, Wi\-Fi, InfiniBand, VLAN, Bond, Bridge, and Team connections\&. -.RE -.PP -\fIifcfg\-suse\fR -.RS 4 -This plugin is only provided for simple backward compatibility with SUSE and OpenSUSE configuration\&. Most setups should be using the -keyfile -plugin instead\&. The -ifcfg\-suse -plugin supports reading Ethernet and Wi\-Fi connections, but does not support saving any connection types\&. -.RE -.PP -\fIifupdown\fR -.RS 4 -This plugin is used on the Debian and Ubuntu distributions, and reads Ethernet and Wi\-Fi connections from -/etc/network/interfaces\&. -.sp -This plugin is read\-only; any connections (of any type) added from within NetworkManager when you are using this plugin will be saved using the -keyfile -plugin instead\&. -.RE -.PP -\fIibft\fR -.RS 4 -This plugin allows to read iBFT configuration (iSCSI Boot Firmware Table)\&. The configuration is read using /sbin/iscsiadm\&. Users are expected to configure iBFT connections via the firmware interfaces\&. -.RE -.SH "APPENDIX" -.SS "Device List Format" -.PP -The configuration options -main\&.no\-auto\-default, -main\&.ignore\-carrier, and -keyfile\&.unmanaged\-devices -select devices based on a list of matchings\&. Devices can be specified using the following format: -.PP -.PP -* -.RS 4 -Matches every device\&. -.RE -.PP -IFNAME -.RS 4 -Case sensitive match of interface name of the device\&. Globbing is not supported\&. -.RE -.PP -HWADDR -.RS 4 -Match the MAC address of the device\&. Globbing is not supported -.RE -.PP -interface\-name:IFNAME, interface\-name:~IFNAME -.RS 4 -Case sensitive match of interface name of the device\&. Simple globbing is supported with -* -and -?\&. Ranges and escaping is not supported\&. -.RE -.PP -interface\-name:=IFNAME -.RS 4 -Case sensitive match of interface name of the device\&. Globbing is disabled and -IFNAME -is taken literally\&. -.RE -.PP -mac:HWADDR -.RS 4 -Match the MAC address of the device\&. Globbing is not supported -.RE -.PP -s390\-subchannels:HWADDR -.RS 4 -Match the device based on the subchannel address\&. Globbing is not supported -.RE -.PP -type:TYPE -.RS 4 -Match the device type\&. Valid type names are as reported by "nmcli \-f GENERAL\&.TYPE device show"\&. Globbing is not supported\&. -.RE -.PP -except:SPEC -.RS 4 -Negative match of a device\&. -SPEC -must be explicitly qualified with a prefix such as -interface\-name:\&. A negative match has higher priority then the positive matches above\&. -.RE -.PP -SPEC[,;]SPEC -.RS 4 -Multiple specs can be concatenated with comman or semicolon\&. The order does not matter as matches are either positive (inclusive) or negative, with negative matches having higher priority\&. -.sp -Backslash is supported to escape the separators \*(Aq;\*(Aq and \*(Aq,\*(Aq, and to express special characters such as newline (\*(Aq\en\*(Aq), tabulator (\*(Aq\et\*(Aq), whitespace (\*(Aq\es\*(Aq) and backslash (\*(Aq\e\e\*(Aq)\&. The globbing of interface names cannot be escaped\&. Whitespace is taken literally so usually the specs will be concatenated without spaces\&. -.RE -.PP -Example: -.sp -.if n \{\ -.RS 4 -.\} -.nf -interface\-name:em4 -mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4;interface\-name:eth2 -interface\-name:vboxnet*,except:interface\-name:vboxnet2 -*,except:mac:00:22:68:1c:59:b1 - -.fi -.if n \{\ -.RE -.\} -.sp -.SH "SEE ALSO" -.PP -\fBNetworkManager\fR(8), -\fBnmcli\fR(1), -\fBnmcli-examples\fR(5), -\fBnm-online\fR(1), -\fBnm-settings\fR(5), -\fBnm-applet\fR(1), -\fBnm-connection-editor\fR(1) diff --git a/man/NetworkManager.conf.xml b/man/NetworkManager.conf.xml new file mode 100644 index 00000000..b4fe396d --- /dev/null +++ b/man/NetworkManager.conf.xml @@ -0,0 +1,988 @@ + + + + + + + + NetworkManager.conf + NetworkManager developers + + + + NetworkManager.conf + 5 + NetworkManager + Configuration + 1.0 + + + + NetworkManager.conf + NetworkManager configuration file + + + + /etc/NetworkManager/NetworkManager.conf, + /etc/NetworkManager/conf.d/name.conf, + /usr/lib/NetworkManager/conf.d/name.conf, + /var/lib/NetworkManager/NetworkManager-intern.conf + + + + + Description + NetworkManager.conf is the configuration file for NetworkManager. It is used + to set up various aspects of NetworkManager's behavior. The + location of the main file and configuration directories may be changed + through use of the , , + , and + argument for NetworkManager, respectively. + + If a default NetworkManager.conf is + provided by your distribution's packages, you should not modify + it, since your changes may get overwritten by package + updates. Instead, you can add additional .conf + files to the /etc/NetworkManager/conf.d directory. + These will be read in order, with later files overriding earlier ones. + Packages might install further configuration snippets to /usr/lib/NetworkManager/conf.d. + This directory is parsed first, even before NetworkManager.conf. + The loading of a file /usr/lib/NetworkManager/conf.d/name.conf + can be prevented by adding a file /etc/NetworkManager/conf.d/name.conf. + In this case, the file from the etc configuration shadows the file from the + system configuration directory. + + + NetworkManager can overwrite certain user configuration options via D-Bus or other internal + operations. In this case it writes those changes to /var/lib/NetworkManager/NetworkManager-intern.conf. + This file is not intended to be modified by the user, but it is read last and can shadow + user configuration from NetworkManager.conf. + + + + + + File Format + + The configuration file format is so-called key file (sort of + ini-style format). It consists of sections (groups) of + key-value pairs. Lines beginning with a '#' and blank lines are + considered comments. Sections are started by a header line + containing the section enclosed in '[' and ']', and ended + implicitly by the start of the next section or the end of the + file. Each key-value pair must be contained in a section. + + + For keys that take a list of devices as their value, you can + specify devices by their MAC addresses or interface names, or + "*" to specify all devices. See + below. + + + Minimal system settings configuration file looks like this: + + [main] + plugins=keyfile + + + + As an extension to the normal keyfile format, you can also + append a value to a previously-set list-valued key by doing: + + plugins+=another-plugin + plugins-=remove-me + + + + + + <literal>main</literal> section + + + plugins + + + Lists system settings plugin names separated by ','. These + plugins are used to read and write system-wide + connections. When multiple plugins are specified, the + connections are read from all listed plugins. When writing + connections, the plugins will be asked to save the + connection in the order listed here; if the first plugin + cannot write out that connection type (or can't write out + any connections) the next plugin is tried, etc. If none of + the plugins can save the connection, an error is returned + to the user. + + + If NetworkManager defines a distro-specific + network-configuration plugin for your system, then that + will normally be listed here. (See below for the available + plugins.) Note that the keyfile plugin + is always appended to the end of this list (if it doesn't + already appear earlier in the list), so if there is no + distro-specific plugin for your system then you can leave + this key unset and NetworkManager will fall back to using + keyfile. + + + + + monitor-connection-files + Whether the configured settings plugin(s) + should set up file monitors and immediately pick up changes + made to connection files while NetworkManager is running. This + is disabled by default; NetworkManager will only read + the connection files at startup, and when explicitly requested + via the ReloadConnections D-Bus call. If this key is set to + 'true', then NetworkManager will reload + connection files any time they changed. + + + auth-polkit + Whether the system uses PolicyKit for authorization. + If false, all requests will be allowed. If + true, non-root requests are authorized using PolicyKit. + The default value is true. + + + + dhcp + This key sets up what DHCP client + NetworkManager will use. Allowed values are + dhclient, dhcpcd, and + internal. The dhclient + and dhcpcd options require the indicated + clients to be installed. The internal + option uses a built-in DHCP client which is not currently as + featureful as the external clients (and in particular, does + not yet support DHCPv6). + If this key is missing, available DHCP clients are + looked for in this order: dhclient, + dhcpcd, + internal. + + + no-auto-default + Specify devices for which + NetworkManager shouldn't create default wired connection + (Auto eth0). By default, NetworkManager creates a temporary + wired connection for any Ethernet device that is managed and + doesn't have a connection configured. List a device in this + option to inhibit creating the default connection for the + device. May have the special value * to + apply to all devices. + When the default wired connection is deleted or saved + to a new persistent connection by a plugin, the device is + added to a list in the file + /var/run/NetworkManager/no-auto-default.state + to prevent creating the default connection for that device + again. + See for the syntax how to + specify a device. + + + Example: + +no-auto-default=00:22:68:5c:5d:c4,00:1e:65:ff:aa:ee +no-auto-default=eth0,eth1 +no-auto-default=* + + + + + + + ignore-carrier + + + Specify devices for which NetworkManager will (partially) + ignore the carrier state. Normally, for + device types that support carrier-detect, such as Ethernet + and InfiniBand, NetworkManager will only allow a + connection to be activated on the device if carrier is + present (ie, a cable is plugged in), and it will + deactivate the device if carrier drops for more than a few + seconds. + + + Listing a device here will allow activating connections on + that device even when it does not have carrier, provided + that the connection uses only statically-configured IP + addresses. Additionally, it will allow any active + connection (whether static or dynamic) to remain active on + the device when carrier is lost. + + + Note that the "carrier" property of NMDevices and device D-Bus + interfaces will still reflect the actual device state; it's just + that NetworkManager will not make use of that information. + + See for the syntax how to + specify a device. + + + + + + assume-ipv6ll-only + + + Specify devices for which NetworkManager will try to + generate a connection based on initial configuration when + the device only has an IPv6 link-local address. + + See for the syntax how to + specify a device. + + + + + + configure-and-quit + + + When set to 'true', NetworkManager quits after + performing initial network configuration but spawns small helpers + to preserve DHCP leases and IPv6 addresses. This is useful in + environments where network setup is more or less static or it is + desirable to save process time but still handle some dynamic + configurations. When this option is true, + network configuration for WiFi, WWAN, Bluetooth, ADSL, and PPPoE + interfaces cannot be preserved due to their use of external + services, and these devices will be deconfigured when NetworkManager + quits even though other interface's configuration may be preserved. + Also, to preserve DHCP addresses the 'dhcp' option + must be set to 'internal'. The default value of + the 'configure-and-quit' option is + 'false', meaning that NetworkManager will continue + running after initial network configuration and continue responding + to system and hardware events, D-Bus requests, and user commands. + + + + + + dns + Set the DNS (resolv.conf) processing mode. + default: The default if the key is + not specified. NetworkManager will update + resolv.conf to reflect the nameservers + provided by currently active connections. + dnsmasq: NetworkManager will run + dnsmasq as a local caching nameserver, using a "split DNS" + configuration if you are connected to a VPN, and then update + resolv.conf to point to the local + nameserver. + unbound: NetworkManager will talk + to unbound and dnssec-triggerd, providing a "split DNS" + configuration with DNSSEC support. The /etc/resolv.conf + will be managed by dnssec-trigger daemon. + none: NetworkManager will not + modify resolv.conf. + + + + + rc-manager + Set the resolv.conf + management mode. The default value depends on how NetworkManager + was built. + none: NetworkManager will directly + write changes to resolv.conf. + resolvconf: NetworkManager will run + resolvconf to update the DNS configuration. + netconfig: NetworkManager will run + netconfig to update the DNS configuration. + + + + + debug + Comma separated list of options to aid + debugging. This value will be combined with the environment + variable NM_DEBUG. Currently the following + values are supported: + + RLIMIT_CORE: set ulimit -c unlimited + to write out core dumps. Beware, that a core dump can contain + sensitive information such as passwords or configuration settings. + + + fatal-warnings: set g_log_set_always_fatal() + to core dump on warning messages from glib. This is equivalent + to the --g-fatal-warnings command line option. + + + + + + + + + <literal>keyfile</literal> section + This section contains keyfile-plugin-specific options, and + is normally only used when you are not using any other + distro-specific plugin. + + + + + hostname + This key is deprecated and has no effect + since the hostname is now stored in /etc/hostname or other + system configuration files according to build options. + + + + path + + The location where keyfiles are read and stored. + This defaults to "/usr/local/etc/NetworkManager/conf.d". + + + + + unmanaged-devices + Set devices that should be ignored by + NetworkManager. + + See for the syntax how to + specify a device. + + + Example: + +unmanaged-devices=interface-name:em4 +unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4;interface-name:eth2 + + + + + + + + + + <literal>ifupdown</literal> section + This section contains ifupdown-specific options and thus only + has effect when using the ifupdown plugin. + + + + + managed + If set to true, then + interfaces listed in + /etc/network/interfaces are managed by + NetworkManager. If set to false, then + any interface listed in + /etc/network/interfaces will be ignored + by NetworkManager. Remember that NetworkManager controls the + default route, so because the interface is ignored, + NetworkManager may assign the default route to some other + interface. + + The default value is false. + + + + + + + + + <literal>logging</literal> section + This section controls NetworkManager's logging. Any + settings here are overridden by the + and command-line options. + + + + + level + The default logging verbosity level. + One of OFF, ERR, + WARN, INFO, + DEBUG, TRACE. The ERR + level logs only critical errors. WARN logs warnings that may + reflect operation. INFO logs various informational messages that + are useful for tracking state and operations. DEBUG enables + verbose logging for debugging purposes. TRACE enables even more + verbose logging then DEBUG level. Subsequent levels also log + all messages from earlier levels; thus setting the log level + to INFO also logs error and warning messages. + + + domains + The following log domains are available: + PLATFORM, RFKILL, ETHER, WIFI, BT, MB, DHCP4, DHCP6, PPP, + WIFI_SCAN, IP4, IP6, AUTOIP4, DNS, VPN, SHARING, SUPPLICANT, + AGENTS, SETTINGS, SUSPEND, CORE, DEVICE, OLPC, WIMAX, + INFINIBAND, FIREWALL, ADSL, BOND, VLAN, BRIDGE, DBUS_PROPS, + TEAM, CONCHECK, DCB, DISPATCH, AUDIT. + In addition, these special domains can be used: NONE, + ALL, DEFAULT, DHCP, IP. + You can specify per-domain log level overrides by + adding a colon and a log level to any domain. E.g., + "WIFI:DEBUG,WIFI_SCAN:OFF". + + + Domain descriptions: + + PLATFORM : OS (platform) operations + RFKILL : RFKill subsystem operations + ETHER : Ethernet device operations + WIFI : Wi-Fi device operations + BT : Bluetooth operations + MB : Mobile broadband operations + DHCP4 : DHCP for IPv4 + DHCP6 : DHCP for IPv6 + PPP : Point-to-point protocol operations + WIFI_SCAN : Wi-Fi scanning operations + IP4 : IPv4-related operations + IP6 : IPv6-related operations + AUTOIP4 : AutoIP operations + DNS : Domain Name System related operations + VPN : Virtual Private Network connections and operations + SHARING : Connection sharing + SUPPLICANT : WPA supplicant related operations + AGENTS : Secret agents operations and communication + SETTINGS : Settings/config service operations + SUSPEND : Suspend/resume + CORE : Core daemon and policy operations + DEVICE : Activation and general interface operations + OLPC : OLPC Mesh device operations + WIMAX : WiMAX device operations + INFINIBAND : InfiniBand device operations + FIREWALL : FirewallD related operations + ADSL : ADSL device operations + BOND : Bonding operations + VLAN : VLAN operations + BRIDGE : Bridging operations + DBUS_PROPS : D-Bus property changes + TEAM : Teaming operations + CONCHECK : Connectivity check + DCB : Data Center Bridging (DCB) operations + DISPATCH : Dispatcher scripts + AUDIT : Audit records + + NONE : when given by itself logging is disabled + ALL : all log domains + DEFAULT : default log domains + DHCP : shortcut for "DHCP4,DHCP6" + IP : shortcut for "IP4,IP6" + + HW : deprecated alias for "PLATFORM" + + + + + backend + The logging backend. Supported values + are "debug", "syslog", + "journal" and "journal-syslog-style. + "debug" uses syslog and logs to standard error. + "journal-syslog-style" prints the same message to journal + as it would print for "syslog", containing redundant + fields in the text. + If NetworkManager is started in debug mode (--debug) + this option is ignored and "debug" is always used. + Otherwise, the default is "journal-syslog-style". + + + + audit + Whether the audit records are delivered to + auditd, the audit daemon. If false, audit + records will be sent only to the NetworkManager logging + system. If set to true, they will be also + sent to auditd. The default value is true. + + + + + + + + <literal>connection</literal> section + This section allows to specify default values for + connections. Not all properties can be overwritten, only a selected + list below. You can have multiple connection + sections, by having different sections with a name that all start + with "connection". + + Example: + +[connection] +ipv6.ip6-privacy=0 +connection.autoconnect-slaves=1 +vpn.timeout=120 + +[connection-wifi-wlan0] +match-device=interface-name:wlan0 +ipv4.route-metric=50 + +[connection-wifi-other] +match-device=type:wifi +ipv4.route-metric=55 +ipv6.ip6-privacy=1 + + + + + The sections within one file are considered in order of appearance, with the + exception that the [connection] section is always + considered last. In the example above, this order is [connection-wifi-wlan0], + [connection-wlan-other], and [connection]. + When checking for a default configuration value, the section are searched until + the requested value is found. + In the example above, "ipv4.route-metric" for wlan0 interface is set to 50, + and for all other Wi-Fi typed interfaces to 55. Also, Wi-Fi devices would have + IPv6 private addresses enabled by default, but other devices would have it disabled. + Note that also "wlan0" gets "ipv6.ip6-privacy=1", because although the section + "[connection-wifi-wlan0]" matches the device, it does not contain that property + and the search continues. + + + When having different sections in multiple files, sections from files that are read + later have higher priority. So within one file the priority of the sections is + top-to-bottom. Across multiple files later definitions take precedence. + + + + + + match-device + An optional device spec that restricts + when the section applies. See + for the possible values. + + + + stop-match + An optional boolean value which defaults to + no. If the section matches (based on + match-device), further sections will not be + considered even if the property in question is not present. In + the example above, if [connection-wifi-wlan0] would + have stop-match set to yes, + its ipv6.ip6-privacy value would be + unspecified. + + + + + + + The following properties are supported to have their default values configured: + + + connection.autoconnect-slaves + + + connection.lldp + + + ethernet.wake-on-lan + + + ipv4.route-metric + + + ipv4.dhcp-timeout + If left unspecified, the default value for + the interface type is used. + + + ipv6.ip6-privacy + If ipv6.ip6-privacy is unset, use the content of + "/proc/sys/net/ipv6/conf/default/use_tempaddr" as last fallback. + + + + ipv6.route-metric + + + + vpn.timeout + If left unspecified, default value of 60 seconds is used. + + + wifi.mac-address-randomization + If left unspecified, MAC address randomization is disabled. + + + + + + <literal>connectivity</literal> section + This section controls NetworkManager's optional connectivity + checking functionality. This allows NetworkManager to detect + whether or not the system can actually access the internet or + whether it is behind a captive portal. + + + + + uri + The URI of a web page to periodically + request when connectivity is being checked. This page + should return the header "X-NetworkManager-Status" with a + value of "online". Alternatively, it's body content should + be set to "NetworkManager is online". The body content + check can be controlled by the response + option. If this option is blank or missing, connectivity + checking is disabled. + + + + interval + Specified in seconds; controls how often + connectivity is checked when a network connection exists. If + set to 0 connectivity checking is disabled. If missing, the + default is 300 seconds. + + + response + If set controls what body content + NetworkManager checks for when requesting the URI for + connectivity checking. If missing, defaults to + "NetworkManager is online" + + + + + + + <literal>global-dns</literal> section + This section specifies global DNS settings that override + connection-specific configuration. + + + + searches + + + A list of search domains to be used during hostname lookup. + + + + + options + + + A list of of options to be passed to the hostname resolver. + + + + + + + + + <literal>global-dns-domain</literal> sections + Sections with a name starting with the "global-dns-domain-" + prefix allow to define global DNS configuration for specific + domains. The part of section name after "global-dns-domain-" + specifies the domain name a section applies to. More specific + domains have the precedence over less specific ones and the + default domain is represented by the wildcard "*". A default + domain section is mandatory. + + + + + servers + + + A list of addresses of DNS servers to be used for the given domain. + + + + + options + + + A list of domain-specific DNS options. Not used at the moment. + + + + + + + + + <literal>.config</literal> sections + This is a special section that contains options which apply + to the configuration file that contains the option. + + + + + enable + + + Defaults to "true". If "false", + the configuration file will be skipped during loading. + Note that the main configuration file NetworkManager.conf + cannot be disabled. + +# always skip loading the config file +[.config] +enable=false + + + + You can also match against the version of NetworkManager. For example + the following are valid configurations: + +# only load on version 1.0.6 +[.config] +enable=nm-version:1.0.6 + +# load on all versions 1.0.x, but not 1.2.x +[.config] +enable=nm-version:1.0 + +# only load on versions >= 1.1.6. This does not match +# with version 1.2.0 or 1.4.4. Only the last digit is considered. +[.config] +enable=nm-version-min:1.1.6 + +# only load on versions >= 1.2. Contrary to the previous +# example, this also matches with 1.2.0, 1.2.10, 1.4.4, etc. +[.config] +enable=nm-version-min:1.2 + +# Match against the maximum allowed version. The example matches +# versions 1.2.0, 1.2.2, 1.2.4. Again, only the last version digit +# is allowed to be smaller. So this would not match match on 1.1.10. +[.config] +enable=nm-version-max:1.2.6 + + + + You can also match against the value of the environment variable + NM_CONFIG_ENABLE_TAG, like: + +# always skip loading the file when running NetworkManager with +# environment variable "NM_CONFIG_ENABLE_TAG=TAG1" +[.config] +enable=env:TAG1 + + + + More then one match can be specified. The configuration will be + enabled if one of the predicates matches ("or"). The special prefix "except:" can + be used to negate the match. Note that if one except-predicate + matches, the entire configuration will be disabled. + In other words, a except predicate always wins over other predicates. + +# enable the configuration either when the environment variable +# is present or the version is at least 1.2.0. +[.config] +enable=env:TAG2,nm-version-min:1.2 + +# enable the configuration for version >= 1.2.0, but disable +# it when the environment variable is set to "TAG3" +[.config] +enable=except:env:TAG3,nm-version-min:1.2 + +# enable the configuration on >= 1.3, >= 1.2.6, and >= 1.0.16. +# Useful if a certain feature is only present since those releases. +[.config] +enable=nm-version-min:1.3,nm-version-min:1.2.6,nm-version-min:1.0.16 + + + + + + + + + + Plugins + + + + keyfile + + + The keyfile plugin is the generic + plugin that supports all the connection types and + capabilities that NetworkManager has. It writes files out + in an .ini-style format in + /etc/NetworkManager/system-connections. + + + The stored connection file may contain passwords and + private keys, so it will be made readable only to root, + and the plugin will ignore files that are readable or + writable by any user or group other than root. + + + This plugin is always active, and will automatically be + used to store any connections that aren't supported by any + other active plugin. + + + + + ifcfg-rh + + + This plugin is used on the Fedora and Red Hat Enterprise + Linux distributions to read and write configuration from + the standard + /etc/sysconfig/network-scripts/ifcfg-* + files. It currently supports reading Ethernet, Wi-Fi, + InfiniBand, VLAN, Bond, Bridge, and Team connections. + Enabling ifcfg-rh implicitly enables + ibft plugin, if it is available. + This can be disabled by adding no-ibft. + + + + + + ifcfg-suse + + + This plugin is deprecated and its selection has no effect. + The keyfile plugin should be used + instead. + + + + + + ifupdown + + + This plugin is used on the Debian and Ubuntu + distributions, and reads Ethernet and Wi-Fi connections + from /etc/network/interfaces. + + + This plugin is read-only; any connections (of any type) + added from within NetworkManager when you are using this + plugin will be saved using the keyfile + plugin instead. + + + + + + ibft, no-ibft + + + This plugin allows to read iBFT configuration (iSCSI Boot Firmware Table). + The configuration is read using /sbin/iscsiadm. Users are expected to + configure iBFT connections via the firmware interfaces. + If ibft support is available, it is automatically enabled after + ifcfg-rh. This can be disabled by no-ibft. + You can also explicitly specify ibft to load the + plugin without ifcfg-rh or to change the plugin order. + + + + + + + + + Appendix + + Device List Format + + The configuration options main.no-auto-default, main.ignore-carrier, + and keyfile.unmanaged-devices select devices based on a list of matchings. + Devices can be specified using the following format: + + + + + * + Matches every device. + + + IFNAME + Case sensitive match of interface name of the device. Globbing is not supported. + + + HWADDR + Match the MAC address of the device. Globbing is not supported + + + interface-name:IFNAME + interface-name:~IFNAME + Case sensitive match of interface name of the device. Simple globbing is supported with + * and ?. Ranges and escaping is not supported. + + + interface-name:=IFNAME + Case sensitive match of interface name of the device. Globbing is disabled and IFNAME + is taken literally. + + + mac:HWADDR + Match the MAC address of the device. Globbing is not supported + + + s390-subchannels:HWADDR + Match the device based on the subchannel address. Globbing is not supported + + + type:TYPE + Match the device type. Valid type names are as reported by "nmcli -f GENERAL.TYPE device show". + Globbing is not supported. + + + except:SPEC + Negative match of a device. SPEC must be explicitly qualified with + a prefix such as interface-name:. A negative match has higher priority then the positive + matches above. + + + SPEC[,;]SPEC + Multiple specs can be concatenated with commas or semicolons. The order does not matter as + matches are either inclusive or negative (except:), with negative matches having higher + priority. + + Backslash is supported to escape the separators ';' and ',', and to express special + characters such as newline ('\n'), tabulator ('\t'), whitespace ('\s') and backslash ('\\'). The globbing of + interface names cannot be escaped. Whitespace is not a separator but will be trimmed between + two specs (unless escaped as '\s'). + + + + + + + Example: + +interface-name:em4 +mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4;interface-name:eth2 +interface-name:vboxnet*,except:interface-name:vboxnet2 +*,except:mac:00:22:68:1c:59:b1 + + + + + + + See Also + + NetworkManager8, + nmcli1, + nmcli-examples5, + nm-online1, + nm-settings5, + nm-applet1, + nm-connection-editor1 + + + diff --git a/man/NetworkManager.conf.xml.in b/man/NetworkManager.conf.xml.in index 029db24e..31c1cf8c 100644 --- a/man/NetworkManager.conf.xml.in +++ b/man/NetworkManager.conf.xml.in @@ -27,23 +27,39 @@ Copyright 2010 - 2014 Red Hat, Inc. /etc/NetworkManager/NetworkManager.conf, - /etc/NetworkManager/conf.d/name.conf + /etc/NetworkManager/conf.d/name.conf, + /usr/lib/NetworkManager/conf.d/name.conf, + /var/lib/NetworkManager/NetworkManager-intern.conf Description - This is a configuration file for NetworkManager. It is used + NetworkManager.conf is the configuration file for NetworkManager. It is used to set up various aspects of NetworkManager's behavior. The - location of the file may be changed through use of the - argument for NetworkManager. + location of the main file and configuration directories may be changed + through use of the , , + , and + argument for NetworkManager, respectively. If a default NetworkManager.conf is provided by your distribution's packages, you should not modify it, since your changes may get overwritten by package updates. Instead, you can add additional .conf - files to the conf.d directory. These will be read in order, - with later files overriding earlier ones. + files to the /etc/NetworkManager/conf.d directory. + These will be read in order, with later files overriding earlier ones. + Packages might install further configuration snippets to /usr/lib/NetworkManager/conf.d. + This directory is parsed first, even before NetworkManager.conf. + The loading of a file /usr/lib/NetworkManager/conf.d/name.conf + can be prevented by adding a file /etc/NetworkManager/conf.d/name.conf. + In this case, the file from the etc configuration shadows the file from the + system configuration directory. + + + NetworkManager can overwrite certain user configuration options via D-Bus or other internal + operations. In this case it writes those changes to /var/lib/NetworkManager/NetworkManager-intern.conf. + This file is not intended to be modified by the user, but it is read last and can shadow + user configuration from NetworkManager.conf. @@ -269,6 +285,20 @@ no-auto-default=* + + rc-manager + Set the resolv.conf + management mode. The default value depends on how NetworkManager + was built. + none: NetworkManager will directly + write changes to resolv.conf. + resolvconf: NetworkManager will run + resolvconf to update the DNS configuration. + netconfig: NetworkManager will run + netconfig to update the DNS configuration. + + + debug Comma separated list of options to aid @@ -301,8 +331,19 @@ no-auto-default=* hostname - Set a persistent hostname. + This key is deprecated and has no effect + since the hostname is now stored in /etc/hostname or other + system configuration files according to build options. + + + path + + The location where keyfiles are read and stored. + This defaults to "@NM_CONFIG_KEYFILE_PATH_DEFAULT@". + + + unmanaged-devices Set devices that should be ignored by @@ -363,7 +404,7 @@ unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4;interface-name:eth level The default logging verbosity level. - One of ERR, + One of OFF, ERR, WARN, INFO, DEBUG, TRACE. The ERR level logs only critical errors. WARN logs warnings that may @@ -381,12 +422,12 @@ unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4;interface-name:eth WIFI_SCAN, IP4, IP6, AUTOIP4, DNS, VPN, SHARING, SUPPLICANT, AGENTS, SETTINGS, SUSPEND, CORE, DEVICE, OLPC, WIMAX, INFINIBAND, FIREWALL, ADSL, BOND, VLAN, BRIDGE, DBUS_PROPS, - TEAM, CONCHECK, DCB, DISPATCH. + TEAM, CONCHECK, DCB, DISPATCH, AUDIT. In addition, these special domains can be used: NONE, ALL, DEFAULT, DHCP, IP. You can specify per-domain log level overrides by adding a colon and a log level to any domain. E.g., - "WIFI:DEBUG". + "WIFI:DEBUG,WIFI_SCAN:OFF". Domain descriptions: @@ -403,7 +444,7 @@ unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4;interface-name:eth WIFI_SCAN : Wi-Fi scanning operations IP4 : IPv4-related operations IP6 : IPv6-related operations - AUTOIP4 : AutoIP (avahi) operations + AUTOIP4 : AutoIP operations DNS : Domain Name System related operations VPN : Virtual Private Network connections and operations SHARING : Connection sharing @@ -426,6 +467,7 @@ unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4;interface-name:eth CONCHECK : Connectivity check DCB : Data Center Bridging (DCB) operations DISPATCH : Dispatcher scripts + AUDIT : Audit records NONE : when given by itself logging is disabled ALL : all log domains @@ -437,6 +479,29 @@ unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4;interface-name:eth + + backend + The logging backend. Supported values + are "debug", "syslog", + "journal" and "journal-syslog-style. + "debug" uses syslog and logs to standard error. + "journal-syslog-style" prints the same message to journal + as it would print for "syslog", containing redundant + fields in the text. + If NetworkManager is started in debug mode (--debug) + this option is ignored and "debug" is always used. + Otherwise, the default is "@NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@". + + + + audit + Whether the audit records are delivered to + auditd, the audit daemon. If false, audit + records will be sent only to the NetworkManager logging + system. If set to true, they will be also + sent to auditd. The default value is @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@. + + @@ -454,6 +519,7 @@ unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4;interface-name:eth [connection] ipv6.ip6-privacy=0 connection.autoconnect-slaves=1 +vpn.timeout=120 [connection-wifi-wlan0] match-device=interface-name:wlan0 @@ -513,9 +579,23 @@ ipv6.ip6-privacy=1 The following properties are supported to have their default values configured: + + connection.autoconnect-slaves + + + connection.lldp + + + ethernet.wake-on-lan + ipv4.route-metric + + ipv4.dhcp-timeout + If left unspecified, the default value for + the interface type is used. + ipv6.ip6-privacy If ipv6.ip6-privacy is unset, use the content of @@ -525,13 +605,15 @@ ipv6.ip6-privacy=1 ipv6.route-metric - - connection.autoconnect-slaves - - - ethernet.wake-on-lan - + + vpn.timeout + If left unspecified, default value of 60 seconds is used. + + + wifi.mac-address-randomization + If left unspecified, MAC address randomization is disabled. + @@ -574,6 +656,153 @@ ipv6.ip6-privacy=1 + + <literal>global-dns</literal> section + This section specifies global DNS settings that override + connection-specific configuration. + + + + searches + + + A list of search domains to be used during hostname lookup. + + + + + options + + + A list of of options to be passed to the hostname resolver. + + + + + + + + + <literal>global-dns-domain</literal> sections + Sections with a name starting with the "global-dns-domain-" + prefix allow to define global DNS configuration for specific + domains. The part of section name after "global-dns-domain-" + specifies the domain name a section applies to. More specific + domains have the precedence over less specific ones and the + default domain is represented by the wildcard "*". A default + domain section is mandatory. + + + + + servers + + + A list of addresses of DNS servers to be used for the given domain. + + + + + options + + + A list of domain-specific DNS options. Not used at the moment. + + + + + + + + + <literal>.config</literal> sections + This is a special section that contains options which apply + to the configuration file that contains the option. + + + + + enable + + + Defaults to "true". If "false", + the configuration file will be skipped during loading. + Note that the main configuration file NetworkManager.conf + cannot be disabled. + +# always skip loading the config file +[.config] +enable=false + + + + You can also match against the version of NetworkManager. For example + the following are valid configurations: + +# only load on version 1.0.6 +[.config] +enable=nm-version:1.0.6 + +# load on all versions 1.0.x, but not 1.2.x +[.config] +enable=nm-version:1.0 + +# only load on versions >= 1.1.6. This does not match +# with version 1.2.0 or 1.4.4. Only the last digit is considered. +[.config] +enable=nm-version-min:1.1.6 + +# only load on versions >= 1.2. Contrary to the previous +# example, this also matches with 1.2.0, 1.2.10, 1.4.4, etc. +[.config] +enable=nm-version-min:1.2 + +# Match against the maximum allowed version. The example matches +# versions 1.2.0, 1.2.2, 1.2.4. Again, only the last version digit +# is allowed to be smaller. So this would not match match on 1.1.10. +[.config] +enable=nm-version-max:1.2.6 + + + + You can also match against the value of the environment variable + NM_CONFIG_ENABLE_TAG, like: + +# always skip loading the file when running NetworkManager with +# environment variable "NM_CONFIG_ENABLE_TAG=TAG1" +[.config] +enable=env:TAG1 + + + + More then one match can be specified. The configuration will be + enabled if one of the predicates matches ("or"). The special prefix "except:" can + be used to negate the match. Note that if one except-predicate + matches, the entire configuration will be disabled. + In other words, a except predicate always wins over other predicates. + +# enable the configuration either when the environment variable +# is present or the version is at least 1.2.0. +[.config] +enable=env:TAG2,nm-version-min:1.2 + +# enable the configuration for version >= 1.2.0, but disable +# it when the environment variable is set to "TAG3" +[.config] +enable=except:env:TAG3,nm-version-min:1.2 + +# enable the configuration on >= 1.3, >= 1.2.6, and >= 1.0.16. +# Useful if a certain feature is only present since those releases. +[.config] +enable=nm-version-min:1.3,nm-version-min:1.2.6,nm-version-min:1.0.16 + + + + + + + + Plugins @@ -592,7 +821,7 @@ ipv6.ip6-privacy=1 The stored connection file may contain passwords and private keys, so it will be made readable only to root, and the plugin will ignore files that are readable or - writeable by any user or group other than root. + writable by any user or group other than root. This plugin is always active, and will automatically be @@ -611,6 +840,9 @@ ipv6.ip6-privacy=1 /etc/sysconfig/network-scripts/ifcfg-* files. It currently supports reading Ethernet, Wi-Fi, InfiniBand, VLAN, Bond, Bridge, and Team connections. + Enabling ifcfg-rh implicitly enables + ibft plugin, if it is available. + This can be disabled by adding no-ibft. @@ -619,12 +851,9 @@ ipv6.ip6-privacy=1 ifcfg-suse - This plugin is only provided for simple backward - compatibility with SUSE and OpenSUSE configuration. Most - setups should be using the keyfile - plugin instead. The ifcfg-suse plugin - supports reading Ethernet and Wi-Fi connections, but does - not support saving any connection types. + This plugin is deprecated and its selection has no effect. + The keyfile plugin should be used + instead. @@ -647,12 +876,16 @@ ipv6.ip6-privacy=1 - ibft + ibft, no-ibft This plugin allows to read iBFT configuration (iSCSI Boot Firmware Table). The configuration is read using /sbin/iscsiadm. Users are expected to configure iBFT connections via the firmware interfaces. + If ibft support is available, it is automatically enabled after + ifcfg-rh. This can be disabled by no-ibft. + You can also explicitly specify ibft to load the + plugin without ifcfg-rh or to change the plugin order. @@ -715,12 +948,16 @@ ipv6.ip6-privacy=1 SPEC[,;]SPEC - Multiple specs can be concatenated with comman or semicolon. The order does not matter as - matches are either positive (inclusive) or negative, with negative matches having higher priority. + Multiple specs can be concatenated with commas or semicolons. The order does not matter as + matches are either inclusive or negative (except:), with negative matches having higher + priority. + Backslash is supported to escape the separators ';' and ',', and to express special characters such as newline ('\n'), tabulator ('\t'), whitespace ('\s') and backslash ('\\'). The globbing of - interface names cannot be escaped. Whitespace is taken literally so usually the specs will be concatenated - without spaces. + interface names cannot be escaped. Whitespace is not a separator but will be trimmed between + two specs (unless escaped as '\s'). + + diff --git a/man/NetworkManager.xml b/man/NetworkManager.xml new file mode 100644 index 00000000..2df37d9a --- /dev/null +++ b/man/NetworkManager.xml @@ -0,0 +1,461 @@ + + + + + + + + + NetworkManager + NetworkManager developers + + + NetworkManager + 8 + NetworkManager + Network management daemons + 1.0 + + + + NetworkManager + network management daemon + + + + + NetworkManager OPTIONS + + + + + Description + + The NetworkManager daemon attempts to make networking + configuration and operation as painless and automatic as + possible by managing the primary network connection and other + network interfaces, like Ethernet, WiFi, and Mobile Broadband + devices. NetworkManager will connect any network device when a + connection for that device becomes available, unless that + behavior is disabled. Information about networking is exported + via a D-Bus interface to any interested application, providing a + rich API with which to inspect and control network settings and + operation. + + + + + Dispatcher scripts + + NetworkManager will execute scripts in the + /etc/NetworkManager/dispatcher.d directory or subdirectories in + alphabetical order in response to network events. Each script should + be a regular executable file owned by root. Furthermore, it must not be + writable by group or other, and not setuid. + + + Each script receives two arguments, the first being the interface name of the + device an operation just happened on, and second the action. For device actions, + the interface is the name of the kernel interface suitable for IP configuration. + Thus it is either VPN_IP_IFACE, DEVICE_IP_IFACE, or DEVICE_IFACE, as applicable. + For the hostname action it is always "none". + + The actions are: + + + pre-up + The interface is connected to the network but is not + yet fully activated. Scripts acting on this event must be placed or + symlinked into the /etc/NetworkManager/dispatcher.d/pre-up.d directory, + and NetworkManager will wait for script execution to complete before + indicating to applications that the interface is fully activated. + + + + up + The interface has been activated. + + + pre-down + The interface will be deactivated but has not yet been + disconnected from the network. Scripts acting on this event must be + placed or symlinked into the /etc/NetworkManager/dispatcher.d/pre-down.d + directory, and NetworkManager will wait for script execution to complete + before disconnecting the interface from its network. Note that this + event is not emitted for forced disconnections, like when carrier is + lost or a wireless signal fades. It is only emitted when there is + an opportunity to cleanly handle a network disconnection event. + + + + down + + The interface has been deactivated. + + + + vpn-pre-up + The VPN is connected to the network but is not yet + fully activated. Scripts acting on this event must be placed or + symlinked into the /etc/NetworkManager/dispatcher.d/pre-up.d directory, + and NetworkManager will wait for script execution to complete before + indicating to applications that the VPN is fully activated. + + + + vpn-up + + A VPN connection has been activated. + + + + vpn-pre-down + The VPN will be deactivated but has not yet been + disconnected from the network. Scripts acting on this event must be + placed or symlinked into the /etc/NetworkManager/dispatcher.d/pre-down.d + directory, and NetworkManager will wait for script execution to complete + before disconnecting the VPN from its network. Note that this + event is not emitted for forced disconnections, like when the VPN + terminates unexpectedly or general connectivity is lost. It is only + emitted when there is an opportunity to cleanly handle a VPN + disconnection event. + + + + vpn-down + + A VPN connection has been deactivated. + + + + hostname + + The system hostname has been updated. Use gethostname(2) to retrieve it. + The interface name (first argument) is empty and no environment variable is + set for this action. + + + + dhcp4-change + + The DHCPv4 lease has changed (renewed, rebound, etc). + + + + dhcp6-change + + The DHCPv6 lease has changed (renewed, rebound, etc). + + + + + The environment contains more information about the interface and the connection. + The following variables are available for the use in the dispatcher scripts: + + + CONNECTION_UUID + + The UUID of the connection profile. + + + + CONNECTION_ID + + The name (ID) of the connection profile. + + + + CONNECTION_DBUS_PATH + + The NetworkManager D-Bus path of the connection. + + + + CONNECTION_FILENAME + + The backing file name of the connection profile (if any). + + + + CONNECTION_EXTERNAL + + If "1", this indicates that the connection describes a + network configuration created outside of NetworkManager. + + + + DEVICE_IFACE + + The interface name of the device. + + + + DEVICE_IP_IFACE + + The IP interface name of the device. + + + + IP4_ADDRESS_N + + The IPv4 address in the format "address/prefix gateway", where N is a number + from 0 to (# IPv4 addresses - 1). gateway item in this variable is deprecated, + use IP4_GATEWAY instead. + + + + IP4_NUM_ADDRESSES + + The variable contains the number of IPv4 addresses the script may expect. + + + + IP4_GATEWAY + + The gateway IPv4 address in traditional numbers-and-dots notation. + + + + IP4_ROUTE_N + + The IPv4 route in the format "address/prefix next-hop metric", where N is a number + from 0 to (# IPv4 routes - 1). + + + + IP4_NUM_ROUTES + + The variable contains the number of IPv4 routes the script may expect. + + + + IP4_NAMESERVERS + + The variable contains a space-separated list of the DNS servers. + + + + IP4_DOMAINS + + The variable contains a space-separated list of the search domains. + + + + DHCP4_<dhcp-option-name> + + If the connection used DHCP for address configuration, the received DHCP + configuration is passed in the environment using standard DHCP + option names, prefixed with "DHCP4_", like "DHCP4_HOST_NAME=foobar". + + + + IP6_<name> and DHCP6_<name> + + The same variables as for IPv4 are available for IPv6, but the prefixes are IP6_ + and DHCP6_ instead. + + + + + + In case of VPN, VPN_IP_IFACE is set, and IP4_*, IP6_* variables with VPN prefix are + exported too, like VPN_IP4_ADDRESS_0, VPN_IP4_NUM_ADDRESSES. + + + Dispatcher scripts are run one at a time, but asynchronously from the main + NetworkManager process, and will be killed if they run for too long. If your script + might take arbitrarily long to complete, you should spawn a child process and have the + parent return immediately. Scripts that are symbolic links pointing inside the + /etc/NetworkManager/dispatcher.d/no-wait.d/ directory are run immediately, without + waiting for the termination of previous scripts, and in parallel. Also beware that + once a script is queued, it will always be run, even if a later event renders it + obsolete. (Eg, if an interface goes up, and then back down again quickly, it is + possible that one or more "up" scripts will be run after the interface has gone down.) + + + + + Options + + The following options are understood: + + + + | + Print the NetworkManager software version and exit. + + + + | + Print NetworkManager's available options and exit. + + + + | + Do not daemonize. + + + + | + Do not daemonize, and direct log output to the + controlling terminal in addition to syslog. + + + + | + Specify location of a PID file. The PID file + is used for storing PID of the running process and prevents + running multiple instances. + + + + + Specify file for storing state of the + NetworkManager persistently. If not specified, the default + value of /var/lib/NetworkManager/NetworkManager.state is used. + + + + + Specify configuration file to set up various + settings for NetworkManager. If not specified, the default + value of /etc/NetworkManager/NetworkManager.conf is used with + a fallback to the older 'nm-system-settings.conf' if located + in the same directory. See + NetworkManager.conf5 + for more information on configuration file. + + + + + List plugins used to manage system-wide + connection settings. This list has preference over plugins + specified in the configuration file. Currently supported + plugins are: keyfile, , + , . + + + + + + Sets how much information NetworkManager sends to the log destination (usually + syslog's "daemon" facility). By default, only informational, warning, and error + messages are logged. See the section on logging in + NetworkManager.conf5 + for more information. + + + + + + A comma-separated list specifying which operations are logged to the log + destination (usually syslog). By default, most domains are logging-enabled. + See the section on logging in + NetworkManager.conf5 + for more information. + + + + + + Print the NetworkManager configuration to stdout and exit. + + + + + + + UDEV PROPERTIES + + + udev7 + device manager is used for the network device discovery. The following + property influences how NetworkManager manages the devices: + + + + + NM_UNMANAGED + + No default connection will be created and automatic activation + will not be attempted when this property of a device is set to a + true value ("1" or "true"). You will still be able to attach a + connection to the device manually or observe externally added + configuration such as addresses or routes. + + Create an udev rule that sets this property to prevent NetworkManager + from interfering with virtual Ethernet device interfaces that are + managed by virtualization tools. + + + + + + + SIGNALS + + NetworkManager process handles the following signals: + + + SIGHUP + + The signal causes a reload of NetworkManager's configuration. + Note that not all configuration parameters can be changed at + runtime and therefore some changes may be applied only after + the next restart of the daemon. The signal also forces a + rewrite of DNS configuration. + + + + SIGUSR1 + + The signal forces a rewrite of DNS configuration. + + + + SIGUSR2 + + The signal has no effect at the moment. + + + + + + + + DEBUGGING + + The following environment variables are supported to help + debugging. When used in conjunction with the + option (thus echoing PPP and DHCP + helper output to stdout) these can quickly help pinpoint the + source of connection issues. Also see the + and + to enable debug logging inside NetworkManager itself. + + + : When set to anything, causes + NetworkManager to turn on PPP debugging in pppd, which logs + all PPP and PPTP frames and client/server exchanges. + + + + + See Also + + NetworkManager.conf5, + nmcli1, + nmcli-examples5, + nm-online1, + nm-settings5, + nm-applet1, + nm-connection-editor1 + udev7 + + + diff --git a/man/nm-settings-ifcfg-rh.5 b/man/nm-settings-ifcfg-rh.5 index ddc9062f..5b0435f8 100644 --- a/man/nm-settings-ifcfg-rh.5 +++ b/man/nm-settings-ifcfg-rh.5 @@ -2,12 +2,12 @@ .\" Title: nm-settings-ifcfg-rh .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 23 December 2015 +.\" Date: 19 January 2016 .\" Manual: Configuration -.\" Source: NetworkManager 1.0.9 +.\" Source: NetworkManager 1.1.90 .\" Language: English .\" -.TH "NM\-SETTINGS\-IFCFG\" "5" "" "NetworkManager 1\&.0\&.9" "Configuration" +.TH "NM\-SETTINGS\-IFCFG\" "5" "" "NetworkManager 1\&.1\&.90" "Configuration" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -257,7 +257,7 @@ files for a single device, NM_CONTROLLED=no in one of the files will cause the d .PP \fBNew variables\fR .RS 4 -NetworkManager has introduced some new variable, not present in initscripts, to be able to store data for its new features\&. The variables are marked as extensions in the tables bellows\&. +NetworkManager has introduced some new variable, not present in initscripts, to be able to store data for its new features\&. The variables are marked as extensions in the tables below\&. .RE .PP \fBSemantic change of variables\fR @@ -791,6 +791,7 @@ l l l l l l l l l l l l l l l l +l l l l l l l l. T{ mac\-address @@ -865,6 +866,17 @@ Ethernet MAC ageing time\&.\fB Allowed values: \fR0 \- 1000000 T} +T{ +multicast\-snooping +T}:T{ +BRIDGING_OPTS: multicast_snooping= +T}:T{ +1 +T}:T{ +IGMP snooping support\&.\fB + +Allowed values: \fR0 or 1 +T} .TE .sp 1 .sp @@ -899,6 +911,7 @@ l l l l l l l l l l l l l l l l +l l l l l l l l. T{ id @@ -1044,6 +1057,19 @@ Example: \fRCONNECTION_METERED=yes\fB Allowed values: \fRyes,no,unknown T} +T{ +lldp +T}:T{ +LLDP +T}:T{ +missing variable means global default +T}:T{ +whether LLDP is enabled for the connection\fB + +Example: \fRLLDP=no\fB + +Allowed values: \fRboolean value or \*(Aqrx\*(Aq +T} .TE .sp 1 .sp @@ -1240,7 +1266,7 @@ T} .TE .sp 1 .PP -All DCB related configuration is a NetworkManager extention\&. DCB=yes must be used explicitly to enable DCB so that the rest of the DCB_* variables can apply\&. +All DCB related configuration is a NetworkManager extension\&. DCB=yes must be used explicitly to enable DCB so that the rest of the DCB_* variables can apply\&. .sp .it 1 an-trap .nr an-no-space-flag 1 @@ -1323,7 +1349,7 @@ T} .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&8.\ \&ipv4 setting +.B Table\ \&8.\ \&ip-tunnel setting .TS allbox tab(:); lB lB lB lB. @@ -1337,6 +1363,30 @@ T}:T{ Description T} .T& +. +.TE +.sp 1 +.sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.B Table\ \&9.\ \&ipv4 setting +.TS +allbox tab(:); +lB lB lB lB. +T{ +Property +T}:T{ +Ifcfg\-rh Variable +T}:T{ +Default +T}:T{ +Description +T} +.T& +l l l l +l l l l l l l l l l l l l l l l @@ -1447,7 +1497,7 @@ DHCP_HOSTNAME T}:T{ \ \& T}:T{ -Hostname to send to the DHCP server\&. +Hostname to send to the DHCP server\&. When both DHCP_HOSTNAME and DHCP_FQDN are specified only the latter is used\&. T} T{ never\-default @@ -1487,6 +1537,28 @@ A string sent to the DHCP server to identify the local machine\&.\fB Example: \fRDHCP_CLIENT_ID=ax\-srv\-1 T} +T{ +dhcp\-timeout +T}:T{ +DHCP_TIMEOUT\fI(+)\fR +T}:T{ +\ \& +T}:T{ +A timeout after which the DHCP transaction fails in case of no response\&.\fB + +Example: \fRDHCP_TIMEOUT=10 +T} +T{ +dhcp\-fqdn +T}:T{ +DHCP_FQDN +T}:T{ +\ \& +T}:T{ +FQDN to send to the DHCP server\&. When both DHCP_HOSTNAME and DHCP_FQDN are specified only the latter is used\&.\fB + +Example: \fRDHCP_FQDN=foo\&.bar\&.com +T} .TE .sp 1 .sp @@ -1494,7 +1566,7 @@ T} .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&9.\ \&ipv6 setting +.B Table\ \&10.\ \&ipv6 setting .TS allbox tab(:); lB lB lB lB. @@ -1520,6 +1592,7 @@ l l l l l l l l l l l l l l l l +l l l l l l l l. T{ method @@ -1646,6 +1719,41 @@ Example: \fRIPV6_PRIVACY=rfc3041 IPV6_PRIVACY_PREFER_PUBLIC_IP=yes\fB Allowed values: \fRIPV6_PRIVACY: no, yes (rfc3041 or rfc4941); IPV6_PRIVACY_PREFER_PUBLIC_IP: yes, no T} +T{ +addr\-gen\-mode +T}:T{ +IPV6_ADDR_GEN_MODE +T}:T{ +eui64 +T}:T{ +Configure IPv6 Stable Privacy addressing for SLAAC (RFC7217)\&.\fB + +Example: \fRIPV6_ADDR_GEN_MODE=stable\-privacy\fB + +Allowed values: \fRIPV6_ADDR_GEN_MODE: eui64, stable\-privacy +T} +.TE +.sp 1 +.sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.B Table\ \&11.\ \&macvlan setting +.TS +allbox tab(:); +lB lB lB lB. +T{ +Property +T}:T{ +Ifcfg\-rh Variable +T}:T{ +Default +T}:T{ +Description +T} +.T& +. .TE .sp 1 .sp @@ -1653,7 +1761,7 @@ T} .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&10.\ \&team-port setting +.B Table\ \&12.\ \&team-port setting .TS allbox tab(:); lB lB lB lB. @@ -1684,7 +1792,7 @@ T} .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&11.\ \&team setting +.B Table\ \&13.\ \&team setting .TS allbox tab(:); lB lB lB lB. @@ -1715,7 +1823,29 @@ T} .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&12.\ \&vlan setting +.B Table\ \&14.\ \&tun setting +.TS +allbox tab(:); +lB lB lB lB. +T{ +Property +T}:T{ +Ifcfg\-rh Variable +T}:T{ +Default +T}:T{ +Description +T} +.T& +. +.TE +.sp 1 +.sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.B Table\ \&15.\ \&vlan setting .TS allbox tab(:); lB lB lB lB. @@ -1756,13 +1886,13 @@ T} T{ flags T}:T{ -VLAN_FLAGS, REORDER_HDR +REORDER_HDR, GVRP, MVRP, VLAN_FLAGS T}:T{ \ \& T}:T{ VLAN flags\&.\fB -Allowed values: \fR"GVRP", "LOOSE_BINDING" for VLAN_FLAGS; 0 or 1 for REORDER_HDR +Allowed values: \fR"yes or "no" for REORDER_HDR, GVRP and MVRP; "LOOSE_BINDING" for VLAN_FLAGS T} T{ ingress\-priority\-map @@ -1804,7 +1934,29 @@ T} .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&13.\ \&802-3-ethernet setting +.B Table\ \&16.\ \&vxlan setting +.TS +allbox tab(:); +lB lB lB lB. +T{ +Property +T}:T{ +Ifcfg\-rh Variable +T}:T{ +Default +T}:T{ +Description +T} +.T& +. +.TE +.sp 1 +.sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.B Table\ \&17.\ \&802-3-ethernet setting .TS allbox tab(:); lB lB lB lB. @@ -1943,7 +2095,7 @@ T} .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&14.\ \&802-11-wireless-security setting +.B Table\ \&18.\ \&802-11-wireless-security setting .TS allbox tab(:); lB lB lB lB. @@ -2150,7 +2302,7 @@ T} .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&15.\ \&802-11-wireless setting +.B Table\ \&19.\ \&802-11-wireless setting .TS allbox tab(:); lB lB lB lB. @@ -2177,6 +2329,8 @@ l l l l l l l l l l l l l l l l +l l l l +l l l l l l l l. T{ ssid @@ -2308,6 +2462,30 @@ T}:T{ Whether the network hides the SSID\&. T} T{ +powersave +T}:T{ +POWERSAVE\fI(+)\fR +T}:T{ +no +T}:T{ +Enables or disables Wi\-Fi power saving\&.\fB + +Example: \fRPOWERSAVE=yes +T} +T{ +mac\-address\-randomization +T}:T{ +MAC_ADDRESS_RANDOMIZATION\fI(+)\fR +T}:T{ +1 +T}:T{ +Enables or disables Wi\-Fi MAC address randomization\&.\fB + +Example: \fRMAC_ADDRESS_RANDOMIZATION=2\fB + +Allowed values: \fR0 (default), (1) never, (2) always +T} +T{ security T}:T{ (none) @@ -2332,7 +2510,7 @@ property that describes how to handle that secret\&. In the \fIfcfg\-rh\fR plugin variables for secret flags have a \fI_FLAGS\fR -suffix\&. The variables contain one or more of the folowing values (space separated)\&. Missing (or empty) *_FLAGS variable means that the password is owned by NetworkManager\&. +suffix\&. The variables contain one or more of the following values (space separated)\&. Missing (or empty) *_FLAGS variable means that the password is owned by NetworkManager\&. .sp .RS 4 .ie n \{\ diff --git a/man/nm-settings-ifcfg-rh.xml b/man/nm-settings-ifcfg-rh.xml index c5360f54..7d577106 100644 --- a/man/nm-settings-ifcfg-rh.xml +++ b/man/nm-settings-ifcfg-rh.xml @@ -1,6 +1,6 @@ -23 December 2015nm-settings-ifcfg-rh5NetworkManagerConfiguration1.0.9nm-settings-ifcfg-rhDescription of ifcfg-rh settings pluginDESCRIPTION +19 January 2016nm-settings-ifcfg-rh5NetworkManagerConfiguration1.1.90nm-settings-ifcfg-rhDescription of ifcfg-rh settings pluginDESCRIPTION NetworkManager is based on the concept of connection profiles that contain network configuration (see nm-settings5 for details). The profiles can be stored in various formats. NetworkManager uses plugins for reading and writing @@ -145,7 +145,7 @@ DEVICETYPE=TeamPort New variables NetworkManager has introduced some new variable, not present in initscripts, to be able to store data for its new features. The variables are marked - as extensions in the tables bellows. + as extensions in the tables below. Semantic change of variables NetworkManager had to slightly change the semantic for a few variables. PEERDNS - @@ -221,7 +221,9 @@ Allowed values: 1 - 10max-age< Allowed values: 6 - 40ageing-timeBRIDGING_OPTS: ageing_time=300Ethernet MAC ageing time. -Allowed values: 0 - 1000000connection settingPropertyIfcfg-rh VariableDefaultDescriptionidNAME(+)User friendly name for the connection profile.uuidUUID(+)UUID for the connection profile. When missing, NetworkManager creates the UUID itself (by hashing the file).interface-nameDEVICEInterface name of the device this profile is bound to. The variable can be left out when the profile should apply for more devices. Note that DEVICE can be required for some connection types.typeTYPE (DEVICETYPE, DEVICE)Base type of the connection. DEVICETYPE is used for teaming connections. +Allowed values: 0 - 1000000multicast-snoopingBRIDGING_OPTS: multicast_snooping=1IGMP snooping support. + +Allowed values: 0 or 1
connection settingPropertyIfcfg-rh VariableDefaultDescriptionidNAME(+)User friendly name for the connection profile.uuidUUID(+)UUID for the connection profile. When missing, NetworkManager creates the UUID itself (by hashing the file).interface-nameDEVICEInterface name of the device this profile is bound to. The variable can be left out when the profile should apply for more devices. Note that DEVICE can be required for some connection types.typeTYPE (DEVICETYPE, DEVICE)Base type of the connection. DEVICETYPE is used for teaming connections. Example: TYPE=Ethernet; TYPE=Bond; TYPE=Bridge; DEVICETYPE=TeamPort @@ -239,7 +241,11 @@ Example: GATEWAY_PING_TIMEOUT=5CONNECTION_METERED=yes -Allowed values: yes,no,unknown
dcb settingPropertyIfcfg-rh VariableDefaultDescriptionapp-fcoe-flagsDCB_APP_FCOE_ENABLE, DCB_APP_FCOE_ADVERTISE, DCB_APP_FCOE_WILLINGnoFCOE flags. +Allowed values: yes,no,unknownlldpLLDPmissing variable means global defaultwhether LLDP is enabled for the connection + +Example: LLDP=no + +Allowed values: boolean value or 'rx'
dcb settingPropertyIfcfg-rh VariableDefaultDescriptionapp-fcoe-flagsDCB_APP_FCOE_ENABLE, DCB_APP_FCOE_ADVERTISE, DCB_APP_FCOE_WILLINGnoFCOE flags. Example: DCB_APP_FCOE_ENABLE=yes DCB_APP_FCOE_ADVERTISE=yesapp-fcoe-priorityDCB_APP_FCOE_PRIORITYPriority of FCoE frames. @@ -262,7 +268,7 @@ Example: DCB_PG_UPPCT=7,13,10,10,15,15,10,20DCB_PG_STRICT=01101110priority-traffic-classDCB_PG_UP2TCPriority values. String of eight trafic class values (0 - 7). Example: DCB_PG_UP2TC=01623701
- All DCB related configuration is a NetworkManager extention. DCB=yes must be + All DCB related configuration is a NetworkManager extension. DCB=yes must be used explicitly to enable DCB so that the rest of the DCB_* variables can apply. infiniband settingPropertyIfcfg-rh VariableDefaultDescriptionmac-addressHWADDRIBoIP 20-byte hardware address of the device (in traditional hex-digits-and-colons notation). @@ -270,7 +276,7 @@ Example: HWADDR=01:02:03:04:05:06:07:08:09:0A:01:02:03:04:05:06:07:08 Example: PKEY=yes PKEY_ID=2 PHYSDEV=mlx4_ib0 DEVICE=mlx4_ib0.8002parentPHYSDEV (PKEY=yes)PKEY=noInfiniBand parent device. -Example: PHYSDEV=ib0
ipv4 settingPropertyIfcfg-rh VariableDefaultDescriptionmethodBOOTPROTOnoneMethod used for IPv4 protocol configuration. +Example: PHYSDEV=ib0
ip-tunnel settingPropertyIfcfg-rh VariableDefaultDescription
ipv4 settingPropertyIfcfg-rh VariableDefaultDescriptionmethodBOOTPROTOnoneMethod used for IPv4 protocol configuration. Allowed values: none, dhcp (bootp), static, ibft, autoip, shareddnsDNS1, DNS2, ...List of DNS servers. Even if NetworkManager supports many DNS servers, initscripts and resolver only care about the first three, usually. @@ -278,9 +284,13 @@ Example: DNS1=1.2.3.4 DNS2=10.0.0.254 DNS3=8.8.8.8 Example: IPADDR=10.5.5.23 PREFIX=24 IPADDR1=1.1.1.2 PREFIX1=16gatewayGATEWAYGateway IP address. -Example: GATEWAY=10.5.5.1routesADDRESS1, NETMASK1, GATEWAY1, METRIC1, ...List of static routes. They are not stored in ifcfg-* file, but in route-* file instead.ignore-auto-routesPEERROUTES(+)yesPEERROUTES has the opposite meaning as 'ignore-auto-routes' property.ignore-auto-dnsPEERDNSyesPEERDNS has the opposite meaning as 'ignore-auto-dns' property.dhcp-send-hostnameDHCP_SEND_HOSTNAME(+)yesWhether DHCP_HOSTNAME should be sent to the DHCP server.dhcp-hostnameDHCP_HOSTNAMEHostname to send to the DHCP server.never-defaultDEFROUTE (GATEWAYDEV in /etc/sysconfig/network)yesDEFROUTE=no tells NetworkManager that this connection should not be assigned the default route. DEFROUTE has the opposite meaning as 'never-default' property.may-failIPV4_FAILURE_FATAL(+)noIPV4_FAILURE_FATAL has the opposite meaning as 'may-fail' property.route-metricIPV4_ROUTE_METRIC(+)-1IPV4_ROUTE_METRIC is the default IPv4 metric for routes on this connection. If set to -1, a default metric based on the device type is used.dhcp-client-idDHCP_CLIENT_ID(+)A string sent to the DHCP server to identify the local machine. +Example: GATEWAY=10.5.5.1routesADDRESS1, NETMASK1, GATEWAY1, METRIC1, ...List of static routes. They are not stored in ifcfg-* file, but in route-* file instead.ignore-auto-routesPEERROUTES(+)yesPEERROUTES has the opposite meaning as 'ignore-auto-routes' property.ignore-auto-dnsPEERDNSyesPEERDNS has the opposite meaning as 'ignore-auto-dns' property.dhcp-send-hostnameDHCP_SEND_HOSTNAME(+)yesWhether DHCP_HOSTNAME should be sent to the DHCP server.dhcp-hostnameDHCP_HOSTNAMEHostname to send to the DHCP server. When both DHCP_HOSTNAME and DHCP_FQDN are specified only the latter is used.never-defaultDEFROUTE (GATEWAYDEV in /etc/sysconfig/network)yesDEFROUTE=no tells NetworkManager that this connection should not be assigned the default route. DEFROUTE has the opposite meaning as 'never-default' property.may-failIPV4_FAILURE_FATAL(+)noIPV4_FAILURE_FATAL has the opposite meaning as 'may-fail' property.route-metricIPV4_ROUTE_METRIC(+)-1IPV4_ROUTE_METRIC is the default IPv4 metric for routes on this connection. If set to -1, a default metric based on the device type is used.dhcp-client-idDHCP_CLIENT_ID(+)A string sent to the DHCP server to identify the local machine. + +Example: DHCP_CLIENT_ID=ax-srv-1dhcp-timeoutDHCP_TIMEOUT(+)A timeout after which the DHCP transaction fails in case of no response. + +Example: DHCP_TIMEOUT=10dhcp-fqdnDHCP_FQDNFQDN to send to the DHCP server. When both DHCP_HOSTNAME and DHCP_FQDN are specified only the latter is used. -Example: DHCP_CLIENT_ID=ax-srv-1
ipv6 settingPropertyIfcfg-rh VariableDefaultDescriptionmethodIPV6INIT, IPV6FORWARDING, IPV6_AUTOCONF, DHCPV6CIPV6INIT=yes; IPV6FORWARDING=no; IPV6_AUTOCONF=!IPV6FORWARDING, DHCPV6=noMethod used for IPv6 protocol configuration. ignore ~ IPV6INIT=no; auto ~ IPV6_AUTOCONF=yes; dhcp ~ IPV6_AUTOCONF=no and DHCPV6C=yesdnsDNS1, DNS2, ...List of DNS servers. NetworkManager uses the variables both for IPv4 and IPv6.dns-searchDOMAINList of DNS search domains.addressesIPV6ADDR, IPV6ADDR_SECONDARIESList of static IP addresses. +Example: DHCP_FQDN=foo.bar.com
ipv6 settingPropertyIfcfg-rh VariableDefaultDescriptionmethodIPV6INIT, IPV6FORWARDING, IPV6_AUTOCONF, DHCPV6CIPV6INIT=yes; IPV6FORWARDING=no; IPV6_AUTOCONF=!IPV6FORWARDING, DHCPV6=noMethod used for IPv6 protocol configuration. ignore ~ IPV6INIT=no; auto ~ IPV6_AUTOCONF=yes; dhcp ~ IPV6_AUTOCONF=no and DHCPV6C=yesdnsDNS1, DNS2, ...List of DNS servers. NetworkManager uses the variables both for IPv4 and IPv6.dns-searchDOMAINList of DNS search domains.addressesIPV6ADDR, IPV6ADDR_SECONDARIESList of static IP addresses. Example: IPV6ADDR=ab12:9876::1 IPV6ADDR_SECONDARIES="ab12:9876::2 ab12:9876::3"gatewayIPV6_DEFAULTGWGateway IP address. @@ -288,15 +298,19 @@ Example: IPV6_DEFAULTGW=abbe::1IPV6_PRIVACY=rfc3041 IPV6_PRIVACY_PREFER_PUBLIC_IP=yes -Allowed values: IPV6_PRIVACY: no, yes (rfc3041 or rfc4941); IPV6_PRIVACY_PREFER_PUBLIC_IP: yes, no
team-port settingPropertyIfcfg-rh VariableDefaultDescriptionconfigTEAM_PORT_CONFIGTeam port configuration in JSON. See man teamd.conf for details.
team settingPropertyIfcfg-rh VariableDefaultDescriptionconfigTEAM_CONFIGTeam configuration in JSON. See man teamd.conf for details.
vlan settingPropertyIfcfg-rh VariableDefaultDescriptionparentDEVICE or PHYSDEVParent interface of the VLAN.idVLAN_ID or DEVICEVLAN identifier.flagsVLAN_FLAGS, REORDER_HDRVLAN flags. +Allowed values: IPV6_PRIVACY: no, yes (rfc3041 or rfc4941); IPV6_PRIVACY_PREFER_PUBLIC_IP: yes, noaddr-gen-modeIPV6_ADDR_GEN_MODEeui64Configure IPv6 Stable Privacy addressing for SLAAC (RFC7217). -Allowed values: "GVRP", "LOOSE_BINDING" for VLAN_FLAGS; 0 or 1 for REORDER_HDRingress-priority-mapVLAN_INGRESS_PRIORITY_MAPIngress priority mapping. +Example: IPV6_ADDR_GEN_MODE=stable-privacy + +Allowed values: IPV6_ADDR_GEN_MODE: eui64, stable-privacy
macvlan settingPropertyIfcfg-rh VariableDefaultDescription
team-port settingPropertyIfcfg-rh VariableDefaultDescriptionconfigTEAM_PORT_CONFIGTeam port configuration in JSON. See man teamd.conf for details.
team settingPropertyIfcfg-rh VariableDefaultDescriptionconfigTEAM_CONFIGTeam configuration in JSON. See man teamd.conf for details.
tun settingPropertyIfcfg-rh VariableDefaultDescription
vlan settingPropertyIfcfg-rh VariableDefaultDescriptionparentDEVICE or PHYSDEVParent interface of the VLAN.idVLAN_ID or DEVICEVLAN identifier.flagsREORDER_HDR, GVRP, MVRP, VLAN_FLAGSVLAN flags. + +Allowed values: "yes or "no" for REORDER_HDR, GVRP and MVRP; "LOOSE_BINDING" for VLAN_FLAGSingress-priority-mapVLAN_INGRESS_PRIORITY_MAPIngress priority mapping. Example: VLAN_INGRESS_PRIORITY_MAP=4:2,3:5egress-priority-mapVLAN_EGRESS_PRIORITY_MAPEgress priority mapping. Example: VLAN_EGRESS_PRIORITY_MAP=5:4,4:1,3:7interface-namePHYSDEV and VLAN_ID, or DEVICEVLAN interface name. If all variables are set, parent device from PHYSDEV takes precedence over DEVICE, but VLAN id from DEVICE takes precedence over VLAN_ID. -Example: PHYSDEV=eth0, VLAN_ID=12; or DEVICE=eth0.12
802-3-ethernet settingPropertyIfcfg-rh VariableDefaultDescriptionport(none)The property is not saved by the plugin.speed(none)The property is not saved by the plugin.duplex(none)The property is not saved by the plugin.auto-negotiate(none)The property is not saved by the plugin.mac-addressHWADDRHardware address of the device in traditional hex-digits-and-colons notation (e.g. 00:22:68:14:5A:05).cloned-mac-addressMACADDRCloned (spoofed) MAC address in traditional hex-digits-and-colons notation (e.g. 00:22:68:14:5A:99).mac-address-blacklistHWADDR_BLACKLIST(+)It denies usage of the connection for any device whose address is listed. +Example: PHYSDEV=eth0, VLAN_ID=12; or DEVICE=eth0.12
vxlan settingPropertyIfcfg-rh VariableDefaultDescription
802-3-ethernet settingPropertyIfcfg-rh VariableDefaultDescriptionport(none)The property is not saved by the plugin.speed(none)The property is not saved by the plugin.duplex(none)The property is not saved by the plugin.auto-negotiate(none)The property is not saved by the plugin.mac-addressHWADDRHardware address of the device in traditional hex-digits-and-colons notation (e.g. 00:22:68:14:5A:05).cloned-mac-addressMACADDRCloned (spoofed) MAC address in traditional hex-digits-and-colons notation (e.g. 00:22:68:14:5A:99).mac-address-blacklistHWADDR_BLACKLIST(+)It denies usage of the connection for any device whose address is listed. Example: HWADDR_BLACKLIST="00:22:68:11:69:08 00:11:22:11:44:55"mtuMTUMTU of the interface.s390-subchannelsSUBCHANNELSSubchannels for IBM S390 hosts. @@ -332,12 +346,18 @@ Allowed values: a, bgchannelCHANNEL=6bssidBSSID(+)Restricts association only to a single AP. -Example: BSSID=00:1E:BD:64:83:21rate(none)This property is not handled by ifcfg-rh plugin.tx-power(none)This property is not handled by ifcfg-rh plugin.mac-addressHWADDRHardware address of the device in traditional hex-digits-and-colons notation (e.g. 00:22:68:14:5A:05).cloned-mac-addressMACADDRCloned (spoofed) MAC address in traditional hex-digits-and-colons notation (e.g. 00:22:68:14:5A:99).mac-address-blacklistHWADDR_BLACKLIST(+)It denies usage of the connection for any device whose address is listed.seen-bssids(none)This property is not handled by ifcfg-rh plugin.mtuMTUMTU of the wireless interface.hiddenSSID_HIDDEN(+)Whether the network hides the SSID.security(none)This property is deprecated and not handled by ifcfg-rh-plugin.
The following settings are not supported by ifcfg-rh plugin:adsl, bluetooth, ppp, pppoe, serial, generic, gsm, cdma, 802-11-olpc-mesh, wimax, vpnSecret flags +Example: BSSID=00:1E:BD:64:83:21rate(none)This property is not handled by ifcfg-rh plugin.tx-power(none)This property is not handled by ifcfg-rh plugin.mac-addressHWADDRHardware address of the device in traditional hex-digits-and-colons notation (e.g. 00:22:68:14:5A:05).cloned-mac-addressMACADDRCloned (spoofed) MAC address in traditional hex-digits-and-colons notation (e.g. 00:22:68:14:5A:99).mac-address-blacklistHWADDR_BLACKLIST(+)It denies usage of the connection for any device whose address is listed.seen-bssids(none)This property is not handled by ifcfg-rh plugin.mtuMTUMTU of the wireless interface.hiddenSSID_HIDDEN(+)Whether the network hides the SSID.powersavePOWERSAVE(+)noEnables or disables Wi-Fi power saving. + +Example: POWERSAVE=yesmac-address-randomizationMAC_ADDRESS_RANDOMIZATION(+)1Enables or disables Wi-Fi MAC address randomization. + +Example: MAC_ADDRESS_RANDOMIZATION=2 + +Allowed values: 0 (default), (1) never, (2) alwayssecurity(none)This property is deprecated and not handled by ifcfg-rh-plugin.The following settings are not supported by ifcfg-rh plugin:adsl, bluetooth, ppp, pppoe, serial, generic, gsm, cdma, 802-11-olpc-mesh, wimax, vpnSecret flags Each secret property in a NetworkManager setting has an associated flags property that describes how to handle that secret. In the fcfg-rh plugin variables for secret flags have a _FLAGS suffix. The variables contain one or more of the - folowing values (space separated). Missing (or empty) *_FLAGS variable means + following values (space separated). Missing (or empty) *_FLAGS variable means that the password is owned by NetworkManager. user - a user-session secret agent is responsible for providing and storing this secret; when it is required, agents will be asked to provide it.ask - the associated password is not saved but it will be diff --git a/man/nm-settings-ifcfg-rh.xsl b/man/nm-settings-ifcfg-rh.xsl index 4338b90d..c648e65f 100644 --- a/man/nm-settings-ifcfg-rh.xsl +++ b/man/nm-settings-ifcfg-rh.xsl @@ -228,7 +228,7 @@ DEVICETYPE=TeamPort NetworkManager has introduced some new variable, not present in initscripts, to be able to store data for its new features. The variables are marked - as extensions in the tables bellows. + as extensions in the tables below.
@@ -284,7 +284,7 @@ DEVICETYPE=TeamPort flags property that describes how to handle that secret. In the fcfg-rh plugin variables for secret flags have a _FLAGS suffix. The variables contain one or more of the - folowing values (space separated). Missing (or empty) *_FLAGS variable means + following values (space separated). Missing (or empty) *_FLAGS variable means that the password is owned by NetworkManager.
@@ -353,7 +353,7 @@ DEVICETYPE=TeamPort - All DCB related configuration is a NetworkManager extention. DCB=yes must be + All DCB related configuration is a NetworkManager extension. DCB=yes must be used explicitly to enable DCB so that the rest of the DCB_* variables can apply. diff --git a/man/nm-settings-keyfile.5 b/man/nm-settings-keyfile.5 index 91f0a93a..af246bb7 100644 --- a/man/nm-settings-keyfile.5 +++ b/man/nm-settings-keyfile.5 @@ -2,12 +2,12 @@ .\" Title: nm-settings-keyfile .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 23 December 2015 +.\" Date: 19 January 2016 .\" Manual: Configuration -.\" Source: NetworkManager 1.0.9 +.\" Source: NetworkManager 1.1.90 .\" Language: English .\" -.TH "NM\-SETTINGS\-KEYFIL" "5" "" "NetworkManager 1\&.0\&.9" "Configuration" +.TH "NM\-SETTINGS\-KEYFIL" "5" "" "NetworkManager 1\&.1\&.90" "Configuration" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -39,7 +39,7 @@ for details)\&. The profiles can be stored in various formats\&. NetworkManager The \fIkeyfile\fR plugin is the generic plugin that supports all the connection types and capabilities that NetworkManager has\&. It writes files out in a \&.ini\-style format in -/etc/NetworkManager/system\-connections/\&. This plugin is always enabled and will automatically be used to store any connections that are not supported by any other active plugin\&. For security, it will ignore files that are readable or writeable by any user or group other than \*(Aqroot\*(Aq since private keys and passphrases may be stored in plaintext inside the file\&. +/etc/NetworkManager/system\-connections/\&. This plugin is always enabled and will automatically be used to store any connections that are not supported by any other active plugin\&. For security, it will ignore files that are readable or writable by any user or group other than \*(Aqroot\*(Aq since private keys and passphrases may be stored in plaintext inside the file\&. .SH "FILE FORMAT" .PP The diff --git a/man/nm-settings-keyfile.xml b/man/nm-settings-keyfile.xml index 6e0e36a3..bf666b7c 100644 --- a/man/nm-settings-keyfile.xml +++ b/man/nm-settings-keyfile.xml @@ -1,6 +1,6 @@ -23 December 2015nm-settings-keyfile5NetworkManagerConfiguration1.0.9nm-settings-keyfileDescription of keyfile settings pluginDESCRIPTION +19 January 2016nm-settings-keyfile5NetworkManagerConfiguration1.1.90nm-settings-keyfileDescription of keyfile settings pluginDESCRIPTION NetworkManager is based on the concept of connection profiles that contain network configuration (see nm-settings5 for details). The profiles can be stored in various formats. NetworkManager uses plugins for reading and writing @@ -11,7 +11,7 @@ out in a .ini-style format in /etc/NetworkManager/system-connections/. This plugin is always enabled and will automatically be used to store any connections that are not supported by any other active plugin. - For security, it will ignore files that are readable or writeable by any user + For security, it will ignore files that are readable or writable by any user or group other than 'root' since private keys and passphrases may be stored in plaintext inside the file. File Format @@ -155,6 +155,7 @@ Example: mac-address=00:22:68:12:79:A2 mac-address=0;34;104;18;121;16 Example: mac-address= 80:00:00:6d:fe:80:00:00:00:00:00:00:00:02:55:00:70:33:cf:01 + ipv4 setting (section)PropertyKeyfile VariableFormatDescriptiondnsdnslist of DNS IP addressesList of DNS servers. @@ -186,6 +187,7 @@ Example: route1=2001:4860:4860::/64,2620:52:0:2219:222:68ff:fe11:5403 +
serial setting (section)PropertyKeyfile VariableFormatDescriptionparityparity'e', 'o', or 'n'The connection parity; even, odd, or none. Note that older versions of NetworkManager stored this as an integer: 69 ('E') for even, 111 ('o') for odd, or 110 ('n') for none. @@ -194,6 +196,7 @@ Example: parity=n +
vpn setting (section)PropertyKeyfile VariableFormatDescriptiondataseparate variables named after keys of the dictionaryThe keys of the data dictionary are used as variable names directly under [vpn] section. @@ -203,6 +206,7 @@ Example: remote=ovpn.corp.com cipher=AES-256-CBC username=joe Example: password=Popocatepetl
+ 802-3-ethernet setting (section)PropertyKeyfile VariableFormatDescriptionmac-addressmac-addressususal hex-digits-and-colons notationMAC address in traditional hex-digits-and-colons notation (e.g. 00:22:68:12:79:A2), or semicolon separated list of 6 bytes (obsolete) (e.g. 0;34;104;18;121;162)cloned-mac-addresscloned-mac-addressususal hex-digits-and-colons notationCloned MAC address in traditional hex-digits-and-colons notation (e.g. 00:22:68:12:79:B2), or semicolon separated list of 6 bytes (obsolete) (e.g. 0;34;104;18;121;178). diff --git a/man/nm-settings-keyfile.xsl b/man/nm-settings-keyfile.xsl index b6e01a23..980a573c 100644 --- a/man/nm-settings-keyfile.xsl +++ b/man/nm-settings-keyfile.xsl @@ -43,7 +43,7 @@ out in a .ini-style format in /etc/NetworkManager/system-connections/. This plugin is always enabled and will automatically be used to store any connections that are not supported by any other active plugin. - For security, it will ignore files that are readable or writeable by any user + For security, it will ignore files that are readable or writable by any user or group other than 'root' since private keys and passphrases may be stored in plaintext inside the file. diff --git a/man/nm-settings.5 b/man/nm-settings.5 index 858cd6ef..bee66154 100644 --- a/man/nm-settings.5 +++ b/man/nm-settings.5 @@ -2,12 +2,12 @@ .\" Title: nm-settings .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 23 December 2015 +.\" Date: 19 January 2016 .\" Manual: Configuration -.\" Source: NetworkManager 1.0.9 +.\" Source: NetworkManager 1.1.90 .\" Language: English .\" -.TH "NM\-SETTINGS" "5" "" "NetworkManager 1\&.0\&.9" "Configuration" +.TH "NM\-SETTINGS" "5" "" "NetworkManager 1\&.1\&.90" "Configuration" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -46,7 +46,7 @@ objects\&. Setting .RS 4 A group of related key/value pairs describing a specific piece of a -\fIConnection (profile)\fR\&. Settings keys and allowed values are described in the tables below\&. Keys are also reffered to as properties\&. Developers can find the setting objects and their properties in the libnm\-util sources\&. Look for the +\fIConnection (profile)\fR\&. Settings keys and allowed values are described in the tables below\&. Keys are also referred to as properties\&. Developers can find the setting objects and their properties in the libnm\-util sources\&. Look for the \fBclass_init\fR functions near the bottom of each setting source file\&. .RE @@ -639,6 +639,7 @@ l l l l l l l l l l l l l l l l +l l l l l l l l. T{ ageing\-time @@ -695,6 +696,15 @@ T}:T{ The Spanning Tree Protocol (STP) maximum message age, in seconds\&. T} T{ +multicast\-snooping +T}:T{ +boolean +T}:T{ +TRUE +T}:T{ +Controls whether IGMP snooping is enabled for this bridge\&. Note that if snooping was automatically disabled due to hash collisions, the system may refuse to enable the feature until the collisions are resolved\&. +T} +T{ name T}:T{ string @@ -890,6 +900,7 @@ l l l l l l l l l l l l l l l l +l l l l l l l l. T{ autoconnect @@ -946,6 +957,15 @@ T}:T{ The name of the network interface this connection is bound to\&. If not set, then the connection can be attached to any interface of the appropriate type (subject to restrictions imposed by other settings)\&. For software devices this specifies the name of the created device\&. For connection types where interface names cannot easily be made persistent (e\&.g\&. mobile broadband or USB Ethernet), this property should not be used\&. Setting this property restricts the interfaces a connection can be used with, and if interface names change or are reordered the connection may be applied to the wrong interface\&. T} T{ +lldp +T}:T{ +int32 +T}:T{ +\-1 +T}:T{ +Whether LLDP is enabled for the connection\&. +T} +T{ master T}:T{ string @@ -961,7 +981,7 @@ NMMetered (int32) T}:T{ \ \& T}:T{ -Whether the connection is metered\&. +Whether the connection is metered\&. When updating this property on a currently activated connection, the change takes effect immediately\&. T} T{ name @@ -1042,7 +1062,7 @@ string T}:T{ \ \& T}:T{ -The trust level of a the connection\&. Free form case\-insensitive string (for example "Home", "Work", "Public")\&. NULL or unspecified zone means the connection will be placed in the default zone as defined by the firewall\&. +The trust level of a the connection\&. Free form case\-insensitive string (for example "Home", "Work", "Public")\&. NULL or unspecified zone means the connection will be placed in the default zone as defined by the firewall\&. When updating this property on a currently activated connection, the change takes effect immediately\&. T} .TE .sp 1 @@ -1286,6 +1306,9 @@ l l l l l l l l l l l l l l l l +l l l l +l l l l +l l l l l l l l. T{ apn @@ -1297,6 +1320,15 @@ T}:T{ The GPRS Access Point Name specifying the APN used when establishing a data session with the GSM\-based network\&. The APN often determines how the user will be billed for their network usage and whether the user has access to the Internet or just a provider\-specific walled\-garden, so it is important to use the correct APN for the user\*(Aqs mobile broadband plan\&. The APN may only be composed of the characters a\-z, 0\-9, \&., and \- per GSM 03\&.60 Section 14\&.9\&. T} T{ +device\-id +T}:T{ +string +T}:T{ +\ \& +T}:T{ +The device unique identifier (as given by the WWAN management service) which this connection applies to\&. If given, the connection will only apply to the specified device\&. +T} +T{ home\-only T}:T{ boolean @@ -1369,6 +1401,24 @@ T}:T{ Flags indicating how to handle the "pin" property\&. (see the section called \(lqSecret flag types:\(rq for flag values) T} T{ +sim\-id +T}:T{ +string +T}:T{ +\ \& +T}:T{ +The SIM card unique identifier (as given by the WWAN management service) which this connection applies to\&. If given, the connection will apply to any device also allowed by "device\-id" which contains a SIM card matching the given identifier\&. +T} +T{ +sim\-operator\-id +T}:T{ +string +T}:T{ +\ \& +T}:T{ +A MCC/MNC string like "310260" or "21601" identifying the specific mobile network operator which this connection applies to\&. If given, the connection will apply to any device also allowed by "device\-id" and "sim\-id" which contains a SIM card provisioined by the given operator\&. +T} +T{ username T}:T{ string @@ -1495,6 +1545,9 @@ l l l l l l l l l l l l l l l l +l l l l +l l l l +l l l l l l l l. T{ address\-data @@ -1524,13 +1577,22 @@ T}:T{ A string sent to the DHCP server to identify the local machine which the DHCP server may use to customize the DHCP lease and options\&. T} T{ +dhcp\-fqdn +T}:T{ +string +T}:T{ +\ \& +T}:T{ +If the "dhcp\-send\-hostname" property is TRUE, then the specified FQDN will be sent to the DHCP server when acquiring a lease\&. This property and "dhcp\-hostname" are mutually exclusive and cannot be set at the same time\&. +T} +T{ dhcp\-hostname T}:T{ string T}:T{ \ \& T}:T{ -If the "dhcp\-send\-hostname" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease\&. +If the "dhcp\-send\-hostname" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease\&. This property and "dhcp\-fqdn" are mutually exclusive and cannot be set at the same time\&. T} T{ dhcp\-send\-hostname @@ -1542,6 +1604,15 @@ T}:T{ If TRUE, a hostname is sent to the DHCP server when acquiring a lease\&. Some DHCP servers use this hostname to update DNS databases, essentially providing a static hostname for the computer\&. If the "dhcp\-hostname" property is NULL and this property is TRUE, the current persistent hostname of the computer is sent\&. T} T{ +dhcp\-timeout +T}:T{ +uint32 +T}:T{ +0 +T}:T{ +A timeout for a DHCP transaction in seconds\&. +T} +T{ dns T}:T{ array of uint32 @@ -1551,6 +1622,15 @@ T}:T{ Array of IP addresses of DNS servers (as network\-byte\-order integers) T} T{ +dns\-options +T}:T{ +array of string +T}:T{ +[] +T}:T{ +Array of DNS options\&. NULL means that the options are unset and left at the default\&. In this case NetworkManager will use default options\&. This is distinct from an empty list of properties\&. +T} +T{ dns\-search T}:T{ array of string @@ -1686,8 +1766,19 @@ l l l l l l l l l l l l l l l l +l l l l +l l l l l l l l. T{ +addr\-gen\-mode +T}:T{ +int32 +T}:T{ +1 +T}:T{ +Configure method for creating the address for use with RFC4862 IPv6 Stateless Address Autoconfiguration\&. The permitted values are: "eui64", "stable\-privacy" or unset\&. If the property is set to "eui64", the addresses will be generated using the interface tokens derived from hardware address\&. This makes the host part of the address to stay constant, making it possible to track host\*(Aqs presence when it changes networks\&. The address changes when the interface hardware is replaced\&. The value of "stable\-privacy" enables use of cryptographically secure hash of a secret host\-specific key along with the connection identification and the network address as specified by RFC7217\&. This makes it impossible to use the address track host\*(Aqs presence, and makes the address stable when the network interface hardware is replaced\&. Leaving this unset causes a default that could be subject to change in future versions to be used\&. Note that this setting is distinct from the Privacy Extensions as configured by "ip6\-privacy" property and it does not affect the temporary addresses configured with this option\&. +T} +T{ address\-data T}:T{ array of vardict @@ -1712,7 +1803,7 @@ string T}:T{ \ \& T}:T{ -If the "dhcp\-send\-hostname" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease\&. +If the "dhcp\-send\-hostname" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease\&. This property and "dhcp\-fqdn" are mutually exclusive and cannot be set at the same time\&. T} T{ dhcp\-send\-hostname @@ -1733,6 +1824,15 @@ T}:T{ Array of IP addresses of DNS servers (in network byte order) T} T{ +dns\-options +T}:T{ +array of string +T}:T{ +[] +T}:T{ +Array of DNS options\&. NULL means that the options are unset and left at the default\&. In this case NetworkManager will use default options\&. This is distinct from an empty list of properties\&. +T} +T{ dns\-search T}:T{ array of string @@ -1775,7 +1875,7 @@ NMSettingIP6ConfigPrivacy (int32) T}:T{ \ \& T}:T{ -Configure IPv6 Privacy Extensions for SLAAC, described in RFC4941\&. If enabled, it makes the kernel generate a temporary IPv6 address in addition to the public one generated from MAC address via modified EUI\-64\&. This enhances privacy, but could cause problems in some applications, on the other hand\&. The permitted values are: \-1: unknown, 0: disabled, 1: enabled (prefer public address), 2: enabled (prefer temporary addresses)\&. Having a per\-connection setting set to "\-1" (unknown) means fallback to global configuration "ipv6\&.ip6\-privacy"\&. If also global configuration is unspecified or set to "\-1", fallback to read "/proc/sys/net/ipv6/conf/default/use_tempaddr"\&. +Configure IPv6 Privacy Extensions for SLAAC, described in RFC4941\&. If enabled, it makes the kernel generate a temporary IPv6 address in addition to the public one generated from MAC address via modified EUI\-64\&. This enhances privacy, but could cause problems in some applications, on the other hand\&. The permitted values are: \-1: unknown, 0: disabled, 1: enabled (prefer public address), 2: enabled (prefer temporary addresses)\&. Having a per\-connection setting set to "\-1" (unknown) means fallback to global configuration "ipv6\&.ip6\-privacy"\&. If also global configuration is unspecified or set to "\-1", fallback to read "/proc/sys/net/ipv6/conf/default/use_tempaddr"\&. Note that this setting is distinct from the Stable Privacy addresses that can be enabled with the "addr\-gen\-mode" property\*(Aqs "stable\-privacy" setting as another way of avoiding host tracking with IPv6 addresses\&. T} T{ may\-fail @@ -1847,7 +1947,7 @@ T} .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&15.\ \&802-11-olpc-mesh setting +.B Table\ \&15.\ \&ip-tunnel setting .TS allbox tab(:); lB lB lB lB. @@ -1864,221 +1964,443 @@ T} l l l l l l l l l l l l +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l l l l l. T{ -channel +encapsulation\-limit T}:T{ uint32 T}:T{ 0 T}:T{ -Channel on which the mesh network to join is located\&. +How many additional levels of encapsulation are permitted to be prepended to packets\&. This property applies only to IPv6 tunnels\&. T} T{ -dhcp\-anycast\-address +flow\-label T}:T{ -byte array +uint32 T}:T{ -\ \& +0 T}:T{ -Anycast DHCP MAC address used when requesting an IP address via DHCP\&. The specific anycast address used determines which DHCP server class answers the request\&. +The flow label to assign to tunnel packets\&. This property applies only to IPv6 tunnels\&. T} T{ -name +input\-key T}:T{ string T}:T{ -802\-11\-olpc\-mesh +\ \& T}:T{ -The setting\*(Aqs name, which uniquely identifies the setting within the connection\&. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired"\&. +The key used for tunnel input packets; the property is valid only for certain tunnel modes (GRE, IP6GRE)\&. If empty, no key is used\&. T} T{ -ssid +local T}:T{ -byte array +string T}:T{ \ \& T}:T{ -SSID of the mesh network to join\&. +The local endpoint of the tunnel; the value can be empty, otherwise it must contain an IPv4 or IPv6 address\&. T} -.TE -.sp 1 -.sp -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.B Table\ \&16.\ \&ppp setting -.TS -allbox tab(:); -lB lB lB lB. T{ -Key Name +mode T}:T{ -Value Type +uint32 T}:T{ -Default Value +0 T}:T{ -Value Description +The tunneling mode, for example NM_IP_TUNNEL_MODE_IPIP (1) or NM_IP_TUNNEL_MODE_GRE (2)\&. T} -.T& -l l l l -l l l l -l l l l -l l l l -l l l l -l l l l -l l l l -l l l l -l l l l -l l l l -l l l l -l l l l -l l l l -l l l l -l l l l -l l l l -l l l l -l l l l -l l l l. T{ -baud +mtu T}:T{ uint32 T}:T{ 0 T}:T{ -If non\-zero, instruct pppd to set the serial port to the specified baudrate\&. This value should normally be left as 0 to automatically choose the speed\&. +None T} T{ -crtscts +name T}:T{ -boolean +string T}:T{ -FALSE +ip\-tunnel T}:T{ -If TRUE, specify that pppd should set the serial port to use hardware flow control with RTS and CTS signals\&. This value should normally be set to FALSE\&. +The setting\*(Aqs name, which uniquely identifies the setting within the connection\&. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired"\&. T} T{ -lcp\-echo\-failure +output\-key T}:T{ -uint32 +string T}:T{ -0 +\ \& T}:T{ -If non\-zero, instruct pppd to presume the connection to the peer has failed if the specified number of LCP echo\-requests go unanswered by the peer\&. The "lcp\-echo\-interval" property must also be set to a non\-zero value if this property is used\&. +The key used for tunnel output packets; the property is valid only for certain tunnel modes (GRE, IP6GRE)\&. If empty, no key is used\&. T} T{ -lcp\-echo\-interval +parent T}:T{ -uint32 +string T}:T{ -0 +\ \& T}:T{ -If non\-zero, instruct pppd to send an LCP echo\-request frame to the peer every n seconds (where n is the specified value)\&. Note that some PPP peers will respond to echo requests and some will not, and it is not possible to autodetect this\&. +If given, specifies the parent interface name or parent connection UUID the new device will be bound to so that tunneled packets will only be routed via that interface\&. T} T{ -mppe\-stateful +path\-mtu\-discovery T}:T{ boolean T}:T{ -FALSE +TRUE T}:T{ -If TRUE, stateful MPPE is used\&. See pppd documentation for more information on stateful MPPE\&. +Whether to enable Path MTU Discovery on this tunnel\&. T} T{ -mru +remote T}:T{ -uint32 +string T}:T{ -0 +\ \& T}:T{ -If non\-zero, instruct pppd to request that the peer send packets no larger than the specified size\&. If non\-zero, the MRU should be between 128 and 16384\&. +The remote endpoint of the tunnel; the value must contain an IPv4 or IPv6 address\&. T} T{ -mtu +tos T}:T{ uint32 T}:T{ 0 T}:T{ -If non\-zero, instruct pppd to send packets no larger than the specified size\&. +The type of service (IPv4) or traffic class (IPv6) field to be set on tunneled packets\&. T} T{ -name +ttl T}:T{ -string +uint32 T}:T{ -ppp +0 T}:T{ -The setting\*(Aqs name, which uniquely identifies the setting within the connection\&. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired"\&. +The TTL to assign to tunneled packets\&. 0 is a special value meaning that packets inherit the TTL value\&. T} +.TE +.sp 1 +.sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.B Table\ \&16.\ \&macvlan setting +.TS +allbox tab(:); +lB lB lB lB. T{ -no\-vj\-comp +Key Name T}:T{ -boolean +Value Type T}:T{ -FALSE +Default Value T}:T{ -If TRUE, Van Jacobsen TCP header compression will not be requested\&. +Value Description T} +.T& +l l l l +l l l l +l l l l +l l l l +l l l l. T{ -noauth +mode T}:T{ -boolean +uint32 T}:T{ -TRUE +0 T}:T{ -If TRUE, do not require the other side (usually the PPP server) to authenticate itself to the client\&. If FALSE, require authentication from the remote side\&. In almost all cases, this should be TRUE\&. +The macvlan mode, which specifies the communication mechanism between multiple macvlans on the same lower device\&. T} T{ -nobsdcomp +name T}:T{ -boolean +string T}:T{ -FALSE +macvlan T}:T{ -If TRUE, BSD compression will not be requested\&. +The setting\*(Aqs name, which uniquely identifies the setting within the connection\&. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired"\&. T} T{ -nodeflate +parent T}:T{ -boolean +string T}:T{ -FALSE +\ \& T}:T{ -If TRUE, "deflate" compression will not be requested\&. +If given, specifies the parent interface name or parent connection UUID from which this MAC\-VLAN interface should be created\&. If this property is not specified, the connection must contain an "802\-3\-ethernet" setting with a "mac\-address" property\&. T} T{ -refuse\-chap +promiscuous T}:T{ boolean T}:T{ -FALSE +TRUE T}:T{ -If TRUE, the CHAP authentication method will not be used\&. +Whether the interface should be put in promiscuous mode\&. T} T{ -refuse\-eap +tap T}:T{ boolean T}:T{ FALSE T}:T{ -If TRUE, the EAP authentication method will not be used\&. +Whether the interface should be a MACVTAP\&. T} +.TE +.sp 1 +.sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.B Table\ \&17.\ \&802-11-olpc-mesh setting +.TS +allbox tab(:); +lB lB lB lB. T{ -refuse\-mschap +Key Name T}:T{ -boolean +Value Type T}:T{ -FALSE +Default Value T}:T{ -If TRUE, the MSCHAP authentication method will not be used\&. +Value Description T} -T{ -refuse\-mschapv2 -T}:T{ +.T& +l l l l +l l l l +l l l l +l l l l. +T{ +channel +T}:T{ +uint32 +T}:T{ +0 +T}:T{ +Channel on which the mesh network to join is located\&. +T} +T{ +dhcp\-anycast\-address +T}:T{ +byte array +T}:T{ +\ \& +T}:T{ +Anycast DHCP MAC address used when requesting an IP address via DHCP\&. The specific anycast address used determines which DHCP server class answers the request\&. +T} +T{ +name +T}:T{ +string +T}:T{ +802\-11\-olpc\-mesh +T}:T{ +The setting\*(Aqs name, which uniquely identifies the setting within the connection\&. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired"\&. +T} +T{ +ssid +T}:T{ +byte array +T}:T{ +\ \& +T}:T{ +SSID of the mesh network to join\&. +T} +.TE +.sp 1 +.sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.B Table\ \&18.\ \&ppp setting +.TS +allbox tab(:); +lB lB lB lB. +T{ +Key Name +T}:T{ +Value Type +T}:T{ +Default Value +T}:T{ +Value Description +T} +.T& +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l. +T{ +baud +T}:T{ +uint32 +T}:T{ +0 +T}:T{ +If non\-zero, instruct pppd to set the serial port to the specified baudrate\&. This value should normally be left as 0 to automatically choose the speed\&. +T} +T{ +crtscts +T}:T{ +boolean +T}:T{ +FALSE +T}:T{ +If TRUE, specify that pppd should set the serial port to use hardware flow control with RTS and CTS signals\&. This value should normally be set to FALSE\&. +T} +T{ +lcp\-echo\-failure +T}:T{ +uint32 +T}:T{ +0 +T}:T{ +If non\-zero, instruct pppd to presume the connection to the peer has failed if the specified number of LCP echo\-requests go unanswered by the peer\&. The "lcp\-echo\-interval" property must also be set to a non\-zero value if this property is used\&. +T} +T{ +lcp\-echo\-interval +T}:T{ +uint32 +T}:T{ +0 +T}:T{ +If non\-zero, instruct pppd to send an LCP echo\-request frame to the peer every n seconds (where n is the specified value)\&. Note that some PPP peers will respond to echo requests and some will not, and it is not possible to autodetect this\&. +T} +T{ +mppe\-stateful +T}:T{ +boolean +T}:T{ +FALSE +T}:T{ +If TRUE, stateful MPPE is used\&. See pppd documentation for more information on stateful MPPE\&. +T} +T{ +mru +T}:T{ +uint32 +T}:T{ +0 +T}:T{ +If non\-zero, instruct pppd to request that the peer send packets no larger than the specified size\&. If non\-zero, the MRU should be between 128 and 16384\&. +T} +T{ +mtu +T}:T{ +uint32 +T}:T{ +0 +T}:T{ +If non\-zero, instruct pppd to send packets no larger than the specified size\&. +T} +T{ +name +T}:T{ +string +T}:T{ +ppp +T}:T{ +The setting\*(Aqs name, which uniquely identifies the setting within the connection\&. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired"\&. +T} +T{ +no\-vj\-comp +T}:T{ +boolean +T}:T{ +FALSE +T}:T{ +If TRUE, Van Jacobsen TCP header compression will not be requested\&. +T} +T{ +noauth +T}:T{ +boolean +T}:T{ +TRUE +T}:T{ +If TRUE, do not require the other side (usually the PPP server) to authenticate itself to the client\&. If FALSE, require authentication from the remote side\&. In almost all cases, this should be TRUE\&. +T} +T{ +nobsdcomp +T}:T{ +boolean +T}:T{ +FALSE +T}:T{ +If TRUE, BSD compression will not be requested\&. +T} +T{ +nodeflate +T}:T{ +boolean +T}:T{ +FALSE +T}:T{ +If TRUE, "deflate" compression will not be requested\&. +T} +T{ +refuse\-chap +T}:T{ +boolean +T}:T{ +FALSE +T}:T{ +If TRUE, the CHAP authentication method will not be used\&. +T} +T{ +refuse\-eap +T}:T{ +boolean +T}:T{ +FALSE +T}:T{ +If TRUE, the EAP authentication method will not be used\&. +T} +T{ +refuse\-mschap +T}:T{ +boolean +T}:T{ +FALSE +T}:T{ +If TRUE, the MSCHAP authentication method will not be used\&. +T} +T{ +refuse\-mschapv2 +T}:T{ boolean T}:T{ FALSE @@ -2119,7 +2441,7 @@ T} .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&17.\ \&pppoe setting +.B Table\ \&19.\ \&pppoe setting .TS allbox tab(:); lB lB lB lB. @@ -2190,7 +2512,7 @@ T} .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&18.\ \&serial setting +.B Table\ \&20.\ \&serial setting .TS allbox tab(:); lB lB lB lB. @@ -2271,7 +2593,7 @@ T} .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&19.\ \&team setting +.B Table\ \&21.\ \&team setting .TS allbox tab(:); lB lB lB lB. @@ -2322,7 +2644,7 @@ T} .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&20.\ \&team-port setting +.B Table\ \&22.\ \&team-port setting .TS allbox tab(:); lB lB lB lB. @@ -2363,7 +2685,98 @@ T} .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&21.\ \&vlan setting +.B Table\ \&23.\ \&tun setting +.TS +allbox tab(:); +lB lB lB lB. +T{ +Key Name +T}:T{ +Value Type +T}:T{ +Default Value +T}:T{ +Value Description +T} +.T& +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l. +T{ +group +T}:T{ +string +T}:T{ +\ \& +T}:T{ +The group ID which will own the device\&. If set to NULL everyone will be able to use the device\&. +T} +T{ +mode +T}:T{ +uint32 +T}:T{ +1 +T}:T{ +The operating mode of the virtual device\&. Allowed values are NM_SETTING_TUN_MODE_TUN (1) to create a layer 3 device and NM_SETTING_TUN_MODE_TAP (2) to create an Ethernet\-like layer 2 one\&. +T} +T{ +multi\-queue +T}:T{ +boolean +T}:T{ +FALSE +T}:T{ +If the property is set to TRUE, the interface will support multiple file descriptors (queues) to parallelize packet sending or receiving\&. Otherwise, the interface will only support a single queue\&. +T} +T{ +name +T}:T{ +string +T}:T{ +tun +T}:T{ +The setting\*(Aqs name, which uniquely identifies the setting within the connection\&. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired"\&. +T} +T{ +owner +T}:T{ +string +T}:T{ +\ \& +T}:T{ +The user ID which will own the device\&. If set to NULL everyone will be able to use the device\&. +T} +T{ +pi +T}:T{ +boolean +T}:T{ +FALSE +T}:T{ +If TRUE the interface will prepend a 4 byte header describing the physical interface to the packets\&. +T} +T{ +vnet\-hdr +T}:T{ +boolean +T}:T{ +FALSE +T}:T{ +If TRUE the IFF_VNET_HDR the tunnel packets will include a virtio network header\&. +T} +.TE +.sp 1 +.sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.B Table\ \&24.\ \&vlan setting .TS allbox tab(:); lB lB lB lB. @@ -2400,7 +2813,7 @@ NMVlanFlags (uint32) T}:T{ \ \& T}:T{ -One or more flags which control the behavior and features of the VLAN interface\&. Flags include NM_VLAN_FLAG_REORDER_HEADERS (0x1) (reordering of output packet headers), NM_VLAN_FLAG_GVRP (0x2) (use of the GVRP protocol), and NM_VLAN_FLAG_LOOSE_BINDING (0x4) (loose binding of the interface to its master device\*(Aqs operating state)\&. +One or more flags which control the behavior and features of the VLAN interface\&. Flags include NM_VLAN_FLAG_REORDER_HEADERS (0x1) (reordering of output packet headers), NM_VLAN_FLAG_GVRP (0x2) (use of the GVRP protocol), and NM_VLAN_FLAG_LOOSE_BINDING (0x4) (loose binding of the interface to its master device\*(Aqs operating state)\&. NM_VLAN_FLAG_MVRP (0x8) (use of the MVRP protocol)\&. The default value of this property is NM_VLAN_FLAG_REORDER_HEADERS, but it used to be 0\&. To preserve backward compatibility, the default\-value in the D\-Bus API continues to be 0 and a missing property on D\-Bus is still considered as 0\&. T} T{ id @@ -2454,7 +2867,7 @@ T} .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&22.\ \&vpn setting +.B Table\ \&25.\ \&vpn setting .TS allbox tab(:); lB lB lB lB. @@ -2473,6 +2886,7 @@ l l l l l l l l l l l l l l l l +l l l l l l l l. T{ data @@ -2520,6 +2934,15 @@ T}:T{ D\-Bus service name of the VPN plugin that this setting uses to connect to its network\&. i\&.e\&. org\&.freedesktop\&.NetworkManager\&.vpnc for the vpnc plugin\&. T} T{ +timeout +T}:T{ +uint32 +T}:T{ +0 +T}:T{ +Timeout for the VPN service to establish the connection\&. Some services may take quite a long time to connect\&. Value of 0 means a default timeout, which is 60 seconds (unless overriden by vpn\&.timeout in configuration file)\&. Values greater than zero mean timeout in seconds\&. +T} +T{ user\-name T}:T{ string @@ -2535,7 +2958,198 @@ T} .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&23.\ \&wimax setting +.B Table\ \&26.\ \&vxlan setting +.TS +allbox tab(:); +lB lB lB lB. +T{ +Key Name +T}:T{ +Value Type +T}:T{ +Default Value +T}:T{ +Value Description +T} +.T& +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l +l l l l. +T{ +ageing +T}:T{ +uint32 +T}:T{ +0 +T}:T{ +Specifies the lifetime in seconds of FDB entries learnt by the kernel\&. +T} +T{ +destination\-port +T}:T{ +uint32 +T}:T{ +8472 +T}:T{ +Specifies the UDP destination port to communicate to the remote VXLAN tunnel endpoint\&. +T} +T{ +id +T}:T{ +uint32 +T}:T{ +0 +T}:T{ +Specifies the VXLAN Network Identifer (or VXLAN Segment Identifier) to use\&. +T} +T{ +l2\-miss +T}:T{ +boolean +T}:T{ +FALSE +T}:T{ +Specifies whether netlink LL ADDR miss notifications are generated\&. +T} +T{ +l3\-miss +T}:T{ +boolean +T}:T{ +FALSE +T}:T{ +Specifies whether netlink IP ADDR miss notifications are generated\&. +T} +T{ +learning +T}:T{ +boolean +T}:T{ +TRUE +T}:T{ +Specifies whether unknown source link layer addresses and IP addresses are entered into the VXLAN device forwarding database\&. +T} +T{ +limit +T}:T{ +uint32 +T}:T{ +0 +T}:T{ +Specifies the maximum number of FDB entries\&. A value of zero means that the kernel will store unlimited entries\&. +T} +T{ +local +T}:T{ +string +T}:T{ +\ \& +T}:T{ +If given, specifies the source IP address to use in outgoing packets\&. +T} +T{ +name +T}:T{ +string +T}:T{ +vxlan +T}:T{ +The setting\*(Aqs name, which uniquely identifies the setting within the connection\&. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired"\&. +T} +T{ +parent +T}:T{ +string +T}:T{ +\ \& +T}:T{ +If given, specifies the parent interface name or parent connection UUID\&. +T} +T{ +proxy +T}:T{ +boolean +T}:T{ +FALSE +T}:T{ +Specifies whether ARP proxy is turned on\&. +T} +T{ +remote +T}:T{ +string +T}:T{ +\ \& +T}:T{ +Specifies the unicast destination IP address to use in outgoing packets when the destination link layer address is not known in the VXLAN device forwarding database, or the multicast IP address to join\&. +T} +T{ +rsc +T}:T{ +boolean +T}:T{ +FALSE +T}:T{ +Specifies whether route short circuit is turned on\&. +T} +T{ +source\-port\-max +T}:T{ +uint32 +T}:T{ +0 +T}:T{ +Specifies the maximum UDP source port to communicate to the remote VXLAN tunnel endpoint\&. +T} +T{ +source\-port\-min +T}:T{ +uint32 +T}:T{ +0 +T}:T{ +Specifies the minimum UDP source port to communicate to the remote VXLAN tunnel endpoint\&. +T} +T{ +tos +T}:T{ +uint32 +T}:T{ +0 +T}:T{ +Specifies the TOS value to use in outgoing packets\&. +T} +T{ +ttl +T}:T{ +uint32 +T}:T{ +0 +T}:T{ +Specifies the time\-to\-live value to use in outgoing packets\&. +T} +.TE +.sp 1 +.sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.B Table\ \&27.\ \&wimax setting .TS allbox tab(:); lB lB lB lB. @@ -2559,7 +3173,7 @@ byte array T}:T{ \ \& T}:T{ -If specified, this connection will only apply to the WiMAX device whose MAC address matches\&. This property does not change the MAC address of the device (known as MAC spoofing)\&. +If specified, this connection will only apply to the WiMAX device whose MAC address matches\&. This property does not change the MAC address of the device (known as MAC spoofing)\&. Deprecated: 1 T} T{ name @@ -2577,7 +3191,7 @@ string T}:T{ \ \& T}:T{ -Network Service Provider (NSP) name of the WiMAX network this connection should use\&. +Network Service Provider (NSP) name of the WiMAX network this connection should use\&. Deprecated: 1 T} .TE .sp 1 @@ -2586,7 +3200,7 @@ T} .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&24.\ \&802-3-ethernet setting +.B Table\ \&28.\ \&802-3-ethernet setting .TS allbox tab(:); lB lB lB lB. @@ -2747,7 +3361,7 @@ T} .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&25.\ \&802-11-wireless setting +.B Table\ \&29.\ \&802-11-wireless setting .TS allbox tab(:); lB lB lB lB. @@ -2775,6 +3389,8 @@ l l l l l l l l l l l l l l l l +l l l l +l l l l l l l l. T{ band @@ -2840,6 +3456,15 @@ T}:T{ A list of permanent MAC addresses of Wi\-Fi devices to which this connection should never apply\&. Each MAC address should be given in the standard hex\-digits\-and\-colons notation (eg "00:11:22:33:44:55")\&. T} T{ +mac\-address\-randomization +T}:T{ +uint32 +T}:T{ +0 +T}:T{ +One of NM_SETTING_MAC_RANDOMIZATION_DEFAULT (0) (never randomize unless the user has set a global default to randomize and the supplicant supports randomization), NM_SETTING_MAC_RANDOMIZATION_NEVER (1) (never randomize the MAC address), or NM_SETTING_MAC_RANDOMIZATION_ALWAYS (2) (always randomize the MAC address)\&. +T} +T{ mode T}:T{ string @@ -2867,6 +3492,15 @@ T}:T{ The setting\*(Aqs name, which uniquely identifies the setting within the connection\&. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired"\&. T} T{ +powersave +T}:T{ +uint32 +T}:T{ +0 +T}:T{ +If set to FALSE, Wi\-Fi power saving behavior is disabled\&. If set to TRUE, Wi\-Fi power saving behavior is enabled\&. All other values are reserved\&. Note that even though only boolean values are allowed, the property type is an unsigned integer to allow for future expansion\&. +T} +T{ rate T}:T{ uint32 @@ -2918,7 +3552,7 @@ T} .nr an-no-space-flag 1 .nr an-break-flag 1 .br -.B Table\ \&26.\ \&802-11-wireless-security setting +.B Table\ \&30.\ \&802-11-wireless-security setting .TS allbox tab(:); lB lB lB lB. diff --git a/man/nm-settings.xml b/man/nm-settings.xml index f809e1ea..2a8ee9f9 100644 --- a/man/nm-settings.xml +++ b/man/nm-settings.xml @@ -1,6 +1,6 @@ -23 December 2015nm-settings5NetworkManagerConfiguration1.0.9nm-settingsDescription of settings and properties of NetworkManager connection profilesDESCRIPTION +19 January 2016nm-settings5NetworkManagerConfiguration1.1.90nm-settingsDescription of settings and properties of NetworkManager connection profilesDESCRIPTION NetworkManager is based on a concept of connection profiles, sometimes referred to as connections only. These connection profiles contain a network configuration. When NetworkManager activates a connection profile on a network device the configuration will @@ -20,7 +20,7 @@ Setting A group of related key/value pairs describing a specific piece of a Connection (profile). Settings keys and allowed values are - described in the tables below. Keys are also reffered to as properties. + described in the tables below. Keys are also referred to as properties. Developers can find the setting objects and their properties in the libnm-util sources. Look for the class_init functions near the bottom of each setting source file. @@ -95,6 +95,7 @@ interface-namestringDeprecated in favor of connection.interface-name, but can be used for backward-compatibility with older daemons, to set the bridge's interface name. mac-addressbyte arrayIf specified, the MAC address of bridge. When creating a new bridge, this MAC address will be set. When matching an existing (outside NetworkManager created) bridge, this MAC address must match. max-ageuint3220The Spanning Tree Protocol (STP) maximum message age, in seconds. + multicast-snoopingbooleanTRUEControls whether IGMP snooping is enabled for this bridge. Note that if snooping was automatically disabled due to hash collisions, the system may refuse to enable the feature until the collisions are resolved. namestringbridgeThe setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired". priorityuint3232768Sets the Spanning Tree Protocol (STP) priority for this bridge. Lower values are "better"; the lowest priority bridge will be elected the root bridge. stpbooleanTRUEControls whether Spanning Tree Protocol (STP) is enabled for this bridge. @@ -119,8 +120,9 @@ gateway-ping-timeoutuint320If greater than zero, delay success of IP addressing until either the timeout is reached, or an IP gateway replies to a ping. idstringA human readable unique identifier for the connection, like "Work Wi-Fi" or "T-Mobile 3G". interface-namestringThe name of the network interface this connection is bound to. If not set, then the connection can be attached to any interface of the appropriate type (subject to restrictions imposed by other settings). For software devices this specifies the name of the created device. For connection types where interface names cannot easily be made persistent (e.g. mobile broadband or USB Ethernet), this property should not be used. Setting this property restricts the interfaces a connection can be used with, and if interface names change or are reordered the connection may be applied to the wrong interface. + lldpint32-1Whether LLDP is enabled for the connection. masterstringInterface name of the master device or UUID of the master connection. - meteredNMMetered (int32)Whether the connection is metered. + meteredNMMetered (int32)Whether the connection is metered. When updating this property on a currently activated connection, the change takes effect immediately. namestringconnectionThe setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired". permissionsarray of string[]An array of strings defining what access a given user has to this connection. If this is NULL or empty, all users are allowed to access this connection. Otherwise a user is allowed to access this connection if and only if they are in this list. Each entry is of the form "[type]:[id]:[reserved]"; for example, "user:dcbw:blah". At this time only the "user" [type] is allowed. Any other values are ignored and reserved for future use. [id] is the username that this permission refers to, which may not contain the ":" character. Any [reserved] information present must be ignored and is reserved for future use. All of [type], [id], and [reserved] must be valid UTF-8. read-onlybooleanFALSEFALSE if the connection can be modified using the provided settings service's D-Bus interface with the right privileges, or TRUE if the connection is read-only and cannot be modified. @@ -129,7 +131,7 @@ timestampuint640The time, in seconds since the Unix Epoch, that the connection was last _successfully_ fully activated. NetworkManager updates the connection timestamp periodically when the connection is active to ensure that an active connection has the latest timestamp. The property is only meant for reading (changes to this property will not be preserved). typestringBase type of the connection. For hardware-dependent connections, should contain the setting name of the hardware-type specific setting (ie, "802-3-ethernet" or "802-11-wireless" or "bluetooth", etc), and for non-hardware dependent connections like VPN or otherwise, should contain the setting name of that setting type (ie, "vpn" or "bridge", etc). uuidstringA universally unique identifier for the connection, for example generated with libuuid. It should be assigned when the connection is created, and never changed as long as the connection still applies to the same network. For example, it should not be changed when the "id" property or NMSettingIP4Config changes, but might need to be re-created when the Wi-Fi SSID, mobile broadband network provider, or "type" property changes. The UUID must be in the format "2815492f-7e56-435e-b2e9-246bd7cdc664" (ie, contains only hexadecimal characters and "-"). - zonestringThe trust level of a the connection. Free form case-insensitive string (for example "Home", "Work", "Public"). NULL or unspecified zone means the connection will be placed in the default zone as defined by the firewall. + zonestringThe trust level of a the connection. Free form case-insensitive string (for example "Home", "Work", "Public"). NULL or unspecified zone means the connection will be placed in the default zone as defined by the firewall. When updating this property on a currently activated connection, the change takes effect immediately.
dcb settingKey NameValue TypeDefault ValueValue Descriptionapp-fcoe-flagsNMSettingDcbFlags (uint32)Specifies the NMSettingDcbFlags for the DCB FCoE application. Flags may be any combination of NM_SETTING_DCB_FLAG_ENABLE (0x1), NM_SETTING_DCB_FLAG_ADVERTISE (0x2), and NM_SETTING_DCB_FLAG_WILLING (0x4). @@ -154,6 +156,7 @@
gsm settingKey NameValue TypeDefault ValueValue DescriptionapnstringThe GPRS Access Point Name specifying the APN used when establishing a data session with the GSM-based network. The APN often determines how the user will be billed for their network usage and whether the user has access to the Internet or just a provider-specific walled-garden, so it is important to use the correct APN for the user's mobile broadband plan. The APN may only be composed of the characters a-z, 0-9, ., and - per GSM 03.60 Section 14.9. + device-idstringThe device unique identifier (as given by the WWAN management service) which this connection applies to. If given, the connection will only apply to the specified device.home-onlybooleanFALSEWhen TRUE, only connections to the home network will be allowed. Connections to roaming networks will not be made.namestringgsmThe setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired".network-idstringThe Network ID (GSM LAI format, ie MCC-MNC) to force specific network registration. If the Network ID is specified, NetworkManager will attempt to force the device to register only on the specified network. This can be used to ensure that the device does not roam when direct roaming control of the device is not otherwise possible. @@ -162,6 +165,8 @@ password-flagsNMSettingSecretFlags (uint32)Flags indicating how to handle the "password" property. (see for flag values)pinstringIf the SIM is locked with a PIN it must be unlocked before any other operations are requested. Specify the PIN here to allow operation of the device.pin-flagsNMSettingSecretFlags (uint32)Flags indicating how to handle the "pin" property. (see for flag values) + sim-idstringThe SIM card unique identifier (as given by the WWAN management service) which this connection applies to. If given, the connection will apply to any device also allowed by "device-id" which contains a SIM card matching the given identifier. + sim-operator-idstringA MCC/MNC string like "310260" or "21601" identifying the specific mobile network operator which this connection applies to. If given, the connection will apply to any device also allowed by "device-id" and "sim-id" which contains a SIM card provisioined by the given operator.usernamestringThe username used to authenticate with the network, if required. Many providers do not require a username, or accept any username. But if a username is required, it is specified here.
infiniband settingKey NameValue TypeDefault ValueValue Description @@ -176,9 +181,12 @@ address-dataarray of vardictArray of IPv4 addresses. Each address dictionary contains at least 'address' and 'prefix' entries, containing the IP address as a string, and the prefix length as a uint32. Additional attributes may also exist on some addresses.addressesarray of array of uint32[]Deprecated in favor of the 'address-data' and 'gateway' properties, but this can be used for backward-compatibility with older daemons. Note that if you send this property the daemon will ignore 'address-data' and 'gateway'. Array of IPv4 address structures. Each IPv4 address structure is composed of 3 32-bit values; the first being the IPv4 address (network byte order), the second the prefix (1 - 32), and last the IPv4 gateway (network byte order). The gateway may be left as 0 if no gateway exists for that subnet.dhcp-client-idstringA string sent to the DHCP server to identify the local machine which the DHCP server may use to customize the DHCP lease and options. - dhcp-hostnamestringIf the "dhcp-send-hostname" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease. + dhcp-fqdnstringIf the "dhcp-send-hostname" property is TRUE, then the specified FQDN will be sent to the DHCP server when acquiring a lease. This property and "dhcp-hostname" are mutually exclusive and cannot be set at the same time. + dhcp-hostnamestringIf the "dhcp-send-hostname" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease. This property and "dhcp-fqdn" are mutually exclusive and cannot be set at the same time.dhcp-send-hostnamebooleanTRUEIf TRUE, a hostname is sent to the DHCP server when acquiring a lease. Some DHCP servers use this hostname to update DNS databases, essentially providing a static hostname for the computer. If the "dhcp-hostname" property is NULL and this property is TRUE, the current persistent hostname of the computer is sent. + dhcp-timeoutuint320A timeout for a DHCP transaction in seconds.dnsarray of uint32[]Array of IP addresses of DNS servers (as network-byte-order integers) + dns-optionsarray of string[]Array of DNS options. NULL means that the options are unset and left at the default. In this case NetworkManager will use default options. This is distinct from an empty list of properties.dns-searcharray of string[]Array of DNS search domains.gatewaystringThe gateway associated with this configuration. This is only meaningful if "addresses" is also set.ignore-auto-dnsbooleanFALSEWhen "method" is set to "auto" and this property to TRUE, automatically configured nameservers and search domains are ignored and only nameservers and search domains specified in the "dns" and "dns-search" properties, if any, are used. @@ -192,16 +200,18 @@ routesarray of array of uint32[]Deprecated in favor of the 'route-data' property, but this can be used for backward-compatibility with older daemons. Note that if you send this property the daemon will ignore 'route-data'. Array of IPv4 route structures. Each IPv4 route structure is composed of 4 32-bit values; the first being the destination IPv4 network or address (network byte order), the second the destination network or address prefix (1 - 32), the third being the next-hop (network byte order) if any, and the fourth being the route metric. If the metric is 0, NM will choose an appropriate default metric for the device. (There is no way to explicitly specify an actual metric of 0 with this property.)
ipv6 settingKey NameValue TypeDefault ValueValue Description + addr-gen-modeint321Configure method for creating the address for use with RFC4862 IPv6 Stateless Address Autoconfiguration. The permitted values are: "eui64", "stable-privacy" or unset. If the property is set to "eui64", the addresses will be generated using the interface tokens derived from hardware address. This makes the host part of the address to stay constant, making it possible to track host's presence when it changes networks. The address changes when the interface hardware is replaced. The value of "stable-privacy" enables use of cryptographically secure hash of a secret host-specific key along with the connection identification and the network address as specified by RFC7217. This makes it impossible to use the address track host's presence, and makes the address stable when the network interface hardware is replaced. Leaving this unset causes a default that could be subject to change in future versions to be used. Note that this setting is distinct from the Privacy Extensions as configured by "ip6-privacy" property and it does not affect the temporary addresses configured with this option.address-dataarray of vardictArray of IPv6 addresses. Each address dictionary contains at least 'address' and 'prefix' entries, containing the IP address as a string, and the prefix length as a uint32. Additional attributes may also exist on some addresses.addressesarray of legacy IPv6 address struct (a(ayuay))[]Deprecated in favor of the 'address-data' and 'gateway' properties, but this can be used for backward-compatibility with older daemons. Note that if you send this property the daemon will ignore 'address-data' and 'gateway'. Array of IPv6 address structures. Each IPv6 address structure is composed of an IPv6 address, a prefix length (1 - 128), and an IPv6 gateway address. The gateway may be zeroed out if no gateway exists for that subnet. - dhcp-hostnamestringIf the "dhcp-send-hostname" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease. + dhcp-hostnamestringIf the "dhcp-send-hostname" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease. This property and "dhcp-fqdn" are mutually exclusive and cannot be set at the same time.dhcp-send-hostnamebooleanTRUEIf TRUE, a hostname is sent to the DHCP server when acquiring a lease. Some DHCP servers use this hostname to update DNS databases, essentially providing a static hostname for the computer. If the "dhcp-hostname" property is NULL and this property is TRUE, the current persistent hostname of the computer is sent.dnsarray of byte array[]Array of IP addresses of DNS servers (in network byte order) + dns-optionsarray of string[]Array of DNS options. NULL means that the options are unset and left at the default. In this case NetworkManager will use default options. This is distinct from an empty list of properties.dns-searcharray of string[]Array of DNS search domains.gatewaystringThe gateway associated with this configuration. This is only meaningful if "addresses" is also set.ignore-auto-dnsbooleanFALSEWhen "method" is set to "auto" and this property to TRUE, automatically configured nameservers and search domains are ignored and only nameservers and search domains specified in the "dns" and "dns-search" properties, if any, are used.ignore-auto-routesbooleanFALSEWhen "method" is set to "auto" and this property to TRUE, automatically configured routes are ignored and only routes specified in the "routes" property, if any, are used. - ip6-privacyNMSettingIP6ConfigPrivacy (int32)Configure IPv6 Privacy Extensions for SLAAC, described in RFC4941. If enabled, it makes the kernel generate a temporary IPv6 address in addition to the public one generated from MAC address via modified EUI-64. This enhances privacy, but could cause problems in some applications, on the other hand. The permitted values are: -1: unknown, 0: disabled, 1: enabled (prefer public address), 2: enabled (prefer temporary addresses). Having a per-connection setting set to "-1" (unknown) means fallback to global configuration "ipv6.ip6-privacy". If also global configuration is unspecified or set to "-1", fallback to read "/proc/sys/net/ipv6/conf/default/use_tempaddr". + ip6-privacyNMSettingIP6ConfigPrivacy (int32)Configure IPv6 Privacy Extensions for SLAAC, described in RFC4941. If enabled, it makes the kernel generate a temporary IPv6 address in addition to the public one generated from MAC address via modified EUI-64. This enhances privacy, but could cause problems in some applications, on the other hand. The permitted values are: -1: unknown, 0: disabled, 1: enabled (prefer public address), 2: enabled (prefer temporary addresses). Having a per-connection setting set to "-1" (unknown) means fallback to global configuration "ipv6.ip6-privacy". If also global configuration is unspecified or set to "-1", fallback to read "/proc/sys/net/ipv6/conf/default/use_tempaddr". Note that this setting is distinct from the Stable Privacy addresses that can be enabled with the "addr-gen-mode" property's "stable-privacy" setting as another way of avoiding host tracking with IPv6 addresses.may-failbooleanTRUEIf TRUE, allow overall network configuration to proceed even if the configuration specified by this property times out. Note that at least one IP configuration must succeed or overall network configuration will still fail. For example, in IPv6-only networks, setting this property to TRUE on the NMSettingIP4Config allows the overall network configuration to succeed if IPv4 configuration fails but IPv6 configuration completes successfully.methodstringIP configuration method. NMSettingIP4Config and NMSettingIP6Config both support "auto", "manual", and "link-local". See the subclass-specific documentation for other values. In general, for the "auto" method, properties such as "dns" and "routes" specify information that is added on to the information returned from automatic configuration. The "ignore-auto-routes" and "ignore-auto-dns" properties modify this behavior. For methods that imply no upstream network, such as "shared" or "link-local", these properties must be empty.namestringipv6The setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired". @@ -210,6 +220,28 @@ route-metricint64-1The default metric for routes that don't explicitly specify a metric. The default value -1 means that the metric is choosen automatically based on the device type. The metric applies to dynamic routes, manual (static) routes that don't have an explicit metric setting, address prefix routes, and the default route. Note that for IPv6, the kernel accepts zero (0) but coerces it to 1024 (user default). Hence, setting this property to zero effectively mean setting it to 1024. For IPv4, zero is a regular value for the metric.routesarray of legacy IPv6 route struct (a(ayuayu))[]Deprecated in favor of the 'route-data' property, but this can be used for backward-compatibility with older daemons. Note that if you send this property the daemon will ignore 'route-data'. Array of IPv6 route structures. Each IPv6 route structure is composed of an IPv6 address, a prefix length (1 - 128), an IPv6 next hop address (which may be zeroed out if there is no next hop), and a metric. If the metric is 0, NM will choose an appropriate default metric for the device.
+ ip-tunnel settingKey NameValue TypeDefault ValueValue Description + encapsulation-limituint320How many additional levels of encapsulation are permitted to be prepended to packets. This property applies only to IPv6 tunnels. + flow-labeluint320The flow label to assign to tunnel packets. This property applies only to IPv6 tunnels. + input-keystringThe key used for tunnel input packets; the property is valid only for certain tunnel modes (GRE, IP6GRE). If empty, no key is used. + localstringThe local endpoint of the tunnel; the value can be empty, otherwise it must contain an IPv4 or IPv6 address. + modeuint320The tunneling mode, for example NM_IP_TUNNEL_MODE_IPIP (1) or NM_IP_TUNNEL_MODE_GRE (2). + mtuuint320None + namestringip-tunnelThe setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired". + output-keystringThe key used for tunnel output packets; the property is valid only for certain tunnel modes (GRE, IP6GRE). If empty, no key is used. + parentstringIf given, specifies the parent interface name or parent connection UUID the new device will be bound to so that tunneled packets will only be routed via that interface. + path-mtu-discoverybooleanTRUEWhether to enable Path MTU Discovery on this tunnel. + remotestringThe remote endpoint of the tunnel; the value must contain an IPv4 or IPv6 address. + tosuint320The type of service (IPv4) or traffic class (IPv6) field to be set on tunneled packets. + ttluint320The TTL to assign to tunneled packets. 0 is a special value meaning that packets inherit the TTL value. +
+ macvlan settingKey NameValue TypeDefault ValueValue Description + modeuint320The macvlan mode, which specifies the communication mechanism between multiple macvlans on the same lower device. + namestringmacvlanThe setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired". + parentstringIf given, specifies the parent interface name or parent connection UUID from which this MAC-VLAN interface should be created. If this property is not specified, the connection must contain an "802-3-ethernet" setting with a "mac-address" property. + promiscuousbooleanTRUEWhether the interface should be put in promiscuous mode. + tapbooleanFALSEWhether the interface should be a MACVTAP. +
802-11-olpc-mesh settingKey NameValue TypeDefault ValueValue Descriptionchanneluint320Channel on which the mesh network to join is located.dhcp-anycast-addressbyte arrayAnycast DHCP MAC address used when requesting an IP address via DHCP. The specific anycast address used determines which DHCP server class answers the request. @@ -261,9 +293,18 @@ configstringThe JSON configuration for the team port. The property should contain raw JSON configuration data suitable for teamd, because the value is passed directly to teamd. If not specified, the default configuration is used. See man teamd.conf for the format details.namestringteam-portThe setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired".
+ tun settingKey NameValue TypeDefault ValueValue Description + groupstringThe group ID which will own the device. If set to NULL everyone will be able to use the device. + modeuint321The operating mode of the virtual device. Allowed values are NM_SETTING_TUN_MODE_TUN (1) to create a layer 3 device and NM_SETTING_TUN_MODE_TAP (2) to create an Ethernet-like layer 2 one. + multi-queuebooleanFALSEIf the property is set to TRUE, the interface will support multiple file descriptors (queues) to parallelize packet sending or receiving. Otherwise, the interface will only support a single queue. + namestringtunThe setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired". + ownerstringThe user ID which will own the device. If set to NULL everyone will be able to use the device. + pibooleanFALSEIf TRUE the interface will prepend a 4 byte header describing the physical interface to the packets. + vnet-hdrbooleanFALSEIf TRUE the IFF_VNET_HDR the tunnel packets will include a virtio network header. +
vlan settingKey NameValue TypeDefault ValueValue Descriptionegress-priority-maparray of string[]For outgoing packets, a list of mappings from Linux SKB priorities to 802.1p priorities. The mapping is given in the format "from:to" where both "from" and "to" are unsigned integers, ie "7:3". - flagsNMVlanFlags (uint32)One or more flags which control the behavior and features of the VLAN interface. Flags include NM_VLAN_FLAG_REORDER_HEADERS (0x1) (reordering of output packet headers), NM_VLAN_FLAG_GVRP (0x2) (use of the GVRP protocol), and NM_VLAN_FLAG_LOOSE_BINDING (0x4) (loose binding of the interface to its master device's operating state). + flagsNMVlanFlags (uint32)One or more flags which control the behavior and features of the VLAN interface. Flags include NM_VLAN_FLAG_REORDER_HEADERS (0x1) (reordering of output packet headers), NM_VLAN_FLAG_GVRP (0x2) (use of the GVRP protocol), and NM_VLAN_FLAG_LOOSE_BINDING (0x4) (loose binding of the interface to its master device's operating state). NM_VLAN_FLAG_MVRP (0x8) (use of the MVRP protocol). The default value of this property is NM_VLAN_FLAG_REORDER_HEADERS, but it used to be 0. To preserve backward compatibility, the default-value in the D-Bus API continues to be 0 and a missing property on D-Bus is still considered as 0.iduint320The VLAN identifier that the interface created by this connection should be assigned.ingress-priority-maparray of string[]For incoming packets, a list of mappings from 802.1p priorities to Linux SKB priorities. The mapping is given in the format "from:to" where both "from" and "to" are unsigned integers, ie "7:3".interface-namestringDeprecated in favor of connection.interface-name, but can be used for backward-compatibility with older daemons, to set the vlan's interface name. @@ -276,12 +317,32 @@ persistentbooleanFALSEIf the VPN service supports persistence, and this property is TRUE, the VPN will attempt to stay connected across link changes and outages, until explicitly disconnected.secretsdict of string to string{}Dictionary of key/value pairs of VPN plugin specific secrets like passwords or private keys. Both keys and values must be strings.service-typestringD-Bus service name of the VPN plugin that this setting uses to connect to its network. i.e. org.freedesktop.NetworkManager.vpnc for the vpnc plugin. + timeoutuint320Timeout for the VPN service to establish the connection. Some services may take quite a long time to connect. Value of 0 means a default timeout, which is 60 seconds (unless overriden by vpn.timeout in configuration file). Values greater than zero mean timeout in seconds.user-namestringIf the VPN connection requires a user name for authentication, that name should be provided here. If the connection is available to more than one user, and the VPN requires each user to supply a different name, then leave this property empty. If this property is empty, NetworkManager will automatically supply the username of the user which requested the VPN connection.
+ vxlan settingKey NameValue TypeDefault ValueValue Description + ageinguint320Specifies the lifetime in seconds of FDB entries learnt by the kernel. + destination-portuint328472Specifies the UDP destination port to communicate to the remote VXLAN tunnel endpoint. + iduint320Specifies the VXLAN Network Identifer (or VXLAN Segment Identifier) to use. + l2-missbooleanFALSESpecifies whether netlink LL ADDR miss notifications are generated. + l3-missbooleanFALSESpecifies whether netlink IP ADDR miss notifications are generated. + learningbooleanTRUESpecifies whether unknown source link layer addresses and IP addresses are entered into the VXLAN device forwarding database. + limituint320Specifies the maximum number of FDB entries. A value of zero means that the kernel will store unlimited entries. + localstringIf given, specifies the source IP address to use in outgoing packets. + namestringvxlanThe setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired". + parentstringIf given, specifies the parent interface name or parent connection UUID. + proxybooleanFALSESpecifies whether ARP proxy is turned on. + remotestringSpecifies the unicast destination IP address to use in outgoing packets when the destination link layer address is not known in the VXLAN device forwarding database, or the multicast IP address to join. + rscbooleanFALSESpecifies whether route short circuit is turned on. + source-port-maxuint320Specifies the maximum UDP source port to communicate to the remote VXLAN tunnel endpoint. + source-port-minuint320Specifies the minimum UDP source port to communicate to the remote VXLAN tunnel endpoint. + tosuint320Specifies the TOS value to use in outgoing packets. + ttluint320Specifies the time-to-live value to use in outgoing packets. +
wimax settingKey NameValue TypeDefault ValueValue Description - mac-addressbyte arrayIf specified, this connection will only apply to the WiMAX device whose MAC address matches. This property does not change the MAC address of the device (known as MAC spoofing). + mac-addressbyte arrayIf specified, this connection will only apply to the WiMAX device whose MAC address matches. This property does not change the MAC address of the device (known as MAC spoofing). Deprecated: 1namestringwimaxThe setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired". - network-namestringNetwork Service Provider (NSP) name of the WiMAX network this connection should use. + network-namestringNetwork Service Provider (NSP) name of the WiMAX network this connection should use. Deprecated: 1
802-3-ethernet settingKey NameValue TypeDefault ValueValue Descriptionauto-negotiatebooleanTRUEIf TRUE, allow auto-negotiation of port speed and duplex mode. If FALSE, do not allow auto-negotiation, in which case the "speed" and "duplex" properties should be set. @@ -307,9 +368,11 @@ hiddenbooleanFALSEIf TRUE, indicates this network is a non-broadcasting network that hides its SSID. In this case various workarounds may take place, such as probe-scanning the SSID for more reliable network discovery. However, these workarounds expose inherent insecurities with hidden SSID networks, and thus hidden SSID networks should be used with caution.mac-addressbyte arrayIf specified, this connection will only apply to the Wi-Fi device whose permanent MAC address matches. This property does not change the MAC address of the device (i.e. MAC spoofing).mac-address-blacklistarray of string[]A list of permanent MAC addresses of Wi-Fi devices to which this connection should never apply. Each MAC address should be given in the standard hex-digits-and-colons notation (eg "00:11:22:33:44:55"). + mac-address-randomizationuint320One of NM_SETTING_MAC_RANDOMIZATION_DEFAULT (0) (never randomize unless the user has set a global default to randomize and the supplicant supports randomization), NM_SETTING_MAC_RANDOMIZATION_NEVER (1) (never randomize the MAC address), or NM_SETTING_MAC_RANDOMIZATION_ALWAYS (2) (always randomize the MAC address).modestringWi-Fi network mode; one of "infrastructure", "adhoc" or "ap". If blank, infrastructure is assumed.mtuuint320If non-zero, only transmit packets of the specified size or smaller, breaking larger packets up into multiple Ethernet frames.namestring802-11-wirelessThe setting's name, which uniquely identifies the setting within the connection. Each setting type has a name unique to that type, for example "ppp" or "wireless" or "wired". + powersaveuint320If set to FALSE, Wi-Fi power saving behavior is disabled. If set to TRUE, Wi-Fi power saving behavior is enabled. All other values are reserved. Note that even though only boolean values are allowed, the property type is an unsigned integer to allow for future expansion.rateuint320If non-zero, directs the device to only use the specified bitrate for communication with the access point. Units are in Kb/s, ie 5500 = 5.5 Mbit/s. This property is highly driver dependent and not all devices support setting a static bitrate.securityNoneThis property is deprecated, but can be set to the value '802-11-wireless-security' when a wireless security setting is also present in the connection dictionary, for compatibility with very old NetworkManager daemons.seen-bssidsarray of string[]A list of BSSIDs (each BSSID formatted as a MAC address like "00:11:22:33:44:55") that have been detected as part of the Wi-Fi network. NetworkManager internally tracks previously seen BSSIDs. The property is only meant for reading and reflects the BSSID list of NetworkManager. The changes you make to this property will not be preserved. diff --git a/man/nm-settings.xsl b/man/nm-settings.xsl index 24e41535..b6f564c7 100644 --- a/man/nm-settings.xsl +++ b/man/nm-settings.xsl @@ -61,7 +61,7 @@ A group of related key/value pairs describing a specific piece of a Connection (profile). Settings keys and allowed values are - described in the tables below. Keys are also reffered to as properties. + described in the tables below. Keys are also referred to as properties. Developers can find the setting objects and their properties in the libnm-util sources. Look for the class_init functions near the bottom of each setting source file. diff --git a/man/nmcli-examples.5 b/man/nmcli-examples.5 deleted file mode 100644 index 23045ecd..00000000 --- a/man/nmcli-examples.5 +++ /dev/null @@ -1,693 +0,0 @@ -'\" t -.\" Title: nmcli-examples -.\" Author: -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 19 November 2014 -.\" Manual: Examples -.\" Source: NetworkManager 1.0 -.\" Language: English -.\" -.TH "NMCLI\-EXAMPLES" "5" "" "NetworkManager 1\&.0" "Examples" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.SH "NAME" -nmcli-examples \- usage examples of nmcli -.SH "SYNOPSIS" -.HP \w'\fBnmcli\ \fR\fB[OPTIONS...]\fR\ 'u -\fBnmcli \fR\fB[OPTIONS...]\fR -.SH "DESCRIPTION" -.PP -\fInmcli\fR -is a command\-line client for NetworkManager\&. It allows controlling NetworkManager and reporting its status\&. For more information please refer to -\fBnmcli\fR(1) -manual page\&. -.PP -The purpose of this manual page is to provide you with various examples and usage scenarios of -\fInmcli\fR\&. -.PP -Note: this page has "work\-in\-progress" status\&. -.SH "EXAMPLES" -.PP -\fBExample\ \&1.\ \&Listing available Wi-Fi APs\fR -.sp -.if n \{\ -.RS 4 -.\} -.nf -\fB -$ nmcli device wifi list - \fR -.fi -.if n \{\ -.RE -.\} -.sp -.if n \{\ -.RS 4 -.\} -.nf -* SSID MODE CHAN RATE SIGNAL BARS SECURITY - netdatacomm_local Infra 6 54 Mbit/s 37 ▂▄__ WEP -* F1 Infra 11 54 Mbit/s 98 ▂▄▆█ WPA1 - LoremCorp Infra 1 54 Mbit/s 62 ▂▄▆_ WPA2 802\&.1X - Internet Infra 6 54 Mbit/s 29 ▂___ WPA1 - HPB110a\&.F2672A Ad\-Hoc 6 54 Mbit/s 22 ▂___ \-\- - Jozinet Infra 1 54 Mbit/s 19 ▂___ WEP - VOIP Infra 1 54 Mbit/s 20 ▂___ WEP - MARTINA Infra 4 54 Mbit/s 32 ▂▄__ WPA2 - N24PU1 Infra 7 11 Mbit/s 22 ▂___ \-\- - alfa Infra 1 54 Mbit/s 67 ▂▄▆_ WPA2 - bertnet Infra 5 54 Mbit/s 20 ▂___ WPA1 WPA2 - -.fi -.if n \{\ -.RE -.\} -.PP -This command shows how to list available Wi\-Fi networks (APs)\&. You can also use -\fI\-\-fields\fR -option for displaying different columns\&. -\fBnmcli \-f all dev wifi list\fR -will show all of them\&. -.PP -\fBExample\ \&2.\ \&Showing general information and properties for a Wi-Fi interface\fR -.sp -.if n \{\ -.RS 4 -.\} -.nf -\fB -$ nmcli \-p \-f general,wifi\-properties device show wlan0 - \fR -.fi -.if n \{\ -.RE -.\} -.sp -.if n \{\ -.RS 4 -.\} -.nf -=============================================================================== - Device details (wlan0) -=============================================================================== -GENERAL\&.DEVICE: wlan0 -GENERAL\&.TYPE: wifi -GENERAL\&.VENDOR: Intel Corporation -GENERAL\&.PRODUCT: PRO/Wireless 5100 AGN [Shiloh] Network Connection -GENERAL\&.DRIVER: iwlwifi -GENERAL\&.DRIVER\-VERSION: 3\&.8\&.13\-100\&.fc17\&.x86_64 -GENERAL\&.FIRMWARE\-VERSION: 8\&.83\&.5\&.1 build 33692 -GENERAL\&.HWADDR: 00:1E:65:37:A1:D3 -GENERAL\&.MTU: 1500 -GENERAL\&.STATE: 100 (connected) -GENERAL\&.REASON: 0 (No reason given) -GENERAL\&.UDI: /sys/devices/pci0000:00/0000:00:1c\&.1/0000:03:00\&.0/net/wlan0 -GENERAL\&.IP\-IFACE: wlan0 -GENERAL\&.IS\-SOFTWARE: no -GENERAL\&.NM\-MANAGED: yes -GENERAL\&.AUTOCONNECT: yes -GENERAL\&.FIRMWARE\-MISSING: no -GENERAL\&.CONNECTION: My Alfa WiFi -GENERAL\&.CON\-UUID: 85194f4c\-d496\-4eec\-bae0\-d880b4cbcf26 -GENERAL\&.CON\-PATH: /org/freedesktop/NetworkManager/ActiveConnection/10 -\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- -WIFI\-PROPERTIES\&.WEP: yes -WIFI\-PROPERTIES\&.WPA: yes -WIFI\-PROPERTIES\&.WPA2: yes -WIFI\-PROPERTIES\&.TKIP: yes -WIFI\-PROPERTIES\&.CCMP: yes -WIFI\-PROPERTIES\&.AP: no -WIFI\-PROPERTIES\&.ADHOC: yes -\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- - -.fi -.if n \{\ -.RE -.\} -.PP -This command shows information about a Wi\-Fi device\&. -.PP -\fBExample\ \&3.\ \&Listing NetworkManager polkit permissions\fR -.sp -.if n \{\ -.RS 4 -.\} -.nf -\fB -$ nmcli general permissions - \fR -.fi -.if n \{\ -.RE -.\} -.sp -.if n \{\ -.RS 4 -.\} -.nf -PERMISSION VALUE -org\&.freedesktop\&.NetworkManager\&.enable\-disable\-network yes -org\&.freedesktop\&.NetworkManager\&.enable\-disable\-wifi yes -org\&.freedesktop\&.NetworkManager\&.enable\-disable\-wwan yes -org\&.freedesktop\&.NetworkManager\&.enable\-disable\-wimax yes -org\&.freedesktop\&.NetworkManager\&.sleep\-wake no -org\&.freedesktop\&.NetworkManager\&.network\-control yes -org\&.freedesktop\&.NetworkManager\&.wifi\&.share\&.protected yes -org\&.freedesktop\&.NetworkManager\&.wifi\&.share\&.open yes -org\&.freedesktop\&.NetworkManager\&.settings\&.modify\&.system yes -org\&.freedesktop\&.NetworkManager\&.settings\&.modify\&.own yes -org\&.freedesktop\&.NetworkManager\&.settings\&.modify\&.hostname auth - -.fi -.if n \{\ -.RE -.\} -.PP -This command shows configured polkit permissions for various NetworkManager operations\&. These permissions or actions (using polkit language) are configured by a system administrator and are not meant to be changed by users\&. The usual place for the polkit configuration is /usr/share/polkit\-1/actions/org\&.freedesktop\&.NetworkManager\&.policy\&. -\fIpkaction\fR -command can display description for polkit actions\&. -.sp -.if n \{\ -.RS 4 -.\} -.nf -\fB - pkaction \-\-action\-id org\&.freedesktop\&.NetworkManager\&.network\-control \-\-verbose - \fR -.fi -.if n \{\ -.RE -.\} -.sp -More information about polkit can be found at http://www\&.freedesktop\&.org/wiki/Software/polkit\&. -.PP -\fBExample\ \&4.\ \&Listing NetworkManager log level and domains\fR -.sp -.if n \{\ -.RS 4 -.\} -.nf -\fB -$ nmcli general logging - \fR -.fi -.if n \{\ -.RE -.\} -.sp -.if n \{\ -.RS 4 -.\} -.nf -LEVEL DOMAINS -INFO PLATFORM,RFKILL,ETHER,WIFI,BT,MB,DHCP4,DHCP6,PPP,WIFI_SCAN,IP4,IP6,AUTOIP4,DNS,VPN,SHARING,SUPPLICANT,AGENTS,SETTINGS,SUSPEND,CORE,DEVICE,OLPC,WIMAX,INFINIBAND,FIREWALL,ADSL,BOND,VLAN,BRIDGE,DBUS_PROPS,TEAM,CONCHECK,DCB,DISPATCH - -.fi -.if n \{\ -.RE -.\} -.PP -This command shows current NetworkManager logging status\&. -.PP -\fBExample\ \&5.\ \&Changing NetworkManager logging\fR -.sp -.if n \{\ -.RS 4 -.\} -.nf -\fB -$ nmcli g log level DEBUG domains CORE,ETHER,IP -$ nmcli g log level INFO domains DEFAULT - \fR -.fi -.if n \{\ -.RE -.\} -.PP -The first command makes NetworkManager log in DEBUG level, and only for CORE, ETHER and IP domains\&. The second command restores the default logging state\&. Please refer to the -\fBNetworkManager.conf\fR(5) -manual page for available logging levels and domains\&. -.PP -\fBExample\ \&6.\ \&Adding a bonding master and two slave connection profiles\fR -.sp -.if n \{\ -.RS 4 -.\} -.nf -\fB -$ nmcli con add type bond ifname mybond0 mode active\-backup -$ nmcli con add type bond\-slave ifname eth1 master mybond0 -$ nmcli con add type bond\-slave ifname eth2 master mybond0 - \fR -.fi -.if n \{\ -.RE -.\} -.PP -This example demonstrates adding a bond master connection and two slaves\&. The first command adds a master bond connection, naming the bonding interface -\fImybond0\fR -and using -\fIactive\-backup\fR -mode\&. The next two commands add slaves connections, both enslaved to -\fImybond0\fR\&. The first slave will be bound to -\fIeth1\fR -interface, the second to -\fIeth2\fR\&. -.PP -\fBExample\ \&7.\ \&Adding a team master and two slave connection profiles\fR -.sp -.if n \{\ -.RS 4 -.\} -.nf -\fB -$ nmcli con add type team con\-name Team1 ifname Team1 config team1\-master\-json\&.conf -$ nmcli con add type team\-slave con\-name Team1\-slave1 ifname em1 master Team1 -$ nmcli con add type team\-slave con\-name Team1\-slave2 ifname em2 master Team1 - \fR -.fi -.if n \{\ -.RE -.\} -.PP -This example demonstrates adding a team master connection profile and two slaves\&. It is very similar to the bonding example\&. The first command adds a master team profile, naming the team interface and the profile -\fITeam1\fR\&. The team configuration for the master is read from -\fIteam1\-master\-json\&.conf\fR -file\&. Later, you can change the configuration with -\fImodify\fR -command (\fBnmcli con modify Team1 team\&.config team1\-master\-another\-json\&.conf\fR)\&. The last two commands add slaves profiles, both enslaved to -\fITeam1\fR\&. The first slave will be bound to -\fIem1\fR -interface, the second to -\fIem2\fR\&. The slaves don\*(Aqt specify -\fIconfig\fR -and thus -\fIteamd\fR -will use its default configuration\&. You will activate the whole setup by activating both slaves: -.sp -.if n \{\ -.RS 4 -.\} -.nf -\fB -$ nmcli con up Team1\-slave1 -$ nmcli con up Team1\-slave2 - \fR -.fi -.if n \{\ -.RE -.\} -.sp -By default, the created profiles are marked for auto\-activation\&. But if another connection has been activated on the device, the new profile won\*(Aqt activate automatically and you need to activate it manually\&. -.PP -\fBExample\ \&8.\ \&Adding a bridge and two slave profiles\fR -.sp -.if n \{\ -.RS 4 -.\} -.nf -\fB -$ nmcli con add type bridge con\-name TowerBridge ifname TowerBridge -$ nmcli con add type bridge\-slave con\-name br\-slave\-1 ifname ens3 master TowerBridge -$ nmcli con add type bridge\-slave con\-name br\-slave\-2 ifname ens4 master TowerBridge -$ nmcli con modify TowerBridge bridge\&.stp no - \fR -.fi -.if n \{\ -.RE -.\} -.PP -This example demonstrates adding a bridge master connection and two slaves\&. The first command adds a master bridge connection, naming the bridge interface and the profile as -\fITowerBridge\fR\&. The next two commands add slaves profiles, both will be enslaved to -\fITowerBridge\fR\&. The first slave will be tied to -\fIens3\fR -interface, the second to -\fIens4\fR\&. The last command will disable 802\&.1D STP for the TowerBridge profile\&. -.PP -\fBExample\ \&9.\ \&Adding an ethernet connection profile with manual IP configuration\fR -.sp -.if n \{\ -.RS 4 -.\} -.nf - \fB -$ nmcli con add con\-name my\-con\-em1 ifname em1 type ethernet ip4 192\&.168\&.100\&.100/24 gw4 192\&.168\&.100\&.1 ip4 1\&.2\&.3\&.4 ip6 abbe::cafe -$ nmcli con mod my\-con\-em1 ipv4\&.dns "8\&.8\&.8\&.8 8\&.8\&.4\&.4" -$ nmcli con mod my\-con\-em1 +ipv4\&.dns 1\&.2\&.3\&.4 -$ nmcli con mod my\-con\-em1 ipv6\&.dns "2001:4860:4860::8888 2001:4860:4860::8844" -$ nmcli \-p con show my\-con\-em1 - \fR - -.fi -.if n \{\ -.RE -.\} -.PP -The first command adds an Ethernet connection profile named -\fImy\-con\-em1\fR -that is bound to interface name -\fIem1\fR\&. The profile is configured with static IP addresses\&. Three addresses are added, two IPv4 addresses and one IPv6\&. The first IP 192\&.168\&.100\&.100 has a prefix of 24 (netmask equivalent of 255\&.255\&.255\&.0)\&. Gateway entry will become the default route if this profile is activated on em1 interface (and there is no connection with higher priority)\&. The next two addresses do not specify a prefix, so a default prefix will be used, i\&.e\&. 32 for IPv4 and 128 for IPv6\&. The second, third and fourth commands modify DNS parameters of the new connection profile\&. The last -\fIcon show\fR -command displays the profile so that all parameters can be reviewed\&. -.PP -\fBExample\ \&10.\ \&Escaping colon characters in tabular mode\fR -.sp -.if n \{\ -.RS 4 -.\} -.nf - \fB -$ nmcli \-t \-f general \-e yes \-m tab dev show eth0 - \fR - -.fi -.if n \{\ -.RE -.\} -.sp -.if n \{\ -.RS 4 -.\} -.nf -GENERAL:eth0:ethernet:Intel Corporation:82567LM Gigabit Network Connection:e1000e:2\&.1\&.4\-k:1\&.8\-3:00\e:22\e:68\e:15\e:29\e:21:1500:100 (connected):0 (No reason given):/sys/devices/pci0000\e:00/0000\e:00\e:19\&.0/net/eth0:eth0:yes:yes:no:ethernet\-13:89cbcbc6\-dc85\-456c\-9c8b\-bd828fee3917:/org/freedesktop/NetworkManager/ActiveConnection/9 - -.fi -.if n \{\ -.RE -.\} -.PP -This example shows escaping colon characters in tabular mode\&. It may be useful for script processing, because \*(Aq:\*(Aq is used as a field separator\&. -.PP -\fBExample\ \&11.\ \&nmcli usage in a NetworkManager dispatcher script to make Ethernet and Wi-Fi mutually exclusive\fR -.sp -.if n \{\ -.RS 4 -.\} -.nf -#!/bin/bash -export LC_ALL=C - -enable_disable_wifi () -{ - result=$(nmcli dev | grep "ethernet" | grep \-w "connected") - if [ \-n "$result" ]; then - nmcli radio wifi off - else - nmcli radio wifi on - fi -} - -if [ "$2" = "up" ]; then - enable_disable_wifi -fi - -if [ "$2" = "down" ]; then - enable_disable_wifi -fi - -.fi -.if n \{\ -.RE -.\} -.PP -This dispatcher script makes Wi\-Fi mutually exclusive with wired networking\&. When a wired interface is connected, Wi\-Fi will be set to airplane mode (rfkilled)\&. When the wired interface is disconnected, Wi\-Fi will be turned back on\&. Name this script e\&.g\&. 70\-wifi\-wired\-exclusive\&.sh and put it into /etc/NetworkManager/dispatcher\&.d/ directory\&. See -\fBNetworkManager\fR(8) -manual page for more information about NetworkManager dispatcher scripts\&. -.PP -\fBExample sessions of interactive connection editor\fR -.PP -\fBExample\ \&12.\ \&Adding an ethernet connection profile in interactive editor (a)\fR -.sp -.if n \{\ -.RS 4 -.\} -.nf - \fB -$ nmcli connection edit type ethernet - \fR - -.fi -.if n \{\ -.RE -.\} -.sp -.if n \{\ -.RS 4 -.\} -.nf - -===| nmcli interactive connection editor |=== - -Adding a new \*(Aq802\-3\-ethernet\*(Aq connection - -Type \*(Aqhelp\*(Aq or \*(Aq?\*(Aq for available commands\&. -Type \*(Aqdescribe [\&.]\*(Aq for detailed property description\&. - -You may edit the following settings: connection, 802\-3\-ethernet (ethernet), 802\-1x, ipv4, ipv6, dcb -nmcli> print -=============================================================================== - Connection details -=============================================================================== -connection\&.id: ethernet\-4 -connection\&.uuid: de89cdeb\-a3e1\-4d53\-8fa0\-c22546c775f4 -connection\&.interface\-name: \-\- -connection\&.type: 802\-3\-ethernet -connection\&.autoconnect: yes -connection\&.autoconnect\-priority: 0 -connection\&.timestamp: 0 -connection\&.read\-only: no -connection\&.permissions: -connection\&.zone: \-\- -connection\&.master: \-\- -connection\&.slave\-type: \-\- -connection\&.secondaries: -connection\&.gateway\-ping\-timeout: 0 -\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- -802\-3\-ethernet\&.port: \-\- -802\-3\-ethernet\&.speed: 0 -802\-3\-ethernet\&.duplex: \-\- -802\-3\-ethernet\&.auto\-negotiate: yes -802\-3\-ethernet\&.mac\-address: \-\- -802\-3\-ethernet\&.cloned\-mac\-address: \-\- -802\-3\-ethernet\&.mac\-address\-blacklist: -802\-3\-ethernet\&.mtu: auto -802\-3\-ethernet\&.s390\-subchannels: -802\-3\-ethernet\&.s390\-nettype: \-\- -802\-3\-ethernet\&.s390\-options: -\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- -ipv4\&.method: auto -ipv4\&.dns: -ipv4\&.dns\-search: -ipv4\&.addresses: -ipv4\&.gateway: \-\- -ipv4\&.routes: -ipv4\&.route\-metric: \-1 -ipv4\&.ignore\-auto\-routes: no -ipv4\&.ignore\-auto\-dns: no -ipv4\&.dhcp\-client\-id: \-\- -ipv4\&.dhcp\-send\-hostname: yes -ipv4\&.dhcp\-hostname: \-\- -ipv4\&.never\-default: no -ipv4\&.may\-fail: yes -\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- -ipv6\&.method: auto -ipv6\&.dns: -ipv6\&.dns\-search: -ipv6\&.addresses: -ipv6\&.gateway: \-\- -ipv6\&.routes: -ipv6\&.route\-metric: \-1 -ipv6\&.ignore\-auto\-routes: no -ipv6\&.ignore\-auto\-dns: no -ipv6\&.never\-default: no -ipv6\&.may\-fail: yes -ipv6\&.ip6\-privacy: \-1 (unknown) -ipv6\&.dhcp\-hostname: \-\- -\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- -nmcli> goto ethernet -You may edit the following properties: port, speed, duplex, auto\-negotiate, mac\-address, cloned\-mac\-address, mac\-address\-blacklist, mtu, s390\-subchannels, s390\-nettype, s390\-options -nmcli 802\-3\-ethernet> set mtu 1492 -nmcli 802\-3\-ethernet> b -nmcli> goto ipv4\&.addresses -nmcli ipv4\&.addresses> desc - -=== [addresses] === -[NM property description] -Array of IP addresses\&. - -[nmcli specific description] -Enter a list of IPv4 addresses formatted as: - ip[/prefix], ip[/prefix],\&.\&.\&. -Missing prefix is regarded as prefix of 32\&. - -Example: 192\&.168\&.1\&.5/24, 10\&.0\&.0\&.11/24 - -nmcli ipv4\&.addresses> set 192\&.168\&.1\&.100/24 -Do you also want to set \*(Aqipv4\&.method\*(Aq to \*(Aqmanual\*(Aq? [yes]: yes -nmcli ipv4\&.addresses> -nmcli ipv4\&.addresses> print -addresses: 192\&.168\&.1\&.100/24 -nmcli ipv4\&.addresses> back -nmcli ipv4> b -nmcli> set ipv4\&.gateway 192\&.168\&.1\&.1 -nmcli> verify -Verify connection: OK -nmcli> print -=============================================================================== - Connection details -=============================================================================== -connection\&.id: ethernet\-4 -connection\&.uuid: de89cdeb\-a3e1\-4d53\-8fa0\-c22546c775f4 -connection\&.interface\-name: \-\- -connection\&.type: 802\-3\-ethernet -connection\&.autoconnect: yes -connection\&.autoconnect\-priority: 0 -connection\&.timestamp: 0 -connection\&.read\-only: no -connection\&.permissions: -connection\&.zone: \-\- -connection\&.master: \-\- -connection\&.slave\-type: \-\- -connection\&.secondaries: -connection\&.gateway\-ping\-timeout: 0 -\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- -802\-3\-ethernet\&.port: \-\- -802\-3\-ethernet\&.speed: 0 -802\-3\-ethernet\&.duplex: \-\- -802\-3\-ethernet\&.auto\-negotiate: yes -802\-3\-ethernet\&.mac\-address: \-\- -802\-3\-ethernet\&.cloned\-mac\-address: \-\- -802\-3\-ethernet\&.mac\-address\-blacklist: -802\-3\-ethernet\&.mtu: 1492 -802\-3\-ethernet\&.s390\-subchannels: -802\-3\-ethernet\&.s390\-nettype: \-\- -802\-3\-ethernet\&.s390\-options: -\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- -ipv4\&.method: manual -ipv4\&.dns: -ipv4\&.dns\-search: -ipv4\&.addresses: 192\&.168\&.1\&.100/24 -ipv4\&.gateway: 192\&.168\&.1\&.1 -ipv4\&.routes: -ipv4\&.route\-metric: \-1 -ipv4\&.ignore\-auto\-routes: no -ipv4\&.ignore\-auto\-dns: no -ipv4\&.dhcp\-client\-id: \-\- -ipv4\&.dhcp\-send\-hostname: yes -ipv4\&.dhcp\-hostname: \-\- -ipv4\&.never\-default: no -ipv4\&.may\-fail: yes -\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- -ipv6\&.method: auto -ipv6\&.dns: -ipv6\&.dns\-search: -ipv6\&.addresses: -ipv6\&.routes: -ipv6\&.route\-metric: \-1 -ipv6\&.ignore\-auto\-routes: no -ipv6\&.ignore\-auto\-dns: no -ipv6\&.never\-default: no -ipv6\&.may\-fail: yes -ipv6\&.ip6\-privacy: \-1 (unknown) -ipv6\&.dhcp\-hostname: \-\- -\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- -nmcli> set ipv4\&.dns 8\&.8\&.8\&.8 8\&.8\&.4\&.4 -nmcli> print -=============================================================================== - Connection details -=============================================================================== -connection\&.id: ethernet\-4 -connection\&.uuid: de89cdeb\-a3e1\-4d53\-8fa0\-c22546c775f4 -connection\&.interface\-name: \-\- -connection\&.type: 802\-3\-ethernet -connection\&.autoconnect: yes -connection\&.autoconnect\-priority: 0 -connection\&.timestamp: 0 -connection\&.read\-only: no -connection\&.permissions: -connection\&.zone: \-\- -connection\&.master: \-\- -connection\&.slave\-type: \-\- -connection\&.secondaries: -connection\&.gateway\-ping\-timeout: 0 -\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- -802\-3\-ethernet\&.port: \-\- -802\-3\-ethernet\&.speed: 0 -802\-3\-ethernet\&.duplex: \-\- -802\-3\-ethernet\&.auto\-negotiate: yes -802\-3\-ethernet\&.mac\-address: \-\- -802\-3\-ethernet\&.cloned\-mac\-address: \-\- -802\-3\-ethernet\&.mac\-address\-blacklist: -802\-3\-ethernet\&.mtu: 1492 -802\-3\-ethernet\&.s390\-subchannels: -802\-3\-ethernet\&.s390\-nettype: \-\- -802\-3\-ethernet\&.s390\-options: -\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- -ipv4\&.method: manual -ipv4\&.dns: 8\&.8\&.8\&.8,8\&.8\&.4\&.4 -ipv4\&.dns\-search: -ipv4\&.addresses: 192\&.168\&.1\&.100/24 -ipv4\&.gateway: 192\&.168\&.1\&.1 -ipv4\&.routes: -ipv4\&.route\-metric: \-1 -ipv4\&.ignore\-auto\-routes: no -ipv4\&.ignore\-auto\-dns: no -ipv4\&.dhcp\-client\-id: \-\- -ipv4\&.dhcp\-send\-hostname: yes -ipv4\&.dhcp\-hostname: \-\- -ipv4\&.never\-default: no -ipv4\&.may\-fail: yes -\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- -ipv6\&.method: auto -ipv6\&.dns: -ipv6\&.dns\-search: -ipv6\&.addresses: -ipv6\&.gateway: \-\- -ipv6\&.routes: -ipv6\&.route\-metric: \-1 -ipv6\&.ignore\-auto\-routes: no -ipv6\&.ignore\-auto\-dns: no -ipv6\&.never\-default: no -ipv6\&.may\-fail: yes -ipv6\&.ip6\-privacy: \-1 (unknown) -ipv6\&.dhcp\-hostname: \-\- -\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- -nmcli> verify -Verify connection: OK -nmcli> save -Connection \*(Aqethernet\-4\*(Aq (de89cdeb\-a3e1\-4d53\-8fa0\-c22546c775f4) successfully saved\&. -nmcli> quit - -.fi -.if n \{\ -.RE -.\} -.PP -Example session in the nmcli interactive connection editor\&. The scenario creates an Ethernet connection profile with static addressing (IPs and DNS)\&. -.SH "SEE ALSO" -.PP -\fBnmcli\fR(1), -\fBNetworkManager\fR(8), -\fBNetworkManager.conf\fR(5), -\fBnm-settings\fR(5), -\fBnm-online\fR(1), -\fBnm-applet\fR(1), -\fBnm-connection-editor\fR(1) diff --git a/man/nmcli-examples.xml b/man/nmcli-examples.xml new file mode 100644 index 00000000..a0da09cc --- /dev/null +++ b/man/nmcli-examples.xml @@ -0,0 +1,568 @@ + + + + + + + + nmcli-examples + 19 November 2014 + NetworkManager developers + + + + nmcli-examples + 5 + NetworkManager + Examples + 1.0 + + + + nmcli-examples + usage examples of nmcli + + + + + nmcli OPTIONS + + + + + Description + + nmcli is a command-line client for NetworkManager. It + allows controlling NetworkManager and reporting its status. For more information + please refer to nmcli1 + manual page. + + + The purpose of this manual page is to provide you with various examples and + usage scenarios of nmcli. + + Note: this page has "work-in-progress" status. + + + + Examples + + Listing available Wi-Fi APs + +$ nmcli device wifi list + + +* SSID MODE CHAN RATE SIGNAL BARS SECURITY + netdatacomm_local Infra 6 54 Mbit/s 37 ▂▄__ WEP +* F1 Infra 11 54 Mbit/s 98 ▂▄▆█ WPA1 + LoremCorp Infra 1 54 Mbit/s 62 ▂▄▆_ WPA2 802.1X + Internet Infra 6 54 Mbit/s 29 ▂___ WPA1 + HPB110a.F2672A Ad-Hoc 6 54 Mbit/s 22 ▂___ -- + Jozinet Infra 1 54 Mbit/s 19 ▂___ WEP + VOIP Infra 1 54 Mbit/s 20 ▂___ WEP + MARTINA Infra 4 54 Mbit/s 32 ▂▄__ WPA2 + N24PU1 Infra 7 11 Mbit/s 22 ▂___ -- + alfa Infra 1 54 Mbit/s 67 ▂▄▆_ WPA2 + bertnet Infra 5 54 Mbit/s 20 ▂___ WPA1 WPA2 + + + + This command shows how to list available Wi-Fi networks (APs). You can also use + --fields option for displaying different columns. + nmcli -f all dev wifi list will show all of them. + + + Showing general information and properties for a Wi-Fi interface + +$ nmcli -p -f general,wifi-properties device show wlan0 + + +=============================================================================== + Device details (wlan0) +=============================================================================== +GENERAL.DEVICE: wlan0 +GENERAL.TYPE: wifi +GENERAL.VENDOR: Intel Corporation +GENERAL.PRODUCT: PRO/Wireless 5100 AGN [Shiloh] Network Connection +GENERAL.DRIVER: iwlwifi +GENERAL.DRIVER-VERSION: 3.8.13-100.fc17.x86_64 +GENERAL.FIRMWARE-VERSION: 8.83.5.1 build 33692 +GENERAL.HWADDR: 00:1E:65:37:A1:D3 +GENERAL.MTU: 1500 +GENERAL.STATE: 100 (connected) +GENERAL.REASON: 0 (No reason given) +GENERAL.UDI: /sys/devices/pci0000:00/0000:00:1c.1/0000:03:00.0/net/wlan0 +GENERAL.IP-IFACE: wlan0 +GENERAL.IS-SOFTWARE: no +GENERAL.NM-MANAGED: yes +GENERAL.AUTOCONNECT: yes +GENERAL.FIRMWARE-MISSING: no +GENERAL.CONNECTION: My Alfa WiFi +GENERAL.CON-UUID: 85194f4c-d496-4eec-bae0-d880b4cbcf26 +GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveConnection/10 +------------------------------------------------------------------------------- +WIFI-PROPERTIES.WEP: yes +WIFI-PROPERTIES.WPA: yes +WIFI-PROPERTIES.WPA2: yes +WIFI-PROPERTIES.TKIP: yes +WIFI-PROPERTIES.CCMP: yes +WIFI-PROPERTIES.AP: no +WIFI-PROPERTIES.ADHOC: yes +------------------------------------------------------------------------------- + + + + This command shows information about a Wi-Fi device. + + + Listing NetworkManager polkit permissions + +$ nmcli general permissions + + +PERMISSION VALUE +org.freedesktop.NetworkManager.enable-disable-network yes +org.freedesktop.NetworkManager.enable-disable-wifi yes +org.freedesktop.NetworkManager.enable-disable-wwan yes +org.freedesktop.NetworkManager.enable-disable-wimax yes +org.freedesktop.NetworkManager.sleep-wake no +org.freedesktop.NetworkManager.network-control yes +org.freedesktop.NetworkManager.wifi.share.protected yes +org.freedesktop.NetworkManager.wifi.share.open yes +org.freedesktop.NetworkManager.settings.modify.system yes +org.freedesktop.NetworkManager.settings.modify.own yes +org.freedesktop.NetworkManager.settings.modify.hostname auth + + + + This command shows configured polkit permissions for various NetworkManager + operations. These permissions or actions (using polkit language) are configured + by a system administrator and are not meant to be changed by users. The usual + place for the polkit configuration is /usr/share/polkit-1/actions/org.freedesktop.NetworkManager.policy. + pkaction command can display description for polkit actions. + + pkaction --action-id org.freedesktop.NetworkManager.network-control --verbose + + More information about polkit can be found at http://www.freedesktop.org/wiki/Software/polkit. + + + Listing NetworkManager log level and domains + +$ nmcli general logging + + +LEVEL DOMAINS +INFO PLATFORM,RFKILL,ETHER,WIFI,BT,MB,DHCP4,DHCP6,PPP,WIFI_SCAN,IP4,IP6,AUTOIP4,DNS,VPN,SHARING,SUPPLICANT,AGENTS,SETTINGS,SUSPEND,CORE,DEVICE,OLPC,WIMAX,INFINIBAND,FIREWALL,ADSL,BOND,VLAN,BRIDGE,DBUS_PROPS,TEAM,CONCHECK,DCB,DISPATCH + + + + This command shows current NetworkManager logging status. + + + Changing NetworkManager logging + +$ nmcli g log level DEBUG domains CORE,ETHER,IP +$ nmcli g log level INFO domains DEFAULT + + + + The first command makes NetworkManager log in DEBUG level, and only for CORE, ETHER and + IP domains. The second command restores the default logging state. Please refer to the + NetworkManager.conf5 manual page + for available logging levels and domains. + + + Adding a bonding master and two slave connection profiles + +$ nmcli con add type bond ifname mybond0 mode active-backup +$ nmcli con add type ethernet ifname eth1 master mybond0 +$ nmcli con add type ethernet ifname eth2 master mybond0 + + + + This example demonstrates adding a bond master connection and two slaves. The + first command adds a master bond connection, naming the bonding interface + mybond0 and using active-backup mode. + The next two commands add slaves connections, both enslaved to mybond0. + The first slave will be bound to eth1 interface, the second to + eth2. + + + Adding a team master and two slave connection profiles + +$ nmcli con add type team con-name Team1 ifname Team1 config team1-master-json.conf +$ nmcli con add type ethernet con-name Team1-slave1 ifname em1 master Team1 +$ nmcli con add type ethernet con-name Team1-slave2 ifname em2 master Team1 + + + + This example demonstrates adding a team master connection profile and two slaves. It is + very similar to the bonding example. The first command adds a master team profile, naming + the team interface and the profile Team1. The team configuration + for the master is read from team1-master-json.conf file. Later, you can + change the configuration with modify command + (nmcli con modify Team1 team.config team1-master-another-json.conf). + The last two commands add slaves profiles, both enslaved to Team1. + The first slave will be bound to em1 interface, the second to + em2. The slaves don't specify config and thus + teamd will use its default configuration. You will activate the whole setup + by activating both slaves: + +$ nmcli con up Team1-slave1 +$ nmcli con up Team1-slave2 + + By default, the created profiles are marked for auto-activation. But if another + connection has been activated on the device, the new profile won't activate + automatically and you need to activate it manually. + + + Adding a bridge and two slave profiles + +$ nmcli con add type bridge con-name TowerBridge ifname TowerBridge +$ nmcli con add type ethernet con-name br-slave-1 ifname ens3 master TowerBridge +$ nmcli con add type ethernet con-name br-slave-2 ifname ens4 master TowerBridge +$ nmcli con modify TowerBridge bridge.stp no + + + + This example demonstrates adding a bridge master connection and two slaves. The + first command adds a master bridge connection, naming the bridge interface and + the profile as TowerBridge. + The next two commands add slaves profiles, both will be enslaved to + TowerBridge. + The first slave will be tied to ens3 interface, the second to + ens4. + The last command will disable 802.1D STP for the TowerBridge profile. + + + Adding an ethernet connection profile with manual IP configuration + + +$ nmcli con add con-name my-con-em1 ifname em1 type ethernet ip4 192.168.100.100/24 gw4 192.168.100.1 ip4 1.2.3.4 ip6 abbe::cafe +$ nmcli con mod my-con-em1 ipv4.dns "8.8.8.8 8.8.4.4" +$ nmcli con mod my-con-em1 +ipv4.dns 1.2.3.4 +$ nmcli con mod my-con-em1 ipv6.dns "2001:4860:4860::8888 2001:4860:4860::8844" +$ nmcli -p con show my-con-em1 + + + + + The first command adds an Ethernet connection profile named my-con-em1 + that is bound to interface name em1. The profile is configured + with static IP addresses. Three addresses are added, two IPv4 addresses and one IPv6. + The first IP 192.168.100.100 has a prefix of 24 (netmask equivalent of 255.255.255.0). + Gateway entry will become the default route if this profile is activated on em1 interface + (and there is no connection with higher priority). The next two addresses do not + specify a prefix, so a default prefix will be used, i.e. 32 for IPv4 and 128 for IPv6. + The second, third and fourth commands modify DNS parameters of the new connection profile. + The last con show command displays the profile so that all + parameters can be reviewed. + + + Escaping colon characters in tabular mode + + +$ nmcli -t -f general -e yes -m tab dev show eth0 + + + +GENERAL:eth0:ethernet:Intel Corporation:82567LM Gigabit Network Connection:e1000e:2.1.4-k:1.8-3:00\:22\:68\:15\:29\:21:1500:100 (connected):0 (No reason given):/sys/devices/pci0000\:00/0000\:00\:19.0/net/eth0:eth0:yes:yes:no:ethernet-13:89cbcbc6-dc85-456c-9c8b-bd828fee3917:/org/freedesktop/NetworkManager/ActiveConnection/9 + + + + This example shows escaping colon characters in tabular mode. It may be + useful for script processing, because ':' is used as a field separator. + + + nmcli usage in a NetworkManager dispatcher script to make Ethernet and Wi-Fi mutually exclusive + +#!/bin/bash +export LC_ALL=C + +enable_disable_wifi () +{ + result=$(nmcli dev | grep "ethernet" | grep -w "connected") + if [ -n "$result" ]; then + nmcli radio wifi off + else + nmcli radio wifi on + fi +} + +if [ "$2" = "up" ]; then + enable_disable_wifi +fi + +if [ "$2" = "down" ]; then + enable_disable_wifi +fi + + + + This dispatcher script makes Wi-Fi mutually exclusive with wired + networking. When a wired interface is connected, Wi-Fi will be set + to airplane mode (rfkilled). When the wired interface is disconnected, + Wi-Fi will be turned back on. + Name this script e.g. 70-wifi-wired-exclusive.sh and put it into /etc/NetworkManager/dispatcher.d/ + directory. + See NetworkManager8 + manual page for more information about NetworkManager dispatcher scripts. + + + + Example sessions of interactive connection editor + + Adding an ethernet connection profile in interactive editor (a) + + +$ nmcli connection edit type ethernet + + + + +===| nmcli interactive connection editor |=== + +Adding a new '802-3-ethernet' connection + +Type 'help' or '?' for available commands. +Type 'describe [<setting>.<prop>]' for detailed property description. + +You may edit the following settings: connection, 802-3-ethernet (ethernet), 802-1x, ipv4, ipv6, dcb +nmcli> print +=============================================================================== + Connection details +=============================================================================== +connection.id: ethernet-4 +connection.uuid: de89cdeb-a3e1-4d53-8fa0-c22546c775f4 +connection.interface-name: -- +connection.type: 802-3-ethernet +connection.autoconnect: yes +connection.autoconnect-priority: 0 +connection.timestamp: 0 +connection.read-only: no +connection.permissions: +connection.zone: -- +connection.master: -- +connection.slave-type: -- +connection.secondaries: +connection.gateway-ping-timeout: 0 +------------------------------------------------------------------------------- +802-3-ethernet.port: -- +802-3-ethernet.speed: 0 +802-3-ethernet.duplex: -- +802-3-ethernet.auto-negotiate: yes +802-3-ethernet.mac-address: -- +802-3-ethernet.cloned-mac-address: -- +802-3-ethernet.mac-address-blacklist: +802-3-ethernet.mtu: auto +802-3-ethernet.s390-subchannels: +802-3-ethernet.s390-nettype: -- +802-3-ethernet.s390-options: +------------------------------------------------------------------------------- +ipv4.method: auto +ipv4.dns: +ipv4.dns-search: +ipv4.addresses: +ipv4.gateway: -- +ipv4.routes: +ipv4.route-metric: -1 +ipv4.ignore-auto-routes: no +ipv4.ignore-auto-dns: no +ipv4.dhcp-client-id: -- +ipv4.dhcp-send-hostname: yes +ipv4.dhcp-hostname: -- +ipv4.never-default: no +ipv4.may-fail: yes +------------------------------------------------------------------------------- +ipv6.method: auto +ipv6.dns: +ipv6.dns-search: +ipv6.addresses: +ipv6.gateway: -- +ipv6.routes: +ipv6.route-metric: -1 +ipv6.ignore-auto-routes: no +ipv6.ignore-auto-dns: no +ipv6.never-default: no +ipv6.may-fail: yes +ipv6.ip6-privacy: -1 (unknown) +ipv6.dhcp-hostname: -- +------------------------------------------------------------------------------- +nmcli> goto ethernet +You may edit the following properties: port, speed, duplex, auto-negotiate, mac-address, cloned-mac-address, mac-address-blacklist, mtu, s390-subchannels, s390-nettype, s390-options +nmcli 802-3-ethernet> set mtu 1492 +nmcli 802-3-ethernet> b +nmcli> goto ipv4.addresses +nmcli ipv4.addresses> desc + +=== [addresses] === +[NM property description] +Array of IP addresses. + +[nmcli specific description] +Enter a list of IPv4 addresses formatted as: + ip[/prefix], ip[/prefix],... +Missing prefix is regarded as prefix of 32. + +Example: 192.168.1.5/24, 10.0.0.11/24 + +nmcli ipv4.addresses> set 192.168.1.100/24 +Do you also want to set 'ipv4.method' to 'manual'? [yes]: yes +nmcli ipv4.addresses> +nmcli ipv4.addresses> print +addresses: 192.168.1.100/24 +nmcli ipv4.addresses> back +nmcli ipv4> b +nmcli> set ipv4.gateway 192.168.1.1 +nmcli> verify +Verify connection: OK +nmcli> print +=============================================================================== + Connection details +=============================================================================== +connection.id: ethernet-4 +connection.uuid: de89cdeb-a3e1-4d53-8fa0-c22546c775f4 +connection.interface-name: -- +connection.type: 802-3-ethernet +connection.autoconnect: yes +connection.autoconnect-priority: 0 +connection.timestamp: 0 +connection.read-only: no +connection.permissions: +connection.zone: -- +connection.master: -- +connection.slave-type: -- +connection.secondaries: +connection.gateway-ping-timeout: 0 +------------------------------------------------------------------------------- +802-3-ethernet.port: -- +802-3-ethernet.speed: 0 +802-3-ethernet.duplex: -- +802-3-ethernet.auto-negotiate: yes +802-3-ethernet.mac-address: -- +802-3-ethernet.cloned-mac-address: -- +802-3-ethernet.mac-address-blacklist: +802-3-ethernet.mtu: 1492 +802-3-ethernet.s390-subchannels: +802-3-ethernet.s390-nettype: -- +802-3-ethernet.s390-options: +------------------------------------------------------------------------------- +ipv4.method: manual +ipv4.dns: +ipv4.dns-search: +ipv4.addresses: 192.168.1.100/24 +ipv4.gateway: 192.168.1.1 +ipv4.routes: +ipv4.route-metric: -1 +ipv4.ignore-auto-routes: no +ipv4.ignore-auto-dns: no +ipv4.dhcp-client-id: -- +ipv4.dhcp-send-hostname: yes +ipv4.dhcp-hostname: -- +ipv4.never-default: no +ipv4.may-fail: yes +------------------------------------------------------------------------------- +ipv6.method: auto +ipv6.dns: +ipv6.dns-search: +ipv6.addresses: +ipv6.routes: +ipv6.route-metric: -1 +ipv6.ignore-auto-routes: no +ipv6.ignore-auto-dns: no +ipv6.never-default: no +ipv6.may-fail: yes +ipv6.ip6-privacy: -1 (unknown) +ipv6.dhcp-hostname: -- +------------------------------------------------------------------------------- +nmcli> set ipv4.dns 8.8.8.8 8.8.4.4 +nmcli> print +=============================================================================== + Connection details +=============================================================================== +connection.id: ethernet-4 +connection.uuid: de89cdeb-a3e1-4d53-8fa0-c22546c775f4 +connection.interface-name: -- +connection.type: 802-3-ethernet +connection.autoconnect: yes +connection.autoconnect-priority: 0 +connection.timestamp: 0 +connection.read-only: no +connection.permissions: +connection.zone: -- +connection.master: -- +connection.slave-type: -- +connection.secondaries: +connection.gateway-ping-timeout: 0 +------------------------------------------------------------------------------- +802-3-ethernet.port: -- +802-3-ethernet.speed: 0 +802-3-ethernet.duplex: -- +802-3-ethernet.auto-negotiate: yes +802-3-ethernet.mac-address: -- +802-3-ethernet.cloned-mac-address: -- +802-3-ethernet.mac-address-blacklist: +802-3-ethernet.mtu: 1492 +802-3-ethernet.s390-subchannels: +802-3-ethernet.s390-nettype: -- +802-3-ethernet.s390-options: +------------------------------------------------------------------------------- +ipv4.method: manual +ipv4.dns: 8.8.8.8,8.8.4.4 +ipv4.dns-search: +ipv4.addresses: 192.168.1.100/24 +ipv4.gateway: 192.168.1.1 +ipv4.routes: +ipv4.route-metric: -1 +ipv4.ignore-auto-routes: no +ipv4.ignore-auto-dns: no +ipv4.dhcp-client-id: -- +ipv4.dhcp-send-hostname: yes +ipv4.dhcp-hostname: -- +ipv4.never-default: no +ipv4.may-fail: yes +------------------------------------------------------------------------------- +ipv6.method: auto +ipv6.dns: +ipv6.dns-search: +ipv6.addresses: +ipv6.gateway: -- +ipv6.routes: +ipv6.route-metric: -1 +ipv6.ignore-auto-routes: no +ipv6.ignore-auto-dns: no +ipv6.never-default: no +ipv6.may-fail: yes +ipv6.ip6-privacy: -1 (unknown) +ipv6.dhcp-hostname: -- +------------------------------------------------------------------------------- +nmcli> verify +Verify connection: OK +nmcli> save +Connection 'ethernet-4' (de89cdeb-a3e1-4d53-8fa0-c22546c775f4) successfully saved. +nmcli> quit + + + + Example session in the nmcli interactive connection editor. + The scenario creates an Ethernet connection profile with static addressing (IPs and DNS). + + + + + + See Also + + nmcli1, + NetworkManager8, + NetworkManager.conf5, + nm-settings5, + nm-online1, + nm-applet1, + nm-connection-editor1 + + + diff --git a/man/nmcli.1.in b/man/nmcli.1.in index 8cd2afac..fbd53c49 100644 --- a/man/nmcli.1.in +++ b/man/nmcli.1.in @@ -19,7 +19,7 @@ .\" with this manual; if not, write to the Free Software Foundation, Inc., .\" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. .\" -.\" Copyright 2010 - 2014 Red Hat, Inc. +.\" Copyright 2010 - 2015 Red Hat, Inc. .\" .TH NMCLI "1" "12 August 2015" @@ -33,7 +33,7 @@ nmcli \- command\(hyline tool for controlling NetworkManager .sp .IR OBJECT " := { " -.BR general " | " networking " | " radio " | " connection " | " device " | " agent +.BR general " | " networking " | " radio " | " connection " | " device " | " agent " | " monitor .RI " }" .sp @@ -45,6 +45,8 @@ nmcli \- command\(hyline tool for controlling NetworkManager .br \fB\-m\fR[\fImode\fR] tabular | multiline .br +\fB\-c\fR[\fIcolors\fR] auto | yes | no +.br \fB\-f\fR[\fIields\fR] | all | common .br \fB\-e\fR[\fIscape\fR] yes | no @@ -53,6 +55,8 @@ nmcli \- command\(hyline tool for controlling NetworkManager .br \fB\-a\fR[\fIsk\fR] .br +\fB\-s\fR[\fIhow-secrets\fR] +.br \fB\-w\fR[\fIait\fR] .br \fB\-v\fR[\fIersion\fR] @@ -106,6 +110,11 @@ Columns define particular properties of the entry. \fImultiline\fP \(en Each entry comprises multiple lines, each property on its own line. The values are prefixed with the property name. .TP +.B \-c, \-\-colors auto|yes|no +This option controls color output (using terminal escape sequences). \fIyes\fP +enables colors, \fIno\fP disables them, \fIauto\fP only produces colors when +standard output is directed to a terminal. The default value is \fIauto\fP. +.TP .B \-f, \-\-fields | all | common This option is used to specify what fields (column names) should be printed. Valid field names differ for specific commands. List available fields by @@ -134,6 +143,11 @@ arguments, so do not use this option for non-interactive purposes like scripts. This option controls, for example, whether you will be prompted for a password if it is required for connecting to a network. .TP +.B \-s, \-\-show-secrets +When using this option \fInmcli\fP will display passwords and secrets that might +be present in an output of an operation. This option also influences echoing +passwords typed by user as an input. +.TP .B \-w, \-\-wait This option sets a timeout period for which \fInmcli\fP will wait for \fINetworkManager\fP to finish operations. It is especially useful for commands that may take a longer time to @@ -176,8 +190,8 @@ file in most distributions. For example, systemd-hostnamed service uses the term .B permissions .br Show the permissions a caller has for various authenticated operations that -NetworkManager provides, like enable and disable networking, changing Wi\(hyFi, -WWAN, and WiMAX state, modifying connections, etc. +NetworkManager provides, like enable and disable networking, changing Wi\(hyFi +and WWAN state, modifying connections, etc. .TP .B logging [level ] [domains ] .br @@ -232,7 +246,7 @@ Possible states are: Use this object to show radio switches status, or enable and disable the switches. .TP -.SS \fICOMMAND\fP := { all | wifi | wwan | wimax } +.SS \fICOMMAND\fP := { all | wifi | wwan } .sp .RS .TP @@ -247,18 +261,21 @@ Show or set status of WWAN (mobile broadband) in NetworkManager. If no arguments are supplied, mobile broadband status is printed; \fIon\fP enables mobile broadband, \fIoff\fP disables it. .TP -.B wimax [ on | off ] -.br -Show or set status of WiMAX in NetworkManager. If no arguments are supplied, -WiMAX status is printed; \fIon\fP enables WiMAX; \fIoff\fP disables WiMAX. Note: -WiMAX support is a compile\(hytime decision, so it may be unavailable on some -installations. -.TP .B all [ on | off ] .br Show or set all previously mentioned radio switches at the same time. .RE +.TP +.B monitor \- monitor NetworkManager +.br +Use this object to observe NetworkManager activity. Watches for changes +in connectivity state, devices or connection profiles. +.br +See also \fImonitor\fP command of \fIconnection\fP or \fIdevice\fP object +to watch for changes in certain objects or object classes. +.RE + .TP .B connection \- start, stop, and manage network connections .sp @@ -278,7 +295,7 @@ be saved as two connections which both apply to eth0, one for DHCP (called connected to the DHCP-enabled network the user would run "nmcli con up default" , and when connected to the static network the user would run "nmcli con up testing". .TP -.SS \fICOMMAND\fP := { show | up | down | add | edit | modify | delete | reload | load } +.SS \fICOMMAND\fP := { show | up | down | add | edit | modify | delete | monitor | reload | load } .sp .RS .TP @@ -289,12 +306,31 @@ active if a device is using that connection profile. Without a parameter, all profiles are listed. When --active option is specified, only the active profiles are shown. .TP -.B show [--active] [--show-secrets] [ id | uuid | path | apath ] ... +.B show [--active] [--order ] [ id | uuid | path | apath ] ... .br Show details for specified connections. By default, both static configuration and active connection data are displayed. When --active option is specified, -only the active profiles are taken into account. When --show-secrets option is -specified, secrets associated with the profile will be revealed too. +only the active profiles are taken into account. Use global --show-secrets option +to display secrets associated with the profile. +.sp +Ordering: +.br +The --order option can be used to get custom ordering of connections. The +connections can be ordered by active status, name, type or D-Bus path. If +connections are equal according to a sort order category, an additional +category can be specified. +The default sorting order is equivalent to "--order active:name:path". +.sp + := category:category:... +.br +category := [+-]active | [+-]name | [+-]type | [+-]path +.br +\fI+\fP or no prefix means sorting in ascending order (alphabetically or in numbers). +.br +\fI-\fP means reverse (descending) order. +.br +The category names can be abbreviated (e.g. --order -a:na) +.sp \fIid\fP, \fIuuid\fP, \fIpath\fP and \fIapath\fP keywords can be used if \fI\fP is ambiguous. .RS @@ -329,10 +365,10 @@ When no command is given to the \fIconnection\fP object, the default action is 'nmcli connection show'. .RE .TP -.B up [ id | uuid | path ] [ifname ] [ap ] [nsp ] [passwd-file ] +.B up [ id | uuid | path ] [ifname ] [ap ] [passwd-file ] .RE .RS -.B up ifname [ap ] [nsp ] [passwd-file ] +.B up ifname [ap ] [passwd-file ] .RS .br Activate a connection. The connection is identified by its name, UUID or D-Bus @@ -355,8 +391,6 @@ Available options are: \(en interface that will be used for activation .IP \fIap\fP 13 \(en BSSID of the AP which the command should connect to (for Wi\(hyFi connections) -.IP \fInsp\fP 13 -\(en NSP (Network Service Provider) which the command should connect to (for WiMAX connections) .IP \fIpasswd-file\fP 13 \(en some networks may require credentials during activation. You can give these credentials using this option. @@ -401,7 +435,7 @@ See \fBconnection show\fP above for the description of the -specifying keywo .br If '--wait' option is not specified, the default timeout will be 10 seconds. .TP -.B add COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS +.B add COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS SLAVE_OPTIONS IP_OPTIONS [-- [+|-]. ...] .br Add a connection for NetworkManager. Arguments differ according to connection types, see below. .RS @@ -409,6 +443,9 @@ Add a connection for NetworkManager. Arguments differ according to connection ty .B COMMON_OPTIONS: .IP "\fItype \fP" 42 \(en connection type; see below \fBTYPE_SPECIFIC_OPTIONS\fP for allowed values; (mandatory) +Note that types \fIbond-slave\fP, \fIteam-slave\fP and \fIbridge-slave\fP create \fIethernet\fP +connection profiles. Their use is discouraged in favor of using a specific type with \fImaster\fP +option. .IP "\fIifname | \(dq\&*\(dq\&\fP" 42 \(en interface to bind the connection to. The connection will only be applicable to this interface name. A special value of "\fB*\fP" can be used for interface-independent connections. @@ -420,6 +457,13 @@ Note: use quotes around \fB*\fP to suppress shell expansion. \(en whether the connection profile can be automatically activated (default: yes) .IP "\fI[save yes|no]\fP" 42 \(en whether the connection should be persistent, i.e. NetworkManager should store it on disk (default: yes) +.IP "\fI[master ]\fP" 42 +\(en master interface name, or connection UUID or ID of master connection profile. +The value can be prefixed with \fBifname/\fP, \fBuuid/\fP or \fBid/\fP to disambiguate it. +See below \fBSLAVE_OPTIONS\fP for additional options for slave connection to masters of various types. +.IP "\fI[slave-type ]\fP" 42 +\(en type of master connection. Only required when it can not be inferred (i.e. the master connection does +not exist yet). .RE .RS .TP @@ -563,8 +607,6 @@ The value can be prefixed with \fBifname/\fP, \fBuuid/\fP or \fBid/\fP to disamb .IP "\fImaster \fP" 42 \(en master team interface name, or connection UUID or ID of team master connection profile. The value can be prefixed with \fBifname/\fP, \fBuuid/\fP or \fBid/\fP to disambiguate it. -.IP "\fI[config |]\fP" 42 -\(en JSON configuration for team .RE .RS .TP @@ -581,6 +623,8 @@ The value can be prefixed with \fBifname/\fP, \fBuuid/\fP or \fBid/\fP to disamb \(en STP maximum message age, in seconds (default: 20) .IP "\fI[ageing-time <0-1000000>]\fP" 42 \(en the Ethernet MAC address aging time, in seconds (default: 300) +.IP "\fI[multicast-snooping yes|no]\fP" 42 +\(en controls whether IGMP snooping is enabled (default: yes) .IP "\fI[mac ]\fP" 42 \(en MAC address of the bridge (note: this requires a recent kernel feature, originally introduced in 3.15 upstream kernel) @@ -591,18 +635,11 @@ originally introduced in 3.15 upstream kernel) .IP "\fImaster \fP" 42 \(en master bridge interface name, or connection UUID or ID of bridge master connection profile. The value can be prefixed with \fBifname/\fP, \fBuuid/\fP or \fBid/\fP to disambiguate it. -.IP "\fI[priority <0-63>]\fP" 42 -\(en STP priority of this slave (default: 32) -.IP "\fI[path-cost <1-65535>]\fP" 42 -\(en STP port cost for destinations via this slave (default: 100) -.IP "\fI[hairpin yes|no]\fP" 42 -\(en 'hairpin mode' for the slave, which allows frames -to be sent back out through the slave the frame was received on (default: yes) .RE .RS .TP .B vpn: -.IP "\fIvpn-type vpnc|openvpn|pptp|openconnect|openswan|libreswan|ssh|l2tp|iodine|...\fP" 42 +.IP "\fIvpn-type vpnc|openvpn|pptp|openconnect|openswan|libreswan|strongswan|ssh|l2tp|iodine|fortisslvpn|...\fP" 42 \(en VPN type .IP "\fI[user ]\fP" 42 \(en VPN username @@ -631,12 +668,94 @@ to be sent back out through the slave the frame was received on (default: yes) .RE .RS .TP +.B tun: +.IP "\fImode tun|tap\fP" 42 +\(en Mode for the device +.IP "\fI[owner ]\fP" 42 +\(en UID of the owner +.IP "\fI[group ]\fP" 42 +\(en GID of the group +.IP "\fI[pi yes|no>]\fP" 42 +\(en include packet information (~IFF_NO_PI flag) +.IP "\fI[vnet-hdr yes|no>]\fP" 42 +\(en send and receive large (i.e. GSO) packets and packets with partial checksums (IFF_VNET_HDR flag) +.IP "\fI[multi-queue yes|no>]\fP" 42 +\(en multi-queue support for tun/tap device (IFF_MULTI_QUEUE flag) +.RE +.RS +.TP +.B ip-tunnel: +.IP "\fImode ipip|gre|sit|isatap|vti|ip6ip6|ipip6|ip6gre|vti6\fP" 42 +\(en tunnel mode +.IP "\fIremote \fP" 42 +\(en IPv4 or IPv6 address of the remote tunnel endpoint +.IP "\fI[local ]\fP" 42 +\(en IPv4 or IPv6 address of the local tunnel endpoint +.IP "\fI[dev ]\fP" 42 +\(en device to use for tunnel endpoint communication +.RE +.RS +.TP +.B macvlan: +.IP "\fIdev \fP" 42 +\(en parent device this MACVLAN is on +.IP "\fImode vepa|bridge|private|passthru|source\fP" 42 +\(en MACVLAN mode, which specifies the communication mechanism between multiple MACVLANs on the same lower device +.IP "\fI[tap yes|no]\fP" 42 +\(en controls the device type. If set to 'yes' a MACVTAP will be created (default: no) +.RE +.RS +.TP +.B vxlan: +.IP "\fIid \fP" 42 +\(en VXLAN Network Identifer to use +.IP "\fIremote \fP" 42 +\(en unicast destination IP address or multicast IP address to join +.IP "\fI[dev ]\fP" 42 +\(en device to use for tunnel endpoint communication +.IP "\fI[local ]\fP" 42 +\(en source IP address +.IP "\fI[source-port-min <0-65535>]\fP" 42 +\(en minimum UDP source port to communicate to the remote VXLAN tunnel endpoint +.IP "\fI[source-port-max <0-65535>]\fP" 42 +\(en maximum UDP source port to communicate to the remote VXLAN tunnel endpoint +.IP "\fI[destination-port <0-65535>]\fP" 42 +\(en UDP destination port to communicate to the remote VXLAN tunnel endpoint +.RE +.RS +.TP +.B SLAVE_OPTIONS: +.RE +.RS +.TP +.B bridge: +.IP "\fI[priority <0-63>]\fP" 42 +\(en STP priority of this slave (default: 32) +.IP "\fI[path-cost <1-65535>]\fP" 42 +\(en STP port cost for destinations via this slave (default: 100) +.IP "\fI[hairpin yes|no]\fP" 42 +\(en 'hairpin mode' for the slave, which allows frames +to be sent back out through the slave the frame was received on (default: yes) +.RE +.RS +.TP +.B team: +.IP "\fI[config |]\fP" 42 +\(en JSON configuration for team +.RE +.RS +.TP .B IP_OPTIONS: .IP "\fI[ip4 ] [gw4 ]\fP" 42 \(en IPv4 addresses .IP "\fI[ip6 ] [gw6 ]\fP" 42 \(en IPv6 addresses .RE +.RS +If a \fI--\fP argument is encountered, the rest of command line is interpreted +as property list in the same format as \fIconnection modify\fP command accepts. +This makes it possible to adjust the connection properties before it's added. +.RE .TP .B edit [id | uuid | path ] - edit an existing connection .RE @@ -693,6 +812,20 @@ The changes to the connection profile will be saved persistently by NetworkManager, unless \fI--temporary\fP option is provided, in which case the changes won't persist over NetworkManager restart. .TP +.B clone [--temporary] [ id | uuid | path ] +.br +Clone a connection. The connection to be cloned is identified by its +name, UUID or D-Bus path. If is ambiguous, a keyword \fIid\fP, +\fIuuid\fP or \fIpath\fP can be used. See \fBconnection show\fP above for +the description of the -specifying keywords. \fI\fP is the name +of the new cloned connection. The new connection will be the exact copy except +the connection.id (\fI\fP) and connection.uuid (generated) +properties. +.br +The new connection profile will be saved as persistent unless \fI--temporary\fP +option is specified, in which case the new profile won't exist after NetworkManager +restart. +.TP .B delete [ id | uuid | path ] ... .br Delete a configured connection. The connection to be deleted is identified by @@ -703,6 +836,19 @@ See \fBconnection show\fP above for the description of the -specifying keywo .br If '--wait' option is not specified, the default timeout will be 10 seconds. .TP +.B monitor [ id | uuid | path ] ... +.br +Monitor connection profile activity. This command prints a line whenever the +specified connection changes. The connection to be monitored is identified by +its name, UUID or D-Bus path. If is ambiguous, a keyword \fIid\fP, +\fIuuid\fP or \fIpath\fP can be used. +.br +See \fBconnection show\fP above for the description of the -specifying keywords. +.br +Monitors all connection profiles in case none is specified. The command terminates +when all monitored connections disappear. If you want to monitor connection creation +consider using the global monitor with \fInmcli monitor\fP command. +.TP .B reload .br Reload all connection files from disk. \fINetworkManager\fP does not monitor @@ -717,13 +863,36 @@ then \fINetworkManager\fP will reload connection files any time they change Load/reload one or more connection files from disk. Use this after manually editing a connection file to ensure that \fBNetworkManager\fP is aware of its latest state. +.TP +.B import [--temporary] type file +.br +Import an external/foreign configuration as a NetworkManager connection profile. +The type of the input file is specified by \fItype\fP option. +.br +Only VPN configurations are supported at the moment. The configuration +is imported by NetworkManager VPN plugins. \fItype\fP values are the same as for +\fIvpn-type\fP option in \fBnmcli connection add\fP. VPN configurations are +imported by VPN plugins. Therefore the proper VPN plugin has to be installed +so that nmcli could import the data. +.br +The imported connection profile will be saved as persistent unless \fI--temporary\fP +option is specified, in which case the new profile won't exist after NetworkManager +restart. +.TP +.B export [ id | uuid | path ] [] +.br +Export a connection. +.br +Only VPN connections are supported at the moment. A proper VPN plugin has to be +installed so that nmcli could export a connection. If no \fI\fP is +provided, the VPN configuration data will be printed to standard output. .RE .TP .B device - show and manage network interfaces .br .TP -.SS \fICOMMAND\fP := { status | show | connect | disconnect | delete | wifi | wimax } +.SS \fICOMMAND\fP := { status | show | set | connect | reapply | disconnect | delete | monitor | wifi | lldp } .sp .RS .TP @@ -739,6 +908,11 @@ Show detailed information about devices. Without an argument, all devices are examined. To get information for a specific device, the interface name has to be provided. .TP +.TP +.B set [ifname] [autoconnect yes|no] [managed yes|no] +.br +Set device properties. +.TP .B connect .br Connect the device. NetworkManager will try to find a suitable connection that @@ -746,6 +920,11 @@ will be activated. It will also consider connections that are not set to auto co .br If '--wait' option is not specified, the default timeout will be 90 seconds. .TP +.B reapply +.br +Attempt to update device with changes to the currently active connection +made since it was last applied. +.TP .B disconnect ... .br Disconnect a device and prevent the device from automatically activating further @@ -762,6 +941,15 @@ Hardware devices (like Ethernet) cannot be deleted by the command. .br If '--wait' option is not specified, the default timeout will be 10 seconds. .TP +.B monitor [] ... +.br +Monitor device activity. This command prints a line whenever the specified devices +change state. +.br +Monitors all devices in case no interface is specified. The monitor terminates when +all specified devices disappear. If you want to monitor device addition consider +using the global monitor with \fInmcli monitor\fP command. +.TP .B wifi [list [ifname ] [bssid ]] .br List available Wi\(hyFi access points. The \fIifname\fP and \fIbssid\fP options @@ -802,6 +990,35 @@ Otherwise the connection is system\(hywide, which is the default. Otherwise the SSID would not be found and the connection attempt would fail. .RE .TP +.B wifi hotspot [ifname ] [con-name ] [ssid ] [band a|bg] [channel ] [password ] +.br +Create a Wi-Fi hotspot. The command creates a hotspot connection profile according to +Wi-Fi device capabilities and activates it on the device. The hotspot is secured with WPA +if device/driver supports that, otherwise WEP is used. +Use \fIconnection down\fP or \fIdevice disconnect\fP to stop the hotspot. +.br +.RS +.PP +Parameters of the hotspot can be influenced by the optional parameters: +.IP \fIifname\fP 17 +\(en what Wi-Fi device is used +.IP \fIcon-name\fP 17 +\(en name of the created hotspot connection profile +.IP \fIssid\fP 17 +\(en SSID of the hotspot +.IP \fIband\fP 17 +\(en Wi-Fi band to use +.IP \fIchannel\fP 17 +\(en Wi-Fi channel to use +.IP \fIpassword\fP 17 +\(en password to use for the created hotspot. If not provided, +nmcli will generate a password. The password is either WPA +pre-shared key or WEP key. +.PP +Note that \fI--show-secrets\fP global option can be used to print the hotspot +password. It is useful especially when the password was generated. +.RE +.TP .B wifi rescan [ifname ] [[ssid ] ...] .br Request that \fINetworkManager\fP immediately re-scan for available access points. @@ -813,11 +1030,12 @@ scan more SSIDs. .br This command does not show the APs, use 'nmcli device wifi list' for that. .TP -.B wimax [list [ifname ] [nsp ]] +.B lldp [list [ifname ]] .br -List available WiMAX NSP. The \fIifname\fP and \fInsp\fP options -can be used to list networks for a particular interface or with a specific -NSP, respectively. +Display information about neighboring devices learned through the Link +Layer Discovery Protocol (LLDP). The \fIifname\fP option can be used to +list neighbors only for a given interface. The protocol must be +enabled in the connection settings. .RE .TP @@ -941,7 +1159,7 @@ shows all connection profile names and their auto-connect property. .IP shows details for "My default em1" connection profile. -.IP "\fB\f(CWnmcli connection show --show-secrets \(dq\&My Home WiFi\(dq\&\fP\fP" +.IP "\fB\f(CWnmcli --show-secrets connection show \(dq\&My Home WiFi\(dq\&\fP\fP" .IP shows details for "My Home WiFi" connection profile with all passwords. Without \fI--show-secrets\fP option, secrets would not be displayed. @@ -980,6 +1198,10 @@ a connection. .IP shows details for wlan0 interface; only GENERAL and WIFI\-PROPERTIES sections will be shown. +.IP "\fB\f(CWnmcli \-f CONNECTIONS device show wlp3s0\fP\fP" +.IP +shows all available connection profiles for your Wi-Fi interface wlp3s0. + .IP "\fB\f(CWnmcli dev wifi\fP\fP" .IP lists available Wi\(hyFi access points known to NetworkManager. @@ -991,6 +1213,11 @@ using password "caffeine". This is mainly useful when connecting to "Cafe Hotspo the first time. Next time, it is better to use 'nmcli con up id "My cafe"' so that the existing connection profile can be used and no additional is created. +.IP "\fB\f(CWnmcli -s dev wifi hotspot con-name QuickHotspot\fP\fP" +.IP +creates a hotspot profile and connects it. Prints the hotspot password the user should use +to connect to the hotspot from other devices. + .IP "\fB\f(CWnmcli connection add type ethernet autoconnect no ifname eth0\fP\fP" .IP non-interactively adds an Ethernet connection tied to eth0 interface with automatic IP configuration (DHCP), @@ -1001,6 +1228,11 @@ and disables the connection's "autoconnect" flag. non-interactively adds a VLAN connection with ID 55. The connection will use eth0 and the VLAN interface will be named Maxipes\(hyfik. +.IP "\fB\f(CWnmcli c a ifname eth0 type ethernet -- ipv4.method disabled ipv6.method link-local\fP\fP" +.IP +non-interactively adds a connection that will use eth0 Ethernet interface and only have an IPv6 link-local +address configured. + .IP "\fB\f(CWnmcli connection edit ethernet\-em1\-2\fP\fP" .IP edits existing "ethernet\(hyem1\(hy2" connection in the interactive editor. @@ -1029,10 +1261,18 @@ appends a Google public DNS server to DNS servers in ABC profile. .IP removes the specified IP address from (static) profile ABC. +.IP "\fB\f(CWnmcli con import type openvpn file ~/Downloads/frootvpn.ovpn\fP\fP" +.IP +imports an OpenVPN configuration to NetworkManager. + +.IP "\fB\f(CWnmcli con export corp-vpnc /home/joe/corpvpn.conf\fP\fP" +.IP +exports NetworkManager VPN profile corp-vpnc as standard Cisco (vpnc) configuration. + .SH NOTES \fInmcli\fP accepts abbreviations, as long as they are a unique prefix in the set of possible options. As new options get added, these abbreviations are not guaranteed -to stay unique. For scripting and long term compatiblity it is therefore strongly +to stay unique. For scripting and long term compatibility it is therefore strongly advised to spell out the full option names. .SH BUGS diff --git a/po/POTFILES.in b/po/POTFILES.in index 19ef9df3..9c37b7ed 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -49,6 +49,7 @@ libnm-core/crypto.c libnm-core/crypto_gnutls.c libnm-core/crypto_nss.c libnm-core/nm-connection.c +libnm-core/nm-dbus-utils.c libnm-core/nm-keyfile-reader.c libnm-core/nm-keyfile-writer.c libnm-core/nm-setting-8021x.c @@ -65,18 +66,24 @@ libnm-core/nm-setting-infiniband.c libnm-core/nm-setting-ip-config.c libnm-core/nm-setting-ip4-config.c libnm-core/nm-setting-ip6-config.c +libnm-core/nm-setting-ip-tunnel.c +libnm-core/nm-setting-macvlan.c libnm-core/nm-setting-olpc-mesh.c libnm-core/nm-setting-ppp.c libnm-core/nm-setting-pppoe.c libnm-core/nm-setting-team-port.c +libnm-core/nm-setting-tun.c libnm-core/nm-setting-vlan.c libnm-core/nm-setting-vpn.c +libnm-core/nm-setting-vxlan.c libnm-core/nm-setting-wimax.c libnm-core/nm-setting-wired.c libnm-core/nm-setting-wireless-security.c libnm-core/nm-setting-wireless.c libnm-core/nm-setting.c libnm-core/nm-utils.c +libnm-core/nm-vpn-editor-plugin.c +libnm-core/nm-vpn-plugin-info.c libnm-glib/nm-device.c libnm-glib/nm-remote-connection.c libnm-util/crypto.c @@ -114,11 +121,15 @@ libnm/nm-device-bridge.c libnm/nm-device-bt.c libnm/nm-device-ethernet.c libnm/nm-device-generic.c +libnm/nm-device-tun.c libnm/nm-device-infiniband.c +libnm/nm-device-ip-tunnel.c +libnm/nm-device-macvlan.c libnm/nm-device-modem.c libnm/nm-device-olpc-mesh.c libnm/nm-device-team.c libnm/nm-device-vlan.c +libnm/nm-device-vxlan.c libnm/nm-device-wifi.c libnm/nm-device-wimax.c libnm/nm-device.c @@ -127,6 +138,7 @@ libnm/nm-object.c libnm/nm-remote-connection.c libnm/nm-remote-settings.c libnm/nm-vpn-plugin-old.c +libnm/nm-vpn-service-plugin.c policy/org.freedesktop.NetworkManager.policy.in.in src/NetworkManagerUtils.c src/main.c @@ -143,12 +155,15 @@ src/devices/nm-device-bridge.c src/devices/nm-device-ethernet.c src/devices/nm-device-ethernet-utils.c src/devices/nm-device-infiniband.c +src/devices/nm-device-ip-tunnel.c +src/devices/nm-device-macvlan.c +src/devices/nm-device-tun.c src/devices/nm-device-vlan.c +src/devices/nm-device-vxlan.c src/devices/team/nm-device-team.c src/devices/wifi/nm-device-olpc-mesh.c src/devices/wifi/nm-device-wifi.c src/devices/wifi/nm-wifi-ap-utils.c -src/devices/wimax/nm-device-wimax.c src/devices/wwan/nm-modem-broadband.c src/nm-config.c src/nm-iface-helper.c diff --git a/po/ar.po b/po/ar.po index cffa6b8f..494b082e 100644 --- a/po/ar.po +++ b/po/ar.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Project\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-12-23 14:29+0100\n" +"POT-Creation-Date: 2015-12-23 14:07+0100\n" "PO-Revision-Date: 2007-12-26 09:20+0100\n" "Last-Translator: Djihed Afifi \n" "Language-Team: Arabic \n" @@ -22,7 +22,7 @@ msgstr "" "X-Poedit-Language: Arabic\n" "X-Generator: KBabel 1.11.4\n" -#: ../clients/cli/agent.c:42 +#: ../clients/cli/agent.c:41 #, c-format msgid "" "Usage: nmcli agent { COMMAND | help }\n" @@ -31,7 +31,7 @@ msgid "" "\n" msgstr "" -#: ../clients/cli/agent.c:50 +#: ../clients/cli/agent.c:49 #, c-format msgid "" "Usage: nmcli agent secret { help }\n" @@ -43,7 +43,7 @@ msgid "" "\n" msgstr "" -#: ../clients/cli/agent.c:60 +#: ../clients/cli/agent.c:59 #, c-format msgid "" "Usage: nmcli agent polkit { help }\n" @@ -55,7 +55,7 @@ msgid "" "\n" msgstr "" -#: ../clients/cli/agent.c:70 +#: ../clients/cli/agent.c:69 #, c-format msgid "" "Usage: nmcli agent all { help }\n" @@ -64,505 +64,507 @@ msgid "" "\n" msgstr "" -#: ../clients/cli/agent.c:152 +#: ../clients/cli/agent.c:151 #, c-format msgid "nmcli successfully registered as a NetworkManager's secret agent.\n" msgstr "" -#: ../clients/cli/agent.c:154 +#: ../clients/cli/agent.c:153 #, c-format msgid "Error: secret agent initialization failed" msgstr "" -#: ../clients/cli/agent.c:169 +#: ../clients/cli/agent.c:168 #, c-format msgid "Error: polkit agent initialization failed: %s" msgstr "" -#: ../clients/cli/agent.c:177 +#: ../clients/cli/agent.c:176 #, c-format msgid "nmcli successfully registered as a polkit agent.\n" msgstr "" -#: ../clients/cli/agent.c:209 ../clients/cli/connections.c:9246 -#: ../clients/cli/devices.c:3060 ../clients/cli/general.c:325 -#: ../clients/cli/general.c:463 +#: ../clients/cli/agent.c:208 ../clients/cli/connections.c:10953 +#: ../clients/cli/devices.c:3552 ../clients/cli/general.c:344 +#: ../clients/cli/general.c:485 #, c-format msgid "Error: NetworkManager is not running." msgstr "" -#: ../clients/cli/agent.c:245 +#: ../clients/cli/agent.c:244 #, c-format msgid "Error: 'agent' command '%s' is not valid." msgstr "" -#: ../clients/cli/common.c:41 ../clients/cli/common.c:54 -#: ../clients/cli/common.c:62 ../clients/cli/common.c:74 -#: ../clients/cli/connections.c:173 ../clients/cli/connections.c:195 +#: ../clients/cli/common.c:40 ../clients/cli/common.c:53 +#: ../clients/cli/common.c:61 ../clients/cli/common.c:73 +#: ../clients/cli/connections.c:193 ../clients/cli/connections.c:215 msgid "GROUP" msgstr "" #. 0 -#: ../clients/cli/common.c:42 ../clients/cli/common.c:63 +#: ../clients/cli/common.c:41 ../clients/cli/common.c:62 msgid "ADDRESS" msgstr "" #. 1 #. 2 -#: ../clients/cli/common.c:43 ../clients/cli/common.c:64 -#: ../clients/cli/connections.c:198 +#: ../clients/cli/common.c:42 ../clients/cli/common.c:63 +#: ../clients/cli/connections.c:218 msgid "GATEWAY" msgstr "" #. 2 -#: ../clients/cli/common.c:44 ../clients/cli/common.c:65 +#: ../clients/cli/common.c:43 ../clients/cli/common.c:64 msgid "ROUTE" msgstr "" #. 3 -#: ../clients/cli/common.c:45 ../clients/cli/common.c:66 +#: ../clients/cli/common.c:44 ../clients/cli/common.c:65 msgid "DNS" msgstr "" #. 4 -#: ../clients/cli/common.c:46 ../clients/cli/common.c:67 +#: ../clients/cli/common.c:45 ../clients/cli/common.c:66 msgid "DOMAIN" msgstr "" #. 5 -#: ../clients/cli/common.c:47 +#: ../clients/cli/common.c:46 msgid "WINS" msgstr "" #. 0 -#: ../clients/cli/common.c:55 ../clients/cli/common.c:75 +#: ../clients/cli/common.c:54 ../clients/cli/common.c:74 msgid "OPTION" msgstr "" -#: ../clients/cli/common.c:379 ../clients/cli/common.c:439 +#: ../clients/cli/common.c:378 ../clients/cli/common.c:438 #, c-format msgid "invalid prefix '%s'; <1-%d> allowed" msgstr "" -#: ../clients/cli/common.c:387 +#: ../clients/cli/common.c:386 #, c-format msgid "invalid IP address: %s" msgstr "" -#: ../clients/cli/common.c:451 +#: ../clients/cli/common.c:450 #, c-format msgid "" "the second component of route ('%s') is neither a next hop address nor a " "metric" msgstr "" -#: ../clients/cli/common.c:460 +#: ../clients/cli/common.c:459 #, c-format msgid "invalid metric '%s'" msgstr "" -#: ../clients/cli/common.c:468 +#: ../clients/cli/common.c:467 #, c-format msgid "invalid route: %s" msgstr "" -#: ../clients/cli/common.c:480 +#: ../clients/cli/common.c:479 msgid "default route cannot be added (NetworkManager handles it by itself)" msgstr "" -#: ../clients/cli/common.c:497 +#: ../clients/cli/common.c:496 msgid "unmanaged" msgstr "" -#: ../clients/cli/common.c:499 +#: ../clients/cli/common.c:498 msgid "unavailable" msgstr "" -#: ../clients/cli/common.c:501 ../clients/cli/general.c:260 +#: ../clients/cli/common.c:500 ../clients/cli/general.c:246 msgid "disconnected" msgstr "" -#: ../clients/cli/common.c:503 +#: ../clients/cli/common.c:502 msgid "connecting (prepare)" msgstr "" -#: ../clients/cli/common.c:505 +#: ../clients/cli/common.c:504 msgid "connecting (configuring)" msgstr "" -#: ../clients/cli/common.c:507 +#: ../clients/cli/common.c:506 msgid "connecting (need authentication)" msgstr "" -#: ../clients/cli/common.c:509 +#: ../clients/cli/common.c:508 msgid "connecting (getting IP configuration)" msgstr "" -#: ../clients/cli/common.c:511 +#: ../clients/cli/common.c:510 msgid "connecting (checking IP connectivity)" msgstr "" -#: ../clients/cli/common.c:513 +#: ../clients/cli/common.c:512 msgid "connecting (starting secondary connections)" msgstr "" -#: ../clients/cli/common.c:515 ../clients/cli/general.c:256 +#: ../clients/cli/common.c:514 ../clients/cli/general.c:242 msgid "connected" msgstr "" -#: ../clients/cli/common.c:517 ../clients/cli/connections.c:544 +#: ../clients/cli/common.c:516 ../clients/cli/connections.c:649 msgid "deactivating" msgstr "" -#: ../clients/cli/common.c:519 +#: ../clients/cli/common.c:518 msgid "connection failed" msgstr "" -#: ../clients/cli/common.c:521 ../clients/cli/common.c:538 -#: ../clients/cli/connections.c:549 ../clients/cli/connections.c:572 -#: ../clients/cli/connections.c:1712 ../clients/cli/devices.c:891 -#: ../clients/cli/devices.c:932 ../clients/cli/devices.c:934 -#: ../clients/cli/general.c:263 ../clients/cli/general.c:281 -#: ../clients/cli/general.c:411 ../clients/cli/general.c:427 -#: ../clients/cli/settings.c:732 ../clients/cli/settings.c:817 -#: ../clients/cli/settings.c:1118 ../clients/cli/settings.c:2839 -#: ../clients/cli/utils.c:1200 ../src/main.c:241 ../src/main.c:386 -#: ../src/main.c:436 +#: ../clients/cli/common.c:520 ../clients/cli/common.c:537 +#: ../clients/cli/connections.c:654 ../clients/cli/connections.c:677 +#: ../clients/cli/connections.c:1947 ../clients/cli/devices.c:1011 +#: ../clients/cli/devices.c:1052 ../clients/cli/devices.c:1054 +#: ../clients/cli/general.c:249 ../clients/cli/general.c:287 +#: ../clients/cli/general.c:433 ../clients/cli/general.c:449 +#: ../clients/cli/settings.c:864 ../clients/cli/settings.c:950 +#: ../clients/cli/settings.c:1277 ../clients/cli/settings.c:1888 +#: ../clients/cli/settings.c:3192 ../clients/cli/utils.c:1396 ../src/main.c:227 +#: ../src/main.c:371 ../src/main.c:426 +#, c-format msgid "unknown" msgstr "" #. "CAPABILITIES" -#: ../clients/cli/common.c:530 ../clients/cli/connections.c:819 -#: ../clients/cli/connections.c:821 ../clients/cli/connections.c:823 -#: ../clients/cli/connections.c:855 ../clients/cli/connections.c:922 -#: ../clients/cli/connections.c:923 ../clients/cli/connections.c:925 -#: ../clients/cli/connections.c:3158 ../clients/cli/connections.c:7239 -#: ../clients/cli/connections.c:7240 ../clients/cli/devices.c:598 -#: ../clients/cli/devices.c:648 ../clients/cli/devices.c:856 -#: ../clients/cli/devices.c:857 ../clients/cli/devices.c:858 -#: ../clients/cli/devices.c:859 ../clients/cli/devices.c:895 -#: ../clients/cli/devices.c:897 ../clients/cli/devices.c:925 -#: ../clients/cli/devices.c:926 ../clients/cli/devices.c:927 -#: ../clients/cli/devices.c:928 ../clients/cli/devices.c:929 -#: ../clients/cli/devices.c:930 ../clients/cli/devices.c:931 -#: ../clients/cli/devices.c:933 ../clients/cli/devices.c:935 -#: ../clients/cli/general.c:421 ../clients/cli/settings.c:2834 +#: ../clients/cli/common.c:529 ../clients/cli/connections.c:934 +#: ../clients/cli/connections.c:936 ../clients/cli/connections.c:938 +#: ../clients/cli/connections.c:972 ../clients/cli/connections.c:1041 +#: ../clients/cli/connections.c:1042 ../clients/cli/connections.c:1044 +#: ../clients/cli/connections.c:3464 ../clients/cli/connections.c:8509 +#: ../clients/cli/connections.c:8510 ../clients/cli/devices.c:759 +#: ../clients/cli/devices.c:976 ../clients/cli/devices.c:977 +#: ../clients/cli/devices.c:978 ../clients/cli/devices.c:979 +#: ../clients/cli/devices.c:980 ../clients/cli/devices.c:1015 +#: ../clients/cli/devices.c:1017 ../clients/cli/devices.c:1045 +#: ../clients/cli/devices.c:1046 ../clients/cli/devices.c:1047 +#: ../clients/cli/devices.c:1048 ../clients/cli/devices.c:1049 +#: ../clients/cli/devices.c:1050 ../clients/cli/devices.c:1051 +#: ../clients/cli/devices.c:1053 ../clients/cli/devices.c:1055 +#: ../clients/cli/general.c:443 ../clients/cli/settings.c:1870 +#: ../clients/cli/settings.c:3187 msgid "yes" msgstr "" -#: ../clients/cli/common.c:532 ../clients/cli/connections.c:819 -#: ../clients/cli/connections.c:821 ../clients/cli/connections.c:823 -#: ../clients/cli/connections.c:922 ../clients/cli/connections.c:923 -#: ../clients/cli/connections.c:925 ../clients/cli/connections.c:3159 -#: ../clients/cli/connections.c:7239 ../clients/cli/connections.c:7240 -#: ../clients/cli/devices.c:598 ../clients/cli/devices.c:648 -#: ../clients/cli/devices.c:856 ../clients/cli/devices.c:857 -#: ../clients/cli/devices.c:858 ../clients/cli/devices.c:859 -#: ../clients/cli/devices.c:895 ../clients/cli/devices.c:897 -#: ../clients/cli/devices.c:925 ../clients/cli/devices.c:926 -#: ../clients/cli/devices.c:927 ../clients/cli/devices.c:928 -#: ../clients/cli/devices.c:929 ../clients/cli/devices.c:930 -#: ../clients/cli/devices.c:931 ../clients/cli/devices.c:933 -#: ../clients/cli/devices.c:935 ../clients/cli/general.c:423 -#: ../clients/cli/settings.c:2836 +#: ../clients/cli/common.c:531 ../clients/cli/connections.c:934 +#: ../clients/cli/connections.c:936 ../clients/cli/connections.c:938 +#: ../clients/cli/connections.c:1041 ../clients/cli/connections.c:1042 +#: ../clients/cli/connections.c:1044 ../clients/cli/connections.c:3465 +#: ../clients/cli/connections.c:8509 ../clients/cli/connections.c:8510 +#: ../clients/cli/devices.c:759 ../clients/cli/devices.c:976 +#: ../clients/cli/devices.c:977 ../clients/cli/devices.c:978 +#: ../clients/cli/devices.c:979 ../clients/cli/devices.c:980 +#: ../clients/cli/devices.c:1015 ../clients/cli/devices.c:1017 +#: ../clients/cli/devices.c:1045 ../clients/cli/devices.c:1046 +#: ../clients/cli/devices.c:1047 ../clients/cli/devices.c:1048 +#: ../clients/cli/devices.c:1049 ../clients/cli/devices.c:1050 +#: ../clients/cli/devices.c:1051 ../clients/cli/devices.c:1053 +#: ../clients/cli/devices.c:1055 ../clients/cli/general.c:445 +#: ../clients/cli/settings.c:1868 ../clients/cli/settings.c:3189 #, fuzzy msgid "no" msgstr "بلا" -#: ../clients/cli/common.c:534 +#: ../clients/cli/common.c:533 msgid "yes (guessed)" msgstr "" -#: ../clients/cli/common.c:536 +#: ../clients/cli/common.c:535 msgid "no (guessed)" msgstr "" -#: ../clients/cli/common.c:547 +#: ../clients/cli/common.c:546 msgid "No reason given" msgstr "" -#: ../clients/cli/common.c:550 ../clients/cli/connections.c:2729 +#: ../clients/cli/common.c:549 ../clients/cli/connections.c:2988 #, c-format msgid "Unknown error" msgstr "" -#: ../clients/cli/common.c:553 +#: ../clients/cli/common.c:552 msgid "Device is now managed" msgstr "" -#: ../clients/cli/common.c:556 +#: ../clients/cli/common.c:555 msgid "Device is now unmanaged" msgstr "" -#: ../clients/cli/common.c:559 +#: ../clients/cli/common.c:558 msgid "The device could not be readied for configuration" msgstr "" -#: ../clients/cli/common.c:562 +#: ../clients/cli/common.c:561 msgid "" "IP configuration could not be reserved (no available address, timeout, etc.)" msgstr "" -#: ../clients/cli/common.c:565 +#: ../clients/cli/common.c:564 msgid "The IP configuration is no longer valid" msgstr "" -#: ../clients/cli/common.c:568 +#: ../clients/cli/common.c:567 msgid "Secrets were required, but not provided" msgstr "" -#: ../clients/cli/common.c:571 +#: ../clients/cli/common.c:570 msgid "802.1X supplicant disconnected" msgstr "" -#: ../clients/cli/common.c:574 +#: ../clients/cli/common.c:573 msgid "802.1X supplicant configuration failed" msgstr "" -#: ../clients/cli/common.c:577 +#: ../clients/cli/common.c:576 msgid "802.1X supplicant failed" msgstr "" -#: ../clients/cli/common.c:580 +#: ../clients/cli/common.c:579 msgid "802.1X supplicant took too long to authenticate" msgstr "" -#: ../clients/cli/common.c:583 +#: ../clients/cli/common.c:582 msgid "PPP service failed to start" msgstr "" -#: ../clients/cli/common.c:586 +#: ../clients/cli/common.c:585 msgid "PPP service disconnected" msgstr "" -#: ../clients/cli/common.c:589 +#: ../clients/cli/common.c:588 msgid "PPP failed" msgstr "" -#: ../clients/cli/common.c:592 +#: ../clients/cli/common.c:591 msgid "DHCP client failed to start" msgstr "" -#: ../clients/cli/common.c:595 +#: ../clients/cli/common.c:594 msgid "DHCP client error" msgstr "" -#: ../clients/cli/common.c:598 +#: ../clients/cli/common.c:597 msgid "DHCP client failed" msgstr "" -#: ../clients/cli/common.c:601 +#: ../clients/cli/common.c:600 msgid "Shared connection service failed to start" msgstr "" -#: ../clients/cli/common.c:604 +#: ../clients/cli/common.c:603 msgid "Shared connection service failed" msgstr "" -#: ../clients/cli/common.c:607 +#: ../clients/cli/common.c:606 msgid "AutoIP service failed to start" msgstr "" -#: ../clients/cli/common.c:610 +#: ../clients/cli/common.c:609 msgid "AutoIP service error" msgstr "" -#: ../clients/cli/common.c:613 +#: ../clients/cli/common.c:612 msgid "AutoIP service failed" msgstr "" -#: ../clients/cli/common.c:616 +#: ../clients/cli/common.c:615 msgid "The line is busy" msgstr "" -#: ../clients/cli/common.c:619 +#: ../clients/cli/common.c:618 msgid "No dial tone" msgstr "" -#: ../clients/cli/common.c:622 +#: ../clients/cli/common.c:621 msgid "No carrier could be established" msgstr "" -#: ../clients/cli/common.c:625 +#: ../clients/cli/common.c:624 msgid "The dialing request timed out" msgstr "" -#: ../clients/cli/common.c:628 +#: ../clients/cli/common.c:627 msgid "The dialing attempt failed" msgstr "" -#: ../clients/cli/common.c:631 +#: ../clients/cli/common.c:630 msgid "Modem initialization failed" msgstr "" -#: ../clients/cli/common.c:634 +#: ../clients/cli/common.c:633 msgid "Failed to select the specified APN" msgstr "" -#: ../clients/cli/common.c:637 +#: ../clients/cli/common.c:636 msgid "Not searching for networks" msgstr "" -#: ../clients/cli/common.c:640 +#: ../clients/cli/common.c:639 msgid "Network registration denied" msgstr "" -#: ../clients/cli/common.c:643 +#: ../clients/cli/common.c:642 msgid "Network registration timed out" msgstr "" -#: ../clients/cli/common.c:646 +#: ../clients/cli/common.c:645 msgid "Failed to register with the requested network" msgstr "" -#: ../clients/cli/common.c:649 +#: ../clients/cli/common.c:648 msgid "PIN check failed" msgstr "" -#: ../clients/cli/common.c:652 +#: ../clients/cli/common.c:651 msgid "Necessary firmware for the device may be missing" msgstr "" -#: ../clients/cli/common.c:655 +#: ../clients/cli/common.c:654 msgid "The device was removed" msgstr "" -#: ../clients/cli/common.c:658 +#: ../clients/cli/common.c:657 msgid "NetworkManager went to sleep" msgstr "" -#: ../clients/cli/common.c:661 +#: ../clients/cli/common.c:660 msgid "The device's active connection disappeared" msgstr "" -#: ../clients/cli/common.c:664 +#: ../clients/cli/common.c:663 msgid "Device disconnected by user or client" msgstr "" -#: ../clients/cli/common.c:667 +#: ../clients/cli/common.c:666 msgid "Carrier/link changed" msgstr "" -#: ../clients/cli/common.c:670 +#: ../clients/cli/common.c:669 msgid "The device's existing connection was assumed" msgstr "" -#: ../clients/cli/common.c:673 +#: ../clients/cli/common.c:672 msgid "The supplicant is now available" msgstr "" -#: ../clients/cli/common.c:676 +#: ../clients/cli/common.c:675 msgid "The modem could not be found" msgstr "" -#: ../clients/cli/common.c:679 +#: ../clients/cli/common.c:678 msgid "The Bluetooth connection failed or timed out" msgstr "" -#: ../clients/cli/common.c:682 +#: ../clients/cli/common.c:681 msgid "GSM Modem's SIM card not inserted" msgstr "" -#: ../clients/cli/common.c:685 +#: ../clients/cli/common.c:684 msgid "GSM Modem's SIM PIN required" msgstr "" -#: ../clients/cli/common.c:688 +#: ../clients/cli/common.c:687 msgid "GSM Modem's SIM PUK required" msgstr "" -#: ../clients/cli/common.c:691 +#: ../clients/cli/common.c:690 msgid "GSM Modem's SIM wrong" msgstr "" -#: ../clients/cli/common.c:694 +#: ../clients/cli/common.c:693 msgid "InfiniBand device does not support connected mode" msgstr "" -#: ../clients/cli/common.c:697 +#: ../clients/cli/common.c:696 msgid "A dependency of the connection failed" msgstr "" -#: ../clients/cli/common.c:700 +#: ../clients/cli/common.c:699 msgid "A problem with the RFC 2684 Ethernet over ADSL bridge" msgstr "" -#: ../clients/cli/common.c:703 +#: ../clients/cli/common.c:702 msgid "ModemManager is unavailable" msgstr "" -#: ../clients/cli/common.c:706 +#: ../clients/cli/common.c:705 msgid "The Wi-Fi network could not be found" msgstr "" -#: ../clients/cli/common.c:709 +#: ../clients/cli/common.c:708 msgid "A secondary connection of the base connection failed" msgstr "" -#: ../clients/cli/common.c:712 +#: ../clients/cli/common.c:711 msgid "DCB or FCoE setup failed" msgstr "" -#: ../clients/cli/common.c:715 +#: ../clients/cli/common.c:714 msgid "teamd control failed" msgstr "" -#: ../clients/cli/common.c:718 +#: ../clients/cli/common.c:717 msgid "Modem failed or no longer available" msgstr "" -#: ../clients/cli/common.c:721 +#: ../clients/cli/common.c:720 msgid "Modem now ready and available" msgstr "" -#: ../clients/cli/common.c:724 +#: ../clients/cli/common.c:723 msgid "SIM PIN was incorrect" msgstr "" -#: ../clients/cli/common.c:727 +#: ../clients/cli/common.c:726 msgid "New connection activation was enqueued" msgstr "" -#: ../clients/cli/common.c:730 +#: ../clients/cli/common.c:729 msgid "The device's parent changed" msgstr "" -#: ../clients/cli/common.c:733 +#: ../clients/cli/common.c:732 msgid "The device parent's management changed" msgstr "" #. TRANSLATORS: Unknown reason for a device state change (NMDeviceStateReason) -#: ../clients/cli/common.c:737 ../clients/cli/devices.c:628 -#: ../libnm-glib/nm-device.c:1813 ../libnm/nm-device.c:1658 +#: ../clients/cli/common.c:736 ../libnm-glib/nm-device.c:1874 +#: ../libnm/nm-device.c:1825 msgid "Unknown" msgstr "" -#: ../clients/cli/common.c:779 +#: ../clients/cli/common.c:778 #, c-format msgid "invalid priority map '%s'" msgstr "" -#: ../clients/cli/common.c:786 ../clients/cli/common.c:792 +#: ../clients/cli/common.c:785 ../clients/cli/common.c:791 #, c-format msgid "priority '%s' is not valid (<0-%ld>)" msgstr "" -#: ../clients/cli/common.c:859 +#: ../clients/cli/common.c:858 #, c-format msgid "'%s' is not a valid team configuration or file name." msgstr "" -#: ../clients/cli/common.c:961 +#: ../clients/cli/common.c:960 #, c-format msgid "Error: openconnect failed: %s\n" msgstr "" -#: ../clients/cli/common.c:968 +#: ../clients/cli/common.c:967 #, c-format msgid "Error: openconnect failed with status %d\n" msgstr "" -#: ../clients/cli/common.c:970 +#: ../clients/cli/common.c:969 #, c-format msgid "Error: openconnect failed with signal %d\n" msgstr "" @@ -598,39 +600,47 @@ msgid "VPN type: " msgstr "" #: ../clients/cli/connections.c:49 -msgid "Bond master: " +msgid "Master: " msgstr "" #: ../clients/cli/connections.c:50 -msgid "Team master: " +msgid "Connection (name, UUID, or path): " msgstr "" #: ../clients/cli/connections.c:51 -msgid "Bridge master: " +msgid "VPN connection (name, UUID, or path): " msgstr "" #: ../clients/cli/connections.c:52 -msgid "Connection (name, UUID, or path): " +msgid "Connection(s) (name, UUID, or path): " msgstr "" #: ../clients/cli/connections.c:53 -msgid "Connection(s) (name, UUID, or path): " +msgid "Connection(s) (name, UUID, path or apath): " +msgstr "" + +#: ../clients/cli/connections.c:54 +msgid "Tunnel mode: " +msgstr "" + +#: ../clients/cli/connections.c:55 +msgid "MACVLAN mode: " msgstr "" #. 0 -#: ../clients/cli/connections.c:61 ../clients/cli/connections.c:174 -#: ../clients/cli/devices.c:58 ../clients/cli/devices.c:91 -#: ../clients/cli/devices.c:101 ../clients/cli/devices.c:112 +#: ../clients/cli/connections.c:74 ../clients/cli/connections.c:194 +#: ../clients/cli/devices.c:56 ../clients/cli/devices.c:90 +#: ../clients/cli/devices.c:100 ../clients/cli/devices.c:111 #: ../clients/cli/devices.c:121 ../clients/cli/devices.c:138 #: ../clients/cli/devices.c:151 ../clients/cli/devices.c:177 #: ../clients/cli/devices.c:192 ../clients/cli/devices.c:201 -#: ../clients/cli/devices.c:211 +#: ../clients/cli/devices.c:211 ../clients/cli/devices.c:252 msgid "NAME" msgstr "" #. 0 #. 1 -#: ../clients/cli/connections.c:62 ../clients/cli/connections.c:175 +#: ../clients/cli/connections.c:75 ../clients/cli/connections.c:195 msgid "UUID" msgstr "" @@ -638,35 +648,35 @@ msgstr "" #. 0 #. 1 #. 2 -#: ../clients/cli/connections.c:63 ../clients/cli/connections.c:196 -#: ../clients/cli/devices.c:44 ../clients/cli/devices.c:60 +#: ../clients/cli/connections.c:76 ../clients/cli/connections.c:216 +#: ../clients/cli/devices.c:42 ../clients/cli/devices.c:58 #: ../clients/cli/devices.c:180 msgid "TYPE" msgstr "" #. 2 -#: ../clients/cli/connections.c:64 +#: ../clients/cli/connections.c:77 msgid "TIMESTAMP" msgstr "" #. 3 -#: ../clients/cli/connections.c:65 +#: ../clients/cli/connections.c:78 msgid "TIMESTAMP-REAL" msgstr "" #. 4 #. 16 -#: ../clients/cli/connections.c:66 ../clients/cli/devices.c:75 +#: ../clients/cli/connections.c:79 ../clients/cli/devices.c:73 msgid "AUTOCONNECT" msgstr "" #. 5 -#: ../clients/cli/connections.c:67 +#: ../clients/cli/connections.c:80 msgid "AUTOCONNECT-PRIORITY" msgstr "" #. 6 -#: ../clients/cli/connections.c:68 +#: ../clients/cli/connections.c:81 msgid "READONLY" msgstr "" @@ -675,8 +685,8 @@ msgstr "" #. 2 #. 15 #. 5 -#: ../clients/cli/connections.c:69 ../clients/cli/connections.c:182 -#: ../clients/cli/devices.c:46 ../clients/cli/devices.c:167 +#: ../clients/cli/connections.c:82 ../clients/cli/connections.c:202 +#: ../clients/cli/devices.c:44 ../clients/cli/devices.c:167 #: ../clients/cli/devices.c:183 msgid "DBUS-PATH" msgstr "" @@ -684,7 +694,7 @@ msgstr "" #. 8 #. 13 #. 4 -#: ../clients/cli/connections.c:70 ../clients/cli/devices.c:165 +#: ../clients/cli/connections.c:83 ../clients/cli/devices.c:165 #: ../clients/cli/devices.c:182 msgid "ACTIVE" msgstr "" @@ -693,9 +703,10 @@ msgstr "" #. 0 #. 12 #. 3 -#: ../clients/cli/connections.c:71 ../clients/cli/devices.c:43 -#: ../clients/cli/devices.c:59 ../clients/cli/devices.c:164 -#: ../clients/cli/devices.c:181 +#. 0 +#: ../clients/cli/connections.c:84 ../clients/cli/devices.c:41 +#: ../clients/cli/devices.c:57 ../clients/cli/devices.c:164 +#: ../clients/cli/devices.c:181 ../clients/cli/devices.c:253 msgid "DEVICE" msgstr "" @@ -704,161 +715,168 @@ msgstr "" #. 1 #. 10 #. 1 -#: ../clients/cli/connections.c:72 ../clients/cli/connections.c:177 -#: ../clients/cli/devices.c:45 ../clients/cli/devices.c:69 +#: ../clients/cli/connections.c:85 ../clients/cli/connections.c:197 +#: ../clients/cli/devices.c:43 ../clients/cli/devices.c:67 #: ../clients/cli/general.c:37 msgid "STATE" msgstr "" #. 11 -#: ../clients/cli/connections.c:73 +#: ../clients/cli/connections.c:86 msgid "ACTIVE-PATH" msgstr "" #. 2 -#: ../clients/cli/connections.c:176 +#: ../clients/cli/connections.c:196 msgid "DEVICES" msgstr "" #. 4 -#: ../clients/cli/connections.c:178 +#: ../clients/cli/connections.c:198 msgid "DEFAULT" msgstr "" #. 5 -#: ../clients/cli/connections.c:179 +#: ../clients/cli/connections.c:199 msgid "DEFAULT6" msgstr "" #. 6 -#: ../clients/cli/connections.c:180 +#: ../clients/cli/connections.c:200 msgid "SPEC-OBJECT" msgstr "" #. 7 #. 4 #. Ask for optional 'vpn' arguments. -#: ../clients/cli/connections.c:181 ../clients/cli/connections.c:219 -#: ../clients/cli/connections.c:3863 ../clients/tui/nm-editor-utils.c:234 -#: ../clients/tui/nmt-connect-connection-list.c:406 +#: ../clients/cli/connections.c:201 ../clients/cli/connections.c:239 +#: ../clients/cli/connections.c:4183 ../clients/tui/nm-editor-utils.c:234 +#: ../clients/tui/nmt-connect-connection-list.c:405 msgid "VPN" msgstr "" #. 9 #. 5 -#. 21 -#: ../clients/cli/connections.c:183 ../clients/cli/devices.c:49 -#: ../clients/cli/devices.c:80 +#. 22 +#: ../clients/cli/connections.c:203 ../clients/cli/devices.c:47 +#: ../clients/cli/devices.c:79 msgid "CON-PATH" msgstr "" #. 10 -#: ../clients/cli/connections.c:184 +#: ../clients/cli/connections.c:204 msgid "ZONE" msgstr "" #. 11 -#: ../clients/cli/connections.c:185 +#: ../clients/cli/connections.c:205 msgid "MASTER-PATH" msgstr "" #. 1 -#: ../clients/cli/connections.c:197 +#: ../clients/cli/connections.c:217 msgid "USERNAME" msgstr "" #. 3 -#: ../clients/cli/connections.c:199 +#: ../clients/cli/connections.c:219 msgid "BANNER" msgstr "" #. 4 -#: ../clients/cli/connections.c:200 +#: ../clients/cli/connections.c:220 msgid "VPN-STATE" msgstr "" #. 5 -#: ../clients/cli/connections.c:201 +#: ../clients/cli/connections.c:221 msgid "CFG" msgstr "" -#: ../clients/cli/connections.c:214 ../clients/cli/devices.c:226 +#: ../clients/cli/connections.c:234 ../clients/cli/devices.c:226 msgid "GENERAL" msgstr "" #. 0 #. 6 -#: ../clients/cli/connections.c:215 ../clients/cli/devices.c:233 +#: ../clients/cli/connections.c:235 ../clients/cli/devices.c:233 msgid "IP4" msgstr "" #. 1 #. 7 -#: ../clients/cli/connections.c:216 ../clients/cli/devices.c:234 +#: ../clients/cli/connections.c:236 ../clients/cli/devices.c:234 msgid "DHCP4" msgstr "" #. 2 #. 8 -#: ../clients/cli/connections.c:217 ../clients/cli/devices.c:235 +#: ../clients/cli/connections.c:237 ../clients/cli/devices.c:235 msgid "IP6" msgstr "" #. 3 #. 9 -#: ../clients/cli/connections.c:218 ../clients/cli/devices.c:236 +#: ../clients/cli/connections.c:238 ../clients/cli/devices.c:236 msgid "DHCP6" msgstr "" -#: ../clients/cli/connections.c:253 +#: ../clients/cli/connections.c:273 #, c-format msgid "" "Usage: nmcli connection { COMMAND | help }\n" "\n" -"COMMAND := { show | up | down | add | modify | edit | delete | reload | " -"load }\n" +"COMMAND := { show | up | down | add | modify | edit | delete | monitor | " +"reload | load }\n" "\n" -" show [--active] [[--show-secrets] [id | uuid | path | apath] ] ...\n" -"\n" -" up [[id | uuid | path] ] [ifname ] [ap ] [nsp ] " -"[passwd-file ]\n" +" show [--active] [--order ]\n" +" show [--active] [id | uuid | path | apath] ...\n" "\n" " up [[id | uuid | path] ] [ifname ] [ap ] [passwd-file " "]\n" "\n" " down [id | uuid | path | apath] ...\n" "\n" -" add COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS\n" +" add COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS SLAVE_OPTIONS IP_OPTIONS [-- " +"([+|-]. )+]\n" "\n" " modify [--temporary] [id | uuid | path] ([+|-]. " ")+\n" "\n" +" clone [--temporary] [id | uuid | path ] \n" +"\n" " edit [id | uuid | path] \n" " edit [type ] [con-name ]\n" "\n" " delete [id | uuid | path] \n" "\n" +" monitor [id | uuid | path] ...\n" +"\n" " reload\n" "\n" " load [ ... ]\n" "\n" +" import [--temporary] type file \n" +"\n" +" export [id | uuid | path] []\n" +"\n" msgstr "" -#: ../clients/cli/connections.c:274 +#: ../clients/cli/connections.c:295 #, c-format msgid "" "Usage: nmcli connection show { ARGUMENTS | help }\n" "\n" -"ARGUMENTS := [--active]\n" +"ARGUMENTS := [--active] [--order ]\n" "\n" "List in-memory and on-disk connection profiles, some of which may also be\n" "active if a device is using that connection profile. Without a parameter, " "all\n" "profiles are listed. When --active option is specified, only the active\n" -"profiles are shown.\n" +"profiles are shown. --order allows custom connection ordering (see manual " +"page).\n" "\n" -"ARGUMENTS := [--active] [--show-secrets] [id | uuid | path | apath] " -" ...\n" +"ARGUMENTS := [--active] [id | uuid | path | apath] ...\n" "\n" "Show details for specified connections. By default, both static " "configuration\n" @@ -867,10 +885,11 @@ msgid "" "using global '--fields' option. Refer to the manual page for more " "information.\n" "When --active option is specified, only the active profiles are taken into\n" -"account. --show-secrets option will reveal associated secrets as well.\n" +"account. Use global --show-secrets option to reveal associated secrets as " +"well.\n" msgstr "" -#: ../clients/cli/connections.c:295 +#: ../clients/cli/connections.c:316 #, c-format msgid "" "Usage: nmcli connection up { ARGUMENTS | help }\n" @@ -895,7 +914,7 @@ msgid "" "\n" msgstr "" -#: ../clients/cli/connections.c:316 +#: ../clients/cli/connections.c:337 #, c-format msgid "" "Usage: nmcli connection down { ARGUMENTS | help }\n" @@ -909,20 +928,22 @@ msgid "" "\n" msgstr "" -#: ../clients/cli/connections.c:328 +#: ../clients/cli/connections.c:349 #, c-format msgid "" "Usage: nmcli connection add { ARGUMENTS | help }\n" "\n" -"ARGUMENTS := COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS IP_OPTIONS\n" +"ARGUMENTS := COMMON_OPTIONS TYPE_SPECIFIC_OPTIONS SLAVE_OPTIONS IP_OPTIONS " +"[-- ([+|-]. )+]\n" "\n" " COMMON_OPTIONS:\n" " type \n" " ifname | \"*\"\n" " [con-name ]\n" " [autoconnect yes|no]\n" -"\n" " [save yes|no]\n" +" [master ]\n" +" [slave-type ]\n" "\n" " TYPE_SPECIFIC_OPTIONS:\n" " ethernet: [mac ]\n" @@ -960,7 +981,7 @@ msgid "" " bluetooth: [addr ]\n" " [bt-type panu|dun-gsm|dun-cdma]\n" "\n" -" vlan: dev \n" +" vlan: dev \n" " id \n" " [flags ]\n" " [ingress ]\n" @@ -992,6 +1013,7 @@ msgid "" " [hello-time <1-10>]\n" " [max-age <6-40>]\n" " [ageing-time <0-1000000>]\n" +" [multicast-snooping yes|no]\n" " [mac ]\n" "\n" " bridge-slave: master \n" @@ -1012,13 +1034,44 @@ msgid "" " [password ]\n" " [encapsulation vcmux|llc]\n" "\n" +" tun: mode tun|tap\n" +" [owner ]\n" +" [group ]\n" +" [pi yes|no]\n" +" [vnet-hdr yes|no]\n" +" [multi-queue yes|no]\n" +"\n" +" ip-tunnel: mode ipip|gre|sit|isatap|vti|ip6ip6|ipip6|ip6gre|vti6\n" +" remote \n" +" [local ]\n" +" [dev ]\n" +"\n" +" macvlan: dev \n" +" mode vepa|bridge|private|passthru|source\n" +" [tap yes|no]\n" +"\n" +" vxlan: id \n" +" remote \n" +" [local ]\n" +" [dev ]\n" +" [source-port-min <0-65535>]\n" +" [source-port-max <0-65535>]\n" +" [destination-port <0-65535>]\n" +"\n" +" SLAVE_OPTIONS:\n" +" bridge: [priority <0-63>]\n" +" [path-cost <1-65535>]\n" +" [hairpin yes|no]\n" +"\n" +" team: [config |]\n" +"\n" " IP_OPTIONS:\n" " [ip4 ] [gw4 ]\n" " [ip6 ] [gw6 ]\n" "\n" msgstr "" -#: ../clients/cli/connections.c:412 +#: ../clients/cli/connections.c:461 #, c-format msgid "" "Usage: nmcli connection modify { ARGUMENTS | help }\n" @@ -1043,7 +1096,21 @@ msgid "" "\n" msgstr "" -#: ../clients/cli/connections.c:435 +#: ../clients/cli/connections.c:484 +#, c-format +msgid "" +"Usage: nmcli connection clone { ARGUMENTS | help }\n" +"\n" +"ARGUMENTS := [--temporary] [id | uuid | path] \n" +"\n" +"Clone an existing connection profile. The newly created connection will be\n" +"the exact copy of the , except the uuid property (will be generated) " +"and\n" +"id (provided as argument).\n" +"\n" +msgstr "" + +#: ../clients/cli/connections.c:496 #, c-format msgid "" "Usage: nmcli connection edit { ARGUMENTS | help }\n" @@ -1059,7 +1126,7 @@ msgid "" "\n" msgstr "" -#: ../clients/cli/connections.c:450 +#: ../clients/cli/connections.c:511 #, c-format msgid "" "Usage: nmcli connection delete { ARGUMENTS | help }\n" @@ -1071,7 +1138,20 @@ msgid "" "\n" msgstr "" -#: ../clients/cli/connections.c:461 +#: ../clients/cli/connections.c:522 +#, c-format +msgid "" +"Usage: nmcli connection monitor { ARGUMENTS | help }\n" +"\n" +"ARGUMENTS := [id | uuid | path] ...\n" +"\n" +"Monitor connection profile activity.\n" +"This command prints a line whenever the specified connection changes.\n" +"Monitors all connection profiles in case none is specified.\n" +"\n" +msgstr "" + +#: ../clients/cli/connections.c:534 #, c-format msgid "" "Usage: nmcli connection reload { help }\n" @@ -1080,7 +1160,7 @@ msgid "" "\n" msgstr "" -#: ../clients/cli/connections.c:469 +#: ../clients/cli/connections.c:542 #, c-format msgid "" "Usage: nmcli connection load { ARGUMENTS | help }\n" @@ -1094,383 +1174,429 @@ msgid "" "\n" msgstr "" -#: ../clients/cli/connections.c:540 +#: ../clients/cli/connections.c:554 +#, c-format +msgid "" +"Usage: nmcli connection import { ARGUMENTS | help }\n" +"\n" +"ARGUMENTS := [--temporary] type file \n" +"\n" +"Import an external/foreign configuration as a NetworkManager connection " +"profile.\n" +"The type of the input file is specified by type option.\n" +"Only VPN configurations are supported at the moment. The configuration\n" +"is imported by NetworkManager VPN plugins.\n" +"\n" +msgstr "" + +#: ../clients/cli/connections.c:567 +#, c-format +msgid "" +"Usage: nmcli connection export { ARGUMENTS | help }\n" +"\n" +"ARGUMENTS := [id | uuid | path] []\n" +"\n" +"Export a connection. Only VPN connections are supported at the moment.\n" +"The data are directed to standard output or to a file if a name is given.\n" +"\n" +msgstr "" + +#: ../clients/cli/connections.c:645 msgid "activating" msgstr "" -#: ../clients/cli/connections.c:542 +#: ../clients/cli/connections.c:647 msgid "activated" msgstr "" -#: ../clients/cli/connections.c:546 +#: ../clients/cli/connections.c:651 msgid "deactivated" msgstr "" -#: ../clients/cli/connections.c:558 +#: ../clients/cli/connections.c:663 #, fuzzy msgid "VPN connecting (prepare)" msgstr "إتّصالات VPN" -#: ../clients/cli/connections.c:560 +#: ../clients/cli/connections.c:665 msgid "VPN connecting (need authentication)" msgstr "" -#: ../clients/cli/connections.c:562 +#: ../clients/cli/connections.c:667 #, fuzzy msgid "VPN connecting" msgstr "إتّصالات VPN" -#: ../clients/cli/connections.c:564 +#: ../clients/cli/connections.c:669 msgid "VPN connecting (getting IP configuration)" msgstr "" -#: ../clients/cli/connections.c:566 +#: ../clients/cli/connections.c:671 #, fuzzy msgid "VPN connected" msgstr "إتّصالات VPN" -#: ../clients/cli/connections.c:568 +#: ../clients/cli/connections.c:673 #, fuzzy msgid "VPN connection failed" msgstr "إتّصالات VPN" -#: ../clients/cli/connections.c:570 +#: ../clients/cli/connections.c:675 #, fuzzy msgid "VPN disconnected" msgstr "إتّصالات VPN" -#: ../clients/cli/connections.c:640 +#: ../clients/cli/connections.c:745 #, c-format msgid "Error updating secrets for %s: %s\n" msgstr "" -#: ../clients/cli/connections.c:660 +#: ../clients/cli/connections.c:765 msgid "Connection profile details" msgstr "" -#: ../clients/cli/connections.c:672 ../clients/cli/connections.c:1081 +#: ../clients/cli/connections.c:777 ../clients/cli/connections.c:1170 #, fuzzy, c-format msgid "Error: 'connection show': %s" msgstr "خطأ أثناء فتح اتصال VPN '%s'" -#: ../clients/cli/connections.c:818 +#: ../clients/cli/connections.c:933 ../clients/cli/settings.c:1884 msgid "never" msgstr "" -#: ../clients/cli/connections.c:1069 +#: ../clients/cli/connections.c:1158 msgid "Activate connection details" msgstr "" -#: ../clients/cli/connections.c:1305 +#: ../clients/cli/connections.c:1394 #, c-format msgid "invalid field '%s'; allowed fields: %s and %s, or %s,%s" msgstr "" -#: ../clients/cli/connections.c:1320 ../clients/cli/connections.c:1328 +#: ../clients/cli/connections.c:1409 ../clients/cli/connections.c:1417 #, c-format msgid "'%s' has to be alone" msgstr "" #. Add headers -#: ../clients/cli/connections.c:1383 +#: ../clients/cli/connections.c:1632 msgid "NetworkManager active profiles" msgstr "" -#: ../clients/cli/connections.c:1384 +#: ../clients/cli/connections.c:1633 msgid "NetworkManager connection profiles" msgstr "" -#: ../clients/cli/connections.c:1424 ../clients/cli/connections.c:2152 -#: ../clients/cli/connections.c:2174 ../clients/cli/connections.c:2183 -#: ../clients/cli/connections.c:2193 ../clients/cli/connections.c:2203 -#: ../clients/cli/connections.c:2365 ../clients/cli/connections.c:8815 -#: ../clients/cli/connections.c:9020 ../clients/cli/devices.c:2028 -#: ../clients/cli/devices.c:2036 ../clients/cli/devices.c:2359 -#: ../clients/cli/devices.c:2366 ../clients/cli/devices.c:2380 -#: ../clients/cli/devices.c:2387 ../clients/cli/devices.c:2404 -#: ../clients/cli/devices.c:2412 ../clients/cli/devices.c:2425 -#: ../clients/cli/devices.c:2669 ../clients/cli/devices.c:2676 -#: ../clients/cli/devices.c:2795 ../clients/cli/devices.c:2802 +#: ../clients/cli/connections.c:1679 ../clients/cli/connections.c:2387 +#: ../clients/cli/connections.c:2409 ../clients/cli/connections.c:2418 +#: ../clients/cli/connections.c:2427 ../clients/cli/connections.c:2586 +#: ../clients/cli/connections.c:10059 ../clients/cli/connections.c:10176 +#: ../clients/cli/connections.c:10308 ../clients/cli/connections.c:10441 +#: ../clients/cli/connections.c:10551 ../clients/cli/connections.c:10562 +#: ../clients/cli/connections.c:10661 ../clients/cli/devices.c:2221 +#: ../clients/cli/devices.c:2229 ../clients/cli/devices.c:2552 +#: ../clients/cli/devices.c:2559 ../clients/cli/devices.c:2573 +#: ../clients/cli/devices.c:2580 ../clients/cli/devices.c:2597 +#: ../clients/cli/devices.c:2605 ../clients/cli/devices.c:2618 +#: ../clients/cli/devices.c:2982 ../clients/cli/devices.c:2989 +#: ../clients/cli/devices.c:2996 ../clients/cli/devices.c:3008 +#: ../clients/cli/devices.c:3021 ../clients/cli/devices.c:3028 +#: ../clients/cli/devices.c:3200 ../clients/cli/devices.c:3207 +#: ../clients/cli/devices.c:3380 #, c-format msgid "Error: %s argument is missing." msgstr "" -#: ../clients/cli/connections.c:1439 +#: ../clients/cli/connections.c:1694 #, c-format msgid "Error: %s - no such connection profile." msgstr "" -#: ../clients/cli/connections.c:1498 ../clients/cli/connections.c:2226 -#: ../clients/cli/connections.c:9319 ../clients/cli/devices.c:2636 -#: ../clients/cli/devices.c:3149 ../clients/cli/general.c:518 -#: ../clients/cli/general.c:567 ../clients/cli/general.c:584 -#: ../clients/cli/general.c:623 ../clients/cli/general.c:637 -#: ../clients/cli/general.c:755 ../clients/cli/general.c:802 -#: ../clients/cli/general.c:822 +#: ../clients/cli/connections.c:1753 ../clients/cli/connections.c:2450 +#: ../clients/cli/connections.c:11065 ../clients/cli/devices.c:3169 +#: ../clients/cli/devices.c:3655 ../clients/cli/general.c:540 +#: ../clients/cli/general.c:589 ../clients/cli/general.c:606 +#: ../clients/cli/general.c:645 ../clients/cli/general.c:659 +#: ../clients/cli/general.c:777 ../clients/cli/general.c:824 +#: ../clients/cli/general.c:844 #, c-format msgid "Error: %s." msgstr "" -#: ../clients/cli/connections.c:1594 +#: ../clients/cli/connections.c:1849 #, c-format msgid "no active connection on device '%s'" msgstr "" -#: ../clients/cli/connections.c:1602 +#: ../clients/cli/connections.c:1857 msgid "no active connection or device" msgstr "" -#: ../clients/cli/connections.c:1673 +#: ../clients/cli/connections.c:1908 #, c-format msgid "device '%s' not compatible with connection '%s'" msgstr "" -#: ../clients/cli/connections.c:1676 +#: ../clients/cli/connections.c:1911 #, fuzzy, c-format msgid "no device found for connection '%s'" msgstr "خطأ أثناء فتح اتصال VPN '%s'" -#: ../clients/cli/connections.c:1688 +#: ../clients/cli/connections.c:1923 msgid "unknown reason" msgstr "" -#: ../clients/cli/connections.c:1690 ../clients/cli/general.c:272 +#: ../clients/cli/connections.c:1925 ../clients/cli/general.c:278 msgid "none" msgstr "بلا" -#: ../clients/cli/connections.c:1692 +#: ../clients/cli/connections.c:1927 msgid "the user was disconnected" msgstr "" -#: ../clients/cli/connections.c:1694 +#: ../clients/cli/connections.c:1929 msgid "the base network connection was interrupted" msgstr "" -#: ../clients/cli/connections.c:1696 +#: ../clients/cli/connections.c:1931 msgid "the VPN service stopped unexpectedly" msgstr "" -#: ../clients/cli/connections.c:1698 +#: ../clients/cli/connections.c:1933 msgid "the VPN service returned invalid configuration" msgstr "" -#: ../clients/cli/connections.c:1700 +#: ../clients/cli/connections.c:1935 msgid "the connection attempt timed out" msgstr "" -#: ../clients/cli/connections.c:1702 +#: ../clients/cli/connections.c:1937 msgid "the VPN service did not start in time" msgstr "" -#: ../clients/cli/connections.c:1704 +#: ../clients/cli/connections.c:1939 msgid "the VPN service failed to start" msgstr "" -#: ../clients/cli/connections.c:1706 +#: ../clients/cli/connections.c:1941 msgid "no valid VPN secrets" msgstr "" -#: ../clients/cli/connections.c:1708 +#: ../clients/cli/connections.c:1943 msgid "invalid VPN secrets" msgstr "" -#: ../clients/cli/connections.c:1710 +#: ../clients/cli/connections.c:1945 msgid "the connection was removed" msgstr "" -#: ../clients/cli/connections.c:1732 ../clients/cli/connections.c:1760 -#: ../clients/cli/connections.c:1921 ../clients/cli/connections.c:7130 +#: ../clients/cli/connections.c:1967 ../clients/cli/connections.c:1995 +#: ../clients/cli/connections.c:2156 ../clients/cli/connections.c:8400 #, c-format msgid "Connection successfully activated (D-Bus active path: %s)\n" msgstr "" -#: ../clients/cli/connections.c:1739 +#: ../clients/cli/connections.c:1974 #, c-format msgid "" "Connection successfully activated (master waiting for slaves) (D-Bus active " "path: %s)\n" msgstr "" -#: ../clients/cli/connections.c:1743 ../clients/cli/connections.c:1765 +#: ../clients/cli/connections.c:1978 ../clients/cli/connections.c:2000 #, c-format msgid "Error: Connection activation failed." msgstr "" -#: ../clients/cli/connections.c:1816 +#: ../clients/cli/connections.c:2051 #, c-format msgid "VPN connection successfully activated (D-Bus active path: %s)\n" msgstr "" -#: ../clients/cli/connections.c:1824 +#: ../clients/cli/connections.c:2059 #, c-format msgid "Error: Connection activation failed: %s." msgstr "" -#: ../clients/cli/connections.c:1843 ../clients/cli/devices.c:1339 +#: ../clients/cli/connections.c:2078 ../clients/cli/devices.c:1413 #, c-format msgid "Error: Timeout %d sec expired." msgstr "" -#: ../clients/cli/connections.c:1903 +#: ../clients/cli/connections.c:2138 #, c-format msgid "Error: Connection activation failed: %s" msgstr "" -#: ../clients/cli/connections.c:1988 +#: ../clients/cli/connections.c:2223 #, c-format msgid "failed to read passwd-file '%s': %s" msgstr "" -#: ../clients/cli/connections.c:2000 +#: ../clients/cli/connections.c:2235 #, c-format msgid "missing colon in 'password' entry '%s'" msgstr "" -#: ../clients/cli/connections.c:2008 +#: ../clients/cli/connections.c:2243 #, c-format msgid "missing dot in 'password' entry '%s'" msgstr "" -#: ../clients/cli/connections.c:2021 +#: ../clients/cli/connections.c:2256 #, c-format msgid "invalid setting name in 'password' entry '%s'" msgstr "" -#: ../clients/cli/connections.c:2068 ../clients/cli/connections.c:2227 +#: ../clients/cli/connections.c:2303 ../clients/cli/connections.c:2451 msgid "unknown error" msgstr "" -#: ../clients/cli/connections.c:2077 +#: ../clients/cli/connections.c:2312 #, c-format msgid "unknown device '%s'." msgstr "" -#: ../clients/cli/connections.c:2082 +#: ../clients/cli/connections.c:2317 msgid "neither a valid connection nor device given" msgstr "" -#: ../clients/cli/connections.c:2165 +#: ../clients/cli/connections.c:2400 #, c-format msgid "Error: Connection '%s' does not exist." msgstr "" -#: ../clients/cli/connections.c:2211 ../clients/cli/devices.c:1238 -#: ../clients/cli/devices.c:2042 ../clients/cli/devices.c:2436 -#: ../clients/cli/devices.c:2682 ../clients/cli/devices.c:2808 +#: ../clients/cli/connections.c:2435 ../clients/cli/devices.c:1312 +#: ../clients/cli/devices.c:2235 ../clients/cli/devices.c:2629 +#: ../clients/cli/devices.c:3213 #, c-format msgid "Unknown parameter: %s\n" msgstr "" -#: ../clients/cli/connections.c:2235 +#: ../clients/cli/connections.c:2460 msgid "preparing" msgstr "" -#: ../clients/cli/connections.c:2259 +#: ../clients/cli/connections.c:2481 #, c-format msgid "Connection '%s' (%s) successfully deleted.\n" msgstr "" -#: ../clients/cli/connections.c:2275 +#: ../clients/cli/connections.c:2497 #, c-format msgid "Connection '%s' successfully deactivated (D-Bus active path: %s)\n" msgstr "" -#: ../clients/cli/connections.c:2347 ../clients/cli/connections.c:9006 -#: ../clients/cli/connections.c:9111 +#: ../clients/cli/connections.c:2568 ../clients/cli/connections.c:10294 +#: ../clients/cli/connections.c:10493 #, c-format msgid "Error: No connection specified." msgstr "" -#: ../clients/cli/connections.c:2379 +#: ../clients/cli/connections.c:2600 #, c-format msgid "Error: '%s' is not an active connection.\n" msgstr "" -#: ../clients/cli/connections.c:2380 ../clients/cli/connections.c:9035 +#: ../clients/cli/connections.c:2601 ../clients/cli/connections.c:10323 #, c-format msgid "Error: not all active connections found." msgstr "" -#: ../clients/cli/connections.c:2389 +#: ../clients/cli/connections.c:2610 #, c-format msgid "Error: no active connection provided." msgstr "" -#: ../clients/cli/connections.c:2708 ../clients/cli/utils.c:569 +#: ../clients/cli/connections.c:2967 ../clients/cli/utils.c:698 #, c-format msgid "'%s' not among [%s]" msgstr "" -#: ../clients/cli/connections.c:2787 +#: ../clients/cli/connections.c:3046 #, c-format msgid "Error: '%s': '%s' is not a valid %s MAC address." msgstr "" #. Ask for optional arguments -#: ../clients/cli/connections.c:2788 ../clients/cli/connections.c:3273 -#: ../clients/tui/nm-editor-utils.c:164 ../libnm-core/nm-connection.c:1614 -#: ../libnm-glib/nm-device.c:1801 ../libnm/nm-device.c:1646 +#: ../clients/cli/connections.c:3047 ../clients/cli/connections.c:3579 +#: ../clients/tui/nm-editor-utils.c:164 ../libnm-core/nm-connection.c:1646 +#: ../libnm-glib/nm-device.c:1862 ../libnm/nm-device.c:1813 msgid "InfiniBand" msgstr "" -#: ../clients/cli/connections.c:2788 ../clients/tui/nm-editor-utils.c:147 -#: ../libnm-glib/nm-device.c:1789 ../libnm/nm-device.c:1634 +#: ../clients/cli/connections.c:3047 ../clients/tui/nm-editor-utils.c:147 +#: ../libnm-glib/nm-device.c:1850 ../libnm/nm-device.c:1801 msgid "Ethernet" msgstr "" -#: ../clients/cli/connections.c:2808 +#: ../clients/cli/connections.c:3067 #, c-format msgid "Error: 'mtu': '%s' is not a valid MTU." msgstr "" -#: ../clients/cli/connections.c:2824 +#: ../clients/cli/connections.c:3083 #, c-format msgid "Error: 'parent': '%s' is not a valid interface name." msgstr "" -#: ../clients/cli/connections.c:2845 +#: ../clients/cli/connections.c:3104 #, c-format msgid "Error: 'p-key': '%s' is not a valid InfiniBand P_KEY." msgstr "" -#: ../clients/cli/connections.c:2890 +#: ../clients/cli/connections.c:3119 +#, c-format +msgid "Error: '%s' is not a valid UID/GID." +msgstr "" + +#: ../clients/cli/connections.c:3163 #, c-format msgid "Error: '%s': '%s' is not a valid %s %s." msgstr "" -#: ../clients/cli/connections.c:2903 +#: ../clients/cli/connections.c:3176 msgid "Wi-Fi mode" msgstr "" -#: ../clients/cli/connections.c:2912 +#: ../clients/cli/connections.c:3185 msgid "InfiniBand transport mode" msgstr "" -#: ../clients/cli/connections.c:2924 +#: ../clients/cli/connections.c:3197 msgid "ADSL protocol" msgstr "" -#: ../clients/cli/connections.c:2935 +#: ../clients/cli/connections.c:3208 msgid "ADSL encapsulation" msgstr "" -#: ../clients/cli/connections.c:2948 +#: ../clients/cli/connections.c:3217 +msgid "TUN device mode" +msgstr "" + +#: ../clients/cli/connections.c:3230 #, c-format msgid "Error: 'flags': '%s' is not valid; use <0-7>." msgstr "" -#: ../clients/cli/connections.c:2970 +#: ../clients/cli/connections.c:3252 #, c-format msgid "Error: '%s': '%s' is not valid; %s " msgstr "" -#: ../clients/cli/connections.c:3149 +#: ../clients/cli/connections.c:3430 +#, c-format +msgid "Warning: master='%s' doesn't refer to any existing profile.\n" +msgstr "" + +#: ../clients/cli/connections.c:3455 #, c-format msgid "Error: '%s': '%s' is not valid; use <%u-%u>." msgstr "" #. Ask for optional arguments. -#: ../clients/cli/connections.c:3205 +#: ../clients/cli/connections.c:3511 #, c-format msgid "There is %d optional argument for '%s' connection type.\n" msgid_plural "There are %d optional arguments for '%s' connection type.\n" @@ -1479,7 +1605,7 @@ msgstr[1] "" msgstr[2] "" msgstr[3] "" -#: ../clients/cli/connections.c:3208 +#: ../clients/cli/connections.c:3514 #, c-format msgid "Do you want to provide it? %s" msgid_plural "Do you want to provide them? %s" @@ -1489,602 +1615,873 @@ msgstr[2] "" msgstr[3] "" #. Ask for optional arguments -#: ../clients/cli/connections.c:3225 +#: ../clients/cli/connections.c:3531 msgid "ethernet" msgstr "" -#: ../clients/cli/connections.c:3230 ../clients/cli/connections.c:3278 -#: ../clients/cli/connections.c:3412 ../clients/cli/connections.c:3491 +#: ../clients/cli/connections.c:3536 ../clients/cli/connections.c:3584 +#: ../clients/cli/connections.c:3718 ../clients/cli/connections.c:3797 msgid "MTU [auto]: " msgstr "" -#: ../clients/cli/connections.c:3241 ../clients/cli/connections.c:3289 -#: ../clients/cli/connections.c:3384 ../clients/cli/connections.c:3423 -#: ../clients/cli/connections.c:3795 +#: ../clients/cli/connections.c:3547 ../clients/cli/connections.c:3595 +#: ../clients/cli/connections.c:3690 ../clients/cli/connections.c:3729 +#: ../clients/cli/connections.c:4115 msgid "MAC [none]: " msgstr "" -#: ../clients/cli/connections.c:3252 +#: ../clients/cli/connections.c:3558 msgid "Cloned MAC [none]: " msgstr "" -#: ../clients/cli/connections.c:3300 +#: ../clients/cli/connections.c:3606 #, c-format msgid "Transport mode %s" msgstr "" -#: ../clients/cli/connections.c:3313 +#: ../clients/cli/connections.c:3619 msgid "Parent interface [none]: " msgstr "" -#: ../clients/cli/connections.c:3324 +#: ../clients/cli/connections.c:3630 msgid "P_KEY [none]: " msgstr "" -#: ../clients/cli/connections.c:3334 +#: ../clients/cli/connections.c:3640 #, c-format msgid "Error: 'p-key' is mandatory when 'parent' is specified.\n" msgstr "" #. Ask for optional arguments -#: ../clients/cli/connections.c:3351 ../clients/tui/nm-editor-utils.c:155 -#: ../libnm-glib/nm-device.c:1791 ../libnm/nm-device.c:1636 +#: ../clients/cli/connections.c:3657 ../clients/tui/nm-editor-utils.c:155 +#: ../libnm-glib/nm-device.c:1852 ../libnm/nm-device.c:1803 msgid "Wi-Fi" msgstr "" -#: ../clients/cli/connections.c:3359 +#: ../clients/cli/connections.c:3665 ../clients/cli/connections.c:6069 #, c-format msgid "Mode %s" msgstr "" #. Ask for optional 'wimax' arguments. -#: ../clients/cli/connections.c:3379 ../libnm-glib/nm-device.c:1797 -#: ../libnm/nm-device.c:1642 +#: ../clients/cli/connections.c:3685 ../libnm-glib/nm-device.c:1858 +#: ../libnm/nm-device.c:1809 msgid "WiMAX" msgstr "" #. Ask for optional 'pppoe' arguments. -#: ../clients/cli/connections.c:3402 +#: ../clients/cli/connections.c:3708 msgid "PPPoE" msgstr "" -#: ../clients/cli/connections.c:3406 ../clients/cli/connections.c:3444 -#: ../clients/cli/connections.c:3917 +#: ../clients/cli/connections.c:3712 ../clients/cli/connections.c:3750 +#: ../clients/cli/connections.c:4237 msgid "Password [none]: " msgstr "" -#: ../clients/cli/connections.c:3408 +#: ../clients/cli/connections.c:3714 msgid "Service [none]: " msgstr "" #. Ask for optional 'gsm' or 'cdma' arguments. -#: ../clients/cli/connections.c:3438 +#: ../clients/cli/connections.c:3744 msgid "mobile broadband" msgstr "" -#: ../clients/cli/connections.c:3442 ../clients/cli/connections.c:3867 +#: ../clients/cli/connections.c:3748 ../clients/cli/connections.c:4187 msgid "Username [none]: " msgstr "" #. Ask for optional 'bluetooth' arguments. -#: ../clients/cli/connections.c:3457 +#: ../clients/cli/connections.c:3763 msgid "bluetooth" msgstr "" -#: ../clients/cli/connections.c:3464 +#: ../clients/cli/connections.c:3770 #, c-format msgid "Bluetooth type %s" msgstr "" -#: ../clients/cli/connections.c:3470 +#: ../clients/cli/connections.c:3776 #, c-format msgid "Error: 'bt-type': '%s' is not a valid bluetooth type.\n" msgstr "" #. Ask for optional 'vlan' arguments. #. 13 -#: ../clients/cli/connections.c:3486 ../clients/cli/devices.c:240 -#: ../clients/tui/nm-editor-utils.c:218 ../clients/tui/nmt-page-vlan.c:97 -#: ../libnm-core/nm-connection.c:1612 ../libnm-glib/nm-device.c:1809 -#: ../libnm-util/nm-connection.c:1601 ../libnm/nm-device.c:1654 +#: ../clients/cli/connections.c:3792 ../clients/cli/devices.c:240 +#: ../clients/tui/nm-editor-utils.c:218 ../clients/tui/nmt-page-vlan.c:95 +#: ../libnm-core/nm-connection.c:1644 ../libnm-glib/nm-device.c:1870 +#: ../libnm-util/nm-connection.c:1600 ../libnm/nm-device.c:1821 msgid "VLAN" msgstr "" -#: ../clients/cli/connections.c:3502 +#: ../clients/cli/connections.c:3808 msgid "VLAN flags (<0-7>) [none]: " msgstr "" -#: ../clients/cli/connections.c:3513 +#: ../clients/cli/connections.c:3819 msgid "Ingress priority maps [none]: " msgstr "" -#: ../clients/cli/connections.c:3524 +#: ../clients/cli/connections.c:3830 msgid "Egress priority maps [none]: " msgstr "" -#: ../clients/cli/connections.c:3535 +#: ../clients/cli/connections.c:3841 msgid "Bonding mode [balance-rr]: " msgstr "" #. Ask for optional 'bond' arguments. -#: ../clients/cli/connections.c:3551 +#: ../clients/cli/connections.c:3857 msgid "bond" msgstr "" -#: ../clients/cli/connections.c:3573 +#: ../clients/cli/connections.c:3879 msgid "Bonding primary interface [none]: " msgstr "" -#: ../clients/cli/connections.c:3576 +#: ../clients/cli/connections.c:3882 #, c-format msgid "Error: 'primary': '%s' is not a valid interface name.\n" msgstr "" -#: ../clients/cli/connections.c:3584 +#: ../clients/cli/connections.c:3890 #, c-format msgid "Bonding monitoring mode %s" msgstr "" -#: ../clients/cli/connections.c:3590 +#: ../clients/cli/connections.c:3896 #, c-format msgid "Error: '%s' is not a valid monitoring mode; use '%s' or '%s'.\n" msgstr "" -#: ../clients/cli/connections.c:3599 +#: ../clients/cli/connections.c:3905 msgid "Bonding miimon [100]: " msgstr "" -#: ../clients/cli/connections.c:3602 +#: ../clients/cli/connections.c:3908 #, c-format msgid "Error: 'miimon': '%s' is not a valid number <0-%u>.\n" msgstr "" -#: ../clients/cli/connections.c:3610 +#: ../clients/cli/connections.c:3916 msgid "Bonding downdelay [0]: " msgstr "" -#: ../clients/cli/connections.c:3613 +#: ../clients/cli/connections.c:3919 #, c-format msgid "Error: 'downdelay': '%s' is not a valid number <0-%u>.\n" msgstr "" -#: ../clients/cli/connections.c:3621 +#: ../clients/cli/connections.c:3927 msgid "Bonding updelay [0]: " msgstr "" -#: ../clients/cli/connections.c:3624 +#: ../clients/cli/connections.c:3930 #, c-format msgid "Error: 'updelay': '%s' is not a valid number <0-%u>.\n" msgstr "" -#: ../clients/cli/connections.c:3633 +#: ../clients/cli/connections.c:3939 msgid "Bonding arp-interval [0]: " msgstr "" -#: ../clients/cli/connections.c:3636 +#: ../clients/cli/connections.c:3942 #, c-format msgid "Error: 'arp-interval': '%s' is not a valid number <0-%u>.\n" msgstr "" #. FIXME: verify the string -#: ../clients/cli/connections.c:3644 +#: ../clients/cli/connections.c:3950 msgid "Bonding arp-ip-target [none]: " msgstr "" -#: ../clients/cli/connections.c:3651 +#: ../clients/cli/connections.c:3957 msgid "LACP rate ('slow' or 'fast') [slow]: " msgstr "" -#: ../clients/cli/connections.c:3657 +#: ../clients/cli/connections.c:3963 #, c-format msgid "Error: 'lacp_rate': '%s' is invalid ('slow' or 'fast').\n" msgstr "" -#: ../clients/cli/connections.c:3680 +#: ../clients/cli/connections.c:3986 msgid "Team JSON configuration [none]: " msgstr "" -#: ../clients/cli/connections.c:3697 +#: ../clients/cli/connections.c:4003 msgid "team" msgstr "" -#: ../clients/cli/connections.c:3703 +#: ../clients/cli/connections.c:4009 msgid "team-slave" msgstr "" #. Ask for optional 'bridge' arguments. -#: ../clients/cli/connections.c:3715 +#: ../clients/cli/connections.c:4021 msgid "bridge" msgstr "" -#: ../clients/cli/connections.c:3721 +#: ../clients/cli/connections.c:4027 #, c-format msgid "Enable STP %s" msgstr "" -#: ../clients/cli/connections.c:3726 +#: ../clients/cli/connections.c:4032 #, c-format msgid "Error: 'stp': %s.\n" msgstr "" -#: ../clients/cli/connections.c:3734 +#: ../clients/cli/connections.c:4040 msgid "STP priority [32768]: " msgstr "" -#: ../clients/cli/connections.c:3738 +#: ../clients/cli/connections.c:4044 #, c-format msgid "Error: 'priority': '%s' is not a valid number <0-%d>.\n" msgstr "" -#: ../clients/cli/connections.c:3746 +#: ../clients/cli/connections.c:4052 msgid "Forward delay [15]: " msgstr "" -#: ../clients/cli/connections.c:3750 +#: ../clients/cli/connections.c:4056 #, c-format msgid "Error: 'forward-delay': '%s' is not a valid number <2-30>.\n" msgstr "" -#: ../clients/cli/connections.c:3759 +#: ../clients/cli/connections.c:4065 msgid "Hello time [2]: " msgstr "" -#: ../clients/cli/connections.c:3763 +#: ../clients/cli/connections.c:4069 #, c-format msgid "Error: 'hello-time': '%s' is not a valid number <1-10>.\n" msgstr "" -#: ../clients/cli/connections.c:3771 +#: ../clients/cli/connections.c:4077 msgid "Max age [20]: " msgstr "" -#: ../clients/cli/connections.c:3775 +#: ../clients/cli/connections.c:4081 #, c-format msgid "Error: 'max-age': '%s' is not a valid number <6-40>.\n" msgstr "" -#: ../clients/cli/connections.c:3783 +#: ../clients/cli/connections.c:4089 msgid "MAC address ageing time [300]: " msgstr "" -#: ../clients/cli/connections.c:3787 +#: ../clients/cli/connections.c:4093 #, c-format msgid "Error: 'ageing-time': '%s' is not a valid number <0-1000000>.\n" msgstr "" +#: ../clients/cli/connections.c:4102 +#, c-format +msgid "Enable IGMP snooping %s" +msgstr "" + +#: ../clients/cli/connections.c:4107 +#, c-format +msgid "Error: 'multicast-snooping': %s.\n" +msgstr "" + #. Ask for optional 'bridge-slave' arguments. -#: ../clients/cli/connections.c:3814 +#: ../clients/cli/connections.c:4134 msgid "bridge-slave" msgstr "" -#: ../clients/cli/connections.c:3819 +#: ../clients/cli/connections.c:4139 msgid "Bridge port priority [32]: " msgstr "" -#: ../clients/cli/connections.c:3832 +#: ../clients/cli/connections.c:4152 msgid "Bridge port STP path cost [100]: " msgstr "" -#: ../clients/cli/connections.c:3846 +#: ../clients/cli/connections.c:4166 #, c-format msgid "Hairpin %s" msgstr "" -#: ../clients/cli/connections.c:3851 +#: ../clients/cli/connections.c:4171 #, c-format msgid "Error: 'hairpin': %s.\n" msgstr "" #. Ask for optional 'olpc' arguments. -#: ../clients/cli/connections.c:3878 ../libnm-glib/nm-device.c:1795 -#: ../libnm/nm-device.c:1640 +#: ../clients/cli/connections.c:4198 ../libnm-glib/nm-device.c:1856 +#: ../libnm/nm-device.c:1807 msgid "OLPC Mesh" msgstr "" -#: ../clients/cli/connections.c:3883 +#: ../clients/cli/connections.c:4203 msgid "OLPC Mesh channel [1]: " msgstr "" -#: ../clients/cli/connections.c:3886 +#: ../clients/cli/connections.c:4206 #, c-format msgid "Error: 'channel': '%s' is not a valid number <1-13>.\n" msgstr "" -#: ../clients/cli/connections.c:3894 +#: ../clients/cli/connections.c:4214 msgid "DHCP anycast MAC address [none]: " msgstr "" #. Ask for optional 'adsl' arguments. -#: ../clients/cli/connections.c:3913 ../libnm-glib/nm-device.c:1811 -#: ../libnm/nm-device.c:1656 +#: ../clients/cli/connections.c:4233 ../libnm-glib/nm-device.c:1872 +#: ../libnm/nm-device.c:1823 msgid "ADSL" msgstr "" -#: ../clients/cli/connections.c:3921 +#: ../clients/cli/connections.c:4241 #, c-format msgid "ADSL encapsulation %s" msgstr "" -#: ../clients/cli/connections.c:3963 +#. Ask for optional 'macvlan' arguments. +#: ../clients/cli/connections.c:4259 +msgid "macvlan" +msgstr "" + +#: ../clients/cli/connections.c:4265 +#, c-format +msgid "Tap %s" +msgstr "" + +#: ../clients/cli/connections.c:4270 +#, c-format +msgid "Error: 'tap': %s.\n" +msgstr "" + +#. Ask for optional 'vxlan' arguments. +#: ../clients/cli/connections.c:4286 +msgid "VXLAN" +msgstr "" + +#: ../clients/cli/connections.c:4291 ../clients/cli/connections.c:4615 +msgid "Parent device [none]: " +msgstr "" + +#: ../clients/cli/connections.c:4296 ../clients/cli/connections.c:4620 +#, c-format +msgid "Error: 'dev': '%s' is neither UUID nor interface name.\n" +msgstr "" + +#: ../clients/cli/connections.c:4305 +msgid "Local address [none]: " +msgstr "" + +#: ../clients/cli/connections.c:4310 +#, c-format +msgid "Error: 'local': '%s' is not a valid IP address.\n" +msgstr "" + +#: ../clients/cli/connections.c:4319 +msgid "Minimum source port [0]: " +msgstr "" + +#: ../clients/cli/connections.c:4323 +#, c-format +msgid "Error: 'source-port-min': '%s' is not a valid number <0-65535>.\n" +msgstr "" + +#: ../clients/cli/connections.c:4332 +msgid "Maximum source port [0]: " +msgstr "" + +#: ../clients/cli/connections.c:4336 +#, c-format +msgid "Error: 'source-port-max': '%s' is not a valid number <0-65535>.\n" +msgstr "" + +#: ../clients/cli/connections.c:4345 +msgid "Destination port [8472]: " +msgstr "" + +#: ../clients/cli/connections.c:4349 +#, c-format +msgid "Error: 'destination-port': '%s' is not a valid number <0-65535>.\n" +msgstr "" + +#: ../clients/cli/connections.c:4388 msgid "IPv4 address (IP[/plen]) [none]: " msgstr "" -#: ../clients/cli/connections.c:3965 +#: ../clients/cli/connections.c:4390 msgid "IPv6 address (IP[/plen]) [none]: " msgstr "" -#: ../clients/cli/connections.c:3979 +#: ../clients/cli/connections.c:4404 #, c-format msgid " Address successfully added: %s\n" msgstr "" -#: ../clients/cli/connections.c:3981 +#: ../clients/cli/connections.c:4406 #, c-format msgid " Warning: address already present: %s\n" msgstr "" -#: ../clients/cli/connections.c:3983 +#: ../clients/cli/connections.c:4408 #, c-format msgid " Warning: ignoring garbage at the end: '%s'\n" msgstr "" -#: ../clients/cli/connections.c:3985 ../clients/cli/connections.c:4867 -#: ../clients/cli/connections.c:4928 ../clients/cli/connections.c:5401 -#: ../clients/cli/connections.c:5434 +#: ../clients/cli/connections.c:4410 ../clients/cli/connections.c:5591 +#: ../clients/cli/connections.c:6451 ../clients/cli/connections.c:6577 +#: ../clients/cli/connections.c:6610 msgid "Error: " msgstr "" -#: ../clients/cli/connections.c:4005 +#: ../clients/cli/connections.c:4430 msgid "IPv4 gateway [none]: " msgstr "" -#: ../clients/cli/connections.c:4008 +#: ../clients/cli/connections.c:4433 msgid "IPv6 gateway [none]: " msgstr "" -#: ../clients/cli/connections.c:4028 +#: ../clients/cli/connections.c:4453 #, c-format msgid "Error: invalid gateway address '%s'\n" msgstr "" #. Ask for IP addresses -#: ../clients/cli/connections.c:4041 +#: ../clients/cli/connections.c:4466 #, c-format msgid "Do you want to add IP addresses? %s" msgstr "" -#: ../clients/cli/connections.c:4049 +#: ../clients/cli/connections.c:4474 #, c-format msgid "Press to finish adding addresses.\n" msgstr "" -#: ../clients/cli/connections.c:4189 +#. Ask for optional 'tun' arguments. +#: ../clients/cli/connections.c:4518 +msgid "Tun" +msgstr "" + +#: ../clients/cli/connections.c:4523 +msgid "User ID [none]: " +msgstr "" + +#: ../clients/cli/connections.c:4536 +msgid "Group ID [none]: " +msgstr "" + +#: ../clients/cli/connections.c:4550 +#, c-format +msgid "Enable PI %s" +msgstr "" + +#: ../clients/cli/connections.c:4555 +#, c-format +msgid "Error: 'pi': %s.\n" +msgstr "" + +#: ../clients/cli/connections.c:4563 +#, c-format +msgid "Enable VNET header %s" +msgstr "" + +#: ../clients/cli/connections.c:4568 +#, c-format +msgid "Error: 'vnet-hdr': %s.\n" +msgstr "" + +#: ../clients/cli/connections.c:4576 +#, c-format +msgid "Enable multi queue %s" +msgstr "" + +#: ../clients/cli/connections.c:4581 +#, c-format +msgid "Error: 'multi-queue': %s.\n" +msgstr "" + +#. Ask for optional 'ip-tunnel' arguments. +#: ../clients/cli/connections.c:4595 +msgid "IP Tunnel" +msgstr "" + +#: ../clients/cli/connections.c:4600 +msgid "Local endpoint [none]: " +msgstr "" + +#: ../clients/cli/connections.c:4606 +#, c-format +msgid "Error: 'local': '%s' is not valid; must be an IP address\n" +msgstr "" + +#: ../clients/cli/connections.c:4661 ../clients/cli/connections.c:10087 +#, c-format +msgid "Error: . argument is missing." +msgstr "" + +#: ../clients/cli/connections.c:4666 +#, c-format +msgid "Error: value for '%s' is missing." +msgstr "" + +#: ../clients/cli/connections.c:4684 +#, c-format +msgid "Error: invalid . '%s'." +msgstr "" + +#: ../clients/cli/connections.c:4691 +#, c-format +msgid "Error: invalid or not allowed setting '%s': %s." +msgstr "" + +#: ../clients/cli/connections.c:4702 +#, c-format +msgid "Error: don't know how to create '%s' setting." +msgstr "" + +#: ../clients/cli/connections.c:4712 +#, c-format +msgid "Error: invalid property '%s': %s." +msgstr "" + +#: ../clients/cli/connections.c:4724 +#, c-format +msgid "Error: failed to modify %s.%s: %s." +msgstr "" + +#: ../clients/cli/connections.c:4743 +#, c-format +msgid "Error: failed to remove a value from %s.%s: %s." +msgstr "" + +#: ../clients/cli/connections.c:4776 +#, c-format +msgid "" +"Warning: 'type' is ignored. Use 'nmcli connection add \"%s\" ...' instead." +msgstr "" + +#: ../clients/cli/connections.c:4784 +msgid "Error: redundant 'master' option." +msgstr "" + +#: ../clients/cli/connections.c:4794 +msgid "Error: 'master' is required." +msgstr "" + +#: ../clients/cli/connections.c:4948 #, c-format msgid "Error: 'parent': not valid without 'p-key'." msgstr "" -#: ../clients/cli/connections.c:4244 ../clients/cli/connections.c:5249 +#: ../clients/cli/connections.c:5003 ../clients/cli/connections.c:5839 msgid "SSID: " msgstr "" -#: ../clients/cli/connections.c:4247 ../clients/cli/connections.c:5252 +#: ../clients/cli/connections.c:5006 ../clients/cli/connections.c:5842 msgid "Error: 'ssid' is required." msgstr "" -#: ../clients/cli/connections.c:4311 +#: ../clients/cli/connections.c:5070 msgid "WiMAX NSP name: " msgstr "" -#: ../clients/cli/connections.c:4314 +#: ../clients/cli/connections.c:5073 msgid "Error: 'nsp' is required." msgstr "" -#: ../clients/cli/connections.c:4366 +#: ../clients/cli/connections.c:5125 msgid "PPPoE username: " msgstr "" -#: ../clients/cli/connections.c:4369 ../clients/cli/connections.c:5319 +#: ../clients/cli/connections.c:5128 ../clients/cli/connections.c:5909 msgid "Error: 'username' is required." msgstr "" -#: ../clients/cli/connections.c:4438 +#: ../clients/cli/connections.c:5197 msgid "APN: " msgstr "" -#: ../clients/cli/connections.c:4441 +#: ../clients/cli/connections.c:5200 msgid "Error: 'apn' is required." msgstr "" -#: ../clients/cli/connections.c:4499 +#: ../clients/cli/connections.c:5258 msgid "Bluetooth device address: " msgstr "" -#: ../clients/cli/connections.c:4502 +#: ../clients/cli/connections.c:5261 msgid "Error: 'addr' is required." msgstr "" -#: ../clients/cli/connections.c:4543 +#: ../clients/cli/connections.c:5302 #, c-format msgid "Error: 'bt-type': '%s' not valid; use [%s, %s (%s), %s]." msgstr "" -#: ../clients/cli/connections.c:4587 +#: ../clients/cli/connections.c:5346 msgid "VLAN parent device or connection UUID: " msgstr "" -#: ../clients/cli/connections.c:4590 +#: ../clients/cli/connections.c:5349 ../clients/cli/connections.c:5978 msgid "Error: 'dev' is required." msgstr "" -#: ../clients/cli/connections.c:4594 +#: ../clients/cli/connections.c:5353 msgid "VLAN ID <0-4095>: " msgstr "" -#: ../clients/cli/connections.c:4597 +#: ../clients/cli/connections.c:5356 ../clients/cli/connections.c:6294 msgid "Error: 'id' is required." msgstr "" -#: ../clients/cli/connections.c:4603 +#: ../clients/cli/connections.c:5362 #, c-format msgid "Error: 'id': '%s' is not valid; use <0-4095>." msgstr "" -#: ../clients/cli/connections.c:4613 +#: ../clients/cli/connections.c:5372 ../clients/cli/connections.c:5986 #, c-format msgid "Error: 'dev': '%s' is neither UUID, interface name, nor MAC." msgstr "" -#: ../clients/cli/connections.c:4747 +#: ../clients/cli/connections.c:5504 #, c-format msgid "Error: 'mode': %s." msgstr "" -#: ../clients/cli/connections.c:4756 +#: ../clients/cli/connections.c:5513 #, c-format msgid "Error: 'primary': '%s' is not a valid interface name." msgstr "" -#: ../clients/cli/connections.c:4808 ../clients/cli/connections.c:4906 -#: ../clients/cli/connections.c:5108 -msgid "Error: 'master' is required." +#: ../clients/cli/connections.c:5681 +#, c-format +msgid "Error: 'stp': %s." msgstr "" -#: ../clients/cli/connections.c:4814 ../clients/cli/connections.c:4912 -#: ../clients/cli/connections.c:5114 +#: ../clients/cli/connections.c:5690 #, c-format -msgid "Warning: master='%s' doesn't refer to any existing profile.\n" +msgid "Error: 'multicast-snooping': %s." +msgstr "" + +#: ../clients/cli/connections.c:5787 +msgid "Error: 'vpn-type' is required." msgstr "" -#: ../clients/cli/connections.c:4817 ../clients/cli/connections.c:4920 -#: ../clients/cli/connections.c:5117 +#: ../clients/cli/connections.c:5794 #, c-format -msgid "" -"Warning: 'type' is currently ignored. We only support ethernet slaves for " -"now.\n" +msgid "Warning: 'vpn-type': %s not known.\n" msgstr "" -#: ../clients/cli/connections.c:5014 +#: ../clients/cli/connections.c:5855 #, c-format -msgid "Error: 'stp': %s." +msgid "Error: 'channel': '%s' is not valid; use <1-13>." msgstr "" -#: ../clients/cli/connections.c:5144 +#: ../clients/cli/connections.c:5906 +msgid "Username: " +msgstr "" + +#: ../clients/cli/connections.c:5915 #, c-format -msgid "Error: 'hairpin': %s." +msgid "Protocol %s" msgstr "" -#: ../clients/cli/connections.c:5197 -msgid "Error: 'vpn-type' is required." +#: ../clients/cli/connections.c:5918 +msgid "Error: 'protocol' is required." +msgstr "" + +#: ../clients/cli/connections.c:5975 +msgid "MACVLAN parent device or connection UUID: " +msgstr "" + +#: ../clients/cli/connections.c:5995 ../clients/cli/connections.c:6075 +#: ../clients/cli/connections.c:6177 +msgid "Error: 'mode' is required." +msgstr "" + +#: ../clients/cli/connections.c:6001 +msgid "Error: 'mode' is not valid." msgstr "" -#: ../clients/cli/connections.c:5204 +#: ../clients/cli/connections.c:6014 #, c-format -msgid "Warning: 'vpn-type': %s not known.\n" +msgid "Error: 'tap': %s." msgstr "" -#: ../clients/cli/connections.c:5265 +#: ../clients/cli/connections.c:6100 #, c-format -msgid "Error: 'channel': '%s' is not valid; use <1-13>." +msgid "Error: 'pi': %s." msgstr "" -#: ../clients/cli/connections.c:5316 -msgid "Username: " +#: ../clients/cli/connections.c:6111 +#, c-format +msgid "Error: 'vnet-hdr': %s." msgstr "" -#: ../clients/cli/connections.c:5325 +#: ../clients/cli/connections.c:6122 #, c-format -msgid "Protocol %s" +msgid "Error: 'multi-queue': %s." msgstr "" -#: ../clients/cli/connections.c:5328 -msgid "Error: 'protocol' is required." +#: ../clients/cli/connections.c:6191 +#, c-format +msgid "Error: 'mode': '%s' is not valid, use one of %s" +msgstr "" + +#: ../clients/cli/connections.c:6197 +msgid "Remote endpoint: " +msgstr "" + +#: ../clients/cli/connections.c:6200 ../clients/cli/connections.c:6302 +msgid "Error: 'remote' is required." msgstr "" -#: ../clients/cli/connections.c:5369 +#: ../clients/cli/connections.c:6207 +#, c-format +msgid "Error: 'remote': '%s' is not valid; must be an IP address" +msgstr "" + +#: ../clients/cli/connections.c:6221 +#, c-format +msgid "Error: 'local': '%s' is not valid; must be an IP address" +msgstr "" + +#: ../clients/cli/connections.c:6230 ../clients/cli/connections.c:6325 +#, c-format +msgid "Error: 'dev': '%s' is neither UUID nor interface name." +msgstr "" + +#: ../clients/cli/connections.c:6291 +msgid "VXLAN ID: " +msgstr "" + +#: ../clients/cli/connections.c:6299 +msgid "Remote: " +msgstr "" + +#: ../clients/cli/connections.c:6308 +#, c-format +msgid "Error: 'id': '%s' is not valid; use <0-16777215>." +msgstr "" + +#: ../clients/cli/connections.c:6334 +#, c-format +msgid "Error: 'remote': '%s' is not a valid IP address" +msgstr "" + +#: ../clients/cli/connections.c:6343 +#, c-format +msgid "Error: 'local': '%s' is not a valid IP address" +msgstr "" + +#: ../clients/cli/connections.c:6352 +#, c-format +msgid "Error: 'source-port-min': %s is not valid; use <0-65535>." +msgstr "" + +#: ../clients/cli/connections.c:6361 +#, c-format +msgid "Error: 'source-port-max': %s is not valid; use <0-65535>." +msgstr "" + +#: ../clients/cli/connections.c:6370 +#, c-format +msgid "Error: 'destination-port': %s is not valid; use <0-65535>." +msgstr "" + +#: ../clients/cli/connections.c:6410 #, c-format msgid "Error: '%s' is not a valid connection type." msgstr "" -#: ../clients/cli/connections.c:5413 +#: ../clients/cli/connections.c:6517 +#, c-format +msgid "Error: 'hairpin': %s." +msgstr "" + +#: ../clients/cli/connections.c:6589 #, c-format msgid "Error: IPv4 gateway specified without IPv4 addresses" msgstr "" -#: ../clients/cli/connections.c:5417 +#: ../clients/cli/connections.c:6593 #, c-format msgid "Error: multiple IPv4 gateways specified" msgstr "" -#: ../clients/cli/connections.c:5421 +#: ../clients/cli/connections.c:6597 #, c-format msgid "Error: Invalid IPv4 gateway '%s'" msgstr "" -#: ../clients/cli/connections.c:5446 +#: ../clients/cli/connections.c:6622 #, c-format msgid "Error: IPv6 gateway specified without IPv6 addresses" msgstr "" -#: ../clients/cli/connections.c:5450 +#: ../clients/cli/connections.c:6626 #, c-format msgid "Error: multiple IPv6 gateways specified" msgstr "" -#: ../clients/cli/connections.c:5454 +#: ../clients/cli/connections.c:6630 #, c-format msgid "Error: Invalid IPv6 gateway '%s'" msgstr "" -#: ../clients/cli/connections.c:5514 +#: ../clients/cli/connections.c:6678 ../clients/cli/connections.c:10126 #, fuzzy, c-format msgid "Error: Failed to add '%s' connection: %s" msgstr "خطأ أثناء فتح اتصال VPN '%s'" -#: ../clients/cli/connections.c:5519 +#: ../clients/cli/connections.c:6683 #, c-format msgid "Connection '%s' (%s) successfully added.\n" msgstr "" -#: ../clients/cli/connections.c:5757 +#: ../clients/cli/connections.c:6959 ../clients/cli/connections.c:10581 #, c-format msgid "Error: 'type' argument is required." msgstr "" -#: ../clients/cli/connections.c:5765 +#: ../clients/cli/connections.c:6967 #, fuzzy, c-format msgid "Error: invalid connection type; %s." msgstr "خطأ أثناء فتح اتصال VPN '%s'" -#: ../clients/cli/connections.c:5774 +#: ../clients/cli/connections.c:6976 ../clients/cli/devices.c:2041 #, c-format msgid "Error: 'autoconnect': %s." msgstr "" -#: ../clients/cli/connections.c:5784 +#: ../clients/cli/connections.c:6986 #, c-format msgid "Error: 'save': %s." msgstr "" -#: ../clients/cli/connections.c:5801 +#: ../clients/cli/connections.c:7003 msgid "Interface name [*]: " msgstr "" -#: ../clients/cli/connections.c:5806 +#: ../clients/cli/connections.c:7008 #, c-format msgid "Error: 'ifname' argument is required." msgstr "" -#: ../clients/cli/connections.c:5808 +#: ../clients/cli/connections.c:7010 #, c-format msgid "Error: mandatory 'ifname' not seen before '%s'." msgstr "" -#: ../clients/cli/connections.c:5817 +#: ../clients/cli/connections.c:7019 #, c-format msgid "Error: 'ifname': '%s' is not a valid interface nor '*'." msgstr "" -#: ../clients/cli/connections.c:6712 +#: ../clients/cli/connections.c:7981 #, c-format msgid "['%s' setting values]\n" msgstr "" @@ -2092,7 +2489,7 @@ msgstr "" #. TRANSLATORS: do not translate command names and keywords before :: #. * However, you should translate terms enclosed in <>. #. -#: ../clients/cli/connections.c:6794 +#: ../clients/cli/connections.c:8063 #, c-format msgid "" "---[ Main menu ]---\n" @@ -2111,7 +2508,7 @@ msgid "" "quit :: exit nmcli\n" msgstr "" -#: ../clients/cli/connections.c:6821 +#: ../clients/cli/connections.c:8090 #, c-format msgid "" "goto [.] | :: enter setting/property for editing\n" @@ -2123,7 +2520,7 @@ msgid "" " nmcli> goto ipv4.addresses\n" msgstr "" -#: ../clients/cli/connections.c:6828 +#: ../clients/cli/connections.c:8097 #, c-format msgid "" "remove [.] :: remove setting or reset property value\n" @@ -2136,7 +2533,7 @@ msgid "" " nmcli> remove eth.mtu\n" msgstr "" -#: ../clients/cli/connections.c:6835 +#: ../clients/cli/connections.c:8104 #, c-format msgid "" "set [. ] :: set property value\n" @@ -2146,7 +2543,7 @@ msgid "" "Example: nmcli> set con.id My connection\n" msgstr "" -#: ../clients/cli/connections.c:6840 +#: ../clients/cli/connections.c:8109 #, c-format msgid "" "describe [.] :: describe property\n" @@ -2155,7 +2552,7 @@ msgid "" "see all NM settings and properties.\n" msgstr "" -#: ../clients/cli/connections.c:6845 +#: ../clients/cli/connections.c:8114 #, c-format msgid "" "print [all] :: print setting or connection values\n" @@ -2165,7 +2562,7 @@ msgid "" "Example: nmcli ipv4> print all\n" msgstr "" -#: ../clients/cli/connections.c:6850 +#: ../clients/cli/connections.c:8119 #, c-format msgid "" "verify [all | fix] :: verify setting or connection validity\n" @@ -2180,7 +2577,7 @@ msgid "" " nmcli bond> verify\n" msgstr "" -#: ../clients/cli/connections.c:6859 +#: ../clients/cli/connections.c:8128 #, c-format msgid "" "save [persistent|temporary] :: save the connection\n" @@ -2196,7 +2593,7 @@ msgid "" "profile must be deleted.\n" msgstr "" -#: ../clients/cli/connections.c:6870 +#: ../clients/cli/connections.c:8139 #, c-format msgid "" "activate [] [/|] :: activate the connection\n" @@ -2209,46 +2606,37 @@ msgid "" "specified)\n" msgstr "" -#: ../clients/cli/connections.c:6877 ../clients/cli/connections.c:7035 +#: ../clients/cli/connections.c:8146 ../clients/cli/connections.c:8305 #, c-format msgid "" "back :: go to upper menu level\n" "\n" msgstr "" -#: ../clients/cli/connections.c:6880 +#: ../clients/cli/connections.c:8149 #, c-format msgid "" "help/? [] :: help for the nmcli commands\n" "\n" msgstr "" -#: ../clients/cli/connections.c:6883 +#: ../clients/cli/connections.c:8152 #, c-format msgid "" "nmcli [ ] :: nmcli configuration\n" "\n" "Configures nmcli. The following options are available:\n" -"status-line yes | no [default: no]\n" -"save-confirmation yes | no [default: yes]\n" -"show-secrets yes | no [default: no]\n" -"prompt-color <0-8> [default: 0]\n" -" 0 = normal\n" -" 1 = black\n" -" 2 = red\n" -" 3 = green\n" -" 4 = yellow\n" -" 5 = blue\n" -" 6 = magenta\n" -" 7 = cyan\n" -" 8 = white\n" -"\n" +"status-line yes | no [default: no]\n" +"save-confirmation yes | no [default: yes]\n" +"show-secrets yes | no [default: no]\n" +"prompt-color | <0-8> [default: 0]\n" +"%s\n" "Examples: nmcli> nmcli status-line yes\n" " nmcli> nmcli save-confirmation no\n" " nmcli> nmcli prompt-color 3\n" msgstr "" -#: ../clients/cli/connections.c:6904 ../clients/cli/connections.c:7041 +#: ../clients/cli/connections.c:8174 ../clients/cli/connections.c:8311 #, c-format msgid "" "quit :: exit nmcli\n" @@ -2257,8 +2645,8 @@ msgid "" "user is asked to confirm the action.\n" msgstr "" -#: ../clients/cli/connections.c:6909 ../clients/cli/connections.c:7046 -#: ../clients/cli/connections.c:7469 ../clients/cli/connections.c:8391 +#: ../clients/cli/connections.c:8179 ../clients/cli/connections.c:8316 +#: ../clients/cli/connections.c:8740 ../clients/cli/connections.c:9645 #, c-format msgid "Unknown command: '%s'\n" msgstr "" @@ -2266,7 +2654,7 @@ msgstr "" #. TRANSLATORS: do not translate command names and keywords before :: #. * However, you should translate terms enclosed in <>. #. -#: ../clients/cli/connections.c:6975 +#: ../clients/cli/connections.c:8245 #, c-format msgid "" "---[ Property menu ]---\n" @@ -2282,7 +2670,7 @@ msgid "" "quit :: exit nmcli\n" msgstr "" -#: ../clients/cli/connections.c:7000 +#: ../clients/cli/connections.c:8270 #, c-format msgid "" "set [] :: set new value\n" @@ -2290,7 +2678,7 @@ msgid "" "This command sets provided to this property\n" msgstr "" -#: ../clients/cli/connections.c:7004 +#: ../clients/cli/connections.c:8274 #, c-format msgid "" "add [] :: append new value to the property\n" @@ -2300,7 +2688,7 @@ msgid "" "(same as 'set').\n" msgstr "" -#: ../clients/cli/connections.c:7010 +#: ../clients/cli/connections.c:8280 #, c-format msgid "" "change :: change current value\n" @@ -2308,7 +2696,7 @@ msgid "" "Displays current value and allows editing it.\n" msgstr "" -#: ../clients/cli/connections.c:7014 +#: ../clients/cli/connections.c:8284 #, c-format msgid "" "remove [||